Fix the build.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-04-07  Tim Horton  <timothy_horton@apple.com>
2
3         Fix the build.
4
5         * UIProcess/API/mac/WKView.mm:
6         (-[WKView _setFixedLayoutSize:]):
7
8 2015-04-07  Tim Horton  <timothy_horton@apple.com>
9
10         Expose and test fixedLayoutSize via modern WebKit SPI
11         https://bugs.webkit.org/show_bug.cgi?id=143500
12
13         Reviewed by Simon Fraser.
14
15         * UIProcess/API/Cocoa/WKViewPrivate.h:
16         * UIProcess/API/Cocoa/WKWebView.mm:
17         (-[WKWebView _isFixedLayoutEnabled]):
18         (-[WKWebView _setFixedLayoutEnabled:]):
19         (-[WKWebView _fixedLayoutSize]):
20         (-[WKWebView _setFixedLayoutSize:]):
21         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
22         * UIProcess/API/mac/WKView.mm:
23         (-[WKView _isFixedLayoutEnabled]):
24         (-[WKView _setFixedLayoutEnabled:]):
25         (-[WKView _fixedLayoutSize]):
26         (-[WKView _setFixedLayoutSize:]):
27         Add API for adjusting the fixed layout size, and whether or not we use it.
28
29         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
30         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
31         Repair a mistake I made in r139822, where I brought odd TILED_BACKING_STORE-only
32         logic (which disables scrollbars if fixedLayoutSize is enabled) to the rest of the ports.
33         Put it back as TILED_BACKING_STORE-only.
34
35         Persist the fixedLayoutSize through view creation; we already persist the enabled state,
36         but not the size, which doesn't make any sense.
37
38         * WebProcess/WebPage/WebPage.cpp:
39         (WebKit::WebPage::fixedLayoutSize):
40         * WebProcess/WebPage/WebPage.h:
41         Add a fixedLayoutSize() getter.
42
43 2015-04-07  Brady Eidson  <beidson@apple.com>
44
45         ContextMenuItem refactoring
46         https://bugs.webkit.org/show_bug.cgi?id=143485
47
48         Reviewed by Beth Dakin.
49
50         * Shared/mac/NativeContextMenuItem.mm:
51         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
52
53 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
54
55         Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
56         https://bugs.webkit.org/show_bug.cgi?id=143495
57
58         Reviewed by Tim Horton.
59         
60         Exposed the antialiasedFontDilationEnabled setting via WK C SPI and Objective-C SPI.
61
62         * Shared/WebPreferencesDefinitions.h:
63         * UIProcess/API/C/WKPreferences.cpp:
64         (WKPreferencesSetAntialiasedFontDilationEnabled):
65         (WKPreferencesGetAntialiasedFontDilationEnabled):
66         * UIProcess/API/C/WKPreferencesRefPrivate.h:
67         * UIProcess/API/Cocoa/WKPreferences.mm:
68         (-[WKPreferences _antialiasedFontDilationEnabled]):
69         (-[WKPreferences _setAntialiasedFontDilationEnabled:]):
70         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
71         * WebProcess/WebPage/WebPage.cpp:
72         (WebKit::WebPage::updatePreferences):
73
74 2015-04-07  Beth Dakin  <bdakin@apple.com>
75
76         Should only propagate pressure events with relevant phases
77         https://bugs.webkit.org/show_bug.cgi?id=143494
78         -and corresponding-
79         rdar://problem/20453738
80
81         Reviewed by Tim Horton.
82
83         We only care about the changed, began, and ended phases. 
84         * UIProcess/API/mac/WKView.mm:
85         (-[WKView pressureChangeWithEvent:]):
86
87 2015-04-07  Jer Noble  <jer.noble@apple.com>
88
89         Unreviewed build fix; make calls to new SPI conditional on iOS version.
90
91         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
92         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
93
94 2015-04-06  Anders Carlsson  <andersca@apple.com>
95
96         Create the web inspector process pool lazily
97         https://bugs.webkit.org/show_bug.cgi?id=143456
98         rdar://problem/20146520
99
100         Reviewed by Mark Lam.
101
102         Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool
103         when trying to determine if a given process pool is the inspector process pool.
104
105         This should speed up initialization somewhat and avoid creating a storage manager for example.
106
107         * UIProcess/WebInspectorProxy.cpp:
108         (WebKit::WebInspectorProxy::inspectorProcessPool):
109         (WebKit::WebInspectorProxy::isInspectorProcessPool):
110         * UIProcess/WebInspectorProxy.h:
111         * UIProcess/WebProcessProxy.cpp:
112         (WebKit::WebProcessProxy::getLaunchOptions):
113
114 2015-04-06  Brady Eidson  <beidson@apple.com>
115
116         Combine ActionMenuHitTestResult with WebHitTestResult
117         https://bugs.webkit.org/show_bug.cgi?id=143444
118
119         Reviewed by Beth Dakin.
120
121         * Shared/mac/ActionMenuHitTestResult.h: Removed.
122         * Shared/mac/ActionMenuHitTestResult.mm: Removed.
123
124         * Shared/WebHitTestResult.cpp:
125         (WebKit::WebHitTestResult::Data::Data):
126         (WebKit::WebHitTestResult::Data::encode):
127         (WebKit::WebHitTestResult::Data::decode):
128         (WebKit::WebHitTestResult::Data::platformEncode):
129         (WebKit::WebHitTestResult::Data::platformDecode):
130         * Shared/WebHitTestResult.h:
131         * Shared/mac/WebHitTestResult.mm: Added.
132         (WebKit::WebHitTestResult::Data::platformEncode):
133         (WebKit::WebHitTestResult::Data::platformDecode):
134
135         * UIProcess/API/mac/WKView.mm:
136         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]):
137         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted.
138         * UIProcess/API/mac/WKViewInternal.h:
139         * UIProcess/PageClient.h:
140         * UIProcess/WebPageProxy.cpp:
141         (WebKit::WebPageProxy::didPerformActionMenuHitTest):
142         * UIProcess/WebPageProxy.h:
143         * UIProcess/WebPageProxy.messages.in:
144         * UIProcess/mac/PageClientImpl.h:
145         * UIProcess/mac/PageClientImpl.mm:
146         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
147         * UIProcess/mac/WKActionMenuController.h:
148         * UIProcess/mac/WKActionMenuController.mm:
149         (-[WKActionMenuController willDestroyView:]):
150         (-[WKActionMenuController _clearActionMenuState]):
151         (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
152         (-[WKActionMenuController _hitTestResultDataImage]):
153         (-[WKActionMenuController _defaultMenuItemsForImage]):
154         (-[WKActionMenuController _copyImage:]):
155         (-[WKActionMenuController _addImageToPhotos:]):
156         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
157         (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
158         (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
159         (-[WKActionMenuController _webHitTestResult]):
160         (-[WKActionMenuController _defaultMenuItems]):
161         (-[WKActionMenuController _hitTestResultImage]): Deleted.
162         * UIProcess/mac/WKImmediateActionController.h:
163         * UIProcess/mac/WKImmediateActionController.mm:
164         (-[WKImmediateActionController willDestroyView:]):
165         (-[WKImmediateActionController _clearImmediateActionState]):
166         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]):
167         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
168         (-[WKImmediateActionController _webHitTestResult]):
169         (-[WKImmediateActionController _defaultAnimationController]):
170         (-[WKImmediateActionController _updateImmediateActionItem]):
171         (-[WKImmediateActionController _menuItemForDataDetectedText]):
172         (-[WKImmediateActionController _animationControllerForText]):
173         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted.
174         * WebKit2.xcodeproj/project.pbxproj:
175         * WebProcess/WebPage/mac/WebPageMac.mm:
176         (WebKit::WebPage::performActionMenuHitTestAtLocation):
177
178 2015-04-06  Jer Noble  <jer.noble@apple.com>
179
180         Synchronize fullscreen animation between processes.
181         https://bugs.webkit.org/show_bug.cgi?id=143131
182
183         Reviewed by Simon Fraser.
184
185         Support synchronize resizing by animating within the UIProcess. Since setVideoLayerFrameFenced() is now only
186         ever called from within a 0-duration transaction, make that the official contract of the function and wrap
187         the WebProcess side of that method in its own 0-duration transaction.
188
189         * Platform/spi/ios/BackBoardServicesSPI.h: Added.
190         * Platform/spi/ios/UIKitSPI.h:
191         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
192         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
193         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Remember the initial rect.
194         (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Added; simple getter.
195         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Use a different synchronization fence primative.
196             Save the cached frame value.
197         (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Added; simple getter.
198         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity): Save the cached gravity value.
199         * WebKit2.xcodeproj/project.pbxproj:
200         * WebProcess/ios/WebVideoFullscreenManager.mm:
201         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Wrap in a 0-length transaction.
202
203 2015-04-06  Chris Dumez  <cdumez@apple.com>
204
205         [WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize()
206         https://bugs.webkit.org/show_bug.cgi?id=143451
207         <rdar://problem/20437994>
208
209         Reviewed by Anders Carlsson.
210
211         Initialize WebProcess::m_webSQLiteDatabaseTracker and
212         NetworkProcess::m_webSQLiteDatabaseTracker in their respective class
213         constructors instead of doing it later in the initializeWebProcess() /
214         initializeNetworkProcess() methods.
215
216         If we do it later, it can happen that the tracker gets set after
217         a SQLiteTransactionInProgressAutoCounter initialization and before
218         the actual transaction. When this happens, the
219         SQLiteTransactionInProgressAutoCounter variable fails to increment the
220         transaction count. Then when the transaction is executed,
221         SQLiteDatabaseTracker::hasTransactionInProgress() can return false.
222         This would lead to possible assertions on start up on iOS.
223
224         * NetworkProcess/NetworkProcess.cpp:
225         (WebKit::NetworkProcess::NetworkProcess):
226         (WebKit::NetworkProcess::initializeNetworkProcess):
227         * NetworkProcess/NetworkProcess.h:
228         * WebProcess/WebProcess.cpp:
229         (WebKit::WebProcess::WebProcess):
230         (WebKit::WebProcess::initializeConnection):
231         * WebProcess/WebProcess.h:
232
233 2015-04-06  Beth Dakin  <bdakin@apple.com>
234
235         https://trac.webkit.org/changeset/182338 introduced a build failure that I 
236         attempted to fix with https://trac.webkit.org/changeset/182341 , but that disabled 
237         the feature accidentally.  This should do the right thing.
238
239         * UIProcess/API/mac/WKView.mm:
240         (-[WKView pressureChangeWithEvent:]):
241
242 2015-04-06  Commit Queue  <commit-queue@webkit.org>
243
244         Unreviewed, rolling out r182296.
245         https://bugs.webkit.org/show_bug.cgi?id=143448
246
247         This will disturb network cache efficacy logging, we should
248         reland this later. (Requested by cdumez__ on #webkit).
249
250         Reverted changeset:
251
252         "[WK2][NetworkCache] Drop HTTP method from NetworkCache::Key"
253         https://bugs.webkit.org/show_bug.cgi?id=143348
254         http://trac.webkit.org/changeset/182296
255
256 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
257
258         [WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array::create() call
259         https://bugs.webkit.org/show_bug.cgi?id=143413
260
261         Reviewed by Darin Adler.
262
263         Move the Vector<> object containing the copied elements into the Array::create()
264         call, avoiding copying all the elements again.
265
266         While here, change the Vector<> parameters for Array::create() and the Array
267         constructor to rvalue references. This will ensure that the passed-in object
268         is moved into the Array::create() call if possible, or explicitly copied
269         otherwise. The constructor is moved into the header for inlining opportunities
270         and the unnecessary parameter in the create(Vector<>&&) method declaration
271         removed.
272
273         * Shared/API/APIArray.cpp:
274         (API::Array::create):
275         (API::Array::copy):
276         (API::Array::Array): Deleted.
277         * Shared/API/APIArray.h:
278
279 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
280
281         UserScript, UserStyleSheet constructors should take in Vector<String> rvalues
282         https://bugs.webkit.org/show_bug.cgi?id=143411
283
284         Reviewed by Darin Adler.
285
286         Move the whitelist and blacklist Vector<String> objects into the
287         UserScript and UserStyleSheet constructors in ArgumentCoder<T>::decode
288         functions.
289
290         * Shared/WebCoreArgumentCoders.cpp:
291         (IPC::ArgumentCoder<UserStyleSheet>::decode):
292         (IPC::ArgumentCoder<UserScript>::decode):
293
294 2015-04-05  Darin Adler  <darin@apple.com>
295
296         [Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on the main thread
297         https://bugs.webkit.org/show_bug.cgi?id=143423
298         rdar://problem/18773785
299
300         Reviewed by Alexey Proskuryakov.
301
302         * WebProcess/cocoa/WebProcessCocoa.mm:
303         (WebKit::origin): Factored out this helper function from updateActivePages below, so
304         the function below is easier to read.
305         (WebKit::WebProcess::updateActivePages): Refactored to use the new origin function.
306         Use dispatch_async to call WKSetApplicationInformationItem without blocking.
307
308 2015-04-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
309
310         Use constants of sqlite3 directly for status of SQL result in webdatabase
311         https://bugs.webkit.org/show_bug.cgi?id=143329
312
313         Reviewed by Darin Adler.
314
315         In webdatabase, it has used own constant variables as well as using sqlite3 constants directly.
316         If sqlite3 constants are changed in the library, we should modify many files as well. Besides
317         it can cause to use if~else statement which consumes more cpu cycles compared to switch~case.
318
319         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
320         (WebKit::SQLiteIDBCursor::createSQLiteStatement):
321         (WebKit::SQLiteIDBCursor::resetAndRebindStatement):
322         (WebKit::SQLiteIDBCursor::bindArguments):
323         (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
324         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
325         (WebKit::createOrMigrateRecordsTableIfNecessary):
326         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata):
327         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
328         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::changeDatabaseVersion):
329         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore):
330         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
331         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
332         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
333         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
334         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber):
335         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber):
336         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
337         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
338         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord):
339         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord):
340         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
341         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
342         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
343         (WebKit::NetworkCache::executeSQLStatement):
344         (WebKit::NetworkCache::Statistics::initialize):
345         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
346         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
347         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
348         * UIProcess/Storage/LocalStorageDatabase.cpp:
349         (WebKit::LocalStorageDatabase::importItems):
350         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
351         (WebKit::LocalStorageDatabase::databaseIsEmpty):
352         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
353         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
354         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers):
355         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier):
356         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
357         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier):
358         * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp:
359         (webkitSoupCookieJarSqliteLoad):
360         (webkitSoupCookieJarSqliteInsertCookie):
361         (webkitSoupCookieJarSqliteDeleteCookie):
362
363 2015-04-05  Simon Fraser  <simon.fraser@apple.com>
364
365         Remove "go ahead and" from comments
366         https://bugs.webkit.org/show_bug.cgi?id=143421
367
368         Reviewed by Darin Adler, Benjamin Poulain.
369
370         Remove the phrase "go ahead and" from comments where it doesn't add
371         anything (which is almost all of them).
372
373         * Platform/unix/EnvironmentUtilities.cpp:
374         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
375         * PluginProcess/PluginProcess.cpp:
376         (WebKit::PluginProcess::didClose):
377         * UIProcess/API/mac/WKView.mm:
378         (-[WKView insertText:replacementRange:]):
379         (-[WKView _pluginFocusOrWindowFocusChanged:pluginComplexTextInputIdentifier:]):
380         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
381         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
382
383 2015-04-05  Antti Koivisto  <antti@apple.com>
384
385         Bloom filter should support longer hashes
386         https://bugs.webkit.org/show_bug.cgi?id=143419
387
388         Reviewed by Dan Bernstein.
389
390         Use the hash digest directly in the contents filter instead of going via shortHash.
391
392         * NetworkProcess/cache/NetworkCacheKey.h:
393         (WebKit::NetworkCache::Key::hash):
394         (WebKit::NetworkCache::Key::shortHash): Deleted.
395         (WebKit::NetworkCache::Key::toShortHash): Deleted.
396
397             No longer needed.
398
399         * NetworkProcess/cache/NetworkCacheStorage.cpp:
400         (WebKit::NetworkCache::Storage::synchronize):
401         (WebKit::NetworkCache::Storage::addToContentsFilter):
402         (WebKit::NetworkCache::Storage::mayContain):
403         * NetworkProcess/cache/NetworkCacheStorage.h:
404
405 2015-04-05  Antti Koivisto  <antti@apple.com>
406
407         Network cache Bloom filter is too big
408         https://bugs.webkit.org/show_bug.cgi?id=143400
409
410         Follow-up: Fix an ineffective assert.
411
412         * NetworkProcess/cache/NetworkCacheStorage.cpp:
413         (WebKit::NetworkCache::Storage::setMaximumSize): Average resource size is closer to 50KB than 50MB.
414
415 2015-04-05  Antti Koivisto  <antti@apple.com>
416
417         Rename Cache::setMaximumSize to setCapacity
418         https://bugs.webkit.org/show_bug.cgi?id=143418
419
420         Reviewed by Dan Bernstein.
421
422         * NetworkProcess/cache/NetworkCache.cpp:
423         (WebKit::NetworkCache::Cache::setCapacity):
424         (WebKit::NetworkCache::Cache::setMaximumSize): Deleted.
425         * NetworkProcess/cache/NetworkCache.h:
426         * NetworkProcess/cache/NetworkCacheStorage.cpp:
427         (WebKit::NetworkCache::Storage::retrieve):
428         (WebKit::NetworkCache::Storage::store):
429         (WebKit::NetworkCache::Storage::update):
430         (WebKit::NetworkCache::Storage::setCapacity):
431         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
432         (WebKit::NetworkCache::Storage::shrink):
433         (WebKit::NetworkCache::Storage::setMaximumSize): Deleted.
434         * NetworkProcess/cache/NetworkCacheStorage.h:
435         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
436         (WebKit::NetworkProcess::platformSetCacheModel):
437
438 2015-04-04  Antti Koivisto  <antti@apple.com>
439
440         Network cache Bloom filter is too big
441         https://bugs.webkit.org/show_bug.cgi?id=143400
442
443         Reviewed by Chris Dumez.
444
445         It is currently 1MB.
446
447         This patch switches the cache from a counting filter (CountingBloomFilter) to a bit filter (BloomFilter).
448
449         It also reduces the filter size from 2^20 to 2^18 elements which is good for ~26000 cache entries while
450         still keeping false positive rate below 1%. The current cache capacity allows around 4000 entries
451         with typical web contents.
452
453         The new filter size is 32KB.
454
455         * NetworkProcess/cache/NetworkCacheStorage.cpp:
456         (WebKit::NetworkCache::Storage::Storage):
457         (WebKit::NetworkCache::Storage::synchronize):
458
459             Turn initialization function into general purpose synchronization function.
460
461         (WebKit::NetworkCache::Storage::addToContentsFilter):
462
463             Collect newly added hashes so we don't miss entries that were added during synchronization.
464
465         (WebKit::NetworkCache::Storage::mayContain):
466         (WebKit::NetworkCache::Storage::remove):
467         (WebKit::NetworkCache::Storage::retrieve):
468         (WebKit::NetworkCache::Storage::store):
469         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
470         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
471         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
472         (WebKit::NetworkCache::Storage::setMaximumSize):
473         (WebKit::NetworkCache::Storage::clear):
474         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
475         (WebKit::NetworkCache::Storage::shrink):
476
477             Non-counting Bloom filter does not support removals so this requires a new strategy.
478
479             Shrink code now simply deletes entries. The filter is updated by calling synchronize() at the end.
480             While we could synchronize the filter during traversal it is better to just have one function for that.
481
482         (WebKit::NetworkCache::Storage::initialize): Deleted.
483         * NetworkProcess/cache/NetworkCacheStorage.h:
484         (WebKit::NetworkCache::Storage::mayContain):
485         (WebKit::NetworkCache::Storage::cacheMayContain): Deleted.
486
487 2015-04-04  Andy Estes  <aestes@apple.com>
488
489         [Content Filtering] Blocked page is not always displayed when it should be
490         https://bugs.webkit.org/show_bug.cgi?id=143410
491
492         Reviewed by Andreas Kling.
493
494         * UIProcess/WebFrameProxy.cpp:
495         (WebKit::WebFrameProxy::didStartProvisionalLoad): Stopped clearing m_contentFilterUnblockHandler here.
496         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Started doing it here instead.
497
498 2015-04-04  Chris Dumez  <cdumez@apple.com>
499
500         [WK2][Cocoa] Add a way to temporarily disable the WebKit Network Cache for testing
501         https://bugs.webkit.org/show_bug.cgi?id=143392
502         <rdar://problem/20315669>
503
504         Reviewed by Antti Koivisto.
505
506         Add a way to temporarily disable the WebKit Network Cache for testing.
507         It will be used temporarily for comparing page load times with and
508         without the WebKit network disk cache enabled.
509
510         This is in addition to the existing "WebKitNetworkCacheEnabled"
511         NSUserDefaults:
512         webkitNetworkCacheIsEnabled = [defaults boolForKey:WebKitNetworkCacheEnabledDefaultsKey]
513             && ![defaults boolForKey:WebKitNetworkCacheTemporarilyDisabledForTestingKey];
514
515         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
516         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
517
518 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
519
520         REGRESSION (r182215): Feedly crashes when closing article
521         https://bugs.webkit.org/show_bug.cgi?id=143405
522         rdar://problem/20382734, rdar://problem/20395497
523
524         Reviewed by Tim Horton.
525         
526         Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
527         is bad, because it can cause FrameView::layout() to get called in the middle of
528         RenderObject destruction, which leaves the render tree in a bad state.
529         
530         Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
531         
532         AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
533         a flag to say that the non-fast region needs to be recomputed, and that schedules
534         a scrolling tree commit. When the commit happens, we recompute the region. If the
535         region didn't change, and no other changes are pending, there's no need to commit.
536
537         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
538         (WebKit::RemoteScrollingCoordinator::buildTransaction):
539         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
540         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Outdent #ifdefs.
541
542 2015-04-03  Beth Dakin  <bdakin@apple.com>
543
544         Attempted build fix.
545
546         * UIProcess/API/mac/WKView.mm:
547
548 2015-04-03  Simon Fraser  <simon.fraser@apple.com>
549
550         Fix the firing of the ReachedSessionRestorationRenderTreeSizeThreshold milestone on iOS
551         https://bugs.webkit.org/show_bug.cgi?id=143394
552
553         Reviewed by Tim Horton.
554         
555         A client reshuffle at some point broke the dispatch of the ReachedSessionRestorationRenderTreeSizeThreshold
556         milestone. Fix by using WebPageProxy::didLayout() to fire the milestone.
557
558         * UIProcess/ios/WebPageProxyIOS.mm:
559         (WebKit::WebPageProxy::didCommitLayerTree):
560
561 2015-04-03  Beth Dakin  <bdakin@apple.com>
562
563         https://bugs.webkit.org/show_bug.cgi?id=143387
564         Improvements to webkitmouseforce web API
565         -and corresponding-
566         rdar://problem/20281808
567         rdar://problem/20281853
568
569         Reviewed by Darin Adler.
570
571         This patch:
572         1. Dispatches webkitmouseforceup and webkitmouseforceclick at the right time.
573         2. Dispatches webkitmouseforcechanged from mousedown all the way through through 
574         mouseup.
575         3. Uses force values from pressureChangeWithEvent instead of the immediate action 
576         gesture recognizer.
577
578         Listen for this NSResponder method, and pass the relevant info to WebPageProxy to 
579         dispatch to the web process.
580         * UIProcess/API/mac/WKView.mm:
581         (-[WKView pressureChangeWithEvent:]):
582         * UIProcess/WebPageProxy.cpp:
583         (WebKit::WebPageProxy::inputDeviceForceDidChange):
584         (WebKit::WebPageProxy::immediateActionDidUpdate):
585         * UIProcess/WebPageProxy.h:
586
587         The web process still needs to know when the immediate action gesture recognizer 
588         is updating, but it doesn’t need the force information. That will come from 
589         pressureChangeWithEvent.
590         * UIProcess/mac/WKImmediateActionController.mm:
591         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
592
593         Cache m_lastForceStage so that we can determine if we are 
594         transitioning to a new stage.
595         * WebProcess/WebPage/WebPage.cpp:
596         (WebKit::WebPage::WebPage):
597         * WebProcess/WebPage/WebPage.h:
598
599         New message for InputDeviceForceDidChange and modified message for 
600         ImmediateActionDidUpdate
601         * WebProcess/WebPage/WebPage.messages.in:
602
603         inputDeviceForceDidChange now takes care of dispatching mouseforcechanged, 
604         mouseforcedown, mouseforceup, and mouseforceclick.
605         * WebProcess/WebPage/mac/WebPageMac.mm:
606         (WebKit::WebPage::inputDeviceForceDidChange):
607
608         We still need to keep track of the ImmediateActionStages in WebCore::EventHandler 
609         so that we can have the right default behavior on mouseup based on whether or not 
610         that action began and was completed. (In other words, to ensure we don’t navigate 
611         to a link after force clicking it.)
612         (WebKit::WebPage::immediateActionDidUpdate):
613         (WebKit::WebPage::immediateActionDidComplete):
614
615 2015-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
616
617         InjectedBundleNodeHandle::renderedImage() needs to be exposed from the Cocoa WebAPI layer.
618         https://bugs.webkit.org/show_bug.cgi?id=143341.
619
620         Reviewed by Anders Carlsson.
621
622         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
623         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
624         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Expose rendered
625         image injected bundle API from the Cocoa layer. A node in the page can be
626         rendered to an NSImage on MacOS and to a UIImage on iOS.
627
628 2015-04-03  Chris Dumez  <cdumez@apple.com>
629
630         [WK2][iOS] We should prevent NetworkProcess suspension while it has pending SQL transactions
631         https://bugs.webkit.org/show_bug.cgi?id=143278
632         <rdar://problem/20180799>
633
634         Reviewed by Anders Carlsson.
635
636         Prevent NetworkProcess suspension while it has pending SQL transactions,
637         similarly to what we already did for WebProcesses. This patch moves the
638         WebSQLiteDatabaseTracker from WebProcess/ to Shared/ and make it usable
639         by the NetworkProcess class as well.
640
641         Whenever there are locked files to due SQL transactions, the
642         NetworkProcess will send an IPC message to the NetworkProcessProxy
643         which will hold a background process assertion until the NetworkProcess'
644         SQL transactions are complete. This way, it is no longer possible for
645         the NetworkProcess to get suspended while SQL transactions are running
646         and a database file is locked.
647
648         * NetworkProcess/NetworkProcess.cpp:
649         (WebKit::NetworkProcess::initializeNetworkProcess):
650         * NetworkProcess/NetworkProcess.h:
651         * Shared/WebSQLiteDatabaseTracker.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp.
652         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
653         (WebKit::m_childProcessType):
654         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
655         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
656         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
657         * Shared/WebSQLiteDatabaseTracker.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h.
658         * UIProcess/Network/NetworkProcessProxy.cpp:
659         (WebKit::NetworkProcessProxy::didClose):
660         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
661         * UIProcess/Network/NetworkProcessProxy.h:
662         * UIProcess/Network/NetworkProcessProxy.messages.in:
663         * WebKit2.xcodeproj/project.pbxproj:
664         * WebProcess/WebProcess.cpp:
665         (WebKit::WebProcess::WebProcess):
666         (WebKit::WebProcess::initializeConnection):
667         * WebProcess/WebProcess.h:
668
669 2015-04-03  Antti Koivisto  <antti@apple.com>
670
671         Add non-counting Bloom filter implementation
672         https://bugs.webkit.org/show_bug.cgi?id=143366
673
674         Reviewed by Sam Weinig.
675
676         * NetworkProcess/cache/NetworkCacheStorage.h:
677
678 2015-04-03  Zan Dobersek  <zdobersek@igalia.com>
679
680         Fix the EFL and GTK build after r182243
681         https://bugs.webkit.org/show_bug.cgi?id=143361
682
683         Reviewed by Csaba Osztrogonác.
684
685         * PlatformGTK.cmake: Add a custom command that copies the
686         InspectorBackendCommands.js file into the proper directory
687         under DerivedSources/WebInspectorUI/.
688
689 2015-04-03  Philippe Normand  <pnormand@igalia.com>
690
691         Unreviewed, GTK build fix.
692
693         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
694         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
695         * UIProcess/gtk/WebContextMenuProxyGtk.h:
696
697 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
698
699         Typo fix.
700
701         * PlatformGTK.cmake:
702
703 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
704
705         URTBF after r182303, stub NativeContextMenuItem implemetations added for EFL and GTK.
706
707         * PlatformEfl.cmake:
708         * PlatformGTK.cmake:
709         * Shared/efl/NativeContextMenuItemEfl.cpp: Added.
710         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
711         * Shared/gtk/NativeContextMenuItemGtk.cpp: Added.
712         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
713
714 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
715
716         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
717         https://bugs.webkit.org/show_bug.cgi?id=143342
718
719         * Platform/mac/LayerHostingContext.h:
720         * Platform/mac/LayerHostingContext.mm:
721         Actually, not available on Mavericks. Fix the build.
722
723 2015-04-02  Brady Eidson  <beidson@apple.com>
724
725         Unreviewed: Re-applied change after rollout.
726
727         Expose the "Share" menu for text selections on platforms where it's available.
728         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
729
730         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
731         * Shared/API/c/WKSharedAPICast.h:
732         (WebKit::toAPI):
733         (WebKit::toImpl):
734
735         * Shared/ContextMenuContextData.cpp:
736         (WebKit::ContextMenuContextData::ContextMenuContextData):
737         (WebKit::ContextMenuContextData::encode):
738         (WebKit::ContextMenuContextData::decode):
739         * Shared/ContextMenuContextData.h:
740         (WebKit::ContextMenuContextData::selectedText):
741
742         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
743         * Shared/NativeContextMenuItem.h:
744         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
745         (WebKit::NativeContextMenuItem::nsMenuItem):
746         * Shared/mac/NativeContextMenuItem.mm:
747         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
748
749         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
750         * Shared/WebContextMenuItem.cpp:
751         (WebKit::WebContextMenuItem::WebContextMenuItem):
752         * Shared/WebContextMenuItem.h:
753         (WebKit::WebContextMenuItem::create):
754         (WebKit::WebContextMenuItem::nativeContextMenuItem):
755
756         * UIProcess/API/APIContextMenuClient.h:
757         (API::ContextMenuClient::getContextMenuFromProposedMenu):
758         (API::ContextMenuClient::showContextMenu):
759
760         * UIProcess/API/C/WKPage.cpp:
761         (WKPageSetPageContextMenuClient):
762
763         * UIProcess/WebContextMenuProxy.h:
764
765         * UIProcess/WebPageProxy.cpp:
766         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
767           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
768           can be attached to them.
769
770         * UIProcess/mac/WebContextMenuProxyMac.h:
771         * UIProcess/mac/WebContextMenuProxyMac.mm:
772         (-[WKMenuTarget forwardContextMenuAction:]):
773         (WebKit::nsMenuItem):
774         (WebKit::nsMenuItemVector):
775         (WebKit::WebContextMenuProxyMac::populate):
776         (WebKit::WebContextMenuProxyMac::showContextMenu):
777
778         * WebKit2.xcodeproj/project.pbxproj:
779
780         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
781         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
782         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
783           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
784
785 2015-04-02  Commit Queue  <commit-queue@webkit.org>
786
787         Unreviewed, rolling out r182293.
788         https://bugs.webkit.org/show_bug.cgi?id=143355
789
790         Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
791
792         Reverted changeset:
793
794         "Expose the "Share" menu for text selections on platforms
795         where it's available."
796         https://bugs.webkit.org/show_bug.cgi?id=143318
797         http://trac.webkit.org/changeset/182293
798
799 2015-04-02  Chris Dumez  <cdumez@apple.com>
800
801         [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key
802         https://bugs.webkit.org/show_bug.cgi?id=143348
803
804         Reviewed by Antti Koivisto.
805
806         Drop HTTP method from NetworkCache::Key as we only cache GET responses
807         for now. Even when we start caching HEAD responses, we likely will not
808         want the method to be part of the key because:
809         - A HEAD response can be used to update the headers of a previously cached response to GET
810         - A cached GET response may be used to satisfy subsequent HEAD requests
811
812         * NetworkProcess/cache/NetworkCache.cpp:
813         (WebKit::NetworkCache::makeCacheKey):
814         * NetworkProcess/cache/NetworkCacheKey.cpp:
815         (WebKit::NetworkCache::Key::Key):
816         (WebKit::NetworkCache::Key::operator=):
817         (WebKit::NetworkCache::Key::computeHash):
818         (WebKit::NetworkCache::Key::operator==):
819         (WebKit::NetworkCache::Key::encode):
820         (WebKit::NetworkCache::Key::decode):
821         * NetworkProcess/cache/NetworkCacheKey.h:
822         (WebKit::NetworkCache::Key::method): Deleted.
823
824 2015-04-02  Jer Noble  <jer.noble@apple.com>
825
826         [Mac][WK2] Fullscreen animation incorrect when initiated on non-primary monitor
827         https://bugs.webkit.org/show_bug.cgi?id=143237
828
829         Reviewed by Brent Fulgham.
830
831         The animation calculations have an implicit assumptions of a screen whose origin is 0,0. Account
832         for the screen origin by passing the window's screen's frame into the zoomAnimation() and maskAnimation()
833         methods.
834
835         * UIProcess/mac/WKFullScreenWindowController.mm:
836         (-[WKFullScreenWindowController initWithWindow:webView:]):
837         (zoomAnimation):
838         (maskAnimation):
839         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
840         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
841
842 2015-04-02  Brady Eidson  <beidson@apple.com>
843
844         Expose the "Share" menu for text selections on platforms where it's available.
845         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
846
847         Reviewed by Sam Weinig.
848
849         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
850         * Shared/API/c/WKSharedAPICast.h:
851         (WebKit::toAPI):
852         (WebKit::toImpl):
853
854         * Shared/ContextMenuContextData.cpp:
855         (WebKit::ContextMenuContextData::ContextMenuContextData):
856         (WebKit::ContextMenuContextData::encode):
857         (WebKit::ContextMenuContextData::decode):
858         * Shared/ContextMenuContextData.h:
859         (WebKit::ContextMenuContextData::selectedText):
860
861         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
862         * Shared/NativeContextMenuItem.h:
863         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
864         (WebKit::NativeContextMenuItem::nsMenuItem):
865         * Shared/mac/NativeContextMenuItem.mm:
866         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
867
868         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
869         * Shared/WebContextMenuItem.cpp:
870         (WebKit::WebContextMenuItem::WebContextMenuItem):
871         * Shared/WebContextMenuItem.h:
872         (WebKit::WebContextMenuItem::create):
873         (WebKit::WebContextMenuItem::nativeContextMenuItem):
874
875         * UIProcess/API/APIContextMenuClient.h:
876         (API::ContextMenuClient::getContextMenuFromProposedMenu):
877         (API::ContextMenuClient::showContextMenu):
878
879         * UIProcess/API/C/WKPage.cpp:
880         (WKPageSetPageContextMenuClient):
881
882         * UIProcess/WebContextMenuProxy.h:
883
884         * UIProcess/WebPageProxy.cpp:
885         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
886           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
887           can be attached to them.
888
889         * UIProcess/mac/WebContextMenuProxyMac.h:
890         * UIProcess/mac/WebContextMenuProxyMac.mm:
891         (-[WKMenuTarget forwardContextMenuAction:]):
892         (WebKit::nsMenuItem):
893         (WebKit::nsMenuItemVector):
894         (WebKit::WebContextMenuProxyMac::populate):
895         (WebKit::WebContextMenuProxyMac::showContextMenu):
896
897         * WebKit2.xcodeproj/project.pbxproj:
898
899         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
900         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
901         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
902           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
903
904 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
905
906         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
907         https://bugs.webkit.org/show_bug.cgi?id=143342
908
909         Reviewed by Myles C. Maxfield.
910
911         * Platform/mac/LayerHostingContext.h:
912         * Platform/mac/LayerHostingContext.mm:
913         (WebKit::LayerHostingContext::setFencePort):
914         There's nothing iOS specific about this.
915
916 2015-04-02  Oliver Hunt  <oliver@apple.com>
917
918         Ensure that we always set network ATS context in the network process
919         https://bugs.webkit.org/show_bug.cgi?id=143343
920
921         Reviewed by Dan Bernstein.
922
923         If a custom cache location or size we were early returning before setting
924         the CFNetwork ATS context. This is clearly an error.
925
926         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
927         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
928
929 2015-04-02  Alexey Proskuryakov  <ap@apple.com>
930
931         Make checkURLReceivedFromWebProcess not rely on details of platform URL implementation.
932         https://bugs.webkit.org/show_bug.cgi?id=143222
933         rdar://problem/19978997
934
935         Reviewed by Sam Weinig.
936
937         * UIProcess/WebProcessProxy.cpp:
938         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
939
940 2015-04-02  Yusuke Suzuki  <utatane.tea@gmail.com>
941
942         Clean up EnumerationMode to easily extend
943         https://bugs.webkit.org/show_bug.cgi?id=143276
944
945         Reviewed by Geoffrey Garen.
946
947         Use default EnumerationMode().
948
949         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
950         (WebKit::NPJSObject::enumerate):
951
952 2015-04-02  Chris Dumez  <cdumez@apple.com>
953
954         [WK2][iOS] Update the WebContent process' sandbox profile for AWD
955         https://bugs.webkit.org/show_bug.cgi?id=143340
956         <rdar://problem/20375170>
957
958         Reviewed by Alexey Proskuryakov.
959
960         Update the WebContent process' sandbox profile for AWD.
961
962         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
963
964 2015-04-01  Antti Koivisto  <antti@apple.com>
965
966         Use std::chrono types to represent time in response and cache classes
967         https://bugs.webkit.org/show_bug.cgi?id=143316
968
969         Reviewed by Andreas Kling.
970
971         * NetworkProcess/NetworkResourceLoader.cpp:
972         (WebKit::NetworkResourceLoader::didFinishLoading):
973         * NetworkProcess/cache/NetworkCache.cpp:
974         (WebKit::NetworkCache::responseHasExpired):
975         (WebKit::NetworkCache::responseNeedsRevalidation):
976         (WebKit::NetworkCache::makeStoreDecision):
977         (WebKit::NetworkCache::Cache::store):
978         * NetworkProcess/cache/NetworkCacheEntry.cpp:
979         (WebKit::NetworkCache::Entry::Entry):
980         (WebKit::NetworkCache::Entry::asJSON):
981         * NetworkProcess/cache/NetworkCacheEntry.h:
982         (WebKit::NetworkCache::Entry::timeStamp):
983         * NetworkProcess/cache/NetworkCacheStorage.cpp:
984         (WebKit::NetworkCache::decodeRecordMetaData):
985         (WebKit::NetworkCache::decodeRecord):
986
987             Sanity check the timestamp on decode.
988
989         (WebKit::NetworkCache::encodeRecordMetaData):
990         (WebKit::NetworkCache::encodeRecordHeader):
991         (WebKit::NetworkCache::Storage::traverse):
992         * NetworkProcess/cache/NetworkCacheStorage.h:
993         * WebProcess/Plugins/PluginView.cpp:
994         (WebKit::lastModifiedDateMS):
995         (WebKit::PluginView::Stream::didReceiveResponse):
996         (WebKit::PluginView::manualLoadDidReceiveResponse):
997         (WebKit::lastModifiedDate): Deleted.
998
999 2015-04-01  Chris Dumez  <cdumez@apple.com>
1000
1001         [WK2][Cocoa] Add didFailProvisionalLoadWithErrorForFrame callback to WKWebProcessPlugInLoadDelegate
1002         https://bugs.webkit.org/show_bug.cgi?id=143319
1003         <rdar://problem/19463834>
1004
1005         Reviewed by Dan Bernstein.
1006
1007         Add didFailProvisionalLoadWithErrorForFrame callback to
1008         WKWebProcessPlugInLoadDelegate so that the client side can track all
1009         types page load completions:
1010         - didFailProvisionalLoadWithErrorForFrame
1011         - didFailLoadWithErrorForFrame
1012         - didFinishLoadForFrame
1013
1014         Note that this event is already exposed on UIProcess side via the
1015         WKPageLoaderClient.didFailLoadWithErrorForFrame callback.
1016
1017         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
1018         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1019         (didFailProvisionalLoadWithErrorForFrame):
1020         (setUpPageLoaderClient):
1021
1022 2015-04-01  Enrica Casucci  <enrica@apple.com>
1023
1024         Injected bundle messages should be at the page level.
1025         https://bugs.webkit.org/show_bug.cgi?id=143283
1026
1027         Reviewed by Alexey Proskuryakov.
1028
1029         All the messages between the injected bundle and the UI
1030         process should be page level messages instead of context.
1031         The author of this patch is Tim Horton, I just finished it.
1032
1033         * UIProcess/API/C/WKPage.cpp:
1034         (WKPageSetPageInjectedBundleClient):
1035         * UIProcess/API/C/WKPage.h:
1036         * UIProcess/API/C/WKPageInjectedBundleClient.h: Added.
1037         * UIProcess/API/Cocoa/WKWebView.mm:
1038         (-[WKWebView _pageForTesting]):
1039         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1040         * UIProcess/WebPageInjectedBundleClient.cpp: Added.
1041         (WebKit::WebPageInjectedBundleClient::didReceiveMessageFromInjectedBundle):
1042         (WebKit::WebPageInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
1043         * UIProcess/WebPageInjectedBundleClient.h: Added.
1044         * UIProcess/WebPageProxy.cpp:
1045         (WebKit::WebPageProxy::setInjectedBundleClient):
1046         (WebKit::WebPageProxy::handleMessage):
1047         (WebKit::WebPageProxy::handleSynchronousMessage):
1048         * UIProcess/WebPageProxy.h:
1049         (WebKit::WebPageProxy::injectedBundleClient):
1050         * UIProcess/WebPageProxy.messages.in:
1051         * UIProcess/WebProcessPool.cpp:
1052         (WebKit::WebProcessPool::handleMessage):
1053         * WebKit2.xcodeproj/project.pbxproj:
1054         * CMakeLists.txt:
1055         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1056         (WKBundlePagePostMessage):
1057         (WKBundlePagePostSynchronousMessage):
1058         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1059         * WebProcess/WebPage/WebPage.cpp:
1060         (WebKit::WebPage::postMessage):
1061         (WebKit::WebPage::postSynchronousMessage):
1062         * WebProcess/WebPage/WebPage.h:
1063
1064 2015-04-01  Alexey Proskuryakov  <ap@apple.com>
1065
1066         [iOS] WebContent should have access to the entirety of its caches directory
1067         https://bugs.webkit.org/show_bug.cgi?id=143312
1068         rdar://problem/20314916
1069
1070         Reviewed by Oliver Hunt.
1071
1072         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1073         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1074         * Shared/Network/NetworkProcessCreationParameters.cpp:
1075         (WebKit::NetworkProcessCreationParameters::encode):
1076         (WebKit::NetworkProcessCreationParameters::decode):
1077         * Shared/Network/NetworkProcessCreationParameters.h:
1078         * Shared/WebProcessCreationParameters.cpp:
1079         (WebKit::WebProcessCreationParameters::encode):
1080         (WebKit::WebProcessCreationParameters::decode):
1081         * Shared/WebProcessCreationParameters.h:
1082         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1083         (WebKit::WebProcessPool::networkingCachesDirectory):
1084         (WebKit::WebProcessPool::webContentCachesDirectory):
1085         (WebKit::WebProcessPool::openGLCacheDirectory): Deleted.
1086         (WebKit::WebProcessPool::networkingHSTSDatabasePath): Deleted.
1087         (WebKit::WebProcessPool::webContentHSTSDatabasePath): Deleted.
1088         * UIProcess/WebProcessPool.cpp:
1089         (WebKit::WebProcessPool::ensureNetworkProcess):
1090         (WebKit::WebProcessPool::createNewWebProcess):
1091         * UIProcess/WebProcessPool.h:
1092         * WebProcess/cocoa/WebProcessCocoa.mm:
1093         (WebKit::WebProcess::platformInitializeWebProcess):
1094
1095 2015-04-01  Timothy Horton  <timothy_horton@apple.com>
1096
1097         Smart magnification gesture sometimes shoots to the middle of the page
1098         https://bugs.webkit.org/show_bug.cgi?id=143296
1099         <rdar://problem/18209280>
1100
1101         Reviewed by Dean Jackson.
1102
1103         * UIProcess/mac/ViewGestureControllerMac.mm:
1104         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
1105         Constrain the target rect to the viewport, and if it had overflowed the viewport,
1106         scroll halfway towards the gesture origin.
1107
1108 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
1109
1110         Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
1111         https://bugs.webkit.org/show_bug.cgi?id=143288
1112         rdar://problem/16049624
1113
1114         Reviewed by Beth Dakin.
1115
1116         Remove the wheel event counting that Document does, and passes into the scrolling tree.
1117         The ScrollingTree now just uses the non-fast scrollable region to determine when to
1118         fast scroll on pages with wheel event handlers.
1119         
1120         If a handler includes position:fixed renderers, we just cover the whole document
1121         with the slow-scrolling region currently. This could be improved.
1122
1123         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1124         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1125         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1126         (WebKit::RemoteScrollingTreeTextStream::dump):
1127         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1128         (WebKit::WebChromeClient::wheelEventHandlersChanged):
1129         (WebKit::WebChromeClient::numWheelEventHandlersChanged): Deleted.
1130         * WebProcess/WebCoreSupport/WebChromeClient.h:
1131         * WebProcess/WebPage/WebPage.cpp:
1132         (WebKit::WebPage::WebPage):
1133         (WebKit::WebPage::wheelEventHandlersChanged):
1134         (WebKit::WebPage::recomputeShortCircuitHorizontalWheelEventsState):
1135         (WebKit::WebPage::numWheelEventHandlersChanged): Deleted.
1136         * WebProcess/WebPage/WebPage.h:
1137
1138 2015-03-31  Dan Bernstein  <mitz@apple.com>
1139
1140         <rdar://problem/20365675> [iOS] Include Add to Reading List link action only where supported
1141         https://bugs.webkit.org/show_bug.cgi?id=143289
1142
1143         Reviewed by Tim Horton.
1144
1145         * UIProcess/API/Cocoa/_WKElementAction.h: Excluded _WKElementActionTypeAddToReadingList from
1146         the _WKElementActionType enum when Reading List is not supported.
1147
1148         * UIProcess/API/Cocoa/_WKElementAction.mm:
1149         (+[_WKElementAction elementActionWithType:customTitle:]): Made Add to Reading List code
1150         conditional on HAVE(SAFARI_SERVICES_FRAMEWORK).
1151
1152         * UIProcess/ios/WKActionSheetAssistant.mm:
1153         (-[WKActionSheetAssistant showImageSheet]): Ditto.
1154         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
1155
1156         * config.h: Defined HAVE_SAFARI_SERVICES_FRAMEWORK.
1157
1158 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1159
1160         TextIndicator for <span> inside an <a> only highlights the <span>, should highlight the whole <a>
1161         https://bugs.webkit.org/show_bug.cgi?id=143287
1162         <rdar://problem/20318342>
1163
1164         Reviewed by Beth Dakin.
1165
1166         * WebProcess/WebPage/mac/WebPageMac.mm:
1167         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1168         Instead of just highlighting the hit element, highlight the whole
1169         element that the link URL comes from.
1170
1171 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1172
1173         WKView should stop using endGestureWithEvent
1174         https://bugs.webkit.org/show_bug.cgi?id=143285
1175         <rdar://problem/20357007>
1176
1177         Reviewed by Simon Fraser.
1178
1179         * UIProcess/API/mac/WKView.mm:
1180         (-[WKView magnifyWithEvent:]):
1181         (-[WKView endGestureWithEvent:]): Deleted.
1182         * UIProcess/mac/ViewGestureController.h:
1183         * UIProcess/mac/ViewGestureControllerMac.mm:
1184         (WebKit::ViewGestureController::endMagnificationGesture):
1185         (WebKit::ViewGestureController::endActiveGesture): Deleted.
1186         While there is no visible symptom, it is recommended that we check
1187         the phase of normal magnification events instead of using the
1188         special gesture end events.
1189
1190 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1191
1192         Swipes occur in the wrong direction in RTL
1193         https://bugs.webkit.org/show_bug.cgi?id=143257
1194         <rdar://problem/20300862>
1195
1196         Reviewed by Simon Fraser.
1197
1198         * UIProcess/ios/ViewGestureControllerIOS.mm:
1199         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
1200         When choosing which edge to attach our gesture recognizers to,
1201         flip them in RTL.
1202
1203         (-[WKSwipeTransitionController directionForTransition:]):
1204         (WebKit::ViewGestureController::beginSwipeGesture):
1205         (WebKit::ViewGestureController::canSwipeInDirection):
1206         * UIProcess/mac/ViewGestureController.h:
1207         * UIProcess/mac/ViewGestureControllerMac.mm:
1208         (WebKit::ViewGestureController::scrollEventCanBecomeSwipe):
1209         (WebKit::ViewGestureController::trackSwipeGesture):
1210         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
1211         (WebKit::ViewGestureController::beginSwipeGesture):
1212         (WebKit::ViewGestureController::handleSwipeGesture):
1213         Adjust SwipeDirection to be in logical back-forward list direction
1214         instead of physical edge direction.
1215
1216 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
1217
1218         Move ExpansionBehaviorFlags and TextDirection to their own file
1219         https://bugs.webkit.org/show_bug.cgi?id=143273
1220
1221         Reviewed by Simon Fraser.
1222
1223         This is a mechanical change. It just moves code around.
1224
1225         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
1226
1227         * Shared/WebPopupItem.h:
1228         * UIProcess/API/C/efl/WKAPICastEfl.h:
1229         * UIProcess/API/efl/EwkView.h:
1230         * UIProcess/WebPopupMenuProxy.h:
1231         * UIProcess/efl/WebUIPopupMenuClient.h:
1232
1233 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1234
1235         Clean up Identifier factories to clarify the meaning of StringImpl*
1236         https://bugs.webkit.org/show_bug.cgi?id=143146
1237
1238         Reviewed by Filip Pizlo.
1239
1240         Just change to Identifier::fromString.
1241
1242         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1243         (WebKit::JSNPObject::getOwnPropertyNames):
1244         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1245         (WebKit::identifierFromIdentifierRep):
1246
1247 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1248
1249         WebKit briefly shows wrong webpage after swiping back (gigaom.com, or any site on a slow network)
1250         https://bugs.webkit.org/show_bug.cgi?id=143256
1251         <rdar://problem/19458648>
1252
1253         Reviewed by Dan Bernstein.
1254
1255         Instead of allowing a flash of the previous page when the swipe snapshot
1256         timeouts fire (removing the snapshot before the new page is loaded), show
1257         the snapshotted background color.
1258
1259         This fixes the problem on iOS, where UI-side compositing makes it easy to fix,
1260         but not yet on OS X.
1261
1262         * UIProcess/API/Cocoa/WKWebView.mm:
1263         (baseScrollViewBackgroundColor):
1264         (scrollViewBackgroundColor):
1265         If the ViewGestureController returns a valid background color, use that
1266         instead of the page's background color.
1267
1268         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1269         Expose _updateScrollViewBackground.
1270
1271         * UIProcess/PageClient.h:
1272         * UIProcess/ios/PageClientImplIOS.h:
1273         * UIProcess/ios/PageClientImplIOS.mm:
1274         (WebKit::PageClientImpl::didChangeBackgroundColor):
1275         * UIProcess/mac/PageClientImpl.h:
1276         * UIProcess/mac/PageClientImpl.mm:
1277         (WebKit::PageClientImpl::didChangeBackgroundColor):
1278         * UIProcess/WebPageProxy.cpp:
1279         (WebKit::WebPageProxy::didChangeBackgroundColor):
1280         * UIProcess/WebPageProxy.h:
1281         Add and plumb didChangeBackgroundColor, which calls
1282         _updateScrollViewBackground on iOS.
1283         
1284         * UIProcess/ios/ViewGestureControllerIOS.mm:
1285         (WebKit::ViewGestureController::endSwipeGesture):
1286         Hide the content of the drawing area until the next commit. This way,
1287         even if the snapshot is removed (say, because a timeout fired), we won't
1288         ever show the old page content (but we will show background color).
1289
1290         Store the background color associated with the current snapshot.
1291
1292         Let WKWebView know that it needs to recompute the background color.
1293
1294         (WebKit::ViewGestureController::removeSwipeSnapshot):
1295         Clear the background color so that the next time we commit, WKWebView
1296         will get an invalid color from ViewGestureController and fall back
1297         to the page's extended background color instead.
1298
1299         * UIProcess/mac/ViewGestureController.h:
1300         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot):
1301         * UIProcess/mac/ViewGestureControllerMac.mm:
1302         (WebKit::ViewGestureController::beginSwipeGesture):
1303         (WebKit::ViewGestureController::removeSwipeSnapshot):
1304         Keep backgroundColorForCurrentSnapshot up to date on Mac too, even
1305         though we don't use it yet.
1306
1307 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1308
1309         [iOS] Rotating PDF in Safari scrolls to the wrong position
1310         https://bugs.webkit.org/show_bug.cgi?id=143259
1311         <rdar://problem/19872693>
1312
1313         Reviewed by Dan Bernstein.
1314
1315         * UIProcess/ios/WKPDFView.mm:
1316         (-[WKPDFView web_setMinimumSize:]):
1317         Maintan the relative top/left within the rescaled document.
1318
1319 2015-03-31  Chris Dumez  <cdumez@apple.com>
1320
1321         [WK2][iOS] Extend ProcessThrottler use to the NetworkProcess
1322         https://bugs.webkit.org/show_bug.cgi?id=143249
1323         <rdar://problem/20231539>
1324
1325         Reviewed by Gavin Barraclough.
1326
1327         Extend ProcessThrottler use to the NetworkProcess instead of only the
1328         WebProcesses. This is needed so that the NetworkProcess gets notified
1329         before suspension. We now use this notification to free-up memory
1330         before suspending by calling the critical memory pressure handler, as
1331         we already do for WebProcesses (rdar://problem/20231539). In the
1332         future, this infrastructure will be used to delay suspension until the
1333         pending SQL transactions are done as well (rdar://problem/20180799).
1334
1335         Previously, the NetworkProcessProxy would hold a foreground assertion
1336         on behalf of the NetworkProcess but would never release that assertion.
1337         In this patch, we change this so that WebProcessProxies hold assertions
1338         on behalf of the NetworkProcess, and release those assertions before
1339         suspending. As a result, the NetworkProcess gets suspended when all
1340         WebProcesses are suspended.
1341
1342         * NetworkProcess/NetworkProcess.cpp:
1343         (WebKit::NetworkProcess::processWillSuspend):
1344         (WebKit::NetworkProcess::cancelProcessWillSuspend):
1345         (WebKit::NetworkProcess::processDidResume):
1346         * NetworkProcess/NetworkProcess.h:
1347         * NetworkProcess/NetworkProcess.messages.in:
1348         * UIProcess/Network/NetworkProcessProxy.cpp:
1349         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
1350         (WebKit::NetworkProcessProxy::didFinishLaunching):
1351         (WebKit::NetworkProcessProxy::sendProcessWillSuspend):
1352         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend):
1353         (WebKit::NetworkProcessProxy::didCancelProcessSuspension):
1354         (WebKit::NetworkProcessProxy::sendProcessDidResume):
1355         (WebKit::NetworkProcessProxy::processReadyToSuspend):
1356         * UIProcess/Network/NetworkProcessProxy.h:
1357         (WebKit::NetworkProcessProxy::throttler):
1358         * UIProcess/Network/NetworkProcessProxy.messages.in:
1359         * UIProcess/ProcessThrottler.cpp:
1360         (WebKit::ProcessThrottler::ProcessThrottler):
1361         (WebKit::ProcessThrottler::didConnectToProcess):
1362         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
1363         * UIProcess/ProcessThrottler.h:
1364         * UIProcess/ProcessThrottlerClient.h: Added.
1365         (WebKit::ProcessThrottlerClient::~ProcessThrottlerClient):
1366         * UIProcess/WebProcessPool.cpp:
1367         (WebKit::WebProcessPool::ensureNetworkProcess):
1368         * UIProcess/WebProcessPool.h:
1369         * UIProcess/WebProcessProxy.cpp:
1370         (WebKit::WebProcessProxy::didFinishLaunching):
1371         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken):
1372         (WebKit::WebProcessProxy::sendProcessDidResume):
1373         (WebKit::WebProcessProxy::processReadyToSuspend):
1374         * UIProcess/WebProcessProxy.h:
1375         * WebKit2.xcodeproj/project.pbxproj:
1376
1377 2015-03-31  Csaba Osztrogonác  <ossy@webkit.org>
1378
1379         Unreviewed, revert accidental change by r182138.
1380
1381         * Scripts/generate-forwarding-headers.pl:
1382         (createForwardingHeadersForFramework):
1383
1384 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1385
1386         Unreviewed. Fix GTK+ build with REDIRECTED_XCOMPOSITE_WINDOW disabled in X11 platform.
1387
1388         Also fix some unused parameter warnings when
1389         REDIRECTED_XCOMPOSITE_WINDOW is disabled.
1390
1391         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1392         (webkitWebViewRenderAcceleratedCompositingResults):
1393         (resizeWebKitWebViewBaseFromAllocation):
1394
1395 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1396
1397         [GTK] DnD icon/widget has odd background
1398         https://bugs.webkit.org/show_bug.cgi?id=143217
1399
1400         Reviewed by Martin Robinson.
1401
1402         Use gtk_drag_set_icon_surface() to set the drag icon image,
1403         instead of DragIcon class.
1404
1405         * UIProcess/API/gtk/WebKitWebView.cpp:
1406         * UIProcess/gtk/DragAndDropHandler.cpp:
1407         (WebKit::DragAndDropHandler::startDrag):
1408         * UIProcess/gtk/DragAndDropHandler.h:
1409
1410 2015-03-30  Commit Queue  <commit-queue@webkit.org>
1411
1412         Unreviewed, rolling out r182172.
1413         https://bugs.webkit.org/show_bug.cgi?id=143250
1414
1415         Since this class is an API object, we don't know for sure when
1416         it will be destroyed. (Requested by kling on #webkit).
1417
1418         Reverted changeset:
1419
1420         "WebBackForwardList doesn't need to manually clear the
1421         snapshot of an entry when removing it."
1422         https://bugs.webkit.org/show_bug.cgi?id=143231
1423         http://trac.webkit.org/changeset/182172
1424
1425 2015-03-30  Andreas Kling  <akling@apple.com>
1426
1427         WebBackForwardList doesn't need to manually clear the snapshot of an entry when removing it.
1428         <https://webkit.org/b/143231>
1429
1430         Reviewed by Tim Horton.
1431
1432         Now that we don't keep WebBackForwardListItem objects alive forever, it's not necessary
1433         to clear the snapshot when removing them from the WebBackForwardList, since the entire
1434         object will be deleted shortly after that anyway.
1435
1436         * UIProcess/WebBackForwardList.cpp:
1437         (WebKit::WebBackForwardList::didRemoveItem):
1438
1439 2015-03-30  Enrica Casucci  <enrica@apple.com>
1440
1441         [iOS] WebContent crashing at WebCore: WebCore::Range::collectSelectionRects.
1442         https://bugs.webkit.org/show_bug.cgi?id=143234
1443         <rdar://problem/18571345>
1444
1445         Reviewed by Tim Horton.
1446
1447         This is a speculative fix that adds a null check before referencing the range.
1448         In both places where the check has been added the range returned by the call
1449         that should create it could be null.
1450
1451         * WebProcess/WebPage/ios/WebPageIOS.mm:
1452         (WebKit::WebPage::platformEditorState):
1453
1454 2015-03-30  Sam Weinig  <sam@webkit.org>
1455
1456         [Content Extensions] Flesh out the UserContentExtensionStore
1457         https://bugs.webkit.org/show_bug.cgi?id=143123
1458
1459         Reviewed by Benjamin Poulain.
1460
1461         * Shared/WebCompiledContentExtension.cpp:
1462         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
1463         * Shared/WebCompiledContentExtensionData.cpp:
1464         (WebKit::WebCompiledContentExtensionData::encode):
1465         (WebKit::WebCompiledContentExtensionData::decode):
1466         * Shared/WebCompiledContentExtensionData.h:
1467         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
1468         Switch the order in memory of actions and bytecode (and switch the order of the
1469         variables as well, to keep it clear). This will become necessary when streaming
1470         the data to disk, as actions are created before the bytecode and we would have to keep them
1471         in memory until the bytecode was finished compiling if they didn't come before in the file.
1472
1473         * UIProcess/API/APIUserContentExtensionStore.h:
1474         * UIProcess/API/APIUserContentExtensionStore.cpp:
1475         (API::UserContentExtensionStore::defaultStore):
1476         Add accessor for the processes default shared store.
1477
1478         (API::constructedPath):
1479         Helper for constructing the path to a file in the store based on identifier.
1480
1481         (API::encodeContentExtensionMetaData):
1482         (API::decodeContentExtensionMetaData):
1483         Helpers for encoding/decoding the file metadata (version, bytecode size, actions size).
1484
1485         (API::openAndMapContentExtension):
1486         Helper to open and map a filed back content extension.
1487
1488         (API::writeDataToFile):
1489         Helper to write a Data object to a file.
1490
1491         (API::compiledToFile):
1492         Helper to run the content extension compiler and write it to disk. It first
1493         writes it to a temporary file and then does an atomic rename operation to put
1494         the file in the final location. Doing this means that if the process crashes while
1495         the compile is taking place, the partially written file won't end up in the cache, 
1496         but rather, will be cleaned up by the OS.
1497  
1498         (API::UserContentExtensionStore::lookupContentExtension):
1499         API entry point to lookup an extension that has been compiled to disk. On a background queue,
1500         it attempts to open and map the extension (based on the identifier passed in) and return it
1501         to the caller via the callback function passed in.
1502         
1503         (API::UserContentExtensionStore::compileContentExtension):
1504         API entry point to compile an extension and write it to store. On a background queue, it 
1505         compiles the file to disk and if successful, returns the memory mapped data via the callback
1506         function passed in.
1507
1508         (API::UserContentExtensionStore::removeContentExtension):
1509         API entry point to remove an extension from the store. On a background queue, it 
1510         unlinks the extension (based on the identifier passed in) and tells the caller it completed
1511         the action vial the callback function passed in.
1512
1513         (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
1514         Helper for testing which synchronously unlinks all the files in the store.
1515
1516         (API::userContentExtensionStoreErrorCategory):
1517         std::error_code adaptor for some generic errors that can happen in the store. We will want
1518         to flesh these out further.
1519
1520         * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: Added.
1521         (API::UserContentExtensionStore::defaultStorePath):
1522         Helper to get the platform specific path for the store.
1523
1524         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
1525         (WKUserContentExtensionStoreGetTypeID):
1526         Add ENABLE(CONTENT_EXTENSIONS) guards.
1527
1528         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
1529         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
1530         (-[_WKUserContentExtensionStore dealloc]):
1531         (+[_WKUserContentExtensionStore defaultStore]):
1532         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
1533         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
1534         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
1535         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
1536         (-[_WKUserContentExtensionStore init]): Deleted.
1537         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
1538         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: Added.
1539         SPI wrappers for the store.
1540
1541         * WebKit2.xcodeproj/project.pbxproj:
1542         Add new files.
1543
1544 2015-03-30  Antti Koivisto  <antti@apple.com>
1545
1546         Don't cache resources that are very unlikely to be reused
1547         https://bugs.webkit.org/show_bug.cgi?id=143226
1548
1549         Reviewed by Chris Dumez.
1550
1551         Follow-up to cover Cache-control: no-cache case which also has zero cache lifetime.
1552
1553         * NetworkProcess/cache/NetworkCache.cpp:
1554         (WebKit::NetworkCache::makeStoreDecision):
1555
1556 2015-03-30  Antti Koivisto  <antti@apple.com>
1557
1558         Include cache entry worth to json dump
1559         https://bugs.webkit.org/show_bug.cgi?id=143202
1560
1561         Follow-up fix.
1562
1563         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1564         (WebKit::NetworkCache::computeRecordWorth):
1565
1566             This accidentally gave the error case worth 1 rather than 0 as it should be.
1567
1568 2015-03-30  Antti Koivisto  <antti@apple.com>
1569
1570         Don't cache resources that are very unlikely to be reused
1571         https://bugs.webkit.org/show_bug.cgi?id=143226
1572         <rdar://problem/20347160>
1573
1574         Reviewed by Geoff Garen.
1575
1576         We are writing lots of resources to the cache that are never used again.
1577
1578         In browse-around-randomly test this reduced number of cache entries created by ~20% and bytes written by ~5%.
1579
1580         * NetworkProcess/cache/NetworkCache.cpp:
1581         (WebKit::NetworkCache::makeUseDecision):
1582         (WebKit::NetworkCache::makeRetrieveDecision):
1583
1584             Rename for clarity.
1585
1586         (WebKit::NetworkCache::makeStoreDecision):
1587
1588             Store only if the resource has non-zero expiration or has validation headers.
1589
1590             Very High priority resources (main resources) keep the existing policy to minimize impact
1591             on back navigation and tab restore.
1592
1593         (WebKit::NetworkCache::Cache::retrieve):
1594         (WebKit::NetworkCache::Cache::store):
1595         (WebKit::NetworkCache::canUse): Deleted.
1596         (WebKit::NetworkCache::canRetrieve): Deleted.
1597         (WebKit::NetworkCache::canStore): Deleted.
1598         * NetworkProcess/cache/NetworkCache.h:
1599         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1600         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
1601
1602 2015-03-30  Tim Horton  <timothy_horton@apple.com>
1603
1604         Swipe snapshot removed too early (jumps around) on arstechnica and NYT
1605         https://bugs.webkit.org/show_bug.cgi?id=143199
1606         <rdar://problem/18420467>
1607
1608         Reviewed by Dan Bernstein.
1609
1610         Make ViewGestureControllerIOS's snapshot removal timing behave more like the Mac version.
1611
1612         * UIProcess/API/Cocoa/WKWebView.mm:
1613         (-[WKWebView _didCommitLayerTree:]):
1614         Let ViewGestureController know when the page has finished state restoration.
1615
1616         (-[WKWebView _didFinishLoadForMainFrame]):
1617         (-[WKWebView _didSameDocumentNavigationForMainFrame:]):
1618         Forward these to ViewGestureController.
1619
1620         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1621         * UIProcess/ios/PageClientImplIOS.mm:
1622         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
1623         Forward didFinishLoadForMainFrame to WKWebView.
1624
1625         * UIProcess/ios/ViewGestureControllerIOS.mm:
1626         (WebKit::ViewGestureController::ViewGestureController):
1627         (WebKit::ViewGestureController::endSwipeGesture):
1628         Split the swipe snapshot removal state into a bunch of bools.
1629
1630         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
1631         (WebKit::ViewGestureController::setRenderTreeSize):
1632         (WebKit::ViewGestureController::removeSwipeSnapshotIfReady):
1633         (WebKit::ViewGestureController::removeSwipeSnapshot):
1634         Unify the snapshot removal logic into one function; removeSwipeSnapshotIfReady
1635         completely owns the decision. For now, we're waiting for everything, but
1636         we can do better in the future (using firstVisuallyNonEmptyLayout like Mac used to).
1637
1638         (WebKit::ViewGestureController::didRestoreScrollPosition):
1639         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
1640         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
1641         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
1642         Add more conditions for swipe snapshot removal. We'll now wait for
1643         didFinishLoadForMainFrame (or didSameDocumentNavigationForMainFrame),
1644         for active loads to finish, and for the scroll position to be restored.
1645         This brings the iOS implementation in line with the slightly better Mac
1646         implementation, and also sets the stage for deduplication of all of this code.
1647         
1648         * UIProcess/mac/ViewGestureController.h:
1649         * UIProcess/mac/ViewGestureControllerMac.mm:
1650         (WebKit::ViewGestureController::ViewGestureController):
1651
1652 2015-03-30  Chris Dumez  <cdumez@apple.com>
1653
1654         [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
1655         https://bugs.webkit.org/show_bug.cgi?id=143159
1656         <rdar://problem/20333296>
1657
1658         Reviewed by Antti Koivisto.
1659
1660         Add support for "Cache-Control: max-stale" request header:
1661         https://tools.ietf.org/html/rfc7234#section-5.2.1.2
1662
1663         * NetworkProcess/cache/NetworkCache.cpp:
1664         (WebKit::NetworkCache::responseHasExpired):
1665         (WebKit::NetworkCache::requestRequiresRevalidation):
1666         (WebKit::NetworkCache::canUse):
1667
1668 2015-03-30  Csaba Osztrogonác  <ossy@webkit.org>
1669
1670         [EFL][GTK] WebKit2's generate-forwarding-headers.pl should fail if clashing headers found
1671         https://bugs.webkit.org/show_bug.cgi?id=142909
1672
1673         Reviewed by Philippe Normand.
1674
1675         * Scripts/generate-forwarding-headers.pl:
1676         (createForwardingHeadersForFramework):
1677
1678 2015-03-29  Antti Koivisto  <antti@apple.com>
1679
1680         Include cache entry worth to json dump
1681         https://bugs.webkit.org/show_bug.cgi?id=143202
1682
1683         Reviewed by Darin Adler.
1684
1685         This is useful for analyzing cache performance.
1686         Also include the body size, total item count and average worth.
1687
1688         * NetworkProcess/cache/NetworkCache.cpp:
1689         (WebKit::NetworkCache::Cache::traverse):
1690         (WebKit::NetworkCache::Cache::dumpContentsToFile):
1691         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1692         (WebKit::NetworkCache::Entry::asJSON):
1693         * NetworkProcess/cache/NetworkCacheEntry.h:
1694         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1695         (WebKit::NetworkCache::Storage::traverse):
1696
1697             Add flags for specificying what sort of information is needed.
1698
1699         (WebKit::NetworkCache::computeRecordWorth):
1700
1701             Factor to a function.
1702
1703         (WebKit::NetworkCache::deletionProbability):
1704         * NetworkProcess/cache/NetworkCacheStorage.h:
1705
1706 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
1707
1708         Fix iOS scrollperf crash after a web process crash
1709         https://bugs.webkit.org/show_bug.cgi?id=143110
1710
1711         Reviewed by Dean Jackson.
1712         
1713         When we destroy the drawing area after a web process crash, we also need to destroy
1714         the scrollingPerformanceData which has a reference to the drawing area.
1715
1716         * UIProcess/WebPageProxy.cpp:
1717         (WebKit::WebPageProxy::resetState):
1718
1719 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
1720
1721         Convert arguments to ScrollingCoordinator functions to references
1722         https://bugs.webkit.org/show_bug.cgi?id=143198
1723
1724         Reviewed by Darin Adler.
1725
1726         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
1727         references, and use references in a few other places.
1728
1729         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
1730         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
1731         (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):
1732
1733 2015-03-29  Enrica Casucci  <enrica@apple.com>
1734
1735         [iOS WK2] WKContentView should implement _selectionClipRect
1736         https://bugs.webkit.org/show_bug.cgi?id=143143
1737         rdar://problem/20330075
1738
1739         Reviewed by Benjamin Poulain.
1740
1741         UIKit checks if the text delegate responds to this selector
1742         to retrieve the clipping rectangle for the editable element
1743         where the selection is being create.
1744
1745         * UIProcess/ios/WKContentViewInteraction.mm:
1746         (-[WKContentView _selectionClipRect]):
1747
1748 2015-03-29  Antti Koivisto  <antti@apple.com>
1749
1750         Use st_mtime instead of st_atime to track file access time
1751         https://bugs.webkit.org/show_bug.cgi?id=143200
1752
1753         Reviewed by Darin Adler.
1754
1755         On OS X atime updates automatically on read so calling Storage::traverse() would always ends up updating access times
1756         for all cache entries to the current time. This would make entry worth computation produce unexpected results.
1757         We update mtime manually on successful cache retrieve only so switching to it fixes the problem.
1758
1759         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
1760         (WebKit::NetworkCache::fileTimes):
1761         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
1762         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded): Deleted.
1763         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1764         (WebKit::NetworkCache::Storage::updateFileModificationTime):
1765         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1766         (WebKit::NetworkCache::deletionProbability):
1767         (WebKit::NetworkCache::Storage::updateFileAccessTime): Deleted.
1768         * NetworkProcess/cache/NetworkCacheStorage.h:
1769
1770 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
1771
1772         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
1773         https://bugs.webkit.org/show_bug.cgi?id=142386
1774
1775         Reviewed by Žan Doberšek.
1776
1777         TextureMapper and TextureMapperGL are bloated and tightly coupled with
1778         BitmapTexture. We should move these classes to seperated file of their own.
1779         Also, this patch removes friend relationship from TextureMapperGL and  its
1780         subsidiary classes.
1781
1782         The main purpose of this refactoring is to expose BitmapTexturePool to
1783         renderers of platformlayers like Video and Canvas. By doing this, each
1784         renderer can acquire textures from the global texture pool to paint
1785         their contents directly.
1786
1787         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly
1788
1789 2015-03-27  Anders Carlsson  <andersca@apple.com>
1790
1791         Use a typedef for the WKPluginLoadClientPolicy enum
1792         https://bugs.webkit.org/show_bug.cgi?id=143161
1793
1794         Reviewed by Tim Horton.
1795
1796         * UIProcess/API/C/WKPluginLoadPolicy.h:
1797
1798 2015-03-27  Chris Dumez  <cdumez@apple.com>
1799
1800         [WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics
1801         https://bugs.webkit.org/show_bug.cgi?id=143154
1802
1803         Reviewed by Antti Koivisto.
1804
1805         Use WTF::WorkQueue abstraction inside NetworkCacheStatistics, like we
1806         already do in NetworkCacheStorage.
1807
1808         * NetworkProcess/cache/NetworkCacheStatistics.cpp: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm.
1809         (WebKit::NetworkCache::executeSQLCommand):
1810         (WebKit::NetworkCache::executeSQLStatement):
1811         (WebKit::NetworkCache::Statistics::open):
1812         (WebKit::NetworkCache::Statistics::Statistics):
1813         (WebKit::NetworkCache::Statistics::initialize):
1814         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
1815         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
1816         (WebKit::NetworkCache::Statistics::recordRetrievalRequest):
1817         (WebKit::NetworkCache::Statistics::recordNotCachingResponse):
1818         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
1819         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
1820         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
1821         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
1822         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
1823         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
1824         (WebKit::NetworkCache::Statistics::markAsRequested):
1825         (WebKit::NetworkCache::Statistics::writeTimerFired):
1826         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
1827         (WebKit::NetworkCache::Statistics::clear):
1828         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
1829         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
1830         * NetworkProcess/cache/NetworkCacheStatistics.h:
1831         (WebKit::NetworkCache::Statistics::serialBackgroundIOQueue):
1832         * WebKit2.xcodeproj/project.pbxproj:
1833
1834 2015-03-27  Ryosuke Niwa  <rniwa@webkit.org>
1835
1836         Safari clears selection when its window gets activated via mouse down
1837         https://bugs.webkit.org/show_bug.cgi?id=143157
1838
1839         Reviewed by Anders Carlsson.
1840
1841         The bug was caused by PlatformMouseEvent created in WebKit2 not having its event number
1842         even though we were correctly calling setActivationEventNumber in WebPage::acceptsFirstMouse.
1843
1844         Fixed the bug by storing [NSEvent eventNumber] in WebMouseEvent on Mac in WebKit2 as done in WebKit1.
1845
1846         * Shared/WebEvent.h:
1847         (WebKit::WebMouseEvent::eventNumber):
1848         * Shared/WebEventConversion.cpp:
1849         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1850         * Shared/WebMouseEvent.cpp:
1851         (WebKit::WebMouseEvent::WebMouseEvent):
1852         (WebKit::WebMouseEvent::encode):
1853         (WebKit::WebMouseEvent::decode):
1854         * Shared/mac/WebEventFactory.mm:
1855         (WebKit::WebEventFactory::createWebMouseEvent):
1856
1857 2015-03-27  Anders Carlsson  <andersca@apple.com>
1858
1859         Only do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary
1860         https://bugs.webkit.org/show_bug.cgi?id=143141
1861         rdar://problem/19471284
1862
1863         Reviewed by Andreas Kling.
1864
1865         * Platform/IPC/Connection.h:
1866         * Platform/IPC/mac/ConnectionMac.mm:
1867         (IPC::Connection::platformInvalidate):
1868         (IPC::Connection::platformInitialize):
1869         (IPC::Connection::open):
1870         * Shared/ChildProcessProxy.cpp:
1871         (WebKit::ChildProcessProxy::didFinishLaunching):
1872         * UIProcess/Plugins/PluginProcessProxy.cpp:
1873         (WebKit::PluginProcessProxy::didFinishLaunching):
1874
1875 2015-03-27  Tim Horton  <timothy_horton@apple.com>
1876
1877         Implement iOS WebKit2 PDF Find-in-Page
1878         https://bugs.webkit.org/show_bug.cgi?id=143065
1879         <rdar://problem/16793370>
1880
1881         Reviewed by Dan Bernstein.
1882
1883         * Platform/spi/ios/CorePDFSPI.h:
1884         Add some SPI.
1885
1886         * UIProcess/API/Cocoa/WKWebView.mm:
1887         (-[WKWebView _countStringMatches:options:maxCount:]):
1888         (-[WKWebView _findString:options:maxCount:]):
1889         (-[WKWebView _hideFindUI]):
1890         If we have a custom content view, forward find-in-page methods to it.
1891         
1892         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1893         * UIProcess/API/Cocoa/_WKFindOptions.h:
1894         Move _WKFindOptions into its own file.
1895
1896         * UIProcess/Cocoa/WKWebViewContentProvider.h:
1897         Add find-related methods to the WKWebViewContentProvider protocol.
1898
1899         * UIProcess/ios/WKPDFView.mm:
1900         (-[WKPDFView web_initWithFrame:webView:]):
1901         (-[WKPDFView dealloc]):
1902         Maintain a dispatch queue for searching the PDF.
1903
1904         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
1905         Fix a type.
1906
1907         (-[WKPDFView _ensureViewForPage:]):
1908         Split the code to create/parent a page view out from _revalidateViews,
1909         so that the find code can create/parent the targetted UIPDFPageView
1910         in order to install the find highlight in it, but before it is scrolled into view.
1911
1912         (-[WKPDFView _revalidateViews]):
1913         Use the stored page index instead of counting again.
1914         Don't unparent page views that have find-in-page highlights in them, because
1915         we won't know enough to recreate them later.
1916
1917         (-[WKPDFView _computePageAndDocumentFrames]):
1918         Put the page index in PDFPageInfo, for reference elsewhere.
1919
1920         (-[WKPDFView _stringCompareOptionsFromWKFindOptions:]):
1921         (-[WKPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
1922         Asynchronously (and on our serial queue) search the PDF for the given string.
1923         We'll cache the most recent results to avoid searching more than once,
1924         cancel existing searches when another begins (since it's a serial queue,
1925         this ensures we'll only have one search active at a time).
1926
1927         (-[WKPDFView web_countStringMatches:options:maxCount:]):
1928         Count the number of matches for the given string, and inform the FindClient
1929         of the result.
1930
1931         (-[WKPDFView _didFindMatch:]):
1932         When we find a match, create a view for it, highlight the match, and
1933         zoom so that it's in-view.
1934
1935         (-[WKPDFView web_findString:options:maxCount:]):
1936         Incrementally search the document for the given string. We do an incremental
1937         search even if we have all of the results so that we can anchor the search
1938         in the right place if the new string is a prefix of the old string, etc.
1939         Wrap around appropriately when searching past the beginning or end of the
1940         document. If we have all of the results (there were less than maxCount results),
1941         look through the cached matches for the incrementally-found result and
1942         report its index to the client.
1943
1944         (-[WKPDFView web_hideFindUI]):
1945         Dismiss the selection and clear some state so we start the next search afresh.
1946
1947         * WebKit2.xcodeproj/project.pbxproj:
1948
1949 2015-03-27  Andreas Kling  <akling@apple.com>
1950
1951         WebProcessProxy should not retain WebBackForwardListItems forever.
1952         <https://webkit.org/b/143152>
1953         <rdar://problem/19925709>
1954
1955         Reviewed by Anders Carlsson.
1956
1957         Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from
1958         the WebBackForwardList.
1959
1960         This ensures that we don't accumulate too many of these objects, which can get quite large
1961         due to the session state encoded in them.
1962
1963         We already have graceful handling of the case where an incoming IPC message references
1964         a removed back/forward list item.
1965
1966         * UIProcess/WebBackForwardList.cpp:
1967         (WebKit::WebBackForwardList::didRemoveItem):
1968         * UIProcess/WebPageProxy.cpp:
1969         (WebKit::WebPageProxy::backForwardRemovedItem):
1970         * UIProcess/WebProcessProxy.cpp:
1971         (WebKit::WebProcessProxy::removeBackForwardItem):
1972         * UIProcess/WebProcessProxy.h:
1973
1974 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
1975
1976         Use the correct timebase to log scrollperf blank pixel counts on iOS
1977         https://bugs.webkit.org/show_bug.cgi?id=143149
1978
1979         Reviewed by Tim Horton.
1980         
1981         MobileSafari and WebKit need to collect scrollperf data using the same timebase;
1982         MobileSafari can't call WTF::monotonicallyIncreasingTime(), so use CFAbsoluteTimeGetCurrent()
1983         everywhere.
1984
1985         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm:
1986         (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
1987
1988 2015-03-27  Chris Dumez  <cdumez@apple.com>
1989
1990         [WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation()
1991         https://bugs.webkit.org/show_bug.cgi?id=143137
1992
1993         Reviewed by Antti Koivisto.
1994
1995         Rename requestNeedsRevalidation() to requestRequiresRevalidation() as I
1996         think it is more accurate. It is not the request that needs revalidating.
1997         The requests just requires us to revalidate the response.
1998
1999         * NetworkProcess/cache/NetworkCache.cpp:
2000         (WebKit::NetworkCache::requestRequiresRevalidation):
2001         (WebKit::NetworkCache::canUse):
2002         (WebKit::NetworkCache::requestNeedsRevalidation): Deleted.
2003
2004 2015-03-27  Oliver Hunt  <oliver@apple.com>
2005
2006         Forward additional CFNetwork ATS information to child processes
2007         https://bugs.webkit.org/show_bug.cgi?id=143136
2008
2009         Reviewed by Anders Carlsson.
2010
2011         Add additional process creation parameter information, and pass it
2012         to the child processes that actually use CFNetwork.
2013
2014         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2015         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2016         * Shared/Network/NetworkProcessCreationParameters.cpp:
2017         (WebKit::NetworkProcessCreationParameters::encode):
2018         (WebKit::NetworkProcessCreationParameters::decode):
2019         * Shared/Network/NetworkProcessCreationParameters.h:
2020         * Shared/Plugins/PluginProcessCreationParameters.cpp:
2021         (WebKit::PluginProcessCreationParameters::encode):
2022         (WebKit::PluginProcessCreationParameters::decode):
2023         * Shared/Plugins/PluginProcessCreationParameters.h:
2024         * Shared/WebProcessCreationParameters.cpp:
2025         (WebKit::WebProcessCreationParameters::encode):
2026         (WebKit::WebProcessCreationParameters::decode):
2027         * Shared/WebProcessCreationParameters.h:
2028         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2029         (WebKit::WebProcessPool::platformInitializeWebProcess):
2030         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2031         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2032         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
2033         * WebProcess/cocoa/WebProcessCocoa.mm:
2034         (WebKit::WebProcess::platformInitializeWebProcess):
2035
2036 2015-03-27  Chris Dumez  <cdumez@apple.com>
2037
2038         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
2039         https://bugs.webkit.org/show_bug.cgi?id=143125
2040         <rdar://problem/20321172>
2041
2042         Reviewed by Antti Koivisto.
2043
2044         We Previously only cached responses with status codes that are cacheable
2045         by default [1]. However, RFC 7234 [2] allows us to cache responses with
2046         other status codes, as long as they have explicit headers allowing
2047         caching:
2048         - 'Expires' header field
2049         - 'max-age' response directive
2050
2051         This patch updates our caching policy accordingly to improve efficiency.
2052
2053         [1] http://tools.ietf.org/html/rfc7231#page-48
2054         [2] http://tools.ietf.org/html/rfc7234#section-4.3.2
2055
2056         Test: http/tests/cache/disk-cache/disk-cache-307-status-code.html
2057
2058         * NetworkProcess/cache/NetworkCache.cpp:
2059         (WebKit::NetworkCache::canStore):
2060
2061 2015-03-26  Antti Koivisto  <antti@apple.com>
2062
2063         Respect cache-control directives in request
2064         https://bugs.webkit.org/show_bug.cgi?id=143121
2065         rdar://problem/19714040
2066
2067         Reviewed by Chris Dumez.
2068
2069         Better support for https://tools.ietf.org/html/rfc7234#section-5.2.1
2070
2071         * NetworkProcess/cache/NetworkCache.cpp:
2072         (WebKit::NetworkCache::canUse):
2073
2074             Consider requests with Cache-control: no-cache and max-age=0 expired.
2075
2076         (WebKit::NetworkCache::canStore):
2077
2078             Don't store requests with Cache-control: no-store.
2079
2080         (WebKit::NetworkCache::Cache::store):
2081         * NetworkProcess/cache/NetworkCache.h:
2082         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
2083         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
2084
2085 2015-03-25  Jon Honeycutt  <jhoneycutt@apple.com>
2086
2087         iOS file upload panel menu items need icons
2088         <https://bugs.webkit.org/show_bug.cgi?id=143042>
2089         <rdar://problem/20178678>
2090
2091         Reviewed by Andy Estes.
2092
2093         * Platform/spi/ios/UIKitSPI.h:
2094         Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon and
2095         _UIImageGetWebKitPhotoLibraryIcon().
2096
2097         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2098         (photoLibraryIcon):
2099         (cameraIcon):
2100         If UIKit SPI exists, use it. Otherwise, return nil.
2101
2102         (-[WKFileUploadPanel _showDocumentPickerMenu]):
2103         Use icons.
2104
2105 2015-03-26  Enrica Casucci  <enrica@apple.com>
2106
2107         OS X build fix after r182037.
2108
2109         Unreviewed.
2110
2111         * UIProcess/API/mac/WKView.mm:
2112         (-[WKView _addFontPanelObserver]):
2113         (-[WKView removeWindowObservers]):
2114         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
2115
2116 2015-03-26  Enrica Casucci  <enrica@apple.com>
2117
2118         iOS build fix after r182037.
2119
2120         Unreviewed.
2121
2122         * UIProcess/API/Cocoa/WKWebView.mm:
2123         (-[WKWebView _setEditable:]):
2124
2125 2015-03-26  Enrica Casucci  <enrica@apple.com>
2126
2127         REGRESSION(r1807689): Slower startup time for WKWebView.
2128         https://bugs.webkit.org/show_bug.cgi?id=143115
2129         rdar://problem/20233711
2130
2131         Reviewed by Anders Carlsson.
2132
2133         In http://trac.webkit.org/changeset/180768 we added an observer to
2134         track visibility of the NSFontPanel to ensure we could fetch the font
2135         information for the current selection when the panel first becomes visible.
2136         It turns out that adding the observer requires the shared font panel
2137         object to be created.
2138         That is apparently a very expensive operation that is regressing
2139         the initialization time for the WKWebView.
2140         We should initialize the NSFontPanel lazily, only when we make the entire
2141         view editable.
2142
2143         * UIProcess/API/Cocoa/WKWebView.mm:
2144         (-[WKWebView _setEditable:]):
2145         * UIProcess/API/mac/WKView.mm:
2146         (-[WKView addWindowObserversForWindow:]):
2147         (-[WKView _addFontPanelObserver]):
2148         (-[WKView removeWindowObservers]):
2149         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
2150         * UIProcess/API/mac/WKViewInternal.h:
2151
2152 2015-03-26  Alex Christensen  <achristensen@webkit.org>
2153
2154         Progress towards CMake on Mac.
2155         https://bugs.webkit.org/show_bug.cgi?id=143112
2156
2157         Reviewed by Chris Dumez.
2158
2159         * CMakeLists.txt:
2160         * PlatformMac.cmake:
2161         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2162
2163 2015-03-26  Chris Dumez  <cdumez@apple.com>
2164
2165         [WK2][Cocoa] Add private API to override the network disk cache size
2166         https://bugs.webkit.org/show_bug.cgi?id=143113
2167         <rdar://problem/20315669>
2168
2169         Reviewed by Antti Koivisto.
2170
2171         Add private API to let the client override the network disk cache size.
2172         By default, the network disk cache is automatically determined based on
2173         the CacheModel and the available disk space. However, for testing
2174         purposes, it can be used for the client-side to be able to override
2175         the disk cache size.
2176
2177         * NetworkProcess/NetworkProcess.cpp:
2178         (WebKit::NetworkProcess::initializeNetworkProcess):
2179         * NetworkProcess/NetworkProcess.h:
2180         * NetworkProcess/cache/NetworkCache.cpp:
2181         (WebKit::NetworkCache::Cache::setMaximumSize):
2182         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2183         (WebKit::NetworkProcess::platformSetCacheModel):
2184         * Shared/Network/NetworkProcessCreationParameters.cpp:
2185         (WebKit::NetworkProcessCreationParameters::encode):
2186         (WebKit::NetworkProcessCreationParameters::decode):
2187         * Shared/Network/NetworkProcessCreationParameters.h:
2188         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2189         (API::ProcessPoolConfiguration::copy):
2190         * UIProcess/API/APIProcessPoolConfiguration.h:
2191         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2192         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2193         (-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
2194         (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
2195         * UIProcess/WebProcessPool.cpp:
2196         (WebKit::WebProcessPool::WebProcessPool):
2197         (WebKit::WebProcessPool::ensureNetworkProcess):
2198         * UIProcess/WebProcessPool.h:
2199
2200 2015-03-26  Andreas Kling  <akling@apple.com>
2201
2202         [Darwin] Boost the web process QoS level while handling a synchronous IPC message.
2203         <https://webkit.org/b/142988>
2204         <rdar://problem/20264346>
2205
2206         Reviewed by Antti Koivisto and Anders Carlsson.
2207
2208         Add a mechanism for IPC::Connection to boost the main thread for the duration
2209         of processing a synchronous message.
2210
2211         This fixes an issue where the UI process would block on a synchronous request
2212         to the web process that was being carried out at a lower QoS level.
2213
2214         * Platform/IPC/Connection.cpp:
2215         (IPC::Connection::Connection): Save the main thread's pthread_t while we have
2216         a chance to retreive it.
2217
2218         (IPC::Connection::processIncomingMessage): Optionally boost the main thread when
2219         processing an incoming message with the IsSyncMessage flag set.
2220
2221         * Platform/IPC/Connection.h:
2222         (IPC::Connection::setShouldBoostMainThreadOnSyncMessage): Added. When this mode is
2223         enabled, Connection will give a temporary QoS override to the main thread when
2224         receiving a synchronous message. Ownership of the override is handed to the
2225         MessageDecoder, which resets the main thread QoS in its destructor.
2226
2227         * Platform/IPC/MessageDecoder.cpp:
2228         (IPC::MessageDecoder::~MessageDecoder): Remove any QoS override owned by this message.
2229
2230         * Platform/IPC/MessageDecoder.h:
2231         (IPC::MessageDecoder::setQOSClassOverride): Added. Takes ownership of a QoS override
2232         to make sure it stays in effect until this message has been dispatched.
2233
2234         * WebProcess/WebProcess.cpp:
2235         (WebKit::WebProcess::initializeConnection): Set up main thread QoS boosting for the
2236         web process's connection to the UI process.
2237
2238 2015-03-26  Ryosuke Niwa  <rniwa@webkit.org>
2239
2240         Cursor doesn't change back to pointer when leaving Mail
2241         https://bugs.webkit.org/show_bug.cgi?id=132038
2242
2243         Reviewed by Anders Carlsson.
2244
2245         Fixed the bug by adding a cursor rect and making the primary tracking area update the cursor so that
2246         AppKit will reset the cursor as it leaves the WebView.
2247
2248         We use nil cursor here since we manually update the cursor by calling [NSCursor set].
2249
2250         * UIProcess/API/mac/WKView.mm:
2251         (-[WKView initWithFrame:processPool:configuration:webView:]):
2252         * UIProcess/mac/PageClientImpl.mm:
2253         (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
2254
2255 2015-03-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2256
2257         [Linux] SeccompFilters: improve the port-agnostic whitelist
2258         https://bugs.webkit.org/show_bug.cgi?id=140064
2259
2260         Reviewed by Žan Doberšek.
2261
2262         Allow the web process to access several files and directories that it
2263         was previously prohibited from accessing. This makes the web process
2264         much less likely to break.
2265
2266         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2267         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
2268
2269 2015-03-26  Antti Koivisto  <antti@apple.com>
2270
2271         Remove unneeded isConditionalRequest check from NetworkResourceLoader
2272         https://bugs.webkit.org/show_bug.cgi?id=143096
2273
2274         Reviewed by Anders Carlsson.
2275
2276         This check is leftover from implementation that allowed disk cache to validate conditional
2277         request itself. The case can't happen as NetworkCache canRetrieve test does not allow
2278         conditional requests in the first place.
2279
2280         * NetworkProcess/NetworkResourceLoader.cpp:
2281         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2282         (WebKit::isConditionalRequest): Deleted.
2283
2284 2015-03-26  Antti Koivisto  <antti@apple.com>
2285
2286         Rename Storage::Entry to Storage::Record
2287         https://bugs.webkit.org/show_bug.cgi?id=143101
2288
2289         Reviewed by Chris Dumez.
2290
2291         Lets have just one type called Entry in the cache code.
2292
2293         * NetworkProcess/cache/NetworkCache.cpp:
2294         (WebKit::NetworkCache::Cache::retrieve):
2295         (WebKit::NetworkCache::Cache::store):
2296         (WebKit::NetworkCache::Cache::update):
2297         (WebKit::NetworkCache::Cache::traverse):
2298         (WebKit::NetworkCache::Cache::dumpContentsToFile):
2299         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2300         (WebKit::NetworkCache::Entry::Entry):
2301         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
2302         (WebKit::NetworkCache::Entry::decodeStorageRecord):
2303         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
2304         (WebKit::NetworkCache::Entry::buffer):
2305         (WebKit::NetworkCache::Entry::shareableResourceHandle):
2306         (WebKit::NetworkCache::Entry::encode): Deleted.
2307         (WebKit::NetworkCache::Entry::decode): Deleted.
2308         (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry): Deleted.
2309         * NetworkProcess/cache/NetworkCacheEntry.h:
2310         (WebKit::NetworkCache::Entry::sourceStorageRecord):
2311         (WebKit::NetworkCache::Entry::sourceStorageEntry): Deleted.
2312         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2313         (WebKit::NetworkCache::RecordMetaData::RecordMetaData):
2314         (WebKit::NetworkCache::decodeRecordMetaData):
2315         (WebKit::NetworkCache::decodeRecordHeader):
2316         (WebKit::NetworkCache::decodeRecord):
2317         (WebKit::NetworkCache::encodeRecordMetaData):
2318         (WebKit::NetworkCache::encodeRecordHeader):
2319         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2320         (WebKit::NetworkCache::retrieveFromMemory):
2321         (WebKit::NetworkCache::Storage::store):
2322         (WebKit::NetworkCache::Storage::update):
2323         (WebKit::NetworkCache::Storage::traverse):
2324         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
2325         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
2326         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
2327         (WebKit::NetworkCache::EntryMetaData::EntryMetaData): Deleted.
2328         (WebKit::NetworkCache::decodeEntryMetaData): Deleted.
2329         (WebKit::NetworkCache::decodeEntryHeader): Deleted.
2330         (WebKit::NetworkCache::decodeEntry): Deleted.
2331         (WebKit::NetworkCache::encodeEntryMetaData): Deleted.
2332         (WebKit::NetworkCache::encodeEntryHeader): Deleted.
2333         * NetworkProcess/cache/NetworkCacheStorage.h:
2334
2335 2015-03-26  Chris Dumez  <cdumez@apple.com>
2336
2337         [WK2] Let the compiler generate the NetworkCache::Key move constructor
2338         https://bugs.webkit.org/show_bug.cgi?id=143079
2339
2340         Reviewed by Antti Koivisto.
2341
2342         Let the compiler generate the NetworkCache::Key move constructor. The
2343         generated one will do exactly the same thing as the one we had except
2344         that it will move the m_hash member as well. I don't see any reason why
2345         we weren't moving this member before (it is an std::array<uint8_t, 16>).
2346
2347         Also have the compiler generate a move assignment operator for
2348         consistency. Although it is not currently useful, it could be at some
2349         point.
2350
2351         * NetworkProcess/cache/NetworkCacheKey.cpp:
2352         (WebKit::NetworkCache::Key::Key): Deleted.
2353         * NetworkProcess/cache/NetworkCacheKey.h:
2354
2355 2015-03-26  Chris Dumez  <cdumez@apple.com>
2356
2357         [WK2][NetworkCache] Compute if a cached response has expired only when actually needed
2358         https://bugs.webkit.org/show_bug.cgi?id=143070
2359
2360         Reviewed by Antti Koivisto.
2361
2362         Compute if a cached response has expired only when actually needed:
2363         - This is not a history navigation
2364         and
2365         - It does not have "Cache-Control: no-cache" header
2366
2367         Previously, we would always determine if the response has expired and
2368         we often end up not using this information.
2369
2370         * NetworkProcess/cache/NetworkCache.cpp:
2371         (WebKit::NetworkCache::responseHasExpired):
2372         (WebKit::NetworkCache::canUse):
2373
2374 2015-03-26  Zan Dobersek  <zdobersek@igalia.com>
2375
2376         Avoid the Vector<> copy in WebTouchEvent constructor
2377         https://bugs.webkit.org/show_bug.cgi?id=143043
2378
2379         Reviewed by Carlos Garcia Campos.
2380
2381         Have the WebTouchEvent accept a Vector<> rvalue.
2382         The relevant code is updated so the Vector<> object is moved
2383         through the call chain and finally into the WebTouchEvent constructor.
2384
2385         * Shared/NativeWebTouchEvent.h:
2386         * Shared/WebEvent.h:
2387         * Shared/WebTouchEvent.cpp:
2388         (WebKit::WebTouchEvent::WebTouchEvent):
2389         * Shared/efl/WebEventFactory.cpp:
2390         (WebKit::WebEventFactory::createWebTouchEvent):
2391         * Shared/gtk/NativeWebTouchEventGtk.cpp:
2392         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
2393         * Shared/gtk/WebEventFactory.cpp:
2394         (WebKit::WebEventFactory::createWebTouchEvent):
2395         * Shared/gtk/WebEventFactory.h:
2396         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2397         (webkitWebViewBaseTouchEvent):
2398
2399 2015-03-25  Chris Dumez  <cdumez@apple.com>
2400
2401         [WK2] WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always call the FramePolicyFunction
2402         https://bugs.webkit.org/show_bug.cgi?id=143036
2403         <rdar://problem/20252438>
2404         <rdar://problem/13811738>
2405
2406         Reviewed by Alexey Proskuryakov.
2407
2408         WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always
2409         call the FramePolicyFunction. Previously, it would fail to do in 2
2410         cases:
2411         - m_frame->page() returns null
2412         or
2413         - webPage->sendSync() returns false
2414
2415         If the FramePolicyFunction is not called, we will fail to clear the
2416         callback in the PolicyChecker and
2417         DocumentLoader::continueAfterContentPolicy() will not be called.
2418
2419         DocumentLoader::continueAfterContentPolicy() is in charge of resetting
2420         m_waitingForContentPolicy flag to false. This could therefore explain
2421         the following assertion being hit in DocumentLoader::detachFromFrame()
2422         (see <rdar://problem/20252438>):
2423         RELEASE_ASSERT(!m_waitingForContentPolicy)
2424
2425         Also, as the PolicyChecker callback is not cleared, it could make it
2426         possible for DocumentLoader::continueAfterContentPolicy() to be called
2427         *after* the load is finished, when later canceling the PolicyCallback:
2428         FrameLoader::stopAllLoaders()
2429          -> PolicyChecker::stopCheck()
2430           -> PolicyCallback::cancel()
2431            -> DocumentLoader::continueAfterContentPolicy(PolicyIgnore)
2432
2433         Calling continueAfterContentPolicy(PolicyIgnore) after the load is
2434         finished would be bad and could explain some of the crashes we've seen
2435         in DocumentLoader::continueAfterContentPolicy() ->
2436         DocumentLoader:: stopLoadingForPolicyChange() (see
2437         <rdar://problem/13811738>).
2438
2439         This patch also applies the same fix to
2440         dispatchDecidePolicyForNewWindowAction() and
2441         dispatchDecidePolicyForNavigationAction() as they use the same pattern.
2442
2443         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2444         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2445         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2446         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2447
2448 2015-03-25  Tim Horton  <timothy_horton@apple.com>
2449
2450         Add a preference to prevent "user-scalable=no" from having any effect
2451         https://bugs.webkit.org/show_bug.cgi?id=143032
2452
2453         Reviewed by Sam Weinig.
2454
2455         * Shared/WebPreferencesDefinitions.h:
2456         * WebProcess/WebPage/WebPage.cpp:
2457         (WebKit::WebPage::updatePreferences):
2458         Add a preference and push it to the ViewportConfiguration.
2459
2460 2015-03-25  Beth Dakin  <bdakin@apple.com>
2461
2462         REGRESSION (r181660): Force click url preview doesn't have a TextIndicator in Mail
2463         https://bugs.webkit.org/show_bug.cgi?id=143064
2464         -and corresponding-
2465         rdar://problem/20251440
2466
2467         Reviewed by Tim Horton.
2468
2469         The TextIndicator was getting set to nil by the call to 
2470         _dismissContentRelativeChildWindows in mouseDown. That line of code was added by 
2471         http://trac.webkit.org/changeset/177242 to work around a bug in another component 
2472         that has now been resolved, so it no longer appears to be necessary. 
2473
2474         * UIProcess/API/mac/WKView.mm:
2475         (-[WKView mouseDown:]):
2476
2477 2015-03-25  Anders Carlsson  <andersca@apple.com>
2478
2479         Add network and application cache directories to WebsiteDataStore
2480         https://bugs.webkit.org/show_bug.cgi?id=143063
2481
2482         Reviewed by Sam Weinig.
2483
2484         Create a WebKit directory under ~/Library/Caches/<Bundle ID> for non-sandboxed applications,
2485         and ~/Library/Caches for sandboxed applications. Create NetworkCache and OfflineWebApplicationCache
2486         subdirectories. These directories will be used with the modern WebKit API.
2487
2488         * UIProcess/API/APIWebsiteDataStore.h:
2489         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2490         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
2491         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2492         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2493         (WebKit::WebsiteDataStore::WebsiteDataStore):
2494         * UIProcess/WebsiteData/WebsiteDataStore.h:
2495
2496 2015-03-25  Sam Weinig  <sam@webkit.org>
2497
2498         Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
2499
2500         * Shared/WebCompiledContentExtension.cpp:
2501         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
2502         * UIProcess/API/C/WKUserContentFilterRef.cpp:
2503         (WKUserContentFilterCreate):
2504         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
2505         (-[_WKUserContentFilter initWithName:serializedRules:]):
2506
2507 2015-03-25  Sam Weinig  <sam@webkit.org>
2508
2509         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
2510         https://bugs.webkit.org/show_bug.cgi?id=143059
2511
2512         Reviewed by Alex Christensen.
2513
2514         * Shared/WebCompiledContentExtension.cpp:
2515         * Shared/WebCompiledContentExtension.h:
2516         (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient):
2517         (WebKit::LegacyContentExtensionCompilationClient::writeBytecode):
2518         (WebKit::LegacyContentExtensionCompilationClient::writeActions):
2519         Add subclass of ContentExtensionCompilationClient for use with the non-file backed content
2520         extensions.
2521
2522         * UIProcess/API/C/WKUserContentFilterRef.cpp:
2523         (WKUserContentFilterCreate):
2524         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
2525         (-[_WKUserContentFilter initWithName:serializedRules:]):
2526         Update to use the new interface of compileRuleList().
2527
2528 2015-03-25  Ryosuke Niwa  <rniwa@webkit.org>
2529
2530         Web Inspector: Switching tabs to window with inspector open prohibits typing into console
2531         https://bugs.webkit.org/show_bug.cgi?id=126800
2532
2533         Reviewed by Anders Carlsson.
2534
2535         This is a regression from r85356 and r83814. These two patches made WKWebView clear its selection
2536         when WKView resigns the first responder without ever restoring it even if WKView later becomes
2537         the first responder again. This is problematic when a text field or a editing host element had been
2538         focused and selected prior to the resignation since the editing code uses the selection to determine
2539         the editability of the element.
2540
2541         Fixed the bug by restoring selection in [WKView becomeFirstResponder] if the selection is empty.
2542
2543         * UIProcess/API/mac/WKView.mm:
2544         (-[WKView becomeFirstResponder]):
2545         * UIProcess/WebPageProxy.cpp:
2546         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
2547         * UIProcess/WebPageProxy.h:
2548         * WebProcess/WebPage/WebPage.cpp:
2549         (WebKit::WebPage::restoreSelectionInFocusedEditableElement):
2550         * WebProcess/WebPage/WebPage.h:
2551         * WebProcess/WebPage/WebPage.messages.in:
2552
2553 2015-03-25  Beth Dakin  <bdakin@apple.com>
2554
2555         REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
2556         force preview
2557         https://bugs.webkit.org/show_bug.cgi?id=143057
2558         -and corresponding-
2559         rdar://problem/20251436
2560
2561         Reviewed by Tim Horton.
2562
2563         Always call _page->immediateActionDidUpdate() so that the EventHandler’s 
2564         ImmediateActionStage is appropriately updated.
2565         * UIProcess/mac/WKImmediateActionController.mm:
2566         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
2567
2568         Update the EventHandler’s ImmediateActionStage.
2569         * WebProcess/WebPage/mac/WebPageMac.mm:
2570         (WebKit::WebPage::immediateActionDidUpdate):
2571
2572 2015-03-25  Antti Koivisto  <antti@apple.com>
2573
2574         Separate entry decoding from validation
2575         https://bugs.webkit.org/show_bug.cgi?id=143052
2576
2577         Reviewed by Chris Dumez.
2578
2579         Make NetworkCache::Cache a class and move it to a file of its own.
2580         Move the encoding/decoding code there.
2581
2582         * NetworkProcess/NetworkProcess.cpp:
2583         (WebKit::fetchDiskCacheEntries):
2584         (WebKit::clearDiskCacheEntries):
2585         * NetworkProcess/NetworkResourceLoader.cpp:
2586         (WebKit::sendReplyToSynchronousRequest):
2587         (WebKit::NetworkResourceLoader::start):
2588         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
2589         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2590         (WebKit::NetworkResourceLoader::validateCacheEntry):
2591         * NetworkProcess/NetworkResourceLoader.h:
2592         * NetworkProcess/cache/NetworkCache.cpp:
2593         (WebKit::NetworkCache::collectVaryingRequestHeaders):
2594         (WebKit::NetworkCache::canUse):
2595
2596             Focused function for deciding if we can use a cache entry and if it needs validation.
2597
2598         (WebKit::NetworkCache::Cache::retrieve):
2599         (WebKit::NetworkCache::Cache::store):
2600         (WebKit::NetworkCache::Cache::update):
2601         (WebKit::NetworkCache::Cache::traverse):
2602         (WebKit::NetworkCache::encodeStorageEntry): Deleted.
2603         (WebKit::NetworkCache::decodeStorageEntry): Deleted.
2604         * NetworkProcess/cache/NetworkCache.h:
2605         * NetworkProcess/cache/NetworkCacheEntry.cpp: Added.
2606         (WebKit::NetworkCache::Entry::Entry):
2607         (WebKit::NetworkCache::Entry::encode):
2608         (WebKit::NetworkCache::Entry::decode):
2609         (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry):
2610         (WebKit::NetworkCache::Entry::buffer):
2611         (WebKit::NetworkCache::Entry::shareableResourceHandle):
2612         (WebKit::NetworkCache::Entry::needsValidation):
2613         (WebKit::NetworkCache::Entry::setNeedsValidation):
2614         * NetworkProcess/cache/NetworkCacheEntry.h: Added.
2615         (WebKit::NetworkCache::Entry::key):
2616         (WebKit::NetworkCache::Entry::timeStamp):
2617         (WebKit::NetworkCache::Entry::response):
2618         (WebKit::NetworkCache::Entry::varyingRequestHeaders):
2619         (WebKit::NetworkCache::Entry::sourceStorageEntry):
2620         * NetworkProcess/cache/NetworkCacheStatistics.h:
2621         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
2622         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
2623         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
2624         * WebKit2.xcodeproj/project.pbxproj:
2625
2626 2015-03-25  David Hyatt  <hyatt@apple.com>
2627
2628         Add a pref to enable the new block-inside-inline model
2629         https://bugs.webkit.org/show_bug.cgi?id=143050
2630
2631         Reviewed by Sam Weinig.
2632
2633         * Shared/WebPreferencesDefinitions.h:
2634         * UIProcess/API/C/WKPreferences.cpp:
2635         (WKPreferencesSetNewBlockInsideInlineModelEnabled):
2636         (WKPreferencesGetNewBlockInsideInlineModelEnabled):
2637         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2638         * WebProcess/WebPage/WebPage.cpp:
2639         (WebKit::WebPage::updatePreferences):
2640
2641 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
2642
2643         [WK2] WebUserMediaClient::pageDestroyed() virtual method should be marked as override
2644         https://bugs.webkit.org/show_bug.cgi?id=143046
2645
2646         Reviewed by Carlos Garcia Campos.
2647
2648         * WebProcess/WebCoreSupport/WebUserMediaClient.h: Mark the WebUserMediaClient::pageDestroyed()
2649         method, inherited from the WebCore::UserMediaClient, as an override.
2650
2651 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
2652
2653         [GTK][WK2] WebPageProxy::failedToShowPopupMenu() virtual method should be marked as override
2654         https://bugs.webkit.org/show_bug.cgi?id=143045
2655
2656         Reviewed by Carlos Garcia Campos.
2657
2658         * UIProcess/WebPageProxy.h: Mark the failedToShowPopupMenu(), inherited from
2659         the WebPopupMenuProxy::Client class, as overridden.
2660
2661 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
2662
2663         [WK2] Clean up DrawingAreaImpl vtable overrides
2664         https://bugs.webkit.org/show_bug.cgi?id=143044
2665
2666         Reviewed by Carlos Garcia Campos.
2667
2668         Declare virtual methods of the DrawingAreaImpl class as overridden where necessary.
2669
2670         * WebProcess/WebPage/DrawingAreaImpl.h:
2671         (WebKit::DrawingAreaImpl::layerTreeStateIsFrozen): Deleted.
2672         (WebKit::DrawingAreaImpl::layerTreeHost): Deleted.
2673
2674 2015-03-24  Ryosuke Niwa  <rniwa@webkit.org>
2675
2676         Inspector doesn't get focused when opened in dock mode
2677         https://bugs.webkit.org/show_bug.cgi?id=143030
2678
2679         Reviewed by Anders Carlsson.
2680
2681         The bug was caused by platformBringToFront and platformAttach calling makeFirstResponder on WKWebView,
2682         which aren't intended to become the first responder. Fixed the bug by calling makeFirstResponder on the WKView
2683         subview of the WKWebView, which is intended to be used as the first responder on behalf of the web view.
2684
2685         * UIProcess/mac/WebInspectorProxyMac.mm:
2686         (WebKit::WebInspectorProxy::platformBringToFront):
2687         (WebKit::WebInspectorProxy::platformAttach):
2688
2689 2015-03-24  Chris Dumez  <cdumez@apple.com>
2690
2691         [WK2] Responses with 302 HTTP Status Code should not be cached
2692         https://bugs.webkit.org/show_bug.cgi?id=143028
2693         <rdar://problem/19714040>
2694
2695         Reviewed by Antti Koivisto.
2696
2697         Responses with 302 HTTP Status Code should not be cached as per
2698         RFC 7231:
2699         http://tools.ietf.org/html/rfc7231#section-6.1
2700
2701         This patch updates our disk cache policy accordingly.
2702
2703         Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
2704
2705         * NetworkProcess/cache/NetworkCache.cpp:
2706         (WebKit::NetworkCache::canStore):
2707
2708 2015-03-24  Anders Carlsson  <andersca@apple.com>
2709
2710         Fix crash in WebKit::RemoteObjectRegistry::sendInvocation
2711         https://bugs.webkit.org/show_bug.cgi?id=143027
2712         rdar://problem/20208674
2713
2714         Reviewed by Sam Weinig.
2715
2716         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2717         (-[WKWebProcessPlugInBrowserContextController dealloc]):
2718         Make sure to invalidate the _WKRemoteObjectRegistry like we do in the UI process.
2719
2720 2015-03-24  Chris Dumez  <cdumez@apple.com>
2721
2722         [WK2] Responses with 204 HTTP Status Code should be cacheable by default
2723         https://bugs.webkit.org/show_bug.cgi?id=143020
2724         <rdar://problem/20281529>
2725
2726         Reviewed by Antti Koivisto.
2727
2728         Make responses with 204 HTTP Status Code cacheable by default, as
2729         per RFC 7231:
2730         http://tools.ietf.org/html/rfc7231#section-6.3.5
2731
2732         Test: http/tests/cache/disk-cache/disk-cache-204-status-code.html
2733
2734         * NetworkProcess/cache/NetworkCache.cpp:
2735         (WebKit::NetworkCache::canStore):
2736
2737 2015-03-24  Enrica Casucci  <enrica@apple.com>
2738
2739         [iOS] Remove unused keyboard code in WKSelectPopover class.
2740         https://bugs.webkit.org/show_bug.cgi?id=143021
2741
2742         Reviewed by Joseph Pecoraro.
2743
2744         WKSelectPopover created an instance of UIKeyboard that was
2745         initialized in initWithView but never used. Removing the
2746         obsolete code.
2747
2748         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2749         (-[WKSelectPopover initWithView:hasGroups:]):
2750
2751 2015-03-24  Dan Bernstein  <mitz@apple.com>
2752
2753         WebKit2 part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
2754         https://bugs.webkit.org/show_bug.cgi?id=143023
2755
2756         Reviewed by Tim Horton.
2757
2758         * UIProcess/API/Cocoa/WKWebView.mm:
2759         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): If the view is in a
2760         window, use CARenderServerRenderLayerWithTransform to synchronously capture a snapshot of
2761         its layer tree into an IOSurfcae, then call the completion handler with an image created
2762         from the IOSurface.
2763
2764 2015-03-24  Beth Dakin  <bdakin@apple.com>
2765
2766         Add events related to force click gesture
2767         https://bugs.webkit.org/show_bug.cgi?id=142836
2768         -and corresponding-
2769         rdar://problem/20210239
2770
2771         Reviewed by Dean Jackson.
2772
2773         ActionMenuHitTestResult has a new bool indicating whether to not the HitTestResult 
2774         will prevent default. 
2775         * Shared/mac/ActionMenuHitTestResult.h:
2776         * Shared/mac/ActionMenuHitTestResult.mm:
2777         (WebKit::ActionMenuHitTestResult::encode):
2778         (WebKit::ActionMenuHitTestResult::decode):
2779
2780         Send immediateActionDidUpdate and the normalized force over the the WebProcess.
2781         * UIProcess/WebPageProxy.cpp:
2782         (WebKit::WebPageProxy::immediateActionDidUpdate):
2783         * UIProcess/WebPageProxy.h:
2784
2785         We need a dummy animation controller when web content is overriding the default 
2786         behavior.
2787         * UIProcess/mac/WKImmediateActionController.mm:
2788
2789         Send along the update information.
2790         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
2791
2792         Use the dummy animation controller if default has been prevented.
2793         (-[WKImmediateActionController _defaultAnimationController]):
2794         (-[WKImmediateActionController _updateImmediateActionItem]):
2795
2796         Keep track of whether m_lastActionMenuHitTes prevented the default immediate 
2797         action behavior.
2798         * WebProcess/WebPage/WebPage.cpp:
2799         (WebKit::WebPage::WebPage):
2800         * WebProcess/WebPage/WebPage.h:
2801         * WebProcess/WebPage/WebPage.messages.in:
2802
2803         Call dispatchMouseForceMayBegin() at hit test time.
2804         * WebProcess/WebPage/mac/WebPageMac.mm:
2805         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2806
2807         Call dispatchMouseForceChanged() if appropriate.
2808         (WebKit::WebPage::immediateActionDidUpdate):
2809
2810         Call dispatchMouseForceCancelled() if appropriate.
2811         (WebKit::WebPage::immediateActionDidCancel):
2812
2813         Call dispatchMouseForceDown() if appropriate.
2814         (WebKit::WebPage::immediateActionDidComplete):
2815
2816 2015-03-24  Anders Carlsson  <andersca@apple.com>
2817
2818         Fix designated initializer violations
2819         https://bugs.webkit.org/show_bug.cgi?id=143016
2820         rdar://problem/20268858
2821
2822         Reviewed by Dan Bernstein.
2823
2824         Move -[WKProcessPool _initWithConfiguration:] to a class extension so we can make it the designated initializer.
2825
2826         * UIProcess/API/Cocoa/WKProcessPool.mm:
2827         (-[WKProcessPool _initWithConfiguration:]):
2828         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2829
2830 2015-03-24  Chris Dumez  <cdumez@apple.com>
2831
2832         [WK2] Responses with 404 HTTP Status Code should be cacheable by default
2833         https://bugs.webkit.org/show_bug.cgi?id=143014
2834         <rdar://problem/20280310>
2835
2836         Reviewed by Antti Koivisto.
2837
2838         Make responses with 404 HTTP Status Code cacheable by default, as
2839         per RFC 7231:
2840         http://tools.ietf.org/html/rfc7231#section-6.5.4
2841
2842         Test: http/tests/cache/disk-cache/disk-cache-404-status-code.html
2843
2844         * NetworkProcess/cache/NetworkCache.cpp:
2845         (WebKit::NetworkCache::canStore):
2846
2847 2015-03-24  Chris Dumez  <cdumez@apple.com>
2848
2849         [WK2] Remove NetworkCache FIXME comment about caching responses to OPTIONS requests
2850         https://bugs.webkit.org/show_bug.cgi?id=143009
2851
2852         Reviewed by Andreas Kling.
2853
2854         Remove NetworkCache FIXME comment about caching responses to OPTIONS
2855         method as RFC 7234 says "Responses to the OPTIONS method are not
2856         cacheable" [1].
2857
2858         [1] http://tools.ietf.org/html/rfc7231#page-31
2859
2860         * NetworkProcess/cache/NetworkCache.cpp:
2861         (WebKit::NetworkCache::canRetrieve):
2862
2863 2015-03-24  Chris Dumez  <cdumez@apple.com>
2864
2865         [WK2] NetworkCache retrievals fail for entries with no body
2866         https://bugs.webkit.org/show_bug.cgi?id=142979
2867         <rdar://problem/20264100>
2868
2869         Reviewed by Antti Koivisto.
2870
2871         NetworkCache retrievals were failing for entries with no body because
2872         decodeEntry() doesn't correctly handle this case. In particular, the
2873         following check fails:
2874         "metaData.bodyOffset + metaData.bodySize == fileData.size()".
2875         This is because bodyOffset is pageSize-aligned.
2876
2877         As a result, the following resource on apple.com is stored in the cache
2878         but we fail to reuse it and reload it from the network every time:
2879         http://images.apple.com/home/styles/promos.css
2880
2881         This patch updates decodeEntry() to create a null Data object for the
2882         body if bodySize is 0.
2883
2884         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2885         (WebKit::NetworkCache::Data::data):
2886         Do not attempt to initialize m_data if m_dispatchData is null as the
2887         call to dispatch_data_create_map() would then crash. We now return
2888         null in this case. This is needed as decodeStorageEntry() in
2889         NetworkCache.cpp constructs a SharedBuffer from
2890         storageEntry.body.data() and the body may be null.
2891
2892         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2893         (WebKit::NetworkCache::decodeEntry):
2894
2895 2015-03-24  Chris Dumez  <cdumez@apple.com>
2896
2897         [WK2] The WebKit network cache does not cache responses with "Content-Disposition: attachment" header
2898         https://bugs.webkit.org/show_bug.cgi?id=142989
2899         <rdar://problem/20265992>
2900
2901         Reviewed by Antti Koivisto.
2902
2903         Update our WebKit network cache policy to cache responses with
2904         "Content-Disposition: attachment" header. There is no reason we cannot
2905         cache these and our memory cache already does.
2906
2907         This was causing a decent amount of cache misses in the wild. I have
2908         noticed for example that when loading disney.com, we fail to cache the
2909         following resources because of this policy:
2910         http://pagead2.googlesyndication.com/pagead/osd.js
2911         http://pagead2.googlesyndication.com/pagead/show_companion_ad.js
2912
2913         Those resources have Cache-Control headers that indicate they are meant
2914         to be cacheable.
2915
2916         Test: http/tests/cache/disk-cache-validation-attachment.html
2917
2918         * NetworkProcess/cache/NetworkCache.cpp:
2919         (WebKit::NetworkCache::canStore):
2920
2921 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
2922
2923         Unreviewed, another attempt to fix 32-bit build after r181881.
2924
2925         * UIProcess/WebInspectorProxy.h:
2926
2927 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
2928
2929         Unreviewed, attempt to fix 32-bit build after r181881.
2930
2931         * UIProcess/API/Cocoa/WKViewPrivate.h:
2932         * UIProcess/API/mac/WKView.mm:
2933
2934 2015-03-19  Timothy Hatcher  <timothy@apple.com>
2935
2936         Web Inspector: Support attaching to another view other than the WKView
2937         https://bugs.webkit.org/show_bug.cgi?id=142892
2938
2939         Reviewed by Tim Horton.
2940
2941         * UIProcess/API/C/WKInspector.cpp:
2942         (WKInspectorAttach): Drive by fix so it used the last attachment side.
2943
2944         * UIProcess/API/Cocoa/WKViewPrivate.h:
2945         * UIProcess/API/mac/WKView.mm:
2946         (-[WKView _inspectorAttachmentView]): Added.
2947         (-[WKView _setInspectorAttachmentView:]): Added.
2948
2949         * UIProcess/WebInspectorProxy.cpp:
2950         (WebKit::WebInspectorProxy::createInspectorPage):
2951         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
2952         Use platformCanAttach as a final check incase there is a different
2953         attachment view that the platform knows about.
2954
2955         * UIProcess/WebInspectorProxy.h:
2956         (WebKit::WebInspectorProxy::attachmentSide): Added.
2957         (WebKit::WebInspectorProxy::platformCanAttach): Added.
2958
2959         * UIProcess/mac/WebInspectorProxyMac.mm:
2960         (WebKit::WebInspectorProxy::attachmentViewDidChange): Added.
2961         (WebKit::WebInspectorProxy::closeTimerFired):
2962         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2963         (WebKit::WebInspectorProxy::platformCanAttach):
2964         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
2965         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
2966         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
2967         (WebKit::WebInspectorProxy::platformAttach):
2968         (WebKit::WebInspectorProxy::platformDetach):
2969         Use the _inspectorAttachmentView and change how the frame change notification
2970         is observed and follow the attachment view as it changes.
2971
2972 2015-03-23  Tim Horton  <timothy_horton@apple.com>
2973
2974         Images shared to photos via action menu are padded with zeroes at the end
2975         https://bugs.webkit.org/show_bug.cgi?id=142985
2976
2977         Reviewed by Anders Carlsson.
2978
2979         * Shared/mac/ActionMenuHitTestResult.h:
2980         * Shared/mac/ActionMenuHitTestResult.mm:
2981         (WebKit::ActionMenuHitTestResult::encode):
2982         (WebKit::ActionMenuHitTestResult::decode):
2983         * WebProcess/WebPage/mac/WebPageMac.mm:
2984         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2985         Send the size of the image separately from the SharedMemory.
2986         The SharedMemory's size can be rounded up, so we need to keep the original
2987         size around in order to write the data to disk.
2988
2989         * UIProcess/mac/WKActionMenuController.mm:
2990         (-[WKActionMenuController _hitTestResultImage]):
2991         (-[WKActionMenuController _addImageToPhotos:]):
2992         Use the image size instead of the SharedMemory size.
2993
2994 2015-03-23  Enrica Casucci  <enrica@apple.com>
2995
2996         [iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect.
2997         https://bugs.webkit.org/show_bug.cgi?id=142913
2998         rdar://problem/16400033
2999
3000         Reviewed by Sam Weinig.
3001
3002         When looking for the best candidate range at the given position,
3003         we should skip nodes that don't have a renderer.
3004         This is a speculative fix.
3005
3006         * WebProcess/WebPage/ios/WebPageIOS.mm:
3007         (WebKit::WebPage::rangeForWebSelectionAtPosition):
3008
3009 2015-03-23  Alexey Proskuryakov  <ap@apple.com>
3010
3011         REGRESSION (Yosemite): WKView visibility notifications are messed up
3012         https://bugs.webkit.org/show_bug.cgi?id=142945
3013
3014         Reviewed by Tim Horton.
3015
3016         As these notifications cannot be used by NSView subclasses, create a separate
3017         object for observing them.
3018
3019         * UIProcess/API/mac/WKView.mm:
3020         (-[WKWindowVisibilityObserver initWithView:]):
3021         (-[WKWindowVisibilityObserver startObserving:]):
3022         (-[WKWindowVisibilityObserver stopObserving:]):
3023         (-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]):
3024         (-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]):
3025         (-[WKView addWindowObserversForWindow:]):
3026         (-[WKView removeWindowObservers]): Also, don't try to remove NSWindowWillOrderOffScreenNotification,
3027         which we never start to observe.
3028         (-[WKView initWithFrame:processPool:configuration:webView:]):
3029         * UIProcess/API/mac/WKViewInternal.h:
3030
3031 2015-03-23  Anders Carlsson  <andersca@apple.com>
3032
3033         Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
3034         https://bugs.webkit.org/show_bug.cgi?id=133692
3035         rdar://problem/17255947
3036
3037         Reviewed by Alexey Proskuryakov.
3038
3039         Add plug-in destruction protectors around message receiver code that can call out to NPObjects or JavaScript
3040         where we need the plug-in to stay around after the call.
3041
3042         * Shared/Plugins/NPObjectMessageReceiver.cpp:
3043         (WebKit::NPObjectMessageReceiver::invoke):
3044         (WebKit::NPObjectMessageReceiver::invokeDefault):
3045         (WebKit::NPObjectMessageReceiver::getProperty):
3046         (WebKit::NPObjectMessageReceiver::setProperty):
3047         (WebKit::NPObjectMessageReceiver::construct):
3048
3049 2015-03-23  Anders Carlsson  <andersca@apple.com>
3050
3051         Put the WK_NULLABLE_SPECIFIER in the right place for block parameters
3052         https://bugs.webkit.org/show_bug.cgi?id=142975
3053         rdar://problem/19863930
3054
3055         Reviewed by Dan Bernstein.
3056
3057         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
3058         * UIProcess/API/Cocoa/WKUIDelegate.h:
3059         * UIProcess/API/Cocoa/WKWebView.h:
3060
3061 2015-03-23  Tim Horton  <timothy_horton@apple.com>
3062
3063         Add a share item to the link action menu
3064         https://bugs.webkit.org/show_bug.cgi?id=142961
3065         <rdar://problem/19198374>
3066
3067         Reviewed by Beth Dakin.
3068
3069         * UIProcess/mac/WKActionMenuController.mm:
3070         (-[WKActionMenuController _hitLinkURL]):
3071         Factor out _hitLinkURL from various places.
3072
3073         (-[WKActionMenuController _openURLFromActionMenu:]):
3074         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
3075         (-[WKActionMenuController _defaultMenuItemsForVideo]):
3076         (-[WKActionMenuController _defaultMenuItemsForImage]):
3077         (-[WKActionMenuController _createActionMenuItemForTag:]):
3078         (-[WKActionMenuController _createShareActionMenuItemForTag:withItems:]):
3079         Adopt -[NSMenuItem standardShareMenuItemWithItems].
3080         All of the null-checking is unnecessary as it's impossible to enter
3081         these functions with a null image/etc.
3082
3083         (-[WKActionMenuController _defaultMenuItemsForLink]):
3084         * Shared/API/c/WKActionMenuItemTypes.h:
3085         Add a 'Share' item to the link menu.
3086
3087 2015-03-23  Zan Dobersek  <zdobersek@igalia.com>
3088
3089         [GTK] Use std::abs() in ClickCounter::currentClickCountForGdkButtonEvent()
3090         https://bugs.webkit.org/show_bug.cgi?id=142964
3091
3092         Reviewed by Carlos Garcia Campos.
3093
3094         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3095         (ClickCounter::currentClickCountForGdkButtonEvent): Use the STL's std::abs()
3096         instead of C's abs(). The templated nature of std::abs() ensures the proper
3097         computation that matches the types of the passed-in values, and shuts down
3098         a warning when compiling with Clang.
3099
3100 2015-03-23  Zan Dobersek  <zdobersek@igalia.com>
3101
3102         [GTK][WK2] webkitBackForwardListChanged() should operate on a Vector reference
3103         https://bugs.webkit.org/show_bug.cgi?id=142963
3104
3105         Reviewed by Carlos Garcia Campos.
3106
3107         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
3108         (webkitBackForwardListChanged): This function only reads from the passed-in
3109         Vector of removed items, so only a const lvalue reference to the Vector
3110         is needed.
3111         * UIProcess/API/gtk/WebKitBackForwardListPrivate.h:
3112
3113 2015-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3114
3115         [GTK] Add a configure option to build without Redirected XComposite Window
3116         https://bugs.webkit.org/show_bug.cgi?id=142865
3117
3118         Reviewed by Žan Doberšek.
3119
3120         Use USE(REDIRECTED_XCOMPOSITE_WINDOW) instead of
3121         USE(TEXTURE_MAPPER_GL) && PLATFORM(X11).
3122
3123         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3124         (webkitWebViewBaseRealize): Use the XID of the WebKitWebView
3125         window as native surface handle when REDIRECTED_XCOMPOSITE_WINDOW
3126         is disabled.
3127         (webkitWebViewRenderAcceleratedCompositingResults):
3128         (resizeWebKitWebViewBaseFromAllocation):
3129         (webkitWebViewBaseEnterAcceleratedCompositingMode):
3130         (webkitWebViewBaseExitAcceleratedCompositingMode):
3131         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
3132         * UIProcess/gtk/RedirectedXCompositeWindow.h:
3133
3134 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
3135
3136         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
3137         https://bugs.webkit.org/show_bug.cgi?id=142940
3138
3139         Reviewed by Sam Weinig.
3140
3141         * WebProcess/WebPage/mac/WebPageMac.mm:
3142         (WebKit::WebPage::playbackTargetSelected): Argument to didChoosePlaybackTarget is now const.
3143
3144 2015-03-22  Anders Carlsson  <andersca@apple.com>
3145
3146         _WKWebsiteDataStore should clear WebSQL databases
3147         https://bugs.webkit.org/show_bug.cgi?id=142947
3148         rdar://problem/20242174
3149
3150         Reviewed by Sam Weinig.
3151
3152         * Shared/WebsiteData/WebsiteDataTypes.h:
3153         Add WebsiteDataTypeWebSQLDatabases.
3154
3155         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3156         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3157         Initialize configuration.webSQLDatabaseDirectory.
3158
3159         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
3160         Add WKWebsiteDataTypeWebSQLDatabases.
3161
3162         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
3163         (dataTypesToString):
3164         Handle WKWebsiteDataTypeWebSQLDatabases.
3165
3166         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
3167         (WebKit::toWebsiteDataTypes):
3168         (WebKit::toWKWebsiteDataTypes):
3169         Handle WKWebsiteDataTypeWebSQLDatabases and WebsiteDataTypes::WebsiteDataTypeWebSQLDatabases.
3170
3171         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3172         (WebKit::WebsiteDataStore::WebsiteDataStore):
3173         Initialize m_webSQLDatabaseDirectory and add a queue member variable.
3174
3175         (WebKit::WebsiteDataStore::fetchData):
3176         Fetch database origins.
3177     
3178         (WebKit::WebsiteDataStore::removeData):
3179         Remove databases.
3180
3181         * UIProcess/WebsiteData/WebsiteDataStore.h:
3182         Add new members.
3183
3184 2015-03-22  Dan Bernstein  <mitz@apple.com>
3185
3186         [iOS] Expose WebPageProxy::setInitialFocus as SPI
3187         https://bugs.webkit.org/show_bug.cgi?id=142951
3188
3189         Reviewed by Anders Carlsson.
3190
3191         * UIProcess/API/Cocoa/WKWebView.mm:
3192         (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): New SPI.
3193         Just calls through to WKWebContentView, but allows a nil completion handler.
3194         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3195
3196         * UIProcess/API/mac/WKView.mm:
3197         (-[WKView becomeFirstResponder]): Pass an empty lambda for the new callback parameter to
3198         WebPageProxy::setInitialFocus.
3199
3200         * UIProcess/WebPageProxy.cpp:
3201         (WebKit::WebPageProxy::setInitialFocus): Added a void callback parameter and made sure to
3202         call it.
3203         * UIProcess/WebPageProxy.h:
3204
3205         * UIProcess/ios/WKContentViewInteraction.h:
3206         * UIProcess/ios/WKContentViewInteraction.mm:
3207         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
3208         Added. Calls WebPageProxy::setInitialFocus, and once that completes, checks if anything was
3209         focused and if so, becomes first responder, then calls the completion handler.
3210
3211         * WebProcess/WebPage/WebPage.cpp:
3212         (WebKit::WebPage::setInitialFocus): Added a callbackID parameter, and made sure to send the
3213         callback message. Added a temporary change of m_userIsInteracting to true, so that the UI
3214         process won’t ignore any StartAssistingNode message resulting from the focus change.
3215         * WebProcess/WebPage/WebPage.h:
3216
3217         * WebProcess/WebPage/WebPage.messages.in: Added a callbackID parameter to SetInitialFocus.
3218
3219 2015-03-21  Dean Jackson  <dino@apple.com>
3220
3221         Remove the prefix for CSS Transforms
3222         https://bugs.webkit.org/show_bug.cgi?id=142927
3223         <rdar://problem/11568151>
3224
3225         Reviewed by Simon Fraser.
3226
3227         Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.
3228
3229         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
3230         (IPC::ArgumentCoder<TextureMapperAnimation>::encode):
3231
3232 2015-03-21  Csaba Osztrogonác  <ossy@webkit.org>
3233
3234         [EFL][GTK] Make WebKit2's generate-forwarding-headers.pl less verbose
3235         https://bugs.webkit.org/show_bug.cgi?id=142908
3236
3237         Reviewed by Žan Doberšek.
3238
3239         * Scripts/generate-forwarding-headers.pl:
3240         (createForwardingHeadersForFramework):
3241
3242 2015-03-21  Commit Queue  <commit-queue@webkit.org>
3243
3244         Unreviewed, rolling out r181824.
3245         https://bugs.webkit.org/show_bug.cgi?id=142935
3246
3247         Broke Windows build (Requested by ap on #webkit).
3248
3249         Reverted changeset:
3250
3251         "Remove the prefix for CSS Transforms"
3252         https://bugs.webkit.org/show_bug.cgi?id=142927
3253         http://trac.webkit.org/changeset/181824
3254
3255 2015-03-20  Dean Jackson  <dino@apple.com>
3256
3257         Remove the prefix for CSS Transforms
3258         https://bugs.webkit.org/show_bug.cgi?id=142927
3259         <rdar://problem/11568151>
3260
3261         Reviewed by Simon Fraser.
3262
3263         Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.
3264
3265         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
3266         (IPC::ArgumentCoder<TextureMapperAnimation>::encode):
3267
3268 2015-03-20  Chris Dumez  <cdumez@apple.com>
3269
3270         [WK2] NetworkCache retrievals sometimes fail on browser startup
3271         https://bugs.webkit.org/show_bug.cgi?id=142925
3272         <rdar://problem/20245368>
3273
3274         Reviewed by Antti Koivisto.
3275
3276         NetworkCache retrievals sometimes fail on browser startup for resources
3277         that are actually cached. The reason is that we are using a bloom filter
3278         for performance reasons to avoid unnecessary disk I/O and this bloom
3279         filter is populated on start up in a background thread by traversing the
3280         cache files on disk. However, when restoring the tabs on start-up we
3281         sometimes query this bloom filter before it is completely populated and
3282         we thus fail to retrieve cached entries because we think they don't
3283         exist and don't check the disk.
3284
3285         This patch adds an "isPopulatingContentsFilter" flag that is turned ON
3286         on start up while we are populating the bloon filter. We then bypass
3287         the bloom filter and send queries directly to disk on start up if this
3288         flag is ON.
3289
3290         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3291         (WebKit::NetworkCache::Storage::initialize):
3292         (WebKit::NetworkCache::Storage::retrieve):
3293         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
3294         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
3295         * NetworkProcess/cache/NetworkCacheStorage.h:
3296         (WebKit::NetworkCache::Storage::cacheMayContain):
3297
3298 2015-03-20  Chris Dumez  <cdumez@apple.com>
3299
3300         [WK2] Allow stale content when restoring the browser's session state
3301         https://bugs.webkit.org/show_bug.cgi?id=142916
3302         <rdar://problem/20243493>
3303
3304         Reviewed by Darin Adler.
3305
3306         Allow stale content when restoring the browser's session state
3307         (restoring all tabs from previous session), e.g.
3308         - Via History > Reopen All windows from previous session on Safari
3309         - Happens on startup for MobileSafari
3310
3311         I have verified that using "Open in tabs" on a bookmarks folder
3312         still does fresh loads (rdar://problem/8131355) as it is not using
3313         the restoreFromSessionState() code path.
3314
3315         * UIProcess/WebPageProxy.cpp:
3316         (WebKit::WebPageProxy::reattachToWebProcessForReload):
3317         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3318         (WebKit::WebPageProxy::goForward):
3319         (WebKit::WebPageProxy::goBack):
3320         (WebKit::WebPageProxy::goToBackForwardItem):
3321         (WebKit::WebPageProxy::restoreFromSessionState):
3322         * UIProcess/WebPageProxy.h:
3323         * WebProcess/WebPage/WebPage.cpp:
3324         (WebKit::WebPage::goToBackForwardItem):
3325         * WebProcess/WebPage/WebPage.h:
3326         * WebProcess/WebPage/WebPage.messages.in:
3327
3328 2015-03-20  Beth Dakin  <bdakin@apple.com>
3329
3330         [Immediate Actions] Should re-enable immediate actions for iBooks
3331         https://bugs.webkit.org/show_bug.cgi?id=142915
3332         -and corresponding-
3333         rdar://problem/19585689
3334
3335         Reviewed by Tim Horton.
3336
3337         * UIProcess/API/mac/WKView.mm:
3338         (-[WKView initWithFrame:processPool:configuration:webView:]):
3339
3340 2015-03-20  Alex Christensen  <achristensen@webkit.org>
3341
3342         Progress towards CMake on Mac.
3343         https://bugs.webkit.org/show_bug.cgi?id=136003
3344
3345         Reviewed by Chris Dumez.
3346
3347         * PlatformMac.cmake:
3348         Add include directories and forwarding headers.
3349         * Shared/API/APIObject.h:
3350         (API::ObjectImpl::operator new):
3351         * UIProcess/DrawingAreaProxy.h:
3352         (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange):
3353         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3354         Fix some unused parameter warnings.
3355
3356 2015-03-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3357
3358         [CMake] Remove duplicated cmake function calls in WebKit2/CMakeLists.txt
3359         https://bugs.webkit.org/show_bug.cgi?id=142901
3360
3361         Reviewed by Csaba Osztrogonác.
3362
3363         add_depencencies(), install() can support multiple targets or location.
3364         We don't need to call it twice.
3365
3366         * CMakeLists.txt: Additionaly move -DBUILDING_WEBKIT to PlatformGTK.cmake,
3367         because it is only used by GTK port.
3368
3369 2015-03-20  Zan Dobersek  <zdobersek@igalia.com>
3370
3371         [GTK] Disable accelerated compositing on Wayland
3372         https://bugs.webkit.org/show_bug.cgi?id=142877
3373
3374         Reviewed by Carlos Garcia Campos.
3375
3376         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3377         (webkitWebViewBaseCreateWebPage): As was done in the past, we should disable
3378         accelerated compositing on Wayland until the proper support for it lands.
3379
3380 2015-03-19  Andy Estes  <aestes@apple.com>
3381
3382         [Content Filtering] Add tests for unblock requests
3383         https://bugs.webkit.org/show_bug.cgi?id=142900
3384
3385         Reviewed by Andreas Kling.
3386
3387         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3388         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::contentFilterDidBlockLoad.
3389         * UIProcess/WebFrameProxy.cpp:
3390         (WebKit::WebFrameProxy::didStartProvisionalLoad): Assigned a default-constructed ContentFilterUnblockHandler instead of calling clear().
3391         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Renamed from contentFilterDidHandleNavigationAction.
3392         Updated to use ContentFilterUnblockHandler's new API.
3393         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Deleted.
3394         * UIProcess/WebFrameProxy.h:
3395         (WebKit::WebFrameProxy::contentFilterDidBlockLoad): Renamed from setContentFilterUnblockHandler.
3396         (WebKit::WebFrameProxy::setContentFilterUnblockHandler): Deleted.
3397         * UIProcess/WebPageProxy.cpp:
3398         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Called WebFrameProxy::didHandleContentFilterUnblockNavigation.
3399         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3400         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): If the unblock handler needs the UI process,
3401         send WebPageProxy::ContentFilterDidBlockLoadForFrame. Oterwise, call PolicyChecker::setContentFilterUnblockHandler.
3402
3403 2015-03-20  Zan Dobersek  <zdobersek@igalia.com>
3404
3405         [GTK] Properly guard X11-specific code in BackingStore::createBackend()
3406         https://bugs.webkit.org/show_bug.cgi?id=142875
3407
3408         Reviewed by Martin Robinson.
3409
3410         * UIProcess/cairo/BackingStoreCairo.cpp:
3411         (WebKit::BackingStore::createBackend): Guard the GTK- and X11-specific
3412         bit of code with PLATFORM(GTK) and PLATFORM(X11). Testing GDK_WINDOWING_X11
3413         ensures that the GTK+ dependency has X11 support, but does not ensure
3414         that WebKitGTK+ has been configured to build for X11 environments (which
3415         is what PLATFORM(X11) ensures).
3416
3417 2015-03-19  Chris Dumez  <cdumez@apple.com>
3418
3419         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
3420         https://bugs.webkit.org/show_bug.cgi?id=142893
3421         <rdar://problem/19633737>
3422         <rdar://problem/19869257>
3423
3424         Reviewed by Antti Koivisto.
3425
3426         Allow stale content when restoring a killed / crashed WebProcess
3427         (similarly to a history navigation). This is actually what was intended
3428         as we call WebPage::goToBackForwardItem() in this case, which uses
3429         IndexedBackForward load type. However, this value was then ignored in
3430         FrameLoader::loadDifferentDocumentItem().
3431
3432         This patch gets rid of the special casing in
3433         FrameLoader::loadDifferentDocumentItem() and makes it clear at call
3434         sites when calling goToBackForwardItem() if we should allow stale
3435         content or not. If goToBackForwardItem() is called with the
3436         allowStaleContent flag off, we'll keep using the IndexedBackForward
3437         frame load type. However, if the flag is on, we'll use the Standard
3438         frame load type and do a fresh load.
3439
3440         * UIProcess/WebPageProxy.cpp:
3441         (WebKit::WebPageProxy::reattachToWebProcessForReload):
3442         Set allowStaleContent flag to true as we want to allow stale content
3443         when reloading a WebProcess after it crashed or was killed (behavior
3444         change).
3445
3446         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3447         Add allowStaleContent parameter so that call sites can decide which
3448         policy to use.
3449
3450         (WebKit::WebPageProxy::goForward):
3451         (WebKit::WebPageProxy::goBack):
3452         Set allowStaleContent flag to true as this is our policy for history
3453         navigations.
3454
3455         (WebKit::WebPageProxy::goToBackForwardItem):
3456         Add allowStaleContent parameter so that the call site can let us know
3457         what to do. This is useful as this is called not only for indexed
3458         back / forward navigations (allowing stale content) but also for
3459         restoring session state (forbidding state content:
3460         <rdar://problem/8131355>).
3461
3462         (WebKit::WebPageProxy::restoreFromSessionState):
3463         Call goToBackForwardItem() with allowStaleContent flag set to false
3464         as users expect fresh contents in this case. This method is called
3465         when:
3466         - Tabs are restored on Safari / MobileSafari startup
3467         - Tabs are restored via "History > Reopen All windows from last session"
3468
3469         * UIProcess/WebPageProxy.h:
3470         * WebProcess/WebPage/WebPage.cpp:
3471         (WebKit::WebPage::goToBackForwardItem):
3472         Add allowStaleContent parameter and use "Standard" frame load type
3473         instead of "IndexedBackForward" if it is false. This is needed as
3474         "IndexedBackForward" frame load type allows using stale content.
3475
3476         * WebProcess/WebPage/WebPage.h:
3477         * WebProcess/WebPage/WebPage.messages.in:
3478         Add allowStaleContent flag to GoToBackForwardItem message.
3479
3480 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
3481
3482         [Mac] Move MediaPlaybackTargetPicker
3483         https://bugs.webkit.org/show_bug.cgi?id=142889
3484
3485         Move WebMediaPlaybackTargetPickerProxy to WebCore so it can be used by
3486         both WK2 and WK1.