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