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