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