[Curl] There is no way for a WebKit client to set the Curl cookie jar path
https://bugs.webkit.org/show_bug.cgi?id=107692

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-01-31
Reviewed by Brent Fulgham.

Set default cookie jar path.
Get the cookie jar path for Curl from the environment variable CURL_COOKIE_JAR_PATH.

* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::cookieJarPath): Added helper function to set cookie jar path.
(WebCore::ResourceHandleManager::ResourceHandleManager): Call helper function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141464 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of IncomingMessage
https://bugs.webkit.org/show_bug.cgi?id=108514

Reviewed by Sam Weinig.

* Platform/CoreIPC/Connection.cpp:
(Connection::SyncMessageState):
(ConnectionAndIncomingMessage):
(CoreIPC::Connection::SyncMessageState::~SyncMessageState):
(CoreIPC::Connection::SyncMessageState::processIncomingMessage):
(CoreIPC::Connection::SyncMessageState::dispatchMessages):
(CoreIPC::Connection::waitForMessage):
(CoreIPC::Connection::processIncomingMessage):
(CoreIPC::Connection::enqueueIncomingMessage):
(CoreIPC::Connection::dispatchMessage):
(CoreIPC::Connection::dispatchOneMessage):
* Platform/CoreIPC/Connection.h:
(Connection):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup: Use ScriptExecutionContext::topOrigin when relevant.
https://bugs.webkit.org/show_bug.cgi?id=108476

Source/WebCore:

Reviewed by Jochen Eisinger.

Rather than diving through 'frame()->top()' or 'topDocument()' to get
the SecurityOrigin of the top-level document in a frame, we can now
directly grab the 'topOrigin()' off of a ScriptExecutionContext. This
patch adjusts a few callsites to use the new hotness rather than the
old brokenness.

This is a pure refactoring: No web-visible changes should result.

* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):
* workers/SharedWorker.cpp:
(WebCore::SharedWorker::create):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerContext):

Source/WebKit2:

Reviewed by Anders Carlsson.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::storageBlockingStateChanged):
(WebKit::PluginView::isPrivateBrowsingEnabled):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Prospective build fix.

Reviewed by Jocelyn Turcotte.

Don't create .prl files for intermediate libs as their contents get
injected within -Wl,-whole-archive -lFoo -wl,-no-whole-archive.

* qmake/mkspecs/features/default_post.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use OS() and PLATFORM() macros in WebCorePrefix.h for readability
<http://webkit.org/b/108374>

Reviewed by Laszlo Gombos.

* WebCorePrefix.h: Replaced all possible checks with OS() or
PLATFORM() macros other than __APPLE__.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r141136): Apple's internal PLT test suite doesn't finish
https://bugs.webkit.org/show_bug.cgi?id=108380

Mark some tests whose results depend on main resource caching being enabled as failing until
main resource caching can be re-enabled on mac.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Make selection handling work in applyPageScaleInCompositor mode
https://bugs.webkit.org/show_bug.cgi?id=107831

Patch by Chris Hopman <cjhopman@chromium.org> on 2013-01-31
Reviewed by Ryosuke Niwa.

These functions expect a window point. When in
applyPageScaleFactorInCompositor mode, the points need to be unscaled
by the page scale factor.

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::selectRange):
(WebKit::WebFrameImpl::moveCaretSelectionTowardsWindowPoint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools: [Chromium] Add two-word misspelling to mock spellchecker
https://bugs.webkit.org/show_bug.cgi?id=108498

Patch by Rouslan Solomakhin <rouslan@chromium.org> on 2013-01-31
Reviewed by Tony Chang.

Some layout tests verify spellcheck behavior when multiple words are
marked as a single misspelling. This change adds a two-word misspelling
'upper case' to the mock spellchecker used by layout tests.

* DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp:
(MockSpellCheck::spellCheckWord): Modified to handle spaces in misspellings.
(MockSpellCheck::initializeIfNeeded):  Modified to use a vector instead of a hash table.
* DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.h:
(MockSpellCheck): Changed misspellings container from hash table to vector.

LayoutTests: [Chromium] Expect spellcheck to work for exactly-selected multi-word misspellings
https://bugs.webkit.org/show_bug.cgi?id=108498

Patch by Rouslan Solomakhin <rouslan@chromium.org> on 2013-01-31
Reviewed by Tony Chang.

* platform/chromium/TestExpectations: Update spellcheck tests expectations.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove MessageID.h
https://bugs.webkit.org/show_bug.cgi?id=108516

Reviewed by Sam Weinig.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::processIncomingMessage):
(CoreIPC::Connection::sendOutgoingMessages):
(CoreIPC::Connection::dispatchSyncMessage):
(CoreIPC::Connection::dispatchMessage):
* Platform/CoreIPC/Connection.h:
(CoreIPC):
(Connection):
* Platform/CoreIPC/MessageID.h: Removed.
* Platform/CoreIPC/mac/ConnectionMac.cpp:
(CoreIPC::Connection::sendOutgoingMessage):
(CoreIPC::Connection::receiveSourceEventHandler):
* Shared/CoreIPCSupport/WebConnectionMessageKinds.h: Removed.
* Shared/CoreIPCSupport/WebContextMessageKinds.h:
* UIProcess/DrawingAreaProxy.h:
(CoreIPC):
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
* UIProcess/WebApplicationCacheManagerProxy.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::didReceiveMessage):
(WebKit::WebContext::didReceiveSyncMessage):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebFrameProxy.h:
(CoreIPC):
* UIProcess/WebFullScreenManagerProxy.h:
(CoreIPC):
* UIProcess/WebIconDatabase.h:
(CoreIPC):
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
(CoreIPC):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/FullScreen/WebFullScreenManager.cpp:
* WebProcess/FullScreen/WebFullScreenManager.h:
(CoreIPC):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::postMessage):
(WebKit::InjectedBundle::postSynchronousMessage):
* WebProcess/InjectedBundle/InjectedBundle.h:
(CoreIPC):
* WebProcess/WebPage/DrawingArea.h:
(CoreIPC):
* WebProcess/WebPage/LayerTreeHost.h:
(CoreIPC):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
(CoreIPC):
* WebProcess/WebPage/WebPageGroupProxy.h:
(CoreIPC):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141472 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit2: provide new bundle APIs to allow bundle clients to be notified of pasteboard access.
https://bugs.webkit.org/show_bug.cgi?id=108396.
<rdar://problem/12920461>

Source/WebCore: 

Reviewed by Alexey Proskuryakov.

Adds support in WebCore to new EditorClient methods to support the modified
client bundle API in WebKit2.

* WebCore.exp.in:
* editing/Editor.cpp:
(WebCore::Editor::cut): Added call to willWriteSelectionToPasteboard.
(WebCore::Editor::copy): Ditto.
(WebCore::Editor::willWriteSelectionToPasteboard): Added.
* editing/Editor.h:
* loader/EmptyClients.h: Added empty client implementation
for the new methods.
(WebCore::EmptyEditorClient::willWriteSelectionToPasteboard):
(WebCore::EmptyEditorClient::getClientPasteboardDataForRange):
* page/EditorClient.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::writeSelectionForTypes): Added call to getClientPasteboardDataForRange.

Source/WebKit/blackberry: 

Reviewed by Alexey Proskuryakov.

Adds stub implementation for WebKit of the new EditorClient methods.

* WebCoreSupport/EditorClientBlackBerry.cpp:
(WebCore::EditorClientBlackBerry::willWriteSelectionToPasteboard):
(WebCore::EditorClientBlackBerry::getClientPasteboardDataForRange):
* WebCoreSupport/EditorClientBlackBerry.h:

Source/WebKit/chromium: 

Reviewed by Alexey Proskuryakov.

Adds stub implementation for WebKit of the new EditorClient methods.

* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::willWriteSelectionToPasteboard):
(WebKit::EditorClientImpl::getClientPasteboardDataForRange):
* src/EditorClientImpl.h:

Source/WebKit/efl: 

Reviewed by Alexey Proskuryakov.

Adds stub implementation for WebKit of the new EditorClient methods.

* WebCoreSupport/EditorClientEfl.cpp:
(WebCore::EditorClientEfl::willWriteSelectionToPasteboard):
(WebCore::EditorClientEfl::getClientPasteboardDataForRange):
* WebCoreSupport/EditorClientEfl.h:

Source/WebKit/gtk: 

Reviewed by Alexey Proskuryakov.

Adds stub implementation for WebKit of the new EditorClient methods.

* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::willWriteSelectionToPasteboard):
(WebKit::EditorClient::getClientPasteboardDataForRange):
* WebCoreSupport/EditorClientGtk.h:

Source/WebKit/mac: 

Reviewed by Alexey Proskuryakov.

Adds stub implementation for WebKit of the new EditorClient methods.

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::willWriteSelectionToPasteboard):
(WebEditorClient::getClientPasteboardDataForRange):

Source/WebKit/qt: 

Reviewed by Alexey Proskuryakov.

Adds stub implementation for WebKit of the new EditorClient methods.

* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::willWriteSelectionToPasteboard):
(WebCore::EditorClientQt::getClientPasteboardDataForRange):
* WebCoreSupport/EditorClientQt.h:

Source/WebKit/win: 

Reviewed by Alexey Proskuryakov.

Adds stub implementation for WebKit of the new EditorClient methods.

* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::willWriteSelectionToPasteboard):
(WebEditorClient::getClientPasteboardDataForRange):
* WebCoreSupport/WebEditorClient.h:

Source/WebKit/wince: 

Reviewed by Alexey Proskuryakov.

Adds stub implementation for WebKit of the new EditorClient methods.

* WebCoreSupport/EditorClientWinCE.cpp:
(WebKit::EditorClientWinCE::willWriteSelectionToPasteboard):
(WebKit::EditorClientWinCE::getClientPasteboardDataForRange):
* WebCoreSupport/EditorClientWinCE.h:

Source/WebKit/wx: 

Reviewed by Alexey Proskuryakov.

Adds stub implementation for WebKit of the new EditorClient methods.

* WebKitSupport/EditorClientWx.cpp:
(WebCore::EditorClientWx::willWriteSelectionToPasteboard):
(WebCore::EditorClientWx::getClientPasteboardDataForRange):
* WebKitSupport/EditorClientWx.h:

Source/WebKit2: 

Reviewed by Alexey Proskuryakov.

This patch adds new bundle client API to receive notifications
relative the pasteboard activity. There are 2 new API added to
InjectedBundleEditorClient, to receive notification before and
after the pasteboard content is added and one API to provide
additional content to add to the pasteboard.
In order to create content to add to the pasteboard, WKWebArchiveRef
and WKWebArchiveResourcesRef have been added to the set of API level
object.
This work is a joint effort with Sam Weinig who contributed the
support for WKWebArchiveRef, WKWebArchiveResourcesRef and related
files. Sam is the author of the first chunk of changes listed below.
        
* Shared/API/c/WKBase.h:
* Shared/API/c/WKSharedAPICast.h:
* Shared/API/c/mac/WKWebArchive.cpp: Added.
(WKWebArchiveGetTypeID):
(WKWebArchiveCreate):
(WKWebArchiveCreateWithData):
(WKWebArchiveCreateFromRange):
(WKWebArchiveCopyMainResource):
(WKWebArchiveCopySubresources):
(WKWebArchiveCopySubframeArchives):
(WKWebArchiveCopyData):
* Shared/API/c/mac/WKWebArchive.h: Added.
* Shared/API/c/mac/WKWebArchiveResource.cpp: Added.
(WKWebArchiveResourceGetTypeID):
(WKWebArchiveResourceCreate):
(WKWebArchiveResourceCopyData):
(WKWebArchiveResourceCopyURL):
(WKWebArchiveResourceCopyMIMEType):
(WKWebArchiveResourceCopyTextEncoding):
* Shared/API/c/mac/WKWebArchiveResource.h: Added.
* Shared/APIObject.h:
* Shared/WebArchive.cpp: Added.
(WebKit::WebArchive::create):
(WebKit::WebArchive::WebArchive):
(WebKit::WebArchive::~WebArchive):
(WebKit::WebArchive::mainResource):
(WebKit::WebArchive::subresources):
(WebKit::WebArchive::subframeArchives):
(WebKit::releaseCFData):
(WebKit::WebArchive::data):
(WebKit::WebArchive::coreLegacyWebArchive):
* Shared/WebArchive.h: Added.
(WebKit::WebArchive::type):
* Shared/WebArchiveResource.cpp: Added.
(WebKit::WebArchiveResource::create):
(WebKit::WebArchiveResource::WebArchiveResource):
(WebKit::WebArchiveResource::~WebArchiveResource):
(WebKit::releaseCFData):
(WebKit::WebArchiveResource::data):
(WebKit::WebArchiveResource::URL):
(WebKit::WebArchiveResource::MIMEType):
(WebKit::WebArchiveResource::textEncoding):
(WebKit::WebArchiveResource::coreArchiveResource):
* Shared/WebArchiveResource.h: Added.
(WebKit::WebArchiveResource::type):
* WebKit2.xcodeproj/project.pbxproj:
        
* Shared/APIClientTraits.cpp: Added versioning to InjectedBundlePageEditorClient.
* Shared/APIClientTraits.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
(WebKit::InjectedBundlePageEditorClient::willWriteToPasteboard): Added.
(WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): Added.
(WebKit::InjectedBundlePageEditorClient::didWriteToPasteboard): Added.
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::didWriteSelectionToPasteboard):
(WebKit::WebEditorClient::willWriteSelectionToPasteboard):
(WebKit::WebEditorClient::getClientPasteboardDataForRange):
* WebProcess/WebCoreSupport/WebEditorClient.h:

Tools: 

Reviewed by Alexey Proskuryakov.
        
Adding new WebKit2 test with relevant bundle, to test the new APIs.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm: Added.
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
(TestWebKitAPI::setInjectedBundleClient):
* TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp: Added.
(PasteboardNotificationsTest):
(TestWebKitAPI::willWriteToPasteboard):
(TestWebKitAPI::getPasteboardDataForRange):
(TestWebKitAPI::didWriteToPasteboard):
(TestWebKitAPI::PasteboardNotificationsTest::PasteboardNotificationsTest):
(TestWebKitAPI::PasteboardNotificationsTest::didCreatePage):
* TestWebKitAPI/Tests/WebKit2/execCopy.html: Added.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: Updated to reflect
changes in InjectedBundleEditorClient.
(WTR::InjectedBundlePage::InjectedBundlePage):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Move LocalizedStrings to WebCore
https://bugs.webkit.org/show_bug.cgi?id=108488

Reviewed by Adam Barth.

Part of a larger refactoring series; see tracking bug 106829.

Source/WebCore:

* WebCore.gypi:
* platform/chromium/LocalizedStringsChromium.cpp: Copied from Source/WebKit/chromium/src/LocalizedStrings.cpp.
(WebCore::imageTitle):

Source/WebKit/chromium:

* WebKit.gyp:
* src/LocalizedStrings.cpp: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141474 268f45cc-cd09-0410-ab3c-d52691b4dbfc