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