PDFPlugin: Use PDFPlugin even if there's an external plugin installed, if it's blocked
https://bugs.webkit.org/show_bug.cgi?id=127415
<rdar://problem/12482452>

Reviewed by Sam Weinig.

Allow use of PDFPlugin even if an external plugin is installed but blocked.
If an external plugin is installed and not blocked, we will continue to use that.

Inject a context menu item into the PDFPlugin context menu that allows the client
to unblock the plugin and reload the page (via the same mechanism that the
unavailable plugin button uses).

* UIProcess/API/C/WKPageLoaderClient.h:
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(setUpPageLoaderClient):
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::pluginLoadPolicy):
* UIProcess/WebLoaderClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::findPlugin):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Add a new PluginLoadPolicy callback for the V4 client with
yet another string out-argument, to allow clients to customize the string
that will appear in the PDFPlugin context menu when it is used in place
of a blocked plugin.

* WebProcess/Plugins/PDF/PDFPlugin.h:
Add setUsedInPlaceOfBlockedPlugin(), which determines whether or not
we should include an item in the PDFPlugin context menu that acts identically
to the unavailable plugin button, allowing the client to potentially unblock
the plugin.

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFPluginContextMenuTarget initWithPDFPlugin:WebKit::]):
(-[WKPDFPluginContextMenuTarget useBlockedPlugin:]):
Added WKPDFPluginContextMenuTarget, which is the Objective-C object that the
aforementioned context menu item targets.

(WebKit::PDFPlugin::PDFPlugin):
By default, we won't show the extra context menu item.

(WebKit::PDFPlugin::handleContextMenuEvent):
If we were used in place of a blocked plugin, inject our additional context
menu item into the menu. If we were handed a custom string via setUsedInPlaceOfBlockedPlugin,
use that. Otherwise, use the generic string from WebCore's localized strings.

(WebKit::PDFPlugin::openWithPlugin):
Pretend that the user clicked the unavailable plugin button when they click
the injected context menu item.

(WebKit::PDFPlugin::setUsedInPlaceOfBlockedPlugin):

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
If we end up with a blocked plugin, but could have used PDFPlugin to display
the content, do so instead of showing the unavailable plugin indicator.

Pass PDFPlugin the custom context menu item title acquired from the client.

(WebKit::WebPage::canPluginHandleResponse):

* English.lproj/Localizable.strings:
* WebCore.exp.in:
* platform/LocalizedStrings.cpp:
(WebCore::useBlockedPlugInContextMenuTitle):
* platform/LocalizedStrings.h:
Add a localizable string for the generic case, where the client
didn't provide a more specific string for the context menu item.

Adopt the new page loader client plugin load callback.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::pluginLoadPolicy):
* WebKitTestRunner/TestController.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE][Mac] Adopt new AVStreamDataParser delegate API
https://bugs.webkit.org/show_bug.cgi?id=127498

Reviewed by Eric Carlson.

Adopt a new delegate API which passes in whether or not the new AVAsset
is discontinuous, implying the AVAsset is entirely new rather than
just updated with new information.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
svg/animations/smil-syncbase-self-dependency.svg is very flaky

This is a newly landed test for <https://bugs.webkit.org/show_bug.cgi?id=108184>
that wasn't actually testing for what the bug fixed. The plan is to add a better
test soon, so deleting this one.

* svg/animations/smil-syncbase-self-dependency-expected.txt: Removed.
* svg/animations/smil-syncbase-self-dependency.svg: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IDB: Implement cross-thread and IPC plumbing for 'get' support
https://bugs.webkit.org/show_bug.cgi?id=127501

Reviewed by Anders Carlsson.

Source/WebCore:

Add isolatedCopy to the IDBGetResult object:
* Modules/indexeddb/IDBGetResult.h:
(WebCore::IDBGetResult::isolatedCopy):

Add a cross-thread and cross-IPC appropriate object for IDBKeyRanges:
* Modules/indexeddb/IDBKeyRangeData.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBGetResult.h.
(WebCore::IDBKeyRangeData::isolatedCopy):
* Modules/indexeddb/IDBKeyRangeData.h: Copied from Source/WebCore/Modules/indexeddb/IDBGetResult.h.
(WebCore::IDBKeyRangeData::IDBKeyRangeData):

Add a few more cross-thread copiers:
* platform/CrossThreadCopier.cpp:
(WebCore::IDBGetResult>::copy):
(WebCore::IDBKeyRangeData>::copy):
* platform/CrossThreadCopier.h:

Project file gunk:
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

Make the WebProcess call out to the DatabaseProcess with a get request, and handle the
response from the DatabaseProcess:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::get):
(WebKit::WebIDBServerConnection::didGetRecord):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:

Get the request from the WebProcess and forward it to the appropriate unique IDB database:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::getRecord):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:

Forward the request to the database thread, and response to the result from that thread:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::getRecord):
(WebKit::UniqueIDBDatabase::getRecordFromBackingStore):
(WebKit::UniqueIDBDatabase::didGetRecordFromBackingStore):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

IPC and asynchronous request infrastructure:
* Scripts/webkit2/messages.py:
(struct_or_class):

* Shared/AsyncTask.h:
(WebKit::createAsyncTask):

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<IDBGetResult>::encode):
(IPC::ArgumentCoder<IDBGetResult>::decode):
(IPC::ArgumentCoder<IDBKeyRangeData>::encode):
(IPC::ArgumentCoder<IDBKeyRangeData>::decode):
* Shared/WebCoreArgumentCoders.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Production build fix.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Compile error.
https://bugs.webkit.org/show_bug.cgi?id=127500

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-01-23
Reviewed by Brent Fulgham.

* WebCache.cpp:
(WebCache::cacheFolder): CurlCacheManager::getCacheDirectory() has changed name to cacheDirectory().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162635 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Compile error.
https://bugs.webkit.org/show_bug.cgi?id=127499

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-01-23
Reviewed by Brent Fulgham.

* platform/network/curl/ResourceError.h: Include <winsock2.h> before <curl/curl.h>.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Loads started soon after main frame completion should be considered part of the main load
https://bugs.webkit.org/show_bug.cgi?id=127504

Reviewed by Andreas Kling.

ProgressTracker currently decides that main load is complete when the main frame stops loading. 
However it is common that timers and onload events trigger more loads immediately (for example 
by inserting iframes) and loading continues visually. These should be considered as part of the
main load for paint throttling and speculative tiling coverage purposes.

* loader/ProgressTracker.cpp:
(WebCore::ProgressTracker::ProgressTracker):
(WebCore::ProgressTracker::progressStarted):
        
    Track whether this is considered part of the main load or not with a boolean. 
    It is set for subframe loads too if they start loading soon (within 1s) after the main frame load completes.

(WebCore::ProgressTracker::finalProgressComplete):
        
    Get a timestamp.

(WebCore::ProgressTracker::isMainLoadProgressing):

    New definition of "main load".

* loader/ProgressTracker.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add init methods that create default configurations
https://bugs.webkit.org/show_bug.cgi?id=127503

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKProcessClass.mm:
(-[WKProcessClass init]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:]):

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