0773a4e25a14bb235af136f17ff5ba4cf49fa477
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-04-16  Brady Eidson  <beidson@apple.com>
2
3         Compiling a content extension fails when user's home directory is on a different volume from /var/tmp.
4         https://bugs.webkit.org/show_bug.cgi?id=143834
5
6         Reviewed by Anders Carlsson.
7
8         * UIProcess/API/APIUserContentExtensionStore.cpp:
9         (API::compiledToFile): Use moveFile() instead of renameFile()
10
11 2015-04-16  Anders Carlsson  <andersca@apple.com>
12
13         Deprecate _WKWebsiteDataStore in favor of WKWebsiteDataStore
14         https://bugs.webkit.org/show_bug.cgi?id=143844
15
16         Reviewed by Dan Bernstein.
17
18         * Shared/API/Cocoa/WKFoundation.h:
19         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
20         (-[WKWebViewConfiguration _validate]):
21         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
22         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
23         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
24         * mac/postprocess-framework-headers.sh:
25
26 2015-04-16  Alex Christensen  <achristensen@webkit.org>
27
28         Removed unused WKUserContentFilterRef.
29         https://bugs.webkit.org/show_bug.cgi?id=143852
30
31         Reviewed by Sam Weinig.
32
33         * Shared/WebCompiledContentExtension.cpp:
34         (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient): Deleted.
35         (WebKit::LegacyContentExtensionCompilationClient::writeBytecode): Deleted.
36         (WebKit::LegacyContentExtensionCompilationClient::writeActions): Deleted.
37         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): Deleted.
38         * Shared/WebCompiledContentExtension.h:
39         * UIProcess/API/C/WKUserContentFilterRef.cpp: Removed.
40         * UIProcess/API/C/WKUserContentFilterRef.h: Removed.
41         * UIProcess/API/C/WebKit2_C.h:
42         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
43         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
44         (-[_WKUserContentFilter initWithName:serializedRules:]): Deleted.
45         * WebKit2.xcodeproj/project.pbxproj:
46
47 2015-04-16  Beth Dakin  <bdakin@apple.com>
48
49         Rubber-stamped by Tim Horton.
50
51         Fixing a small mistake in http://trac.webkit.org/changeset/182912 which should 
52         make sure to use the most up-to-date pressure information when setting the force 
53         on a WebMouseEvent.
54
55         * Shared/mac/WebEventFactory.mm:
56         (WebKit::WebEventFactory::createWebMouseEvent):
57
58 2015-04-13  Jer Noble  <jer.noble@apple.com>
59
60         [iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents.
61         https://bugs.webkit.org/show_bug.cgi?id=143680
62
63         Reviewed by Simon Fraser.
64
65         The original assumption of WebVideoFullscreenManager and -Proxy was that the two classes would represent a
66         single video element and its full screen state. With multiple animations in and out of fullscreen combined with
67         multiple fullscreen modes, this assumption no longer holds true.
68
69         Rather than having a WebVideoFullscreenManager which /isa/ WebVideoFullscreenModelVideoElement, the manager now
70         /hasa/ WebVideoFullscreenModelVideoElement (or has many such models). Ditto for WebVideoFullscreenManager and
71         WebVideoFullscreenInterfaceAVKit. The WebVideoFullscreenInterfaceAVKit still needs a WebVideoFullscreenModel to
72         communicate with, so a new wrapper class is used for that purpose, WebVideoFullscreenModelContext. Ditto for
73         WebVideoFullscreenModelVideoElement and the new class WebVideoFullscreenInterfaceContext. These context classes
74         are paired and share a contextId, allowing the manager and its proxy to route messages between the UIProcess's
75         WebVideoFullscreenInterfaceAVKit to-and-from the WebProcess's WebVideoFullscreenModelVideoElement.
76
77         Both the WebVideoFullscreenModelContext and the WebVideoFullscreenInterfaceContext take a back-pointer to their
78         manager or manager proxy, and each method on the context simply calls the matching method on the manager and
79         passes its contextId as a parameter.
80
81         Both the WebVideoFullscreenManager and the WebVideoFullscreenManagerProxy pass that contextId in each of their
82         cross-process messages.
83
84         On the other side, the manager and proxy also have a map between contextIds and their matching
85         WebVideoFullscreenModelVideoElement (in the case of WebVideoFullscreenManager) or
86         WebVideoFullscreenInterfaceAVKit (in the case of WebVideoFullscreenManagerProxy).
87
88         While this change is large by LoC, it is almost entirely boilerplate.  The new and interesting pieces are these:
89
90         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
91         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): No longer a WebVideoFullscreenInterfaceAVKit.
92         (WebKit::WebVideoFullscreenManagerProxy::invalidate): Walk through the models and interfaces, invalidating each.
93         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface): Added. Return a new model and interface tuple.
94         (WebKit::WebVideoFullscreenManagerProxy::ensureModelAndInterface): Added. Lazily create, and add to the m_contextMap
95             a new model and interface object.
96         (WebKit::WebVideoFullscreenManagerProxy::ensureModel): Return the model half of ensureModelAndInterface().
97         (WebKit::WebVideoFullscreenManagerProxy::ensureInterface): Return the interface half of ensureModelAndInterface().
98         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Walk through the outstanding interface objects, and if 
99             any have a fullscreen mode which matches the about-to-be-fullscreen interface, request that that other interface
100             exit fullscreen.
101         * WebProcess/ios/WebVideoFullscreenManager.mm:
102         (WebKit::nextContextId): Static, incrementing counter used as a contextId source.
103         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager): No longer a WebVideoFullscreenModelVideoElement.
104         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Walk through the models and interfaces, invalidating each.
105         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Added. Return a new model and interface tuple.
106         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface):  Added. Lazily create, and add to the m_contextMap
107             a new model and interface object.
108         (WebKit::WebVideoFullscreenManager::ensureModel): Return the model half of ensureModelAndInterface().
109         (WebKit::WebVideoFullscreenManager::ensureInterface): Return the interface half of ensureModelAndInterface().
110
111         New classes and methods which just forward on to their owning objects:
112
113         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
114         (WebKit::WebVideoFullscreenModelContext::create):
115         (WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
116         (WebKit::WebVideoFullscreenModelContext::invalidate):
117         (WebKit::WebVideoFullscreenModelContext::layerHost):
118         (WebKit::WebVideoFullscreenModelContext::setLayerHost):
119         (WebKit::WebVideoFullscreenModelContext::setInitialVideoLayerFrame):
120         (WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
121         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
122         (WebKit::WebVideoFullscreenModelContext::play):
123         (WebKit::WebVideoFullscreenModelContext::pause):
124         (WebKit::WebVideoFullscreenModelContext::togglePlayState):
125         (WebKit::WebVideoFullscreenModelContext::beginScrubbing):
126         (WebKit::WebVideoFullscreenModelContext::endScrubbing):
127         (WebKit::WebVideoFullscreenModelContext::seekToTime):
128         (WebKit::WebVideoFullscreenModelContext::fastSeek):
129         (WebKit::WebVideoFullscreenModelContext::beginScanningForward):
130         (WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
131         (WebKit::WebVideoFullscreenModelContext::endScanning):
132         (WebKit::WebVideoFullscreenModelContext::requestExitFullscreen):
133         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame):
134         (WebKit::WebVideoFullscreenModelContext::videoLayerFrame):
135         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity):
136         (WebKit::WebVideoFullscreenModelContext::videoLayerGravity):
137         (WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
138         (WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
139         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged):
140         (WebKit::WebVideoFullscreenModelContext::didSetupFullscreen):
141         (WebKit::WebVideoFullscreenModelContext::didEnterFullscreen):
142         (WebKit::WebVideoFullscreenModelContext::didExitFullscreen):
143         (WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen):
144         (WebKit::WebVideoFullscreenModelContext::fullscreenMayReturnToInline):
145         * WebProcess/ios/WebVideoFullscreenManager.h:
146         (WebKit::WebVideoFullscreenInterfaceContext::create):
147         (WebKit::WebVideoFullscreenInterfaceContext::invalidate):
148         (WebKit::WebVideoFullscreenInterfaceContext::layerHostingContext):
149         (WebKit::WebVideoFullscreenInterfaceContext::isAnimating):
150         (WebKit::WebVideoFullscreenInterfaceContext::setIsAnimating):
151         (WebKit::WebVideoFullscreenInterfaceContext::targetIsFullscreen):
152         (WebKit::WebVideoFullscreenInterfaceContext::setTargetIsFullscreen):
153         (WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode):
154         (WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode):
155         (WebKit::WebVideoFullscreenInterfaceContext::isFullscreen):
156         (WebKit::WebVideoFullscreenInterfaceContext::setIsFullscreen):
157         * WebProcess/ios/WebVideoFullscreenManager.mm:
158         (WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
159         (WebKit::WebVideoFullscreenInterfaceContext::~WebVideoFullscreenInterfaceContext):
160         (WebKit::WebVideoFullscreenInterfaceContext::setLayerHostingContext):
161         (WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
162         (WebKit::WebVideoFullscreenInterfaceContext::setDuration):
163         (WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
164         (WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
165         (WebKit::WebVideoFullscreenInterfaceContext::setRate):
166         (WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions):
167         (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
168         (WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
169         (WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
170         (WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
171         (WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):
172
173         Cross-process methods which now take a contextId parameter:
174
175         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
176         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
177         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
178         (WebKit::WebVideoFullscreenManagerProxy::resetMediaState):
179         (WebKit::WebVideoFullscreenManagerProxy::setCurrentTime):
180         (WebKit::WebVideoFullscreenManagerProxy::setBufferedTime):
181         (WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions):
182         (WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector):
183         (WebKit::WebVideoFullscreenManagerProxy::setCanPlayFastReverse):
184         (WebKit::WebVideoFullscreenManagerProxy::setAudioMediaSelectionOptions):
185         (WebKit::WebVideoFullscreenManagerProxy::setLegibleMediaSelectionOptions):
186         (WebKit::WebVideoFullscreenManagerProxy::setExternalPlaybackProperties):
187         (WebKit::WebVideoFullscreenManagerProxy::setDuration):
188         (WebKit::WebVideoFullscreenManagerProxy::setRate):
189         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen):
190         (WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen):
191         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline):
192         (WebKit::WebVideoFullscreenManagerProxy::play):
193         (WebKit::WebVideoFullscreenManagerProxy::pause):
194         (WebKit::WebVideoFullscreenManagerProxy::togglePlayState):
195         (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing):
196         (WebKit::WebVideoFullscreenManagerProxy::endScrubbing):
197         (WebKit::WebVideoFullscreenManagerProxy::seekToTime):
198         (WebKit::WebVideoFullscreenManagerProxy::fastSeek):
199         (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
200         (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
201         (WebKit::WebVideoFullscreenManagerProxy::endScanning):
202         (WebKit::WebVideoFullscreenManagerProxy::requestExitFullscreen):
203         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen):
204         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen):
205         (WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen):
206         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
207         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
208         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity):
209         (WebKit::WebVideoFullscreenManagerProxy::selectAudioMediaOption):
210         (WebKit::WebVideoFullscreenManagerProxy::selectLegibleMediaOption):
211         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged):
212         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
213         (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Deleted.
214         (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Deleted.
215         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
216         * WebProcess/ios/WebVideoFullscreenManager.mm:
217         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
218         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
219         (WebKit::WebVideoFullscreenManager::resetMediaState):
220         (WebKit::WebVideoFullscreenManager::setDuration):
221         (WebKit::WebVideoFullscreenManager::setCurrentTime):
222         (WebKit::WebVideoFullscreenManager::setBufferedTime):
223         (WebKit::WebVideoFullscreenManager::setRate):
224         (WebKit::WebVideoFullscreenManager::setVideoDimensions):
225         (WebKit::WebVideoFullscreenManager::setSeekableRanges):
226         (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse):
227         (WebKit::WebVideoFullscreenManager::setAudioMediaSelectionOptions):
228         (WebKit::WebVideoFullscreenManager::setLegibleMediaSelectionOptions):
229         (WebKit::WebVideoFullscreenManager::setExternalPlayback):
230         (WebKit::WebVideoFullscreenManager::play):
231         (WebKit::WebVideoFullscreenManager::pause):
232         (WebKit::WebVideoFullscreenManager::togglePlayState):
233         (WebKit::WebVideoFullscreenManager::beginScrubbing):
234         (WebKit::WebVideoFullscreenManager::endScrubbing):
235         (WebKit::WebVideoFullscreenManager::seekToTime):
236         (WebKit::WebVideoFullscreenManager::fastSeek):
237         (WebKit::WebVideoFullscreenManager::beginScanningForward):
238         (WebKit::WebVideoFullscreenManager::beginScanningBackward):
239         (WebKit::WebVideoFullscreenManager::endScanning):
240         (WebKit::WebVideoFullscreenManager::requestExitFullscreen):
241         (WebKit::WebVideoFullscreenManager::selectAudioMediaOption):
242         (WebKit::WebVideoFullscreenManager::selectLegibleMediaOption):
243         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged):
244         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
245         (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
246         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
247         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
248         (WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum):
249         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
250         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
251         (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.
252
253 2015-04-16  Beth Dakin  <bdakin@apple.com>
254
255         Force mouse events should go through normal mouse event handling code paths
256         https://bugs.webkit.org/show_bug.cgi?id=143749
257         -and corresponding-
258         rdar://problem/20472895
259
260         Reviewed by Dean Jackson.
261
262         This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the 
263         NSEventTypePressures that is gets and sends those down to the web process.
264
265         Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an 
266         NSEventTypePressure, the new name makes it clear how the second parameter differs 
267         from the first.
268         * Shared/NativeWebMouseEvent.h:
269
270         New event types for the new types of events.
271         * Shared/WebEvent.h:
272         * Shared/WebEventConversion.cpp:
273         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
274         * Shared/mac/NativeWebMouseEventMac.mm:
275         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
276         * Shared/mac/WebEventFactory.h:
277
278         All of the square-peg, round-hole problems of massaging the NSEventTypePressures 
279         events into WebMouseEvents is taken care of here.
280         * Shared/mac/WebEventFactory.mm:
281         (WebKit::mouseButtonForEvent):
282         (WebKit::globalPointForEvent):
283         (WebKit::pointForEvent):
284         (WebKit::WebEventFactory::createWebMouseEvent):
285
286         Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent 
287         and handle it.
288         * UIProcess/API/mac/WKView.mm:
289         (-[WKView pressureChangeWithEvent:]):
290
291         Handle the new types.
292         * UIProcess/WebPageProxy.cpp:
293         (WebKit::WebPageProxy::didReceiveEvent):
294
295         Can delete inputDeviceForceDidChange since it’s no longer used.
296         (WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted.
297         * UIProcess/WebPageProxy.h:
298
299         Handle the new types of mouse events properly.
300         * WebProcess/WebPage/WebPage.cpp:
301         (WebKit::handleMouseEvent):
302
303         Delete inputDeviceForceDidChange() and m_lastForceStage.
304         * WebProcess/WebPage/WebPage.h:
305         * WebProcess/WebPage/WebPage.messages.in:
306         * WebProcess/WebPage/mac/WebPageMac.mm:
307         (WebKit::WebPage::inputDeviceForceDidChange): Deleted.
308
309         Handle new WebEvent types.
310         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
311
312 2015-04-16  Dan Bernstein  <mitz@apple.com>
313
314         <rdar://problem/20575744> Also include a definition of __NSd_{current deployment target} in WKFoundation.h.
315
316         Reviewed by Tim Horton.
317
318         * WebKit2.xcodeproj/project.pbxproj:
319
320 2015-04-16  Timothy Horton  <timothy_horton@apple.com>
321
322         Provide a mechanism through the legacy SPI to know when swipe gestures begin and end
323         https://bugs.webkit.org/show_bug.cgi?id=143740
324         <rdar://problem/20468540>
325
326         Reviewed by Dan Bernstein.
327
328         In the C SPI, add three WKPageLoaderClient callbacks for the three
329         navigation gesture events (did begin, will end, did end).
330
331         * UIProcess/API/C/WKPageLoaderClient.h:
332         Add the callbacks.
333
334         * UIProcess/API/APILoaderClient.h:
335         (API::LoaderClient::navigationGestureDidBegin):
336         (API::LoaderClient::navigationGestureWillEnd):
337         (API::LoaderClient::navigationGestureDidEnd):
338         * UIProcess/WebPageProxy.cpp:
339         (WebKit::WebPageProxy::navigationGestureDidBegin):
340         (WebKit::WebPageProxy::navigationGestureWillEnd):
341         (WebKit::WebPageProxy::navigationGestureDidEnd):
342         Dispatch navigation gesture events to the loader client as well as
343         (after a bounce through the PageClient) the navigation delegate.
344
345         * UIProcess/API/C/WKPage.cpp:
346         (WKPageSetPageLoaderClient):
347         Call the callbacks.
348
349         * UIProcess/mac/ViewGestureController.h:
350         * UIProcess/mac/ViewGestureControllerMac.mm:
351         (WebKit::ViewGestureController::trackSwipeGesture):
352         (WebKit::ViewGestureController::willEndSwipeGesture):
353         While we were already informing WebPageProxy of 'did begin' and 'did end'
354         navigation gesture events, we were missing 'will end'. Add it.
355
356 2015-04-16  Tim Horton  <timothy_horton@apple.com>
357
358         Dispatching multiple asynchronous animated resizes in parallel causes page scale to detach from reality
359         https://bugs.webkit.org/show_bug.cgi?id=143812
360         <rdar://problem/19866038>
361
362         Reviewed by Simon Fraser.
363
364         * Shared/VisibleContentRectUpdateInfo.h:
365         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
366         No cats in transaction (more of these below, too).
367
368         * UIProcess/WebPageProxy.h:
369         * UIProcess/WebPageProxy.messages.in:
370         * UIProcess/ios/WebPageProxyIOS.mm:
371         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
372         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
373         * WebProcess/WebPage/WebPage.h:
374         * WebProcess/WebPage/WebPage.messages.in:
375         * WebProcess/WebPage/ios/WebPageIOS.mm:
376         (WebKit::WebPage::handleTap):
377         (WebKit::WebPage::commitPotentialTap):
378         (WebKit::WebPage::dynamicViewportSizeUpdate):
379         Add an incrementing ID to dynamicViewportSizeUpdates. The UI process keeps
380         the current ID, and it is bounced through the Web process (dynamicViewportSizeUpdates)
381         back to the UI process (dynamicViewportUpdateChangedTarget). If we have
382         dispatched another dynamicViewportSizeUpdate in the interim, ignore
383         the intermediate target.
384
385 2015-04-16  Sungmann Cho  <sungmann.cho@navercorp.com>
386
387         Remove PluginController::isPluginVisible().
388         https://bugs.webkit.org/show_bug.cgi?id=143830
389
390         Reviewed by Darin Adler.
391
392         PluginController::isPluginVisible() was introduced by http://webkit.org/b/60285.
393         This method had been used only for WebKit2 on Windows, and no one uses it now.
394         So we can remove it.
395
396         No new tests, no behavior change.
397
398         * PluginProcess/PluginControllerProxy.cpp:
399         (WebKit::PluginControllerProxy::isPluginVisible): Deleted.
400         * PluginProcess/PluginControllerProxy.h:
401         * WebProcess/Plugins/PluginController.h:
402         * WebProcess/Plugins/PluginView.cpp:
403         (WebKit::PluginView::isPluginVisible): Deleted.
404         * WebProcess/Plugins/PluginView.h:
405
406 2015-04-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
407
408         [EFL] Disable a flaky ewk_context_network_process_model() API test
409         https://bugs.webkit.org/show_bug.cgi?id=143824
410
411         Reviewed by Csaba Osztrogonác.
412
413         ewk_context_network_process_model has been often failed. Though Bug 142967
414         was filed to fix this issue, it is not solved yet. To maintain EFL bot, this patch
415         disables it until fixing it.
416
417         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
418         (TEST_F):
419
420 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
421
422         [WK2] Forwarding headers generator shouldn't generate unnecessary headers
423         https://bugs.webkit.org/show_bug.cgi?id=143820
424
425         Reviewed by Carlos Garcia Campos.
426
427         * Scripts/generate-forwarding-headers.pl:
428         (collectNeededHeaders):
429
430 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
431
432         [GTK] Run forwarding headers generator unconditionally
433         https://bugs.webkit.org/show_bug.cgi?id=143819
434
435         Reviewed by Carlos Garcia Campos.
436
437         * PlatformGTK.cmake:
438
439 2015-04-15  Brent Fulgham  <bfulgham@apple.com>
440
441         [Mac] Disable "Save to Downloads" option for local files
442         https://bugs.webkit.org/show_bug.cgi?id=143794
443
444         Reviewed by Tim Horton.
445
446         Disable the Image and Media download options if the download
447         target is a local file. We can only download web resources;
448         anything else is actually a no-op.
449
450         * UIProcess/mac/WKActionMenuController.mm:
451         (-[WKActionMenuController _defaultMenuItemsForVideo]):
452         (-[WKActionMenuController _defaultMenuItemsForImage]):
453
454 2015-04-15  Anders Carlsson  <andersca@apple.com>
455
456         Make websiteDataStore on WKWebViewConfiguration public
457         https://bugs.webkit.org/show_bug.cgi?id=143810
458
459         Reviewed by Dan Bernstein.
460
461         * UIProcess/API/Cocoa/WKWebView.mm:
462         (-[WKWebView initWithFrame:configuration:]):
463         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
464         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
465         (-[WKWebViewConfiguration copyWithZone:]):
466         (-[WKWebViewConfiguration websiteDataStore]):
467         (-[WKWebViewConfiguration setWebsiteDataStore:]):
468         (-[WKWebViewConfiguration _websiteDataStore]):
469         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
470
471 2015-04-15  Anders Carlsson  <andersca@apple.com>
472
473         Make WKWebsiteDataStore public
474         https://bugs.webkit.org/show_bug.cgi?id=143805
475
476         Reviewed by Dan Bernstein.
477
478         Rename the current _WKWebsiteDataStore to WKWebsiteDataStore. Make init unavailable and tighten up the
479         types of the defaultDataStore and nonPersistentDataStore class methods.
480         
481         Add a new _WKWebsiteDataStore @interface and @implementation that derives from WKWebsiteDataStore
482         and forwards the defaultDataStore and nonPersistentDataStore method calls.
483
484         * Shared/API/Cocoa/WebKit.h:
485         * Shared/Cocoa/APIObject.mm:
486         (API::Object::newObject):
487         * UIProcess/API/Cocoa/WKWebView.mm:
488         (-[WKWebView initWithFrame:configuration:]):
489         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
490         (-[WKWebViewConfiguration _websiteDataStore]):
491         * UIProcess/API/Cocoa/WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
492         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.mm.
493         (+[WKWebsiteDataStore defaultDataStore]):
494         (+[WKWebsiteDataStore nonPersistentDataStore]):
495         (-[WKWebsiteDataStore dealloc]):
496         (-[WKWebsiteDataStore isNonPersistent]):
497         (toSystemClockTime):
498         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
499         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
500         (toWebsiteDataRecords):
501         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
502         (-[WKWebsiteDataStore _apiObject]):
503         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h.
504         (WebKit::wrapper):
505         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
506         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
507         (+[_WKWebsiteDataStore defaultDataStore]):
508         (+[_WKWebsiteDataStore nonPersistentDataStore]):
509         (-[_WKWebsiteDataStore dealloc]): Deleted.
510         (-[_WKWebsiteDataStore isNonPersistent]): Deleted.
511         (toWebsiteDataTypes): Deleted.
512         (toSystemClockTime): Deleted.
513         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): Deleted.
514         (-[_WKWebsiteDataStore _apiObject]): Deleted.
515         * WebKit2.xcodeproj/project.pbxproj:
516
517 2015-04-15  Timothy Horton  <timothy_horton@apple.com>
518
519         Custom CSS cursors do not use -webkit-image-set on retina displays
520         https://bugs.webkit.org/show_bug.cgi?id=120783
521
522         Reviewed by Beth Dakin.
523         Patch by Evan Wallace <evan.exe@gmail.com>.
524
525         Serialize the cursor image scale for SetCursor messages so custom
526         CSS cursors work with -webkit-image-set on retina displays.
527
528         * Shared/WebCoreArgumentCoders.cpp:
529         (CoreIPC::ArgumentCoder<Cursor>::encode):
530         (CoreIPC::ArgumentCoder<Cursor>::decode):
531
532 2015-04-15  Alex Christensen  <achristensen@webkit.org>
533
534         Progress towards CMake on Mac.
535         https://bugs.webkit.org/show_bug.cgi?id=143785
536
537         Reviewed by Csaba Osztrogonác.
538
539         * CMakeLists.txt:
540         * PlatformEfl.cmake:
541         * PlatformGTK.cmake:
542
543 2015-04-15  Anders Carlsson  <andersca@apple.com>
544
545         Make WKWebsiteDataRecord public
546         https://bugs.webkit.org/show_bug.cgi?id=143796
547
548         Reviewed by Dan Bernstein.
549
550         Rename _WKWebsiteDataRecord and associated files to WKWebsiteDataRecord and
551         add a new _WKWebsiteDataRecord.h with a class @interface declaration that just
552         inherits from WKWebsiteDataRecord. We don't need an @implementation since nobody is expected
553         to allocate _WKWebsiteDataRecord objects.
554
555         * Shared/API/Cocoa/WebKit.h:
556         * Shared/Cocoa/APIObject.mm:
557         (API::Object::newObject):
558         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.h.
559         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm.
560         (-[WKWebsiteDataRecord dealloc]):
561         (dataTypesToString):
562         (-[WKWebsiteDataRecord description]):
563         (-[WKWebsiteDataRecord displayName]):
564         (-[WKWebsiteDataRecord dataTypes]):
565         (-[WKWebsiteDataRecord _apiObject]):
566         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h.
567         (WebKit::wrapper):
568         (WebKit::toWebsiteDataTypes):
569         (WebKit::toWKWebsiteDataTypes):
570         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
571         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
572         (toWebsiteDataRecords):
573         * WebKit2.xcodeproj/project.pbxproj:
574
575 2015-04-13  Jer Noble  <jer.noble@apple.com>
576
577         [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
578         https://bugs.webkit.org/show_bug.cgi?id=143674
579
580         Reviewed by Darin Adler.
581
582         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
583         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Takes a reference.
584         (WebKit::WebChromeClient::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
585         (WebKit::WebChromeClient::exitVideoFullscreen): Deleted.
586         * WebProcess/WebCoreSupport/WebChromeClient.h:
587         * WebProcess/ios/WebVideoFullscreenManager.h:
588         * WebProcess/ios/WebVideoFullscreenManager.mm:
589         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto.
590         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
591         (WebKit::WebVideoFullscreenManager::didEnterFullscreen): Pass a reference.
592         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto.
593         (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.
594
595 2015-04-15  Antti Koivisto  <antti@apple.com>
596
597         Network Cache: Inline small body data to record file
598         https://bugs.webkit.org/show_bug.cgi?id=143783
599
600         Reviewed by Chris Dumez.
601
602         We currently save all body data as separate files. We can improve space efficiency and do less reads and writes
603         by inlining smaller resource bodies with the header.
604
605         * NetworkProcess/cache/NetworkCacheIOChannel.h:
606         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
607         (WebKit::NetworkCache::IOChannel::read):
608         (WebKit::NetworkCache::IOChannel::readSync):
609         (WebKit::NetworkCache::IOChannel::write):
610
611             Add WorkQueue argument to allow specifying which queue the result is submitted to.
612
613         * NetworkProcess/cache/NetworkCacheStorage.cpp:
614         (WebKit::NetworkCache::decodeRecordMetaData):
615
616             Add a boolean indicating whether the body is inlined.
617
618         (WebKit::NetworkCache::decodeRecordHeader):
619         (WebKit::NetworkCache::Storage::decodeRecord):
620         (WebKit::NetworkCache::encodeRecordMetaData):
621         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
622         (WebKit::NetworkCache::Storage::encodeRecord):
623         (WebKit::NetworkCache::Storage::dispatchReadOperation):
624
625             Read the record first, then read the blob if needed.
626             Submit the read operation directly from the main queue. Only thing we do is opening an IO channel
627             and that uses O_NONBLOCK.
628             Process the read results in the IO work queue where we now do the blob retrieval.
629
630         (WebKit::NetworkCache::shouldStoreBodyAsBlob):
631
632             The current threshold for saving a separate blob is 16KB.
633
634         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
635         (WebKit::NetworkCache::Storage::traverse):
636         (WebKit::NetworkCache::createRecord): Deleted.
637         (WebKit::NetworkCache::encodeRecordHeader): Deleted.
638         * NetworkProcess/cache/NetworkCacheStorage.h:
639
640 2015-04-15  Tim Horton  <timothy_horton@apple.com>
641
642         Non-local keyboards don't update scroll view parameters
643         https://bugs.webkit.org/show_bug.cgi?id=143791
644         <rdar://problem/18974020>
645
646         * Platform/spi/ios/UIKitSPI.h:
647         Fix the build.
648
649 2015-04-15  Tim Horton  <timothy_horton@apple.com>
650
651         Non-local keyboards don't update scroll view parameters
652         https://bugs.webkit.org/show_bug.cgi?id=143791
653         <rdar://problem/18974020>
654
655         Reviewed by Enrica Casucci.
656
657         * UIProcess/API/Cocoa/WKWebView.mm:
658         (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
659         (-[WKWebView _keyboardWillChangeFrame:]):
660         (-[WKWebView _keyboardWillShow:]):
661         Make sure that we update scroll view parameters (obscured insets, etc.)
662         if we have a non-local keyboard, in addition to the cases where we have an assisted node.
663
664 2015-04-15  Dan Bernstein  <mitz@apple.com>
665
666         <rdar://problem/20549298> No matching __NSi_ definition for postprocessed value of WK_{MAC,IOS}_TBA
667         https://bugs.webkit.org/show_bug.cgi?id=143786
668
669         Reviewed by Anders Carlsson.
670
671         * Shared/API/Cocoa/WKFoundation.h: Added a placeholder for the postprocessing script to
672         insert a definition of __NSi_* for the current deployment target. Import CoreFoundation.h so
673         that we can check if the macro is already defined.
674         * WebKit2.xcodeproj/project.pbxproj: In the Postprocess WKFoundation.h script build phase,
675         replace the placeholder with a definition of __NSi_{current deployment target} if not
676         already defined.
677
678 2015-04-14  Anders Carlsson  <andersca@apple.com>
679
680         Make creating send rights from shared memory more robust
681         https://bugs.webkit.org/show_bug.cgi?id=143730
682         rdar://problem/16595870
683
684         Reviewed by Darin Adler.
685
686         This cleans up creation of handles and send rights and also fixes a bug where it would be impossible
687         to send more than 128 MB of shared memory in a single object.
688
689         * Platform/SharedMemory.h:
690         * Platform/mac/SharedMemoryMac.cpp:
691         (WebKit::makeMemoryEntry):
692         New helper function that creates a memory entry send right. This uses MAP_MEM_VM_SHARE which ensures
693         that memory objects larger than 128 MB will be handled correctly.
694
695         (WebKit::SharedMemory::create):
696         Call makeMemoryEntry.
697
698         (WebKit::SharedMemory::createHandle):
699         Call createSendRight.
700
701         (WebKit::SharedMemory::createSendRight):
702         Call makeMemoryEntry and add the necessary assertions.
703
704 2015-04-15  Eric Carlson  <eric.carlson@apple.com>
705
706         Generalize "isPlayingAudio" to include other media characteristics
707         https://bugs.webkit.org/show_bug.cgi?id=143713
708
709         Reviewed by Jer Noble.
710
711         * UIProcess/API/C/WKPage.cpp:
712         (toGenericCallbackFunction): Scope CallbackBase.
713         (WKPageForceRepaint): Ditto.
714         (WKPageValidateCommand): Ditto.
715         (WKPageComputePagesForPrinting): Ditto.
716
717         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
718         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.
719
720         * UIProcess/API/mac/WKView.mm:
721         (-[WKView becomeFirstResponder]): Ditto.
722         (-[WKView updateFontPanelIfNeeded]): Ditto.
723         (-[WKView validateUserInterfaceItem:]): Ditto.
724         (-[WKView startSpeaking:]): Ditto.
725         (-[WKView selectedRangeWithCompletionHandler:]): Ditto.
726         (-[WKView markedRangeWithCompletionHandler:]): Ditto.
727         (-[WKView hasMarkedTextWithCompletionHandler:]): Ditto.
728         (-[WKView attributedSubstringForProposedRange:completionHandler:]): Ditto.
729         (-[WKView firstRectForCharacterRange:completionHandler:]): Ditto.
730         (-[WKView characterIndexForPoint:completionHandler:]): Ditto.
731
732         * UIProcess/WebPageProxy.cpp:
733         (WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange.
734         (WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted.
735         * UIProcess/WebPageProxy.h:
736
737         * UIProcess/WebPageProxy.messages.in:
738
739         * UIProcess/mac/WKFullScreenWindowController.mm:
740         (-[WKFullScreenWindowController dealloc]): Scope CallbackBase.
741         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
742
743         * UIProcess/mac/WKPrintingView.mm:
744         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
745         (-[WKPrintingView _askPageToComputePageRects]): Ditto.
746         (-[WKPrintingView _drawPreview:]): Ditto.
747
748         * WebProcess/Plugins/PluginView.cpp:
749         (WebKit::PluginView::setPluginIsPlayingAudio):
750         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
751         (WebKit::WebChromeClient::isPlayingMediaDidChange):
752         (WebKit::WebChromeClient::isPlayingAudioDidChange): Deleted.
753         * WebProcess/WebCoreSupport/WebChromeClient.h:
754
755 2015-04-15  Antti Koivisto  <antti@apple.com>
756
757         Network Cache: Add thread-safe accessors for storage paths
758         https://bugs.webkit.org/show_bug.cgi?id=143668
759
760         Reviewed by Darin Adler.
761
762         Less need to use StringCapture.
763
764         * NetworkProcess/cache/NetworkCache.cpp:
765         (WebKit::NetworkCache::Cache::dumpFilePath):
766         (WebKit::NetworkCache::Cache::storagePath):
767         * NetworkProcess/cache/NetworkCacheStorage.cpp:
768         (WebKit::NetworkCache::makeRecordsDirectoryPath):
769         (WebKit::NetworkCache::Storage::Storage):
770         (WebKit::NetworkCache::Storage::basePath):
771         (WebKit::NetworkCache::Storage::versionPath):
772         (WebKit::NetworkCache::Storage::recordsPath):
773         (WebKit::NetworkCache::Storage::synchronize):
774         (WebKit::NetworkCache::Storage::remove):
775         (WebKit::NetworkCache::Storage::dispatchReadOperation):
776         (WebKit::NetworkCache::Storage::finishReadOperation):
777         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
778         (WebKit::NetworkCache::Storage::traverse):
779         (WebKit::NetworkCache::Storage::clear):
780         (WebKit::NetworkCache::Storage::shrink):
781         (WebKit::NetworkCache::Storage::deleteOldVersions):
782         (WebKit::NetworkCache::makeRecordDirectoryPath): Deleted.
783         * NetworkProcess/cache/NetworkCacheStorage.h:
784         (WebKit::NetworkCache::Storage::baseDirectoryPath): Deleted.
785         (WebKit::NetworkCache::Storage::directoryPath): Deleted.
786
787 2015-04-14  Tim Horton  <timothy_horton@apple.com>
788
789         Update gesture swipe shadow style
790         https://bugs.webkit.org/show_bug.cgi?id=143616
791         <rdar://problem/19295843>
792
793         Reviewed by Darin Adler.
794
795         * UIProcess/mac/ViewGestureController.h:
796         * UIProcess/mac/ViewGestureControllerMac.mm:
797         (WebKit::ViewGestureController::beginSwipeGesture):
798         For the modern shadow style, use a layer stretched along the edge of the swiping content
799         with the newly added PNGs as the layer contents.
800
801         Add a dimming layer over the lower layer of content which fades in/out
802         during the swipe.
803
804         (WebKit::ViewGestureController::handleSwipeGesture):
805         Fade the dimming layer in and out during the entire swipe.
806         Fade the shadow layer out during the last few pixels of the swipe.
807
808         (WebKit::ViewGestureController::removeSwipeSnapshot):
809         Unparent the new layers.
810
811         * WebKit2.xcodeproj/project.pbxproj:
812         * Resources/SwipeShadow.png:
813         * Resources/SwipeShadow@2x.png:
814         Add the new resources.
815
816 2015-04-14  Brian Weinstein  <bweinstein@apple.com>
817
818         Add SPI to clear HSTS hosts added since a date.
819         https://bugs.webkit.org/show_bug.cgi?id=143726
820         and
821         rdar://problem/16664597
822
823         Reviewed by Anders Carlsson.
824
825         * UIProcess/API/C/mac/WKContextPrivateMac.h:
826         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
827         (WKContextResetHSTSHostsAddedAfterDate): Call into the WebProcessPool.
828         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
829         (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): Call CFNetwork SPI to clear HSTS hosts added
830         after the given date.
831         * UIProcess/WebProcessPool.h:
832
833 2015-04-14  Anders Carlsson  <andersca@apple.com>
834
835         More work on making the SharedMemory interface more sane
836         https://bugs.webkit.org/show_bug.cgi?id=143718
837
838         Reviewed by Andreas Kling.
839
840         Get rid of m_shouldVMDeallocateData. The idea is that shared memory created by calling
841         SharedMemory::allocate has a non-null m_data pointer, and a null m_port. Shared memory created
842         by calling SharedMemory::create with a pointer and a length has a non-null port but a null m_data
843         since the data can be unmapped by the caller and we don't want to hold on to dangling pointers.
844
845         * Platform/SharedMemory.h:
846         (WebKit::SharedMemory::data):
847         * Platform/mac/SharedMemoryMac.cpp:
848         (WebKit::SharedMemory::allocate):
849         (WebKit::SharedMemory::create):
850         (WebKit::SharedMemory::map):
851         (WebKit::SharedMemory::~SharedMemory):
852         (WebKit::SharedMemory::createHandle):
853
854 2015-04-14  Antti Koivisto  <antti@apple.com>
855
856         Network Cache: Deduplicate body data
857         https://bugs.webkit.org/show_bug.cgi?id=143652
858
859         Reviewed by Darin Adler.
860
861         It is common to have cache entries with identical body data. This happens when the same resource is loaded from
862         a different URL (https vs http, slash vs no-slash at end, etc.). It also happens when the same URL is
863         referenced from different cache partitions.
864
865         We can improve disk space efficiency and use less memory by sharing identical body data between cache entries.
866
867         This patch splits the body data out from the record file. The new record file contains meta data and response
868         headers only. Body data is stored using the new BlobStorage interface. Files are deduplicated by computing
869         SHA1 hash over the data and looking for an existing blob with the same hash. If found the existing entry
870         is reused by creating a hard link to it.
871
872         The new disk structure looks like this:
873
874         WebKitCache/
875             Version 3/
876                 Blobs/
877                     0A3C9A970ADA27FAE9BD7BC630BAD0B929C293C0
878                     0A6B8060BA77DF92C82A2FD7AF58F79524D8F34C
879                     ...
880                 Records/
881                     apple.com/
882                         0B8645B04E7EC78C178B7460052601C2
883                         0B8645B04E7EC78C178B7460052601C2-body
884                         0CB1A3638D1C5A09C5E3283A74FA040B
885                         0CB1A3638D1C5A09C5E3283A74FA040B-body
886                         ...
887
888         Each record file has an associated -body which is a hard link to a file in the Blobs directory.
889
890         The patch increases effective capacity by 10-20% with a typical cache. It also saves memory especially when identical
891         resources are used in multiple tabs.
892
893         Currently all >0 sized resources are stored as shared blobs. In future small resources should be integrated into record
894         files and blobs used for larger files only.
895
896         * NetworkProcess/cache/NetworkCache.cpp:
897         (WebKit::NetworkCache::Cache::store):
898         (WebKit::NetworkCache::Cache::update):
899
900             Adopt the new storage interface.
901
902         (WebKit::NetworkCache::Cache::dumpContentsToFile):
903         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: Added.
904         (WebKit::NetworkCache::BlobStorage::BlobStorage):
905         (WebKit::NetworkCache::BlobStorage::synchronize):
906
907             Compute size and delete unused files from the Blobs directory (link count == 1).
908
909         (WebKit::NetworkCache::BlobStorage::blobPath):
910         (WebKit::NetworkCache::BlobStorage::add):
911         (WebKit::NetworkCache::BlobStorage::get):
912
913             Interface for storing and retrieving data blobs. Blobs are deduplicated on add.
914
915         (WebKit::NetworkCache::BlobStorage::remove):
916
917             Removes the link but doesn't remove the blob even if there are no other clients. That happens on next synchronize().
918
919         (WebKit::NetworkCache::BlobStorage::shareCount):
920
921             Checks the link count to get the number of clients.
922
923         * NetworkProcess/cache/NetworkCacheBlobStorage.h: Added.
924         (WebKit::NetworkCache::BlobStorage::approximateSize):
925         * NetworkProcess/cache/NetworkCacheCoders.cpp:
926         (WebKit::NetworkCache::Coder<SHA1::Digest>::encode):
927         (WebKit::NetworkCache::Coder<SHA1::Digest>::decode):
928         * NetworkProcess/cache/NetworkCacheCoders.h:
929         * NetworkProcess/cache/NetworkCacheData.h:
930         (WebKit::NetworkCache::Data::isEmpty):
931         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
932         (WebKit::NetworkCache::Data::empty):
933         (WebKit::NetworkCache::Data::fromMap):
934         (WebKit::NetworkCache::mapFile):
935         (WebKit::NetworkCache::computeSHA1):
936         (WebKit::NetworkCache::bytesEqual):
937
938             Add some helpers.
939
940         * NetworkProcess/cache/NetworkCacheEntry.cpp:
941         (WebKit::NetworkCache::Entry::asJSON):
942         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
943         (WebKit::NetworkCache::IOChannel::IOChannel):
944         * NetworkProcess/cache/NetworkCacheStorage.cpp:
945         (WebKit::NetworkCache::makeRecordDirectoryPath):
946         (WebKit::NetworkCache::makeBlobDirectoryPath):
947         (WebKit::NetworkCache::Storage::Storage):
948         (WebKit::NetworkCache::Storage::approximateSize):
949         (WebKit::NetworkCache::Storage::synchronize):
950         (WebKit::NetworkCache::partitionPathForKey):
951         (WebKit::NetworkCache::recordPathForKey):
952         (WebKit::NetworkCache::bodyPath):
953         (WebKit::NetworkCache::decodeRecordMetaData):
954         (WebKit::NetworkCache::decodeRecordHeader):
955         (WebKit::NetworkCache::createRecord):
956         (WebKit::NetworkCache::encodeRecordMetaData):
957         (WebKit::NetworkCache::encodeRecordHeader):
958         (WebKit::NetworkCache::Storage::remove):
959         (WebKit::NetworkCache::Storage::updateFileModificationTime):
960         (WebKit::NetworkCache::Storage::dispatchReadOperation):
961
962             Read both the blob and the record entry.
963
964         (WebKit::NetworkCache::Storage::finishReadOperation):
965
966             Factor to a function.
967
968         (WebKit::NetworkCache::Storage::store):
969         (WebKit::NetworkCache::Storage::traverse):
970         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
971         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
972
973             We don't need separate full write and header write paths anymore. Everything is treated
974             as a full write and deduplication stops us writing the body again.
975
976             This simplifies the code and data structures.
977
978         (WebKit::NetworkCache::Storage::finishWriteOperation):
979
980             Factor to a function.
981
982         (WebKit::NetworkCache::Storage::clear):
983         (WebKit::NetworkCache::deletionProbability):
984
985             Take the sharing count into account when computing deletion probability.
986             It is less useful to delete a record that shares its body with others as data won't get deleted.
987
988         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
989         (WebKit::NetworkCache::Storage::shrink):
990         (WebKit::NetworkCache::Storage::deleteOldVersions):
991         (WebKit::NetworkCache::directoryPathForKey): Deleted.
992         (WebKit::NetworkCache::filePathForKey): Deleted.
993         (WebKit::NetworkCache::openFileForKey): Deleted.
994         (WebKit::NetworkCache::decodeRecord): Deleted.
995         (WebKit::NetworkCache::Storage::update): Deleted.
996
997             No need for separate update interface anymore. Regular store() avoids unnecessary body write.
998
999         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation): Deleted.
1000         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation): Deleted.
1001         * NetworkProcess/cache/NetworkCacheStorage.h:
1002         * WebKit2.xcodeproj/project.pbxproj:
1003
1004 2015-04-14  Chris Dumez  <cdumez@apple.com>
1005
1006         REGRESSION(r182603): [GTK] More than 500 crashes on the layout tests with the debug build.
1007         https://bugs.webkit.org/show_bug.cgi?id=143715
1008
1009         Reviewed by Darin Adler.
1010
1011         Enable assertions checking that calling editorState() does not cause a
1012         synchronous layout only on Mac and iOS. This assertion does not
1013         necessarily hold true on other ports as each one as its own
1014         platformEditorState() implementation. In particular, this assertion
1015         was being hit on GTK.
1016
1017         * WebProcess/WebPage/WebPage.cpp:
1018         (WebKit::WebPage::didChangeSelection):
1019
1020 2015-04-13  Alexey Proskuryakov  <ap@apple.com>
1021
1022         Build fixes after r182772.
1023
1024         * UIProcess/API/mac/WKView.mm:
1025         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Make a CGSize, not an NSSize.
1026         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Moved implementation
1027         to the correct place.
1028         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Ditto.
1029         (-[WKView _layoutMode]): Use a memeber from _data directly, not via a method.
1030
1031 2015-04-13  Alexey Proskuryakov  <ap@apple.com>
1032
1033         More build fix.
1034
1035         * UIProcess/mac/PageClientImpl.mm:
1036         (WebKit::PageClientImpl::setDragImage):
1037
1038 2015-04-13  Hunseop Jeong  <hs85.jeong@samsung.com>
1039
1040         [EFL][GTK] Fix build break after r182753 
1041         https://bugs.webkit.org/show_bug.cgi?id=143689
1042
1043         Reviewed by Anders Carlsson.
1044
1045         * Platform/IPC/unix/ConnectionUnix.cpp:
1046         (IPC::Connection::processMessage):
1047         (IPC::Connection::sendOutgoingMessage):
1048         * Platform/unix/SharedMemoryUnix.cpp:
1049         (WebKit::SharedMemory::allocate):
1050         (WebKit::accessModeMMap):
1051         (WebKit::SharedMemory::map):
1052         (WebKit::SharedMemory::create): Deleted.
1053
1054 2015-04-13  Alexey Proskuryakov  <ap@apple.com>
1055
1056         Build fix.
1057
1058         * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setDragImage):
1059
1060 2015-04-13  Anders Carlsson  <andersca@apple.com>
1061
1062         Keep track of each shared memory object's protection when deciding whether to return our existing port
1063         https://bugs.webkit.org/show_bug.cgi?id=143687
1064
1065         Reviewed by Tim Horton.
1066
1067         * Platform/SharedMemory.h:
1068         * Platform/mac/SharedMemoryMac.cpp:
1069         (WebKit::machProtection):
1070         (WebKit::SharedMemory::create):
1071         (WebKit::SharedMemory::map):
1072         (WebKit::SharedMemory::createHandle):
1073
1074 2015-04-13  Tim Horton  <timothy_horton@apple.com>
1075
1076         Add a persistent, fixed scale factor to make it easy to scale down WK(Web)Views
1077         https://bugs.webkit.org/show_bug.cgi?id=143560
1078         <rdar://problem/16302047>
1079
1080         Reviewed by Darin Adler.
1081
1082         Add a new "view" scale factor to WKView and WKWebView.
1083
1084         Unlike page scale (or "magnification" in the API), view scale:
1085             - persists between page loads
1086             - persists between Web process crashes
1087             - is not user adjustable
1088             - can reliably be < 1
1089
1090         The page scale and view scale are multiplied together whenever we push
1091         a new page scale down into WebCore, so the implementation of view scale
1092         is transparent to WebCore, and acts effectively as a constant multiplier
1093         for the (user-adjustable) page scale factor.
1094
1095         * UIProcess/WebPageProxy.cpp:
1096         (WebKit::WebPageProxy::scaleView):
1097         Add scaleView, which updates our cached viewScaleFactor and pushes it to the Web process.
1098
1099         (WebKit::WebPageProxy::creationParameters):
1100         Plumb viewScaleFactor through the page creation parameters.
1101
1102         * UIProcess/WebPageProxy.h:
1103         (WebKit::WebPageProxy::viewScaleFactor): Added.
1104
1105         * WebProcess/WebPage/WebPage.cpp:
1106         (WebKit::WebPage::WebPage):
1107         If the viewScaleFactor is not 1 at creation time, call scalePage with a page scale of 1.
1108         Internally, scalePage will multiply in the viewScaleFactor and push it all to the Web process.
1109
1110         (WebKit::WebPage::scalePage):
1111         Multiply the page scale factor by the view scale factor before passing it to WebCore.
1112
1113         (WebKit::WebPage::scalePageInViewCoordinates):
1114         Early returns need to check the total scale, not just the new page scale.
1115
1116         (WebKit::WebPage::totalScaleFactor):
1117         The scale that we get back from WebCore::Page::pageScaleFactor is the product
1118         of WebKit2's view and page scales. So, here we'll call that the totalScaleFactor.
1119         (Might need a different name because it seems like "total" should include deviceScale too).
1120
1121         (WebKit::WebPage::pageScaleFactor):
1122         WebKit2's notion of the pageScaleFactor does not include the view scale, so
1123         divide it out of WebCore's page scale.
1124
1125         (WebKit::WebPage::scaleView):
1126         Apply a new view scale, maintaining the current scroll position.
1127
1128         * WebProcess/WebPage/WebPage.h:
1129         (WebKit::WebPage::viewScaleFactor):
1130         * WebProcess/WebPage/WebPage.messages.in:
1131
1132         * Shared/WebPageCreationParameters.cpp:
1133         (WebKit::WebPageCreationParameters::encode):
1134         (WebKit::WebPageCreationParameters::decode):
1135         * Shared/WebPageCreationParameters.h:
1136         Plumb viewScaleFactor through the page creation parameters.
1137
1138         * UIProcess/API/Cocoa/WKViewPrivate.h:
1139         * UIProcess/API/Cocoa/WKWebView.mm:
1140         (-[WKWebView _viewScale]):
1141         (-[WKWebView _setViewScale:]):
1142         * UIProcess/API/mac/WKView.mm:
1143         (-[WKView _viewScale]):
1144         (-[WKView _setViewScale:]):
1145         Push the new view scale to WebPage.
1146
1147         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1148         * UIProcess/API/Cocoa/WKWebView.mm:
1149         (-[WKWebView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]):
1150         (-[WKWebView _automaticallyComputesFixedLayoutSizeFromViewScale]):
1151         * UIProcess/API/mac/WKView.mm:
1152         (-[WKView setFrameSize:]):
1153         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]):
1154         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]):
1155         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]):
1156         * UIProcess/API/mac/WKViewInternal.h:
1157         Add a new layout mode, "DynamicSizeComputedFromViewScale",
1158         which turns on fixed layout size mode, and sets the fixed layout size
1159         based on the view's frame and view scale. The fixed layout size is maintained
1160         as the frame of the view scaled by the inverse of the view scale. This
1161         makes it very easy to maintain a WK(Web)View that is scaled down by
1162         a constant amount, but is laid out as if it were not.
1163         
1164         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1165         (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
1166         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
1167         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
1168         Because the transient zoom mechanism touches layers that WebCore owns,
1169         it mostly need to operate with totalScaleFactor, because that is what WebCore sees.
1170
1171 2015-04-10  Brent Fulgham  <bfulgham@apple.com>
1172
1173         Expand test infrastructure to support scrolling tests
1174         https://bugs.webkit.org/show_bug.cgi?id=143286
1175         <rdar://problem/20375516>
1176
1177         Reviewed by Simon Fraser.
1178
1179         Extend the WK2 testing API to include a method for setting a JSC callback function to be triggered
1180         by the new WebCore::WheelEventTestTrigger singleton.
1181
1182         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1183         (WKBundlePageStartMonitoringScrollOperations): WK2 method that causes the testing system to begin tracking wheel events.
1184         (WKBundlePageRegisterScrollOperationCompletionCallback): WK2 method to set the callback function for testing.
1185         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1186
1187 2015-04-13  Enrica Casucci  <enrica@apple.com>
1188
1189         Clients of WKWebView should be able to override drag functions.
1190         https://bugs.webkit.org/show_bug.cgi?id=143618
1191
1192         Reviewed by Darin Adler.
1193
1194         WKWebView now implements the drag protocol functions and
1195         forwards the calls to the inner WKView.
1196         In the page client, when we receive a request to start drag
1197         from the WebProcess, we call _dragImageForView in WKView with
1198         the target view. The function calls dragImage on the given view,
1199         so that its clients can override the dragImage function.
1200
1201         * UIProcess/API/Cocoa/WKWebView.mm:
1202         (-[WKWebView draggingEntered:]):
1203         (-[WKWebView draggingUpdated:]):
1204         (-[WKWebView draggingExited:]):
1205         (-[WKWebView prepareForDragOperation:]):
1206         (-[WKWebView performDragOperation:]):
1207         * UIProcess/API/mac/WKView.mm:
1208         (-[WKView _dragImageForView:withImage:at:linkDrag:]):
1209         (-[WKView _setDragImage:at:linkDrag:]): Deleted.
1210         * UIProcess/API/mac/WKViewInternal.h:
1211         * UIProcess/mac/PageClientImpl.mm:
1212         (WebKit::PageClientImpl::setDragImage):
1213
1214 2015-04-13  Alex Christensen  <achristensen@webkit.org>
1215
1216         [iOS] Unreviewed build fix after r182760.
1217
1218         * Shared/WebCoreArgumentCoders.cpp:
1219         (IPC::encodeSharedBuffer):
1220         (IPC::decodeSharedBuffer):
1221         Update SharedMemory function names.
1222
1223 2015-04-13  Anders Carlsson  <andersca@apple.com>
1224
1225         Rename SharedMemory::create overloads
1226         https://bugs.webkit.org/show_bug.cgi?id=143679
1227
1228         Reviewed by Beth Dakin.
1229
1230         Rename the SharedMemory::create overload that allocates memory to SharedMemory::allocate,
1231         and the SharedMemory::create overload that maps in a handle to SharedMemory::map.
1232
1233         * Platform/SharedMemory.h:
1234         * Platform/mac/SharedMemoryMac.cpp:
1235         (WebKit::SharedMemory::allocate):
1236         (WebKit::SharedMemory::map):
1237         (WebKit::SharedMemory::create): Deleted.
1238         * Shared/ShareableBitmap.cpp:
1239         (WebKit::ShareableBitmap::createShareable):
1240         (WebKit::ShareableBitmap::create):
1241         * Shared/ShareableResource.cpp:
1242         (WebKit::ShareableResource::create):
1243         * Shared/ShareableResource.h:
1244         * Shared/WebCompiledContentExtension.cpp:
1245         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
1246         * Shared/WebCompiledContentExtensionData.cpp:
1247         (WebKit::WebCompiledContentExtensionData::decode):
1248         * Shared/WebHitTestResult.cpp:
1249         (WebKit::WebHitTestResult::Data::Data):
1250         (WebKit::WebHitTestResult::Data::decode):
1251         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1252         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
1253         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
1254         * UIProcess/VisitedLinkProvider.cpp:
1255         (WebKit::VisitedLinkProvider::resizeTable):
1256         * UIProcess/mac/WebPageProxyMac.mm:
1257         (WebKit::WebPageProxy::dataSelectionForPasteboard):
1258         (WebKit::WebPageProxy::setPromisedDataForImage):
1259         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1260         (WebKit::PDFPlugin::writeItemsToPasteboard):
1261         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1262         (WebKit::WebPlatformStrategies::bufferForType):
1263         (WebKit::WebPlatformStrategies::setBufferForType):
1264         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1265         (WebKit::WebDragClient::declareAndWriteDragImage):
1266         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1267         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
1268         * WebProcess/WebPage/mac/WebPageMac.mm:
1269         (WebKit::WebPage::getDataSelectionForPasteboard):
1270
1271 2015-04-13  Brady Eidson  <beidson@apple.com>
1272
1273         Share sheets from Share menus appear outside the browser window.
1274         <rdar://problem/20455592> and https://bugs.webkit.org/show_bug.cgi?id=143620
1275
1276         Reviewed by Darin Adler.
1277
1278         Refactor existing Sharing Service Picker code to also be used for the Share menu NSMenuItem.
1279
1280         * UIProcess/WebPageProxy.cpp:
1281         (WebKit::WebPageProxy::internalShowContextMenu):
1282         (WebKit::WebPageProxy::platformInitializeShareMenuItem):
1283         * UIProcess/WebPageProxy.h:
1284
1285         * UIProcess/mac/WKSharingServicePickerDelegate.h: Added.
1286         * UIProcess/mac/WKSharingServicePickerDelegate.mm: Added.
1287         (+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]):
1288         (-[WKSharingServicePickerDelegate menuProxy]):
1289         (-[WKSharingServicePickerDelegate setMenuProxy:]):
1290         (-[WKSharingServicePickerDelegate setPicker:]):
1291         (-[WKSharingServicePickerDelegate setFiltersEditingServices:]):
1292         (-[WKSharingServicePickerDelegate setHandlesEditingReplacement:]):
1293         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
1294         (-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]):
1295         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]):
1296         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
1297         (-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]):
1298
1299         * UIProcess/mac/WebContextMenuProxyMac.mm:
1300         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
1301         (+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]): Deleted.
1302         (-[WKSharingServicePickerDelegate menuProxy]): Deleted.
1303         (-[WKSharingServicePickerDelegate setMenuProxy:]): Deleted.
1304         (-[WKSharingServicePickerDelegate setPicker:]): Deleted.
1305         (-[WKSharingServicePickerDelegate setIncludeEditorServices:]): Deleted.
1306         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): Deleted.
1307         (-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]): Deleted.
1308         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]): Deleted.
1309         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Deleted.
1310         (-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]): Deleted.
1311
1312         * UIProcess/mac/WebPageProxyMac.mm:
1313         (WebKit::WebPageProxy::platformInitializeShareMenuItem):
1314
1315         * WebKit2.xcodeproj/project.pbxproj:
1316
1317 2015-04-13  Anders Carlsson  <andersca@apple.com>
1318
1319         Begin cleaning up the shared memory interface
1320         https://bugs.webkit.org/show_bug.cgi?id=143677
1321
1322         Reviewed by Andreas Kling.
1323
1324         Rename createFromVMBuffer to create and add a protection parameter (which is currently unused).
1325         Also, turn SharedMemory::Protection into a proper enum class.
1326
1327         * NetworkProcess/cache/NetworkCache.cpp:
1328         (WebKit::NetworkCache::Cache::store):
1329         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1330         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
1331         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1332         (WebKit::tryGetShareableHandleFromCFData):
1333         * Platform/SharedMemory.h:
1334         * Platform/mac/SharedMemoryMac.cpp:
1335         (WebKit::SharedMemory::create):
1336         (WebKit::machProtection):
1337         (WebKit::SharedMemory::createHandle):
1338         (WebKit::SharedMemory::createFromVMBuffer): Deleted.
1339         * Shared/ContextMenuContextData.cpp:
1340         (WebKit::ContextMenuContextData::encode):
1341         (WebKit::ContextMenuContextData::decode):
1342         * Shared/ShareableBitmap.h:
1343         * Shared/ShareableResource.cpp:
1344         (WebKit::ShareableResource::create):
1345         (WebKit::ShareableResource::createHandle):
1346         * Shared/WebCompiledContentExtensionData.cpp:
1347         (WebKit::WebCompiledContentExtensionData::encode):
1348         (WebKit::WebCompiledContentExtensionData::decode):
1349         * Shared/WebHitTestResult.cpp:
1350         (WebKit::WebHitTestResult::Data::encode):
1351         (WebKit::WebHitTestResult::Data::decode):
1352         * UIProcess/API/APIUserContentExtensionStore.cpp:
1353         (API::createExtension):
1354         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1355         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
1356         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
1357         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
1358         * UIProcess/VisitedLinkProvider.cpp:
1359         (WebKit::VisitedLinkProvider::sendTable):
1360         * UIProcess/mac/WKPrintingView.mm:
1361         (pageDidDrawToImage):
1362         * UIProcess/mac/WebPageProxyMac.mm:
1363         (WebKit::WebPageProxy::dataSelectionForPasteboard):
1364         (WebKit::WebPageProxy::setPromisedDataForImage):
1365         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1366         (WebKit::PDFPlugin::writeItemsToPasteboard):
1367         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1368         (WebKit::WebPlatformStrategies::bufferForType):
1369         (WebKit::WebPlatformStrategies::setBufferForType):
1370         (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
1371         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1372         (WebKit::WebDragClient::declareAndWriteDragImage):
1373         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1374         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
1375         * WebProcess/WebPage/WebPage.cpp:
1376         (WebKit::WebPage::takeSnapshot):
1377         (WebKit::WebPage::drawRectToImage):
1378         * WebProcess/WebPage/mac/WebPageMac.mm:
1379         (WebKit::WebPage::getDataSelectionForPasteboard):
1380
1381 2015-04-10  Jon Honeycutt  <jhoneycutt@apple.com>
1382
1383         Cannot click "Next" button on Google two-factor auth setup page
1384
1385         <https://bugs.webkit.org/show_bug.cgi?id=143624>
1386         <rdar://problem/19175714>
1387
1388         This issue occurs when this site focuses the submit button. When it
1389         receives focus, we try to assist it. While we consider ourselves to be
1390         assisting it, we ignore further gesture inputs for that node, including
1391         the tap gesture.
1392
1393         To fix this, only assist input types that we know are assistable,
1394         including text fields, select and date elements, etc.
1395
1396         Reviewed by Darin Adler.
1397
1398         * UIProcess/ios/WKContentViewInteraction.mm:
1399         (isAssistableInputType):
1400         If the type is a known-assistable type, return true.
1401         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
1402         Call isAssistableInputType() to determine whether we should do any kind
1403         of assistance for this node.
1404
1405 2015-04-13  Beth Dakin  <bdakin@apple.com>
1406
1407         Add force property to MouseEvents
1408         https://bugs.webkit.org/show_bug.cgi?id=143569
1409         -and corresponding-
1410         rdar://problem/20472954
1411
1412         Reviewed by Darin Adler.
1413
1414         In order to accommodate adding force to all PlatformMouseEvents, we have to add it 
1415         to pass a caches pressure event to NativeWebMouseEvent and add force to 
1416         WebMouseEvent.
1417
1418         NativeWebMouseEvent now requires a second NSEvent for the pressureEvent. 
1419         * Shared/NativeWebMouseEvent.h:
1420
1421         WebMouseEvent takes a force parameter.
1422         * Shared/WebEvent.h:
1423         (WebKit::WebMouseEvent::force):
1424         * Shared/WebEventConversion.cpp:
1425         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1426         * Shared/WebMouseEvent.cpp:
1427         (WebKit::WebMouseEvent::WebMouseEvent):
1428         (WebKit::WebMouseEvent::encode):
1429         (WebKit::WebMouseEvent::decode):
1430         * Shared/mac/NativeWebMouseEventMac.mm:
1431         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
1432         * Shared/mac/WebEventFactory.h:
1433         * Shared/mac/WebEventFactory.mm:
1434         (WebKit::WebEventFactory::createWebMouseEvent):
1435
1436         Cache the most recent pressureEvent in _data so that it can be sent along to the 
1437         NativeWebMouseEvent constructor.
1438         * UIProcess/API/mac/WKView.mm:
1439         (-[WKView pressureChangeWithEvent:]):
1440         (-[WKView acceptsFirstMouse:]):
1441         (-[WKView shouldDelayWindowOrderingForEvent:]):
1442         (-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]):
1443         (-[WKView initWithFrame:processPool:configuration:webView:]):
1444
1445         WebMouseEvent takes a force parameter.
1446         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1447         (WebKit::PDFPlugin::showContextMenuAtPoint):
1448         * WebProcess/Plugins/PluginView.cpp:
1449         (WebKit::PluginView::createWebEvent):
1450
1451         MouseEvent and PlatformMouseEvent both take force parameters too.
1452         * WebProcess/WebPage/WebPage.cpp:
1453         (WebKit::WebPage::navigateToURLWithSimulatedClick):
1454         (WebKit::WebPage::contextMenuAtPointInWindow):
1455         (WebKit::WebPage::dragEnded):
1456         (WebKit::WebPage::simulateMouseDown):
1457         (WebKit::WebPage::simulateMouseUp):
1458         (WebKit::WebPage::simulateMouseMotion):
1459
1460         The functions that dispatch the force events no longer take a PlatformMouseEvent 
1461         as a parameter.
1462         * WebProcess/WebPage/mac/WebPageMac.mm:
1463         (WebKit::WebPage::inputDeviceForceDidChange):
1464         (WebKit::WebPage::immediateActionDidCancel):
1465
1466 2015-04-13  Andreas Kling  <akling@apple.com>
1467
1468         Don't segregate heap objects based on Structure immortality.
1469         <https://webkit.org/b/143638>
1470
1471         Reviewed by Darin Adler.
1472
1473         * WebProcess/Plugins/Netscape/JSNPObject.h:
1474
1475 2015-04-13  Timothy Horton  <timothy_horton@apple.com>
1476
1477         javascript: links in inline PDFs shouldn't execute JavaScript in the context of the host website
1478         https://bugs.webkit.org/show_bug.cgi?id=143642
1479         <rdar://problem/18259355>
1480
1481         Reviewed by Darin Adler.
1482
1483         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1484         (WebKit::PDFPlugin::clickedLink):
1485         Don't follow javascript: URLs.
1486
1487 2015-04-10  Alex Christensen  <achristensen@webkit.org>
1488
1489         [Content Extensions] Don't unmap shared memory while using it.
1490         https://bugs.webkit.org/show_bug.cgi?id=143625
1491
1492         Reviewed by Darin Adler.
1493
1494         * Shared/WebCompiledContentExtension.cpp:
1495         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
1496         * Shared/WebCompiledContentExtensionData.h:
1497         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
1498         * UIProcess/API/APIUserContentExtensionStore.cpp:
1499         (API::createExtension):
1500         Keep the Data object alive as long as the SharedMemory that uses it.
1501
1502 2015-04-12  Darin Adler  <darin@apple.com>
1503
1504         [Cocoa] Localizable strings are inconsistent and need to be regenerated
1505         https://bugs.webkit.org/show_bug.cgi?id=143661
1506
1507         Reviewed by Dan Bernstein.
1508
1509         * UIProcess/WebEditCommandProxy.cpp:
1510         (WebKit::WebEditCommandProxy::nameForEditAction): Also added a comment
1511         about the fact that we have two copies of all the localizable strings.
1512
1513 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
1514
1515         Fix trival typos related to the word "coordinate".
1516         https://bugs.webkit.org/show_bug.cgi?id=143644
1517
1518         Reviewed by Alexey Proskuryakov.
1519
1520         No new tests, no behavior change.
1521
1522         * Shared/WebHitTestResult.cpp:
1523         (WebKit::WebHitTestResult::Data::encode):
1524         (WebKit::WebHitTestResult::Data::decode):
1525         * Shared/WebHitTestResult.h:
1526         * WebProcess/WebPage/mac/WebPageMac.mm:
1527         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1528         (WebKit::WebPage::lookupTextAtLocation):
1529
1530 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
1531
1532         Remove PluginModuleInfo.cpp from WebKit2
1533         https://bugs.webkit.org/show_bug.cgi?id=143643
1534
1535         Reviewed by Darin Adler.
1536
1537         Remove PluginModuleInfo.cpp from WebKit2 because it is totally empty.
1538
1539         No new tests, no behavior change.
1540
1541         * CMakeLists.txt:
1542         * Shared/Plugins/PluginModuleInfo.cpp: Removed.
1543         * WebKit2.xcodeproj/project.pbxproj:
1544
1545 2015-04-11  Yusuke Suzuki  <utatane.tea@gmail.com>
1546
1547         [ES6] Enable Symbol in web pages
1548         https://bugs.webkit.org/show_bug.cgi?id=143375
1549
1550         Reviewed by Ryosuke Niwa.
1551
1552         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1553         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1554         * UIProcess/efl/WebInspectorProxyEfl.cpp:
1555         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1556         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1557         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1558         * UIProcess/mac/WebInspectorProxyMac.mm:
1559         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1560
1561 2015-04-08  Sam Weinig  <sam@webkit.org>
1562
1563         Allow LaunchServices to handle URLs on link navigations
1564         <rdar://problem/19446826>
1565         https://bugs.webkit.org/show_bug.cgi?id=143544
1566
1567         Reviewed by Anders Carlsson.
1568
1569         * UIProcess/Cocoa/NavigationState.mm:
1570         (WebKit::tryAppLink):
1571         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1572         Only let LaunchServices have a crack at the URL if the navigation is:
1573             1) a main frame navigation
1574             2) a result of a user gesture
1575
1576 2015-04-10  Tim Horton  <timothy_horton@apple.com>
1577
1578         Replace setFixedLayoutSizeEnabled: with an enum of layout modes
1579         https://bugs.webkit.org/show_bug.cgi?id=143576
1580
1581         Reviewed by Simon Fraser.
1582
1583         * UIProcess/API/C/WKLayoutMode.h: Added.
1584         * UIProcess/API/Cocoa/WKViewPrivate.h:
1585         * UIProcess/API/Cocoa/WKWebView.mm:
1586         (-[WKWebView _layoutMode]):
1587         (-[WKWebView _setLayoutMode:]):
1588         (-[WKWebView _isFixedLayoutEnabled]): Deleted.
1589         (-[WKWebView _setFixedLayoutEnabled:]): Deleted.
1590         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1591         * UIProcess/API/Cocoa/_WKLayoutMode.h: Added.
1592         * UIProcess/API/mac/WKView.mm:
1593         (-[WKView _layoutMode]):
1594         (-[WKView _setLayoutMode:]):
1595         (-[WKView _isFixedLayoutEnabled]): Deleted.
1596         (-[WKView _setFixedLayoutEnabled:]): Deleted.
1597         * WebKit2.xcodeproj/project.pbxproj:
1598         Add enums for "layout mode". Currently we have two values: "ViewSize",
1599         which is the normal behavior, and "FixedSize", which is fixed layout mode.
1600         More values will come in the future.
1601
1602 2015-04-10  Anders Carlsson  <andersca@apple.com>
1603
1604         _WKWebsiteDataStore doesn't track and remove offline application cache entries
1605         https://bugs.webkit.org/show_bug.cgi?id=143614
1606         rdar://problem/20243235
1607
1608         Reviewed by Andreas Kling.
1609
1610         * Shared/WebsiteData/WebsiteDataTypes.h:
1611         Add WebsiteDataTypeOfflineWebApplicationCache.
1612
1613         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
1614         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
1615         (dataTypesToString):
1616         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
1617         (WebKit::toWebsiteDataTypes):
1618         (WebKit::toWKWebsiteDataTypes):
1619         Add WKWebsiteDataTypeOfflineWebApplicationCache.
1620
1621         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1622         (WebKit::WebsiteDataStore::fetchData):
1623         Create a custom application cache storage and fetch the origins from it.
1624
1625         (WebKit::WebsiteDataStore::removeData):
1626         Delete either all the cache entries (since we don't track time in the application cache),
1627         or the ones specified by the given entries.
1628
1629 2015-04-10  Eric Carlson  <eric.carlson@apple.com>
1630
1631         [Mac] Refactor MediaPlaybackTarget
1632         https://bugs.webkit.org/show_bug.cgi?id=143571
1633
1634         Reviewed by Jer Noble.
1635
1636         Pass a MediaPlaybackTargetContext across process boundary instead of a MediaPlaybackTarget.
1637         * Shared/WebCoreArgumentCoders.h:
1638         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encode): New.
1639         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decode): New.
1640         * Shared/mac/WebCoreArgumentCoders.cpp:
1641         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): New.
1642         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): New.
1643         (IPC::ArgumentCoder<MediaPlaybackTarget>::encode): Deleted.
1644         (IPC::ArgumentCoder<MediaPlaybackTarget>::decode): Deleted.
1645         * UIProcess/WebPageProxy.cpp:
1646         (WebKit::WebPageProxy::didChoosePlaybackTarget): Take a Ref<MediaPlaybackTarget>&&.
1647         * UIProcess/WebPageProxy.h:
1648         * WebProcess/WebPage/WebPage.h:
1649         * WebProcess/WebPage/WebPage.messages.in:
1650         * WebProcess/WebPage/mac/WebPageMac.mm:
1651         (WebKit::WebPage::playbackTargetSelected): Take a Ref<MediaPlaybackTarget>&&.
1652
1653 2015-04-10  Hunseop Jeong  <hs85.jeong@samsung.com>
1654
1655         Fix some minor typos related to the WebProcessCreationParameter. 
1656         https://bugs.webkit.org/show_bug.cgi?id=143598
1657
1658         Reviewed by Csaba Osztrogonác.
1659
1660         No new tests, no behavior change.
1661
1662         * Shared/WebProcessCreationParameters.cpp:
1663         (WebKit::WebProcessCreationParameters::encode):
1664         (WebKit::WebProcessCreationParameters::decode):
1665         * Shared/WebProcessCreationParameters.h:
1666         * UIProcess/WebProcessPool.cpp:
1667         (WebKit::WebProcessPool::createNewWebProcess):
1668         * WebProcess/WebProcess.cpp:
1669         (WebKit::WebProcess::initializeWebProcess):
1670
1671 2015-04-09  Andy Estes  <aestes@apple.com>
1672
1673         [Cocoa] Add a HAVE(AVKIT) and use it
1674         https://bugs.webkit.org/show_bug.cgi?id=143593
1675
1676         Reviewed by David Kilzer.
1677
1678         * UIProcess/API/Cocoa/WKWebView.mm:
1679         (-[WKWebView _mayAutomaticallyShowVideoOptimized]): Returned false if !HAVE(AVKIT).
1680         * UIProcess/WebPageProxy.cpp:
1681         (WebKit::WebPageProxy::WebPageProxy): Removed the check for < iOS 8.2.
1682         (WebKit::WebPageProxy::reattachToWebProcess): Ditto.
1683         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1684         (WebKit::WebVideoFullscreenManagerProxy::create): Created a version of this function that returns nullptr if
1685         the minimum required version of iOS is less than 8.2 or if !HAVE(AVKIT).
1686         * WebProcess/WebPage/WebPage.cpp:
1687         (WebKit::WebPage::updatePreferences): Only called Settings::setAVKitEnabled(true) if HAVE(AVKIT).
1688
1689 2015-04-09  Hunseop Jeong  <hs85.jeong@samsung.com>
1690
1691         Use modern loops in WebProcess 
1692         https://bugs.webkit.org/show_bug.cgi?id=143302
1693
1694         Reviewed by Darin Adler.
1695
1696         Use modern range for-loops in WebProcess.
1697
1698         No new tests, no behavior change.
1699
1700         * WebProcess/WebProcess.cpp:
1701         (WebKit::WebProcess::initializeConnection):
1702         (WebKit::WebProcess::initializeWebProcess):
1703         (WebKit::WebProcess::focusedWebPage):
1704         (WebKit::WebProcess::webPageGroup):
1705         (WebKit::WebProcess::setTextCheckerState):
1706         (WebKit::WebProcess::resetAllGeolocationPermissions):
1707
1708 2015-04-09  Gordon Sheridan  <gordon_sheridan@apple.com>
1709
1710         Track IconDatabase retain counts for WebContent processes. Balance retain/releases for processes that terminate before successfully doing it themselves.
1711         https://bugs.webkit.org/show_bug.cgi?id=143517.
1712
1713         Reviewed by Brady Eidson.
1714
1715         * UIProcess/WebIconDatabase.messages.in:
1716         Move RetainIconForPageURL and ReleaseIconForPageURL messages to WebProcessProxy so they can be associated with the appropriate web process.
1717
1718         * UIProcess/WebProcessProxy.cpp:
1719         (WebKit::WebProcessProxy::connectionDidClose):
1720         Call releaseRemainingIconsForPageURLs() to balance retains/releases for this process.
1721
1722         (WebKit::WebProcessProxy::retainIconForPageURL):
1723         Track retain counts for page URLs and call through to WebIconDatabase.
1724
1725         (WebKit::WebProcessProxy::releaseIconForPageURL):
1726         Ditto.
1727
1728         (WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs):
1729         Call releaseIconForPageURL() once for each outstanding retain count, for each page URL.
1730
1731         * UIProcess/WebProcessProxy.h:
1732         Declare methods for retainIconForPageURL(), releaseIconForPageURL(), and releaseRemainingIconsForPageURLs().
1733         Declare hash map to track number of retains per page URL.
1734
1735         * UIProcess/WebProcessProxy.messages.in:
1736         Moved RetainIconForPageURL and ReleaseIconForPageURL messages here from WebIconDatabase.
1737
1738         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1739         (WebKit::WebIconDatabaseProxy::retainIconForPageURL):
1740         Modify the receiver of the message to be WebProcessProxy.
1741
1742         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
1743         Ditto.
1744
1745 2015-04-09  Chris Dumez  <cdumez@apple.com>
1746
1747         [WK2] Regression(r182194): The NetworkProcess is calling the wrong memory pressure handler before suspending
1748         https://bugs.webkit.org/show_bug.cgi?id=143575
1749         <rdar://problem/20484338>
1750
1751         Reviewed by Andreas Kling.
1752
1753         After r182194, the NetworkProcess is calling the memory pressure
1754         handler before getting suspended to free-up as much memory as possible
1755         at this point.
1756
1757         However, we were calling the default memory pressure handling code
1758         instead of the custom handler registered by the NetworkProcess. This
1759         patch fixes the problem.
1760
1761         * NetworkProcess/NetworkProcess.cpp:
1762         (WebKit::NetworkProcess::lowMemoryHandler):
1763         (WebKit::NetworkProcess::initializeNetworkProcess):
1764         (WebKit::NetworkProcess::processWillSuspend):
1765         * NetworkProcess/NetworkProcess.h:
1766
1767 2015-04-09  Brady Eidson  <beidson@apple.com>
1768
1769         REGRESSION (r182573): Action Menus no longer appear for WebKit2 views displaying an image
1770         rdar://problem/20486551 and https://bugs.webkit.org/show_bug.cgi?id=143574
1771
1772         Reviewed by Brent Fulgham.
1773
1774         * Shared/WebHitTestResult.cpp:
1775         (WebKit::WebHitTestResult::Data::Data): Clear up a name scoping issue.
1776
1777 2015-04-09  Chris Dumez  <cdumez@apple.com>
1778
1779         [WK2][iOS] editorState() should not cause a synchronous layout
1780         https://bugs.webkit.org/show_bug.cgi?id=142536
1781         <rdar://problem/20041506>
1782
1783         Reviewed by Enrica Casucci.
1784
1785         platformEditorState() on iOS does a synchronous layout to compute some
1786         of the EditorState members (e.g. caretRectAtStart / caretRectAtEnd).
1787         This is bad for performance as this is called every time the selection
1788         is changed (which happens for e.g. when you set the value of a focused
1789         HTMLInputElement).
1790
1791         This patch updates the behavior on iOS to only send a partial EditorState
1792         on selection change so that the UIProcess gets most of the information
1793         (the ones that do not require style recalc or layout) ASAP. A full Editor
1794         state is then sent after the asynchronous layout is done.
1795
1796         With this change, I see a 38% improvement on Speedometer (26.4 +/- 0.37
1797         -> 36.5 +/- 0.54) on iPhone 6 Plus.
1798
1799         * Shared/EditorState.cpp:
1800         (WebKit::EditorState::encode):
1801         (WebKit::EditorState::decode):
1802         (WebKit::EditorState::PostLayoutData::encode):
1803         (WebKit::EditorState::PostLayoutData::decode):
1804         * Shared/EditorState.h:
1805         (WebKit::EditorState::EditorState): Deleted.
1806         * UIProcess/ios/WKContentView.mm:
1807         (-[WKContentView _didCommitLayerTree:]):
1808         * UIProcess/ios/WKContentViewInteraction.mm:
1809         (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
1810         (-[WKContentView webSelectionRects]):
1811         (-[WKContentView _addShortcut:]):
1812         (-[WKContentView selectedText]):
1813         (-[WKContentView isReplaceAllowed]):
1814         (-[WKContentView _promptForReplace:]):
1815         (-[WKContentView _transliterateChinese:]):
1816         (-[WKContentView textStylingAtPosition:inDirection:]):
1817         (-[WKContentView canPerformAction:withSender:]):
1818         (-[WKContentView _showDictionary:]):
1819         (-[WKContentView _characterBeforeCaretSelection]):
1820         (-[WKContentView _characterInRelationToCaretSelection:]):
1821         (-[WKContentView _selectionAtDocumentStart]):
1822         (-[WKContentView selectedTextRange]):
1823         (-[WKContentView hasContent]):
1824         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1825         (WebKit::WebEditorClient::didChangeSelectionAndUpdateLayout):
1826         * WebProcess/WebCoreSupport/WebEditorClient.h:
1827         * WebProcess/WebPage/WebPage.cpp:
1828         (WebKit::WebPage::editorState):
1829         (WebKit::WebPage::didChangeSelection):
1830         (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded):
1831         * WebProcess/WebPage/WebPage.h:
1832         * WebProcess/WebPage/efl/WebPageEfl.cpp:
1833         (WebKit::WebPage::platformEditorState):
1834         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1835         (WebKit::WebPage::platformEditorState):
1836         * WebProcess/WebPage/ios/WebPageIOS.mm:
1837         (WebKit::WebPage::platformEditorState):
1838         * WebProcess/WebPage/mac/WebPageMac.mm:
1839         (WebKit::WebPage::platformEditorState):
1840
1841 2015-04-09  Antti Koivisto  <antti@apple.com>
1842
1843         Network Cache: Crash in WebCore::CachedResource::tryReplaceEncodedData
1844         https://bugs.webkit.org/show_bug.cgi?id=143562
1845
1846         Reviewed by Anders Carlsson.
1847
1848         If another thread comes and truncates the file before we map it we end up with a map that crashes when accessed.
1849
1850         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1851         (WebKit::NetworkCache::IOChannel::IOChannel):
1852
1853             When creating a new file unlink any existing file instead of using O_TRUNC.
1854
1855 2015-04-09  Csaba Osztrogonác  <ossy@webkit.org>
1856
1857         [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
1858         https://bugs.webkit.org/show_bug.cgi?id=142907
1859
1860         Unreviewed typo fix after r182595.
1861
1862         * PlatformGTK.cmake:
1863
1864 2015-04-09  Csaba Osztrogonác  <ossy@webkit.org>
1865
1866         [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
1867         https://bugs.webkit.org/show_bug.cgi?id=142907
1868
1869         Reviewed by Carlos Garcia Campos.
1870
1871         * PlatformEfl.cmake:
1872         * PlatformGTK.cmake:
1873         * Scripts/generate-forwarding-headers.pl: Make it work with more path and platform arguments.
1874
1875 2015-04-08  Joseph Pecoraro  <pecoraro@apple.com>
1876
1877         Exception in console and broken right click after attempting to show context menu in Inspector
1878         https://bugs.webkit.org/show_bug.cgi?id=143556
1879
1880         Reviewed by Brady Eidson.
1881
1882         * Shared/mac/NativeContextMenuItem.mm:
1883         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
1884         Add an ASSERT to immediately catch a menu item created with a nil native menu item.
1885
1886         * UIProcess/WebPageProxy.cpp:
1887         (WebKit::WebPageProxy::internalShowContextMenu):
1888         Gracefully handle a null share context menu item.
1889
1890 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
1891
1892         [Mac] Unreviewed test fix after r182584
1893         https://bugs.webkit.org/show_bug.cgi?id=143452
1894
1895         Correct bit comparison to use the correct value for the Control-key
1896
1897         * Shared/mac/WebEventFactory.mm:
1898         (WebKit::typeForEvent):
1899
1900 2015-04-08  Jaehun Lim  <ljaehun.lim@samsung.com>
1901
1902         [EFL] Create PageUIClientEfl after sending CreateWebPage message
1903         https://bugs.webkit.org/show_bug.cgi?id=143514
1904
1905         Reviewed by Gyuyoung Kim.
1906
1907         UIProcess sends some messages to WebPage before WebPage is created. It makes some error logs on debug build.
1908         So this patch moves the initialization of m_pageUIClient after calling WKViewInitialize().
1909
1910         * UIProcess/API/efl/EwkView.cpp:
1911         (EwkView::EwkView):
1912
1913 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
1914
1915         [Mac] WebKit is not honoring OS preferences for secondary click behaviors
1916         https://bugs.webkit.org/show_bug.cgi?id=143452
1917         <rdar://problem/20437483>
1918
1919         Reviewed by Tim Horton.
1920
1921         We cannot rely on the event's button number to decide behavior. The OS settings might have
1922         mapped middle button to context menu, etc. Instead, we should ask the OS (via NSMenu) what
1923         the proper button press behavior is.
1924
1925         * Shared/mac/WebEventFactory.mm:
1926         (WebKit::mouseButtonForEvent): Ask NSMenu what kind of button press we have received.
1927
1928 2015-04-08  Brady Eidson  <beidson@apple.com>
1929
1930         Expose the "Share" menu for links, images, and media.
1931         <rdar://problem/20435340> and https://bugs.webkit.org/show_bug.cgi?id=143502
1932
1933         Reviewed by Tim Horton.
1934
1935         * Shared/ContextMenuContextData.cpp:
1936         (WebKit::ContextMenuContextData::ContextMenuContextData):
1937
1938         * Shared/WebHitTestResult.cpp:
1939         (WebKit::WebHitTestResult::Data::Data):
1940         * Shared/WebHitTestResult.h:
1941
1942         * UIProcess/WebPageProxy.cpp:
1943         (WebKit::WebPageProxy::internalShowContextMenu):
1944
1945         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
1946         (WebKit::WebContextMenuClient::shareMenuItem):
1947         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
1948
1949         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1950         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): Deleted.
1951
1952         * WebProcess/WebPage/mac/WebPageMac.mm:
1953         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1954
1955 2015-04-08  Anders Carlsson  <andersca@apple.com>
1956
1957         Add encoding and decoding of ints to WKRemoteObjectCoder
1958         https://bugs.webkit.org/show_bug.cgi?id=143538
1959
1960         Reviewed by Tim Horton.
1961
1962         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1963         (-[WKRemoteObjectEncoder encodeInt:forKey:]):
1964         (-[WKRemoteObjectDecoder decodeIntForKey:]):
1965
1966 2015-04-08  Anders Carlsson  <andersca@apple.com>
1967
1968         Delete ApplicationCache static member functions
1969         https://bugs.webkit.org/show_bug.cgi?id=143534
1970
1971         Reviewed by Tim Horton.
1972
1973         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
1974         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
1975         (WebKit::WebApplicationCacheManager::deleteAllEntries):
1976         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1977         (WebKit::InjectedBundle::clearApplicationCacheForOrigin):
1978         (WebKit::InjectedBundle::appCacheUsageForOrigin):
1979
1980 2015-04-08  Enrica Casucci  <enrica@apple.com>
1981
1982         32-bit build fix after r182554.
1983
1984         * UIProcess/API/mac/WKView.mm:
1985         (-[WKView resignFirstResponder]):
1986
1987 2015-04-08  Beth Dakin  <bdakin@apple.com>
1988
1989         Force events should not require preventDefault in order to fire
1990         https://bugs.webkit.org/show_bug.cgi?id=143503
1991         -and corresponding-
1992         rdar://problem/20458916
1993
1994         Reviewed by Tim Horton.
1995
1996         We no longer need m_lastActionMenuHitTestPreventsDefault since we’ll always 
1997         dispatch the events to Element.
1998         * WebProcess/WebPage/WebPage.cpp:
1999         (WebKit::WebPage::WebPage):
2000         * WebProcess/WebPage/WebPage.h:
2001         * WebProcess/WebPage/mac/WebPageMac.mm:
2002         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2003         (WebKit::WebPage::inputDeviceForceDidChange):
2004         (WebKit::WebPage::immediateActionDidCancel):
2005
2006 2015-04-08  Enrica Casucci  <enrica@apple.com>
2007
2008         Calling makeFirstResponder on WKWebView doesn't work.
2009         https://bugs.webkit.org/show_bug.cgi?id=143482
2010         rdar://problem/20298166
2011
2012         Reviewed by Dan Bernstein.
2013
2014         Adding forwarding of the responder status to the WKView.
2015         We also need to avoid doing any cleanup in resignFirstResponder
2016         if we know we are about to regain responder status again.
2017         Same goes for becomeFirstResponder.
2018
2019         * UIProcess/API/Cocoa/WKWebView.mm:
2020         (-[WKWebView becomeFirstResponder]):
2021         (-[WKWebView acceptsFirstResponder]):
2022         * UIProcess/API/mac/WKView.mm:
2023         (-[WKView becomeFristResponder]):
2024         (-[WKView resignFirstResponder]):
2025
2026 2015-04-07  Tim Horton  <timothy_horton@apple.com>
2027
2028         Fix the build.
2029
2030         * UIProcess/API/mac/WKView.mm:
2031         (-[WKView _setFixedLayoutSize:]):
2032
2033 2015-04-07  Tim Horton  <timothy_horton@apple.com>
2034
2035         Expose and test fixedLayoutSize via modern WebKit SPI
2036         https://bugs.webkit.org/show_bug.cgi?id=143500
2037
2038         Reviewed by Simon Fraser.
2039
2040         * UIProcess/API/Cocoa/WKViewPrivate.h:
2041         * UIProcess/API/Cocoa/WKWebView.mm:
2042         (-[WKWebView _isFixedLayoutEnabled]):
2043         (-[WKWebView _setFixedLayoutEnabled:]):
2044         (-[WKWebView _fixedLayoutSize]):
2045         (-[WKWebView _setFixedLayoutSize:]):
2046         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2047         * UIProcess/API/mac/WKView.mm:
2048         (-[WKView _isFixedLayoutEnabled]):
2049         (-[WKView _setFixedLayoutEnabled:]):
2050         (-[WKView _fixedLayoutSize]):
2051         (-[WKView _setFixedLayoutSize:]):
2052         Add API for adjusting the fixed layout size, and whether or not we use it.
2053
2054         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2055         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2056         Repair a mistake I made in r139822, where I brought odd TILED_BACKING_STORE-only
2057         logic (which disables scrollbars if fixedLayoutSize is enabled) to the rest of the ports.
2058         Put it back as TILED_BACKING_STORE-only.
2059
2060         Persist the fixedLayoutSize through view creation; we already persist the enabled state,
2061         but not the size, which doesn't make any sense.
2062
2063         * WebProcess/WebPage/WebPage.cpp:
2064         (WebKit::WebPage::fixedLayoutSize):
2065         * WebProcess/WebPage/WebPage.h:
2066         Add a fixedLayoutSize() getter.
2067
2068 2015-04-07  Brady Eidson  <beidson@apple.com>
2069
2070         ContextMenuItem refactoring
2071         https://bugs.webkit.org/show_bug.cgi?id=143485
2072
2073         Reviewed by Beth Dakin.
2074
2075         * Shared/mac/NativeContextMenuItem.mm:
2076         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2077
2078 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
2079
2080         Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
2081         https://bugs.webkit.org/show_bug.cgi?id=143495
2082
2083         Reviewed by Tim Horton.
2084         
2085         Exposed the antialiasedFontDilationEnabled setting via WK C SPI and Objective-C SPI.
2086
2087         * Shared/WebPreferencesDefinitions.h:
2088         * UIProcess/API/C/WKPreferences.cpp:
2089         (WKPreferencesSetAntialiasedFontDilationEnabled):
2090         (WKPreferencesGetAntialiasedFontDilationEnabled):
2091         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2092         * UIProcess/API/Cocoa/WKPreferences.mm:
2093         (-[WKPreferences _antialiasedFontDilationEnabled]):
2094         (-[WKPreferences _setAntialiasedFontDilationEnabled:]):
2095         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2096         * WebProcess/WebPage/WebPage.cpp:
2097         (WebKit::WebPage::updatePreferences):
2098
2099 2015-04-07  Beth Dakin  <bdakin@apple.com>
2100
2101         Should only propagate pressure events with relevant phases
2102         https://bugs.webkit.org/show_bug.cgi?id=143494
2103         -and corresponding-
2104         rdar://problem/20453738
2105
2106         Reviewed by Tim Horton.
2107
2108         We only care about the changed, began, and ended phases. 
2109         * UIProcess/API/mac/WKView.mm:
2110         (-[WKView pressureChangeWithEvent:]):
2111
2112 2015-04-07  Jer Noble  <jer.noble@apple.com>
2113
2114         Unreviewed build fix; make calls to new SPI conditional on iOS version.
2115
2116         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2117         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
2118
2119 2015-04-06  Anders Carlsson  <andersca@apple.com>
2120
2121         Create the web inspector process pool lazily
2122         https://bugs.webkit.org/show_bug.cgi?id=143456
2123         rdar://problem/20146520
2124
2125         Reviewed by Mark Lam.
2126
2127         Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool
2128         when trying to determine if a given process pool is the inspector process pool.
2129
2130         This should speed up initialization somewhat and avoid creating a storage manager for example.
2131
2132         * UIProcess/WebInspectorProxy.cpp:
2133         (WebKit::WebInspectorProxy::inspectorProcessPool):
2134         (WebKit::WebInspectorProxy::isInspectorProcessPool):
2135         * UIProcess/WebInspectorProxy.h:
2136         * UIProcess/WebProcessProxy.cpp:
2137         (WebKit::WebProcessProxy::getLaunchOptions):
2138
2139 2015-04-06  Brady Eidson  <beidson@apple.com>
2140
2141         Combine ActionMenuHitTestResult with WebHitTestResult
2142         https://bugs.webkit.org/show_bug.cgi?id=143444
2143
2144         Reviewed by Beth Dakin.
2145
2146         * Shared/mac/ActionMenuHitTestResult.h: Removed.
2147         * Shared/mac/ActionMenuHitTestResult.mm: Removed.
2148
2149         * Shared/WebHitTestResult.cpp:
2150         (WebKit::WebHitTestResult::Data::Data):
2151         (WebKit::WebHitTestResult::Data::encode):
2152         (WebKit::WebHitTestResult::Data::decode):
2153         (WebKit::WebHitTestResult::Data::platformEncode):
2154         (WebKit::WebHitTestResult::Data::platformDecode):
2155         * Shared/WebHitTestResult.h:
2156         * Shared/mac/WebHitTestResult.mm: Added.
2157         (WebKit::WebHitTestResult::Data::platformEncode):
2158         (WebKit::WebHitTestResult::Data::platformDecode):
2159
2160         * UIProcess/API/mac/WKView.mm:
2161         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]):
2162         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted.
2163         * UIProcess/API/mac/WKViewInternal.h:
2164         * UIProcess/PageClient.h:
2165         * UIProcess/WebPageProxy.cpp:
2166         (WebKit::WebPageProxy::didPerformActionMenuHitTest):
2167         * UIProcess/WebPageProxy.h:
2168         * UIProcess/WebPageProxy.messages.in:
2169         * UIProcess/mac/PageClientImpl.h:
2170         * UIProcess/mac/PageClientImpl.mm:
2171         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
2172         * UIProcess/mac/WKActionMenuController.h:
2173         * UIProcess/mac/WKActionMenuController.mm:
2174         (-[WKActionMenuController willDestroyView:]):
2175         (-[WKActionMenuController _clearActionMenuState]):
2176         (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
2177         (-[WKActionMenuController _hitTestResultDataImage]):
2178         (-[WKActionMenuController _defaultMenuItemsForImage]):
2179         (-[WKActionMenuController _copyImage:]):
2180         (-[WKActionMenuController _addImageToPhotos:]):
2181         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
2182         (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
2183         (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
2184         (-[WKActionMenuController _webHitTestResult]):
2185         (-[WKActionMenuController _defaultMenuItems]):
2186         (-[WKActionMenuController _hitTestResultImage]): Deleted.
2187         * UIProcess/mac/WKImmediateActionController.h:
2188         * UIProcess/mac/WKImmediateActionController.mm:
2189         (-[WKImmediateActionController willDestroyView:]):
2190         (-[WKImmediateActionController _clearImmediateActionState]):
2191         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]):
2192         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
2193         (-[WKImmediateActionController _webHitTestResult]):
2194         (-[WKImmediateActionController _defaultAnimationController]):
2195         (-[WKImmediateActionController _updateImmediateActionItem]):
2196         (-[WKImmediateActionController _menuItemForDataDetectedText]):
2197         (-[WKImmediateActionController _animationControllerForText]):
2198         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted.
2199         * WebKit2.xcodeproj/project.pbxproj:
2200         * WebProcess/WebPage/mac/WebPageMac.mm:
2201         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2202
2203 2015-04-06  Jer Noble  <jer.noble@apple.com>
2204
2205         Synchronize fullscreen animation between processes.
2206         https://bugs.webkit.org/show_bug.cgi?id=143131
2207
2208         Reviewed by Simon Fraser.
2209
2210         Support synchronize resizing by animating within the UIProcess. Since setVideoLayerFrameFenced() is now only
2211         ever called from within a 0-duration transaction, make that the official contract of the function and wrap
2212         the WebProcess side of that method in its own 0-duration transaction.
2213
2214         * Platform/spi/ios/BackBoardServicesSPI.h: Added.
2215         * Platform/spi/ios/UIKitSPI.h:
2216         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2217         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2218         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Remember the initial rect.
2219         (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Added; simple getter.
2220         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Use a different synchronization fence primative.
2221             Save the cached frame value.
2222         (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Added; simple getter.
2223         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity): Save the cached gravity value.
2224         * WebKit2.xcodeproj/project.pbxproj:
2225         * WebProcess/ios/WebVideoFullscreenManager.mm:
2226         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Wrap in a 0-length transaction.
2227
2228 2015-04-06  Chris Dumez  <cdumez@apple.com>
2229
2230         [WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize()
2231         https://bugs.webkit.org/show_bug.cgi?id=143451
2232         <rdar://problem/20437994>
2233
2234         Reviewed by Anders Carlsson.
2235
2236         Initialize WebProcess::m_webSQLiteDatabaseTracker and
2237         NetworkProcess::m_webSQLiteDatabaseTracker in their respective class
2238         constructors instead of doing it later in the initializeWebProcess() /
2239         initializeNetworkProcess() methods.
2240
2241         If we do it later, it can happen that the tracker gets set after
2242         a SQLiteTransactionInProgressAutoCounter initialization and before
2243         the actual transaction. When this happens, the
2244         SQLiteTransactionInProgressAutoCounter variable fails to increment the
2245         transaction count. Then when the transaction is executed,
2246         SQLiteDatabaseTracker::hasTransactionInProgress() can return false.
2247         This would lead to possible assertions on start up on iOS.
2248
2249         * NetworkProcess/NetworkProcess.cpp:
2250         (WebKit::NetworkProcess::NetworkProcess):
2251         (WebKit::NetworkProcess::initializeNetworkProcess):
2252         * NetworkProcess/NetworkProcess.h:
2253         * WebProcess/WebProcess.cpp:
2254         (WebKit::WebProcess::WebProcess):
2255         (WebKit::WebProcess::initializeConnection):
2256         * WebProcess/WebProcess.h:
2257
2258 2015-04-06  Beth Dakin  <bdakin@apple.com>
2259
2260         https://trac.webkit.org/changeset/182338 introduced a build failure that I 
2261         attempted to fix with https://trac.webkit.org/changeset/182341 , but that disabled 
2262         the feature accidentally.  This should do the right thing.
2263
2264         * UIProcess/API/mac/WKView.mm:
2265         (-[WKView pressureChangeWithEvent:]):
2266
2267 2015-04-06  Commit Queue  <commit-queue@webkit.org>
2268
2269         Unreviewed, rolling out r182296.
2270         https://bugs.webkit.org/show_bug.cgi?id=143448
2271
2272         This will disturb network cache efficacy logging, we should
2273         reland this later. (Requested by cdumez__ on #webkit).
2274
2275         Reverted changeset:
2276
2277         "[WK2][NetworkCache] Drop HTTP method from NetworkCache::Key"
2278         https://bugs.webkit.org/show_bug.cgi?id=143348
2279         http://trac.webkit.org/changeset/182296
2280
2281 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
2282
2283         [WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array::create() call
2284         https://bugs.webkit.org/show_bug.cgi?id=143413
2285
2286         Reviewed by Darin Adler.
2287
2288         Move the Vector<> object containing the copied elements into the Array::create()
2289         call, avoiding copying all the elements again.
2290
2291         While here, change the Vector<> parameters for Array::create() and the Array
2292         constructor to rvalue references. This will ensure that the passed-in object
2293         is moved into the Array::create() call if possible, or explicitly copied
2294         otherwise. The constructor is moved into the header for inlining opportunities
2295         and the unnecessary parameter in the create(Vector<>&&) method declaration
2296         removed.
2297
2298         * Shared/API/APIArray.cpp:
2299         (API::Array::create):
2300         (API::Array::copy):
2301         (API::Array::Array): Deleted.
2302         * Shared/API/APIArray.h:
2303
2304 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
2305
2306         UserScript, UserStyleSheet constructors should take in Vector<String> rvalues
2307         https://bugs.webkit.org/show_bug.cgi?id=143411
2308
2309         Reviewed by Darin Adler.
2310
2311         Move the whitelist and blacklist Vector<String> objects into the
2312         UserScript and UserStyleSheet constructors in ArgumentCoder<T>::decode
2313         functions.
2314
2315         * Shared/WebCoreArgumentCoders.cpp:
2316         (IPC::ArgumentCoder<UserStyleSheet>::decode):
2317         (IPC::ArgumentCoder<UserScript>::decode):
2318
2319 2015-04-05  Darin Adler  <darin@apple.com>
2320
2321         [Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on the main thread
2322         https://bugs.webkit.org/show_bug.cgi?id=143423
2323         rdar://problem/18773785
2324
2325         Reviewed by Alexey Proskuryakov.
2326
2327         * WebProcess/cocoa/WebProcessCocoa.mm:
2328         (WebKit::origin): Factored out this helper function from updateActivePages below, so
2329         the function below is easier to read.
2330         (WebKit::WebProcess::updateActivePages): Refactored to use the new origin function.
2331         Use dispatch_async to call WKSetApplicationInformationItem without blocking.
2332
2333 2015-04-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2334
2335         Use constants of sqlite3 directly for status of SQL result in webdatabase
2336         https://bugs.webkit.org/show_bug.cgi?id=143329
2337
2338         Reviewed by Darin Adler.
2339
2340         In webdatabase, it has used own constant variables as well as using sqlite3 constants directly.
2341         If sqlite3 constants are changed in the library, we should modify many files as well. Besides
2342         it can cause to use if~else statement which consumes more cpu cycles compared to switch~case.
2343
2344         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
2345         (WebKit::SQLiteIDBCursor::createSQLiteStatement):
2346         (WebKit::SQLiteIDBCursor::resetAndRebindStatement):
2347         (WebKit::SQLiteIDBCursor::bindArguments):
2348         (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
2349         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2350         (WebKit::createOrMigrateRecordsTableIfNecessary):
2351         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata):
2352         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
2353         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::changeDatabaseVersion):
2354         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore):
2355         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
2356         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
2357         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
2358         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
2359         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber):
2360         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber):
2361         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
2362         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
2363         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord):
2364         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord):
2365         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
2366         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
2367         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2368         (WebKit::NetworkCache::executeSQLStatement):
2369         (WebKit::NetworkCache::Statistics::initialize):
2370         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
2371         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
2372         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
2373         * UIProcess/Storage/LocalStorageDatabase.cpp:
2374         (WebKit::LocalStorageDatabase::importItems):
2375         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
2376         (WebKit::LocalStorageDatabase::databaseIsEmpty):
2377         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2378         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
2379         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers):
2380         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier):
2381         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
2382         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier):
2383         * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp:
2384         (webkitSoupCookieJarSqliteLoad):
2385         (webkitSoupCookieJarSqliteInsertCookie):
2386         (webkitSoupCookieJarSqliteDeleteCookie):
2387
2388 2015-04-05  Simon Fraser  <simon.fraser@apple.com>
2389
2390         Remove "go ahead and" from comments
2391         https://bugs.webkit.org/show_bug.cgi?id=143421
2392
2393         Reviewed by Darin Adler, Benjamin Poulain.
2394
2395         Remove the phrase "go ahead and" from comments where it doesn't add
2396         anything (which is almost all of them).
2397
2398         * Platform/unix/EnvironmentUtilities.cpp:
2399         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
2400         * PluginProcess/PluginProcess.cpp:
2401         (WebKit::PluginProcess::didClose):
2402         * UIProcess/API/mac/WKView.mm:
2403         (-[WKView insertText:replacementRange:]):
2404         (-[WKView _pluginFocusOrWindowFocusChanged:pluginComplexTextInputIdentifier:]):
2405         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2406         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
2407
2408 2015-04-05  Antti Koivisto  <antti@apple.com>
2409
2410         Bloom filter should support longer hashes
2411         https://bugs.webkit.org/show_bug.cgi?id=143419
2412
2413         Reviewed by Dan Bernstein.
2414
2415         Use the hash digest directly in the contents filter instead of going via shortHash.
2416
2417         * NetworkProcess/cache/NetworkCacheKey.h:
2418         (WebKit::NetworkCache::Key::hash):
2419         (WebKit::NetworkCache::Key::shortHash): Deleted.
2420         (WebKit::NetworkCache::Key::toShortHash): Deleted.
2421
2422             No longer needed.
2423
2424         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2425         (WebKit::NetworkCache::Storage::synchronize):
2426         (WebKit::NetworkCache::Storage::addToContentsFilter):
2427         (WebKit::NetworkCache::Storage::mayContain):
2428         * NetworkProcess/cache/NetworkCacheStorage.h:
2429
2430 2015-04-05  Antti Koivisto  <antti@apple.com>
2431
2432         Network cache Bloom filter is too big
2433         https://bugs.webkit.org/show_bug.cgi?id=143400
2434
2435         Follow-up: Fix an ineffective assert.
2436
2437         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2438         (WebKit::NetworkCache::Storage::setMaximumSize): Average resource size is closer to 50KB than 50MB.
2439
2440 2015-04-05  Antti Koivisto  <antti@apple.com>
2441
2442         Rename Cache::setMaximumSize to setCapacity
2443         https://bugs.webkit.org/show_bug.cgi?id=143418
2444
2445         Reviewed by Dan Bernstein.
2446
2447         * NetworkProcess/cache/NetworkCache.cpp:
2448         (WebKit::NetworkCache::Cache::setCapacity):
2449         (WebKit::NetworkCache::Cache::setMaximumSize): Deleted.
2450         * NetworkProcess/cache/NetworkCache.h:
2451         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2452         (WebKit::NetworkCache::Storage::retrieve):
2453         (WebKit::NetworkCache::Storage::store):
2454         (WebKit::NetworkCache::Storage::update):
2455         (WebKit::NetworkCache::Storage::setCapacity):
2456         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
2457         (WebKit::NetworkCache::Storage::shrink):
2458         (WebKit::NetworkCache::Storage::setMaximumSize): Deleted.
2459         * NetworkProcess/cache/NetworkCacheStorage.h:
2460         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2461         (WebKit::NetworkProcess::platformSetCacheModel):
2462
2463 2015-04-04  Antti Koivisto  <antti@apple.com>
2464
2465         Network cache Bloom filter is too big
2466         https://bugs.webkit.org/show_bug.cgi?id=143400
2467
2468         Reviewed by Chris Dumez.
2469
2470         It is currently 1MB.
2471
2472         This patch switches the cache from a counting filter (CountingBloomFilter) to a bit filter (BloomFilter).
2473
2474         It also reduces the filter size from 2^20 to 2^18 elements which is good for ~26000 cache entries while
2475         still keeping false positive rate below 1%. The current cache capacity allows around 4000 entries
2476         with typical web contents.
2477
2478         The new filter size is 32KB.
2479
2480         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2481         (WebKit::NetworkCache::Storage::Storage):
2482         (WebKit::NetworkCache::Storage::synchronize):
2483
2484             Turn initialization function into general purpose synchronization function.
2485
2486         (WebKit::NetworkCache::Storage::addToContentsFilter):
2487
2488             Collect newly added hashes so we don't miss entries that were added during synchronization.
2489
2490         (WebKit::NetworkCache::Storage::mayContain):
2491         (WebKit::NetworkCache::Storage::remove):
2492         (WebKit::NetworkCache::Storage::retrieve):
2493         (WebKit::NetworkCache::Storage::store):
2494         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
2495         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
2496         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
2497         (WebKit::NetworkCache::Storage::setMaximumSize):
2498         (WebKit::NetworkCache::Storage::clear):
2499         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
2500         (WebKit::NetworkCache::Storage::shrink):
2501
2502             Non-counting Bloom filter does not support removals so this requires a new strategy.
2503
2504             Shrink code now simply deletes entries. The filter is updated by calling synchronize() at the end.
2505             While we could synchronize the filter during traversal it is better to just have one function for that.
2506
2507         (WebKit::NetworkCache::Storage::initialize): Deleted.
2508         * NetworkProcess/cache/NetworkCacheStorage.h:
2509         (WebKit::NetworkCache::Storage::mayContain):
2510         (WebKit::NetworkCache::Storage::cacheMayContain): Deleted.
2511
2512 2015-04-04  Andy Estes  <aestes@apple.com>
2513
2514         [Content Filtering] Blocked page is not always displayed when it should be
2515         https://bugs.webkit.org/show_bug.cgi?id=143410
2516
2517         Reviewed by Andreas Kling.
2518
2519         * UIProcess/WebFrameProxy.cpp:
2520         (WebKit::WebFrameProxy::didStartProvisionalLoad): Stopped clearing m_contentFilterUnblockHandler here.
2521         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Started doing it here instead.
2522
2523 2015-04-04  Chris Dumez  <cdumez@apple.com>
2524
2525         [WK2][Cocoa] Add a way to temporarily disable the WebKit Network Cache for testing
2526         https://bugs.webkit.org/show_bug.cgi?id=143392
2527         <rdar://problem/20315669>
2528
2529         Reviewed by Antti Koivisto.
2530
2531         Add a way to temporarily disable the WebKit Network Cache for testing.
2532         It will be used temporarily for comparing page load times with and
2533         without the WebKit network disk cache enabled.
2534
2535         This is in addition to the existing "WebKitNetworkCacheEnabled"
2536         NSUserDefaults:
2537         webkitNetworkCacheIsEnabled = [defaults boolForKey:WebKitNetworkCacheEnabledDefaultsKey]
2538             && ![defaults boolForKey:WebKitNetworkCacheTemporarilyDisabledForTestingKey];
2539
2540         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2541         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2542
2543 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
2544
2545         REGRESSION (r182215): Feedly crashes when closing article
2546         https://bugs.webkit.org/show_bug.cgi?id=143405
2547         rdar://problem/20382734, rdar://problem/20395497
2548
2549         Reviewed by Tim Horton.
2550         
2551         Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
2552         is bad, because it can cause FrameView::layout() to get called in the middle of
2553         RenderObject destruction, which leaves the render tree in a bad state.
2554         
2555         Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
2556         
2557         AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
2558         a flag to say that the non-fast region needs to be recomputed, and that schedules
2559         a scrolling tree commit. When the commit happens, we recompute the region. If the
2560         region didn't change, and no other changes are pending, there's no need to commit.
2561
2562         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2563         (WebKit::RemoteScrollingCoordinator::buildTransaction):
2564         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2565         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Outdent #ifdefs.
2566
2567 2015-04-03  Beth Dakin  <bdakin@apple.com>
2568
2569         Attempted build fix.
2570
2571         * UIProcess/API/mac/WKView.mm:
2572
2573 2015-04-03  Simon Fraser  <simon.fraser@apple.com>
2574
2575         Fix the firing of the ReachedSessionRestorationRenderTreeSizeThreshold milestone on iOS
2576         https://bugs.webkit.org/show_bug.cgi?id=143394
2577
2578         Reviewed by Tim Horton.
2579         
2580         A client reshuffle at some point broke the dispatch of the ReachedSessionRestorationRenderTreeSizeThreshold
2581         milestone. Fix by using WebPageProxy::didLayout() to fire the milestone.
2582
2583         * UIProcess/ios/WebPageProxyIOS.mm:
2584         (WebKit::WebPageProxy::didCommitLayerTree):
2585
2586 2015-04-03  Beth Dakin  <bdakin@apple.com>
2587
2588         https://bugs.webkit.org/show_bug.cgi?id=143387
2589         Improvements to webkitmouseforce web API
2590         -and corresponding-
2591         rdar://problem/20281808
2592         rdar://problem/20281853
2593
2594         Reviewed by Darin Adler.
2595
2596         This patch:
2597         1. Dispatches webkitmouseforceup and webkitmouseforceclick at the right time.
2598         2. Dispatches webkitmouseforcechanged from mousedown all the way through through 
2599         mouseup.
2600         3. Uses force values from pressureChangeWithEvent instead of the immediate action 
2601         gesture recognizer.
2602
2603         Listen for this NSResponder method, and pass the relevant info to WebPageProxy to 
2604         dispatch to the web process.
2605         * UIProcess/API/mac/WKView.mm:
2606         (-[WKView pressureChangeWithEvent:]):
2607         * UIProcess/WebPageProxy.cpp:
2608         (WebKit::WebPageProxy::inputDeviceForceDidChange):
2609         (WebKit::WebPageProxy::immediateActionDidUpdate):
2610         * UIProcess/WebPageProxy.h:
2611
2612         The web process still needs to know when the immediate action gesture recognizer 
2613         is updating, but it doesn’t need the force information. That will come from 
2614         pressureChangeWithEvent.
2615         * UIProcess/mac/WKImmediateActionController.mm:
2616         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
2617
2618         Cache m_lastForceStage so that we can determine if we are 
2619         transitioning to a new stage.
2620         * WebProcess/WebPage/WebPage.cpp:
2621         (WebKit::WebPage::WebPage):
2622         * WebProcess/WebPage/WebPage.h:
2623
2624         New message for InputDeviceForceDidChange and modified message for 
2625         ImmediateActionDidUpdate
2626         * WebProcess/WebPage/WebPage.messages.in:
2627
2628         inputDeviceForceDidChange now takes care of dispatching mouseforcechanged, 
2629         mouseforcedown, mouseforceup, and mouseforceclick.
2630         * WebProcess/WebPage/mac/WebPageMac.mm:
2631         (WebKit::WebPage::inputDeviceForceDidChange):
2632
2633         We still need to keep track of the ImmediateActionStages in WebCore::EventHandler 
2634         so that we can have the right default behavior on mouseup based on whether or not 
2635         that action began and was completed. (In other words, to ensure we don’t navigate 
2636         to a link after force clicking it.)
2637         (WebKit::WebPage::immediateActionDidUpdate):
2638         (WebKit::WebPage::immediateActionDidComplete):
2639
2640 2015-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2641
2642         InjectedBundleNodeHandle::renderedImage() needs to be exposed from the Cocoa WebAPI layer.
2643         https://bugs.webkit.org/show_bug.cgi?id=143341.
2644
2645         Reviewed by Anders Carlsson.
2646
2647         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
2648         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2649         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Expose rendered
2650         image injected bundle API from the Cocoa layer. A node in the page can be
2651         rendered to an NSImage on MacOS and to a UIImage on iOS.
2652
2653 2015-04-03  Chris Dumez  <cdumez@apple.com>
2654
2655         [WK2][iOS] We should prevent NetworkProcess suspension while it has pending SQL transactions
2656         https://bugs.webkit.org/show_bug.cgi?id=143278
2657         <rdar://problem/20180799>
2658
2659         Reviewed by Anders Carlsson.
2660
2661         Prevent NetworkProcess suspension while it has pending SQL transactions,
2662         similarly to what we already did for WebProcesses. This patch moves the
2663         WebSQLiteDatabaseTracker from WebProcess/ to Shared/ and make it usable
2664         by the NetworkProcess class as well.
2665
2666         Whenever there are locked files to due SQL transactions, the
2667         NetworkProcess will send an IPC message to the NetworkProcessProxy
2668         which will hold a background process assertion until the NetworkProcess'
2669         SQL transactions are complete. This way, it is no longer possible for
2670         the NetworkProcess to get suspended while SQL transactions are running
2671         and a database file is locked.
2672
2673         * NetworkProcess/NetworkProcess.cpp:
2674         (WebKit::NetworkProcess::initializeNetworkProcess):
2675         * NetworkProcess/NetworkProcess.h:
2676         * Shared/WebSQLiteDatabaseTracker.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp.
2677         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2678         (WebKit::m_childProcessType):
2679         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
2680         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
2681         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
2682         * Shared/WebSQLiteDatabaseTracker.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h.
2683         * UIProcess/Network/NetworkProcessProxy.cpp:
2684         (WebKit::NetworkProcessProxy::didClose):
2685         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
2686         * UIProcess/Network/NetworkProcessProxy.h:
2687         * UIProcess/Network/NetworkProcessProxy.messages.in:
2688         * WebKit2.xcodeproj/project.pbxproj:
2689         * WebProcess/WebProcess.cpp:
2690         (WebKit::WebProcess::WebProcess):
2691         (WebKit::WebProcess::initializeConnection):
2692         * WebProcess/WebProcess.h:
2693
2694 2015-04-03  Antti Koivisto  <antti@apple.com>
2695
2696         Add non-counting Bloom filter implementation
2697         https://bugs.webkit.org/show_bug.cgi?id=143366
2698
2699         Reviewed by Sam Weinig.
2700
2701         * NetworkProcess/cache/NetworkCacheStorage.h:
2702
2703 2015-04-03  Zan Dobersek  <zdobersek@igalia.com>
2704
2705         Fix the EFL and GTK build after r182243
2706         https://bugs.webkit.org/show_bug.cgi?id=143361
2707
2708         Reviewed by Csaba Osztrogonác.
2709
2710         * PlatformGTK.cmake: Add a custom command that copies the
2711         InspectorBackendCommands.js file into the proper directory
2712         under DerivedSources/WebInspectorUI/.
2713
2714 2015-04-03  Philippe Normand  <pnormand@igalia.com>
2715
2716         Unreviewed, GTK build fix.
2717
2718         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
2719         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2720         * UIProcess/gtk/WebContextMenuProxyGtk.h:
2721
2722 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
2723
2724         Typo fix.
2725
2726         * PlatformGTK.cmake:
2727
2728 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
2729
2730         URTBF after r182303, stub NativeContextMenuItem implemetations added for EFL and GTK.
2731
2732         * PlatformEfl.cmake:
2733         * PlatformGTK.cmake:
2734         * Shared/efl/NativeContextMenuItemEfl.cpp: Added.
2735         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2736         * Shared/gtk/NativeContextMenuItemGtk.cpp: Added.
2737         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2738
2739 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
2740
2741         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
2742         https://bugs.webkit.org/show_bug.cgi?id=143342
2743
2744         * Platform/mac/LayerHostingContext.h:
2745         * Platform/mac/LayerHostingContext.mm:
2746         Actually, not available on Mavericks. Fix the build.
2747
2748 2015-04-02  Brady Eidson  <beidson@apple.com>
2749
2750         Unreviewed: Re-applied change after rollout.
2751
2752         Expose the "Share" menu for text selections on platforms where it's available.
2753         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
2754
2755         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
2756         * Shared/API/c/WKSharedAPICast.h:
2757         (WebKit::toAPI):
2758         (WebKit::toImpl):
2759
2760         * Shared/ContextMenuContextData.cpp:
2761         (WebKit::ContextMenuContextData::ContextMenuContextData):
2762         (WebKit::ContextMenuContextData::encode):
2763         (WebKit::ContextMenuContextData::decode):
2764         * Shared/ContextMenuContextData.h:
2765         (WebKit::ContextMenuContextData::selectedText):
2766
2767         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
2768         * Shared/NativeContextMenuItem.h:
2769         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
2770         (WebKit::NativeContextMenuItem::nsMenuItem):
2771         * Shared/mac/NativeContextMenuItem.mm:
2772         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2773
2774         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
2775         * Shared/WebContextMenuItem.cpp:
2776         (WebKit::WebContextMenuItem::WebContextMenuItem):
2777         * Shared/WebContextMenuItem.h:
2778         (WebKit::WebContextMenuItem::create):
2779         (WebKit::WebContextMenuItem::nativeContextMenuItem):
2780
2781         * UIProcess/API/APIContextMenuClient.h:
2782         (API::ContextMenuClient::getContextMenuFromProposedMenu):
2783         (API::ContextMenuClient::showContextMenu):
2784
2785         * UIProcess/API/C/WKPage.cpp:
2786         (WKPageSetPageContextMenuClient):
2787
2788         * UIProcess/WebContextMenuProxy.h:
2789
2790         * UIProcess/WebPageProxy.cpp:
2791         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
2792           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
2793           can be attached to them.
2794
2795         * UIProcess/mac/WebContextMenuProxyMac.h:
2796         * UIProcess/mac/WebContextMenuProxyMac.mm:
2797         (-[WKMenuTarget forwardContextMenuAction:]):
2798         (WebKit::nsMenuItem):
2799         (WebKit::nsMenuItemVector):
2800         (WebKit::WebContextMenuProxyMac::populate):
2801         (WebKit::WebContextMenuProxyMac::showContextMenu):
2802
2803         * WebKit2.xcodeproj/project.pbxproj:
2804
2805         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
2806         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2807         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
2808           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
2809
2810 2015-04-02  Commit Queue  <commit-queue@webkit.org>
2811
2812         Unreviewed, rolling out r182293.
2813         https://bugs.webkit.org/show_bug.cgi?id=143355
2814
2815         Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
2816
2817         Reverted changeset:
2818
2819         "Expose the "Share" menu for text selections on platforms
2820         where it's available."
2821         https://bugs.webkit.org/show_bug.cgi?id=143318
2822         http://trac.webkit.org/changeset/182293
2823
2824 2015-04-02  Chris Dumez  <cdumez@apple.com>
2825
2826         [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key
2827         https://bugs.webkit.org/show_bug.cgi?id=143348
2828
2829         Reviewed by Antti Koivisto.
2830
2831         Drop HTTP method from NetworkCache::Key as we only cache GET responses
2832         for now. Even when we start caching HEAD responses, we likely will not
2833         want the method to be part of the key because:
2834         - A HEAD response can be used to update the headers of a previously cached response to GET
2835         - A cached GET response may be used to satisfy subsequent HEAD requests
2836
2837         * NetworkProcess/cache/NetworkCache.cpp:
2838         (WebKit::NetworkCache::makeCacheKey):
2839         * NetworkProcess/cache/NetworkCacheKey.cpp:
2840         (WebKit::NetworkCache::Key::Key):
2841         (WebKit::NetworkCache::Key::operator=):
2842         (WebKit::NetworkCache::Key::computeHash):
2843         (WebKit::NetworkCache::Key::operator==):
2844         (WebKit::NetworkCache::Key::encode):
2845         (WebKit::NetworkCache::Key::decode):
2846         * NetworkProcess/cache/NetworkCacheKey.h:
2847         (WebKit::NetworkCache::Key::method): Deleted.
2848
2849 2015-04-02  Jer Noble  <jer.noble@apple.com>
2850
2851         [Mac][WK2] Fullscreen animation incorrect when initiated on non-primary monitor
2852         https://bugs.webkit.org/show_bug.cgi?id=143237
2853
2854         Reviewed by Brent Fulgham.
2855
2856         The animation calculations have an implicit assumptions of a screen whose origin is 0,0. Account
2857         for the screen origin by passing the window's screen's frame into the zoomAnimation() and maskAnimation()
2858         methods.
2859
2860         * UIProcess/mac/WKFullScreenWindowController.mm:
2861         (-[WKFullScreenWindowController initWithWindow:webView:]):
2862         (zoomAnimation):
2863         (maskAnimation):
2864         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2865         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2866
2867 2015-04-02  Brady Eidson  <beidson@apple.com>
2868
2869         Expose the "Share" menu for text selections on platforms where it's available.
2870         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
2871
2872         Reviewed by Sam Weinig.
2873
2874         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
2875         * Shared/API/c/WKSharedAPICast.h:
2876         (WebKit::toAPI):
2877         (WebKit::toImpl):
2878
2879         * Shared/ContextMenuContextData.cpp:
2880         (WebKit::ContextMenuContextData::ContextMenuContextData):
2881         (WebKit::ContextMenuContextData::encode):
2882         (WebKit::ContextMenuContextData::decode):
2883         * Shared/ContextMenuContextData.h:
2884         (WebKit::ContextMenuContextData::selectedText):
2885
2886         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
2887         * Shared/NativeContextMenuItem.h:
2888         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
2889         (WebKit::NativeContextMenuItem::nsMenuItem):
2890         * Shared/mac/NativeContextMenuItem.mm:
2891         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2892
2893         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
2894         * Shared/WebContextMenuItem.cpp:
2895         (WebKit::WebContextMenuItem::WebContextMenuItem):
2896         * Shared/WebContextMenuItem.h:
2897         (WebKit::WebContextMenuItem::create):
2898         (WebKit::WebContextMenuItem::nativeContextMenuItem):
2899
2900         * UIProcess/API/APIContextMenuClient.h:
2901         (API::ContextMenuClient::getContextMenuFromProposedMenu):
2902         (API::ContextMenuClient::showContextMenu):
2903
2904         * UIProcess/API/C/WKPage.cpp:
2905         (WKPageSetPageContextMenuClient):
2906
2907         * UIProcess/WebContextMenuProxy.h:
2908
2909         * UIProcess/WebPageProxy.cpp:
2910         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
2911           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
2912           can be attached to them.
2913
2914         * UIProcess/mac/WebContextMenuProxyMac.h:
2915         * UIProcess/mac/WebContextMenuProxyMac.mm:
2916         (-[WKMenuTarget forwardContextMenuAction:]):
2917         (WebKit::nsMenuItem):
2918         (WebKit::nsMenuItemVector):
2919         (WebKit::WebContextMenuProxyMac::populate):
2920         (WebKit::WebContextMenuProxyMac::showContextMenu):
2921
2922         * WebKit2.xcodeproj/project.pbxproj:
2923
2924         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
2925         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2926         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
2927           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
2928
2929 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
2930
2931         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
2932         https://bugs.webkit.org/show_bug.cgi?id=143342
2933
2934         Reviewed by Myles C. Maxfield.
2935
2936         * Platform/mac/LayerHostingContext.h:
2937         * Platform/mac/LayerHostingContext.mm:
2938         (WebKit::LayerHostingContext::setFencePort):
2939         There's nothing iOS specific about this.
2940
2941 2015-04-02  Oliver Hunt  <oliver@apple.com>
2942
2943         Ensure that we always set network ATS context in the network process
2944         https://bugs.webkit.org/show_bug.cgi?id=143343
2945
2946         Reviewed by Dan Bernstein.
2947
2948         If a custom cache location or size we were early returning before setting
2949         the CFNetwork ATS context. This is clearly an error.
2950
2951         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2952         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2953
2954 2015-04-02  Alexey Proskuryakov  <ap@apple.com>
2955
2956         Make checkURLReceivedFromWebProcess not rely on details of platform URL implementation.
2957         https://bugs.webkit.org/show_bug.cgi?id=143222
2958         rdar://problem/19978997
2959
2960         Reviewed by Sam Weinig.
2961
2962         * UIProcess/WebProcessProxy.cpp:
2963         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
2964
2965 2015-04-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2966
2967         Clean up EnumerationMode to easily extend
2968         https://bugs.webkit.org/show_bug.cgi?id=143276
2969
2970         Reviewed by Geoffrey Garen.
2971
2972         Use default EnumerationMode().
2973
2974         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2975         (WebKit::NPJSObject::enumerate):
2976
2977 2015-04-02  Chris Dumez  <cdumez@apple.com>
2978
2979         [WK2][iOS] Update the WebContent process' sandbox profile for AWD
2980         https://bugs.webkit.org/show_bug.cgi?id=143340
2981         <rdar://problem/20375170>
2982
2983         Reviewed by Alexey Proskuryakov.
2984
2985         Update the WebContent process' sandbox profile for AWD.
2986
2987         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2988
2989 2015-04-01  Antti Koivisto  <antti@apple.com>
2990
2991         Use std::chrono types to represent time in response and cache classes
2992         https://bugs.webkit.org/show_bug.cgi?id=143316
2993
2994         Reviewed by Andreas Kling.
2995
2996         * NetworkProcess/NetworkResourceLoader.cpp:
2997         (WebKit::NetworkResourceLoader::didFinishLoading):
2998         * NetworkProcess/cache/NetworkCache.cpp:
2999         (WebKit::NetworkCache::responseHasExpired):
3000         (WebKit::NetworkCache::responseNeedsRevalidation):
3001         (WebKit::NetworkCache::makeStoreDecision):
3002         (WebKit::NetworkCache::Cache::store):
3003         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3004         (WebKit::NetworkCache::Entry::Entry):
3005         (WebKit::NetworkCache::Entry::asJSON):
3006         * NetworkProcess/cache/NetworkCacheEntry.h:
3007         (WebKit::NetworkCache::Entry::timeStamp):
3008         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3009         (WebKit::NetworkCache::decodeRecordMetaData):
3010         (WebKit::NetworkCache::decodeRecord):
3011
3012             Sanity check the timestamp on decode.
3013
3014         (WebKit::NetworkCache::encodeRecordMetaData):
3015         (WebKit::NetworkCache::encodeRecordHeader):
3016         (WebKit::NetworkCache::Storage::traverse):
3017         * NetworkProcess/cache/NetworkCacheStorage.h:
3018         * WebProcess/Plugins/PluginView.cpp:
3019         (WebKit::lastModifiedDateMS):
3020         (WebKit::PluginView::Stream::didReceiveResponse):
3021         (WebKit::PluginView::manualLoadDidReceiveResponse):
3022         (WebKit::lastModifiedDate): Deleted.
3023
3024 2015-04-01  Chris Dumez  <cdumez@apple.com>
3025
3026         [WK2][Cocoa] Add didFailProvisionalLoadWithErrorForFrame callback to WKWebProcessPlugInLoadDelegate
3027         https://bugs.webkit.org/show_bug.cgi?id=143319
3028         <rdar://problem/19463834>
3029
3030         Reviewed by Dan Bernstein.
3031
3032         Add didFailProvisionalLoadWithErrorForFrame callback to
3033         WKWebProcessPlugInLoadDelegate so that the client side can track all
3034         types page load completions:
3035         - didFailProvisionalLoadWithErrorForFrame
3036         - didFailLoadWithErrorForFrame
3037         - didFinishLoadForFrame
3038
3039         Note that this event is already exposed on UIProcess side via the
3040         WKPageLoaderClient.didFailLoadWithErrorForFrame callback.
3041
3042         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
3043         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3044         (didFailProvisionalLoadWithErrorForFrame):
3045         (setUpPageLoaderClient):
3046
3047 2015-04-01  Enrica Casucci  <enrica@apple.com>
3048
3049         Injected bundle messages should be at the page level.
3050         https://bugs.webkit.org/show_bug.cgi?id=143283
3051
3052         Reviewed by Alexey Proskuryakov.
3053
3054         All the messages between the injected bundle and the UI
3055         process should be page level messages instead of context.
3056         The author of this patch is Tim Horton, I just finished it.
3057
3058         * UIProcess/API/C/WKPage.cpp:
3059         (WKPageSetPageInjectedBundleClient):
3060         * UIProcess/API/C/WKPage.h:
3061         * UIProcess/API/C/WKPageInjectedBundleClient.h: Added.
3062         * UIProcess/API/Cocoa/WKWebView.mm:
3063         (-[WKWebView _pageForTesting]):
3064         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3065         * UIProcess/WebPageInjectedBundleClient.cpp: Added.
3066         (WebKit::WebPageInjectedBundleClient::didReceiveMessageFromInjectedBundle):
3067         (WebKit::WebPageInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
3068         * UIProcess/WebPageInjectedBundleClient.h: Added.
3069         * UIProcess/WebPageProxy.cpp:
3070         (WebKit::WebPageProxy::setInjectedBundleClient):
3071         (WebKit::WebPageProxy::handleMessage):
3072         (WebKit::WebPageProxy::handleSynchronousMessage):
3073         * UIProcess/WebPageProxy.h:
3074         (WebKit::WebPageProxy::injectedBundleClient):
3075         * UIProcess/WebPageProxy.messages.in:
3076         * UIProcess/WebProcessPool.cpp:
3077         (WebKit::WebProcessPool::handleMessage):
3078         * WebKit2.xcodeproj/project.pbxproj:
3079         * CMakeLists.txt:
3080         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3081         (WKBundlePagePostMessage):
3082         (WKBundlePagePostSynchronousMessage):
3083         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3084         * WebProcess/WebPage/WebPage.cpp:
3085         (WebKit::WebPage::postMessage):
3086         (WebKit::WebPage::postSynchronousMessage):
3087         * WebProcess/WebPage/WebPage.h:
3088
3089 2015-04-01  Alexey Proskuryakov  <ap@apple.com>
3090
3091         [iOS] WebContent should have access to the entirety of its caches directory
3092         https://bugs.webkit.org/show_bug.cgi?id=143312
3093         rdar://problem/20314916
3094
3095         Reviewed by Oliver Hunt.
3096
3097         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3098         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3099         * Shared/Network/NetworkProcessCreationParameters.cpp:
3100         (WebKit::NetworkProcessCreationParameters::encode):
3101         (WebKit::NetworkProcessCreationParameters::decode):
3102         * Shared/Network/NetworkProcessCreationParameters.h:
3103         * Shared/WebProcessCreationParameters.cpp:
3104         (WebKit::WebProcessCreationParameters::encode):
3105         (WebKit::WebProcessCreationParameters::decode):
3106         * Shared/WebProcessCreationParameters.h:
3107         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3108         (WebKit::WebProcessPool::networkingCachesDirectory):
3109         (WebKit::WebProcessPool::webContentCachesDirectory):
3110         (WebKit::WebProcessPool::openGLCacheDirectory): Deleted.
3111         (WebKit::WebProcessPool::networkingHSTSDatabasePath): Deleted.
3112         (WebKit::WebProcessPool::webContentHSTSDatabasePath): Deleted.
3113         * UIProcess/WebProcessPool.cpp:
3114         (WebKit::WebProcessPool::ensureNetworkProcess):
3115         (WebKit::WebProcessPool::createNewWebProcess):
3116         * UIProcess/WebProcessPool.h:
3117         * WebProcess/cocoa/WebProcessCocoa.mm:
3118         (WebKit::WebProcess::platformInitializeWebProcess):
3119
3120 2015-04-01  Timothy Horton  <timothy_horton@apple.com>
3121
3122         Smart magnification gesture sometimes shoots to the middle of the page
3123         https://bugs.webkit.org/show_bug.cgi?id=143296
3124         <rdar://problem/18209280>
3125
3126         Reviewed by Dean Jackson.
3127
3128         * UIProcess/mac/ViewGestureControllerMac.mm:
3129         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
3130         Constrain the target rect to the viewport, and if it had overflowed the viewport,
3131         scroll halfway towards the gesture origin.
3132
3133 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
3134
3135         Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
3136         https://bugs.webkit.org/show_bug.cgi?id=143288
3137         rdar://problem/16049624
3138
3139         Reviewed by Beth Dakin.
3140
3141         Remove the wheel event counting that Document does, and passes into the scrolling tree.
3142         The ScrollingTree now just uses the non-fast scrollable region to determine when to
3143         fast scroll on pages with wheel event handlers.
3144         
3145         If a handler includes position:fixed renderers, we just cover the whole document
3146         with the slow-scrolling region currently. This could be improved.
3147
3148         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3149         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
3150         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
3151         (WebKit::RemoteScrollingTreeTextStream::dump):
3152         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3153         (WebKit::WebChromeClient::wheelEventHandlersChanged):
3154         (WebKit::WebChromeClient::numWheelEventHandlersChanged): Deleted.
3155         * WebProcess/WebCoreSupport/WebChromeClient.h:
3156         * WebProcess/WebPage/WebPage.cpp:
3157         (WebKit::WebPage::WebPage):
3158         (WebKit::WebPage::wheelEventHandlersChanged):
3159         (WebKit::WebPage::recomputeShortCircuitHorizontalWheelEventsState):
3160         (WebKit::WebPage::numWheelEventHandlersChanged): Deleted.
3161         * WebProcess/WebPage/WebPage.h:
3162
3163 2015-03-31  Dan Bernstein  <mitz@apple.com>
3164
3165         <rdar://problem/20365675> [iOS] Include Add to Reading List link action only where supported
3166         https://bugs.webkit.org/show_bug.cgi?id=143289
3167
3168         Reviewed by Tim Horton.
3169
3170         * UIProcess/API/Cocoa/_WKElementAction.h: Excluded _WKElementActionTypeAddToReadingList from
3171         the _WKElementActionType enum when Reading List is not supported.
3172
3173         * UIProcess/API/Cocoa/_WKElementAction.mm:
3174         (+[_WKElementAction elementActionWithType:customTitle:]): Made Add to Reading List code
3175         conditional on HAVE(SAFARI_SERVICES_FRAMEWORK).
3176
3177         * UIProcess/ios/WKActionSheetAssistant.mm:
3178         (-[WKActionSheetAssistant showImageSheet]): Ditto.
3179         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
3180
3181         * config.h: Defined HAVE_SAFARI_SERVICES_FRAMEWORK.
3182
3183 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
3184
3185         TextIndicator for <span> inside an <a> only highlights the <span>, should highlight the whole <a>
3186         https://bugs.webkit.org/show_bug.cgi?id=143287
3187         <rdar://problem/20318342>
3188
3189         Reviewed by Beth Dakin.
3190
3191         * WebProcess/WebPage/mac/WebPageMac.mm:
3192         (WebKit::WebPage::performActionMenuHitTestAtLocation):
3193         Instead of just highlighting the hit element, highlight the whole
3194         element that the link URL comes from.
3195
3196 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
3197
3198         WKView should stop using endGestureWithEvent
3199         https://bugs.webkit.org/show_bug.cgi?id=143285
3200         <rdar://problem/20357007>
3201
3202         Reviewed by Simon Fraser.
3203
3204         * UIProcess/API/mac/WKView.mm:
3205         (-[WKView magnifyWithEvent:]):
3206         (-[WKView endGestureWithEvent:]): Deleted.
3207         * UIProcess/mac/ViewGestureController.h:
3208         * UIProcess/mac/ViewGestureControllerMac.mm:
3209         (WebKit::ViewGestureController::endMagnificationGesture):
3210         (WebKit::ViewGestureController::endActiveGesture): Deleted.
3211         While there is no visible symptom, it is recommended that we check
3212         the phase of normal magnification events instead of using the
3213         special gesture end events.
3214
3215 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
3216
3217         Swipes occur in the wrong direction in RTL
3218         https://bugs.webkit.org/show_bug.cgi?id=143257
3219         <rdar://problem/20300862>
3220
3221         Reviewed by Simon Fraser.
3222
3223         * UIProcess/ios/ViewGestureControllerIOS.mm:
3224         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
3225         When choosing which edge to attach our gesture recognizers to,
3226         flip them in RTL.
3227
3228         (-[WKSwipeTransitionController directionForTransition:]):
3229         (WebKit::ViewGestureController::beginSwipeGesture):
3230         (WebKit::ViewGestureController::canSwipeInDirection):
3231         * UIProcess/mac/ViewGestureController.h:
3232         * UIProcess/mac/ViewGestureControllerMac.mm:
3233         (WebKit::ViewGestureController::scrollEventCanBecomeSwipe):
3234         (WebKit::ViewGestureController::trackSwipeGesture):
3235         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
3236         (WebKit::ViewGestureController::beginSwipeGesture):
3237         (WebKit::ViewGestureController::handleSwipeGesture):
3238         Adjust SwipeDirection to be in logical back-forward list direction
3239         instead of physical edge direction.
3240
3241 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
3242
3243         Move ExpansionBehaviorFlags and TextDirection to their own file
3244         https://bugs.webkit.org/show_bug.cgi?id=143273
3245
3246         Reviewed by Simon Fraser.
3247
3248         This is a mechanical change. It just moves code around.
3249
3250         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
3251
3252         * Shared/WebPopupItem.h:
3253         * UIProcess/API/C/efl/WKAPICastEfl.h:
3254         * UIProcess/API/efl/EwkView.h:
3255         * UIProcess/WebPopupMenuProxy.h:
3256         * UIProcess/efl/WebUIPopupMenuClient.h:
3257
3258 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
3259
3260         Clean up Identifier factories to clarify the meaning of StringImpl*
3261         https://bugs.webkit.org/show_bug.cgi?id=143146
3262
3263         Reviewed by Filip Pizlo.
3264
3265         Just change to Identifier::fromString.
3266
3267         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3268         (WebKit::JSNPObject::getOwnPropertyNames):
3269         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3270         (WebKit::identifierFromIdentifierRep):
3271
3272 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
3273
3274         WebKit briefly shows wrong webpage after swiping back (gigaom.com, or any site on a slow network)
3275         https://bugs.webkit.org/show_bug.cgi?id=143256
3276         <rdar://problem/19458648>
3277
3278         Reviewed by Dan Bernstein.
3279
3280         Instead of allowing a flash of the previous page when the swipe snapshot
3281         timeouts fire (removing the snapshot before the new page is loaded), show
3282         the snapshotted background color.
3283
3284         This fixes the problem on iOS, where UI-side compositing makes it easy to fix,
3285         but not yet on OS X.
3286
3287         * UIProcess/API/Cocoa/WKWebView.mm:
3288         (baseScrollViewBackgroundColor):
3289         (scrollViewBackgroundColor):
3290         If the ViewGestureController returns a valid background color, use that
3291         instead of the page's background color.
3292
3293         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3294         Expose _updateScrollViewBackground.
3295
3296         * UIProcess/PageClient.h:
3297         * UIProcess/ios/PageClientImplIOS.h:
3298         * UIProcess/ios/PageClientImplIOS.mm:
3299         (WebKit::PageClientImpl::didChangeBackgroundColor):
3300         * UIProcess/mac/PageClientImpl.h:
3301         * UIProcess/mac/PageClientImpl.mm:
3302         (WebKit::PageClientImpl::didChangeBackgroundColor):
3303         * UIProcess/WebPageProxy.cpp:
3304         (WebKit::WebPageProxy::didChangeBackgroundColor):
3305         * UIProcess/WebPageProxy.h:
3306         Add and plumb didChangeBackgroundColor, which calls
3307         _updateScrollViewBackground on iOS.
3308         
3309         * UIProcess/ios/ViewGestureControllerIOS.mm:
3310         (WebKit::ViewGestureController::endSwipeGesture):
3311         Hide the content of the drawing area until the next commit. This way,
3312         even if the snapshot is removed (say, because a timeout fired), we won't
3313         ever show the old page content (but we will show background color).
3314
3315         Store the background color associated with the current snapshot.
3316
3317         Let WKWebView know that it needs to recompute the background color.
3318
3319         (WebKit::ViewGestureController::removeSwipeSnapshot):
3320         Clear the background color so that the next time we commit, WKWebView
3321         will get an invalid color from ViewGestureController and fall back
3322         to the page's extended background color instead.
3323
3324         * UIProcess/mac/ViewGestureController.h:
3325         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot):
3326         * UIProcess/mac/ViewGestureControllerMac.mm:
3327         (WebKit::ViewGestureController::beginSwipeGesture):
3328         (WebKit::ViewGestureController::removeSwipeSnapshot):
3329         Keep backgroundColorForCurrentSnapshot up to date on Mac too, even
3330         though we don't use it yet.
3331
3332 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
3333
3334         [iOS] Rotating PDF in Safari scrolls to the wrong position
3335         https://bugs.webkit.org/show_bug.cgi?id=143259
3336         <rdar://problem/19872693>
3337
3338         Reviewed by Dan Bernstein.
3339
3340         * UIProcess/ios/WKPDFView.mm:
3341         (-[WKPDFView web_setMinimumSize:]):
3342         Maintan the relative top/left within the rescaled document.
3343
3344 2015-03-31  Chris Dumez  <cdumez@apple.com>
3345
3346         [WK2][iOS] Extend ProcessThrottler use to the NetworkProcess
3347         https://bugs.webkit.org/show_bug.cgi?id=143249
3348         <rdar://problem/20231539>
3349
3350         Reviewed by Gavin Barraclough.
3351
3352         Extend ProcessThrottler use to the NetworkProcess instead of only the
3353         WebProcesses. This is needed so that the NetworkProcess gets notified
3354         before suspension. We now use this notification to free-up memory
3355         before suspending by calling the critical memory pressure handler, as
3356         we already do for WebProcesses (rdar://problem/20231539). In the
3357         future, this infrastructure will be used to delay suspension until the
3358         pending SQL transactions are done as well (rdar://problem/20180799).
3359
3360         Previously, the NetworkProcessProxy would hold a foreground assertion
3361         on behalf of the NetworkProcess but would never release that assertion.
3362         In this patch, we change this so that WebProcessProxies hold assertions
3363         on behalf of the NetworkProcess, and release those assertions before
3364         suspending. As a result, the NetworkProcess gets suspended when all
3365         WebProcesses are suspended.
3366
3367         * NetworkProcess/NetworkProcess.cpp:
3368         (WebKit::NetworkProcess::processWillSuspend):
3369         (WebKit::NetworkProcess::cancelProcessWillSuspend):
3370         (WebKit::NetworkProcess::processDidResume):
3371         * NetworkProcess/NetworkProcess.h:
3372         * NetworkProcess/NetworkProcess.messages.in:
3373         * UIProcess/Network/NetworkProcessProxy.cpp:
3374         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
3375         (WebKit::NetworkProcessProxy::didFinishLaunching):
3376         (WebKit::NetworkProcessProxy::sendProcessWillSuspend):
3377         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend):
3378         (WebKit::NetworkProcessProxy::didCancelProcessSuspension):
3379         (WebKit::NetworkProcessProxy::sendProcessDidResume):
3380         (WebKit::NetworkProcessProxy::processReadyToSuspend):
3381         * UIProcess/Network/NetworkProcessProxy.h:
3382         (WebKit::NetworkProcessProxy::throttler):
3383         * UIProcess/Network/NetworkProcessProxy.messages.in:
3384         * UIProcess/ProcessThrottler.cpp:
3385         (WebKit::ProcessThrottler::ProcessThrottler):
3386         (WebKit::ProcessThrottler::didConnectToProcess):
3387         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
3388         * UIProcess/ProcessThrottler.h:
3389         * UIProcess/ProcessThrottlerClient.h: Added.
3390         (WebKit::ProcessThrottlerClient::~ProcessThrottlerClient):
3391         * UIProcess/WebProcessPool.cpp:
3392         (WebKit::WebProcessPool::ensureNetworkProcess):
3393         * UIProcess/WebProcessPool.h:
3394         * UIProcess/WebProcessProxy.cpp:
3395         (WebKit::WebProcessProxy::didFinishLaunching):
3396         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken):
3397         (WebKit::WebProcessProxy::sendProcessDidResume):
3398         (WebKit::WebProcessProxy::processReadyToSuspend):
3399         * UIProcess/WebProcessProxy.h:
3400         * WebKit2.xcodeproj/project.pbxproj:
3401
3402 2015-03-31  Csaba Osztrogonác  <ossy@webkit.org>
3403
3404         Unreviewed, revert accidental change by r182138.
3405
3406         * Scripts/generate-forwarding-headers.pl:
3407         (createForwardingHeadersForFramework):
3408
3409 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3410
3411         Unreviewed. Fix GTK+ build with REDIRECTED_XCOMPOSITE_WINDOW disabled in X11 platform.
3412
3413         Also fix some unused parameter warnings when
3414         REDIRECTED_XCOMPOSITE_WINDOW is disabled.
3415
3416         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3417         (webkitWebViewRenderAcceleratedCompositingResults):
3418         (resizeWebKitWebViewBaseFromAllocation):
3419
3420 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3421
3422         [GTK] DnD icon/widget has odd background
3423         https://bugs.webkit.org/show_bug.cgi?id=143217
3424
3425         Reviewed by Martin Robinson.
3426
3427         Use gtk_drag_set_icon_surface() to set the drag icon image,
3428         instead of DragIcon class.
3429
3430         * UIProcess/API/gtk/WebKitWebView.cpp:
3431         * UIProcess/gtk/DragAndDropHandler.cpp:
3432         (WebKit::DragAndDropHandler::startDrag):
3433         * UIProcess/gtk/DragAndDropHandler.h:
3434
3435 2015-03-30  Commit Queue  <commit-queue@webkit.org>
3436
3437         Unreviewed, rolling out r182172.
3438         https://bugs.webkit.org/show_bug.cgi?id=143250
3439
3440         Since this class is an API object, we don't know for sure when
3441         it will be destroyed. (Requested by kling on #webkit).
3442
3443         Reverted changeset:
3444
3445         "WebBackForwardList doesn't need to manually clear the
3446         snapshot of an entry when removing it."
3447         https://bugs.webkit.org/show_bug.cgi?id=143231
3448         http://trac.webkit.org/changeset/182172
3449
3450 2015-03-30  Andreas Kling  <akling@apple.com>
3451
3452         WebBackForwardList doesn't need to manually clear the snapshot of an entry when removing it.
3453         <https://webkit.org/b/143231>
3454
3455         Reviewed by Tim Horton.
3456
3457         Now that we don't keep WebBackForwardListItem objects alive forever, it's not necessary
3458         to clear the snapshot when removing them from the WebBackForwardList, since the entire
3459         object will be deleted shortly after that anyway.
3460
3461         * UIProcess/WebBackForwardList.cpp:
3462         (WebKit::WebBackForwardList::didRemoveItem):
3463
3464 2015-03-30  Enrica Casucci  <enrica@apple.com>
3465
3466         [iOS] WebContent crashing at WebCore: WebCore::Range::collectSelectionRects.
3467         https://bugs.webkit.org/show_bug.cgi?id=143234
3468         <rdar://problem/18571345>
3469
3470         Reviewed by Tim Horton.
3471
3472         This is a speculative fix that adds a null check before referencing the range.
3473         In both places where the check has been added the range returned by the call
3474         that should create it could be null.
3475
3476         * WebProcess/WebPage/ios/WebPageIOS.mm:
3477         (WebKit::WebPage::platformEditorState):
3478
3479 2015-03-30  Sam Weinig  <sam@webkit.org>
3480
3481         [Content Extensions] Flesh out the UserContentExtensionStore
3482         https://bugs.webkit.org/show_bug.cgi?id=143123
3483
3484         Reviewed by Benjamin Poulain.
3485
3486         * Shared/WebCompiledContentExtension.cpp:
3487         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
3488         * Shared/WebCompiledContentExtensionData.cpp:
3489         (WebKit::WebCompiledContentExtensionData::encode):
3490         (WebKit::WebCompiledContentExtensionData::decode):
3491         * Shared/WebCompiledContentExtensionData.h:
3492         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
3493         Switch the order in memory of actions and bytecode (and switch the order of the
3494         variables as well, to keep it clear). This will become necessary when streaming
3495         the data to disk, as actions are created before the bytecode and we would have to keep them
3496         in memory until the bytecode was finished compiling if they didn't come before in the file.
3497
3498         * UIProcess/API/APIUserContentExtensionStore.h:
3499         * UIProcess/API/APIUserContentExtensionStore.cpp:
3500         (API::UserContentExtensionStore::defaultStore):
3501         Add accessor for the processes default shared store.
3502
3503         (API::constructedPath):
3504         Helper for constructing the path to a file in the store based on identifier.
3505
3506         (API::encodeContentExtensionMetaData):
3507         (API::decodeContentExtensionMetaData):
3508         Helpers for encoding/decoding the file metadata (version, bytecode size, actions size).
3509
3510         (API::openAndMapContentExtension):
3511         Helper to open and map a filed back content extension.
3512
3513         (API::writeDataToFile):
3514         Helper to write a Data object to a file.
3515
3516         (API::compiledToFile):
3517         Helper to run the content extension compiler and write it to disk. It first
3518         writes it to a temporary file and then does an atomic rename operation to put
3519         the file in the final location. Doing this means that if the process crashes while
3520         the compile is taking place, the partially written file won't end up in the cache, 
3521         but rather, will be cleaned up by the OS.
3522  
3523         (API::UserContentExtensionStore::lookupContentExtension):
3524         API entry point to lookup an extension that has been compiled to disk. On a background queue,
3525         it attempts to open and map the extension (based on the identifier passed in) and return it
3526         to the caller via the callback function passed in.
3527         
3528         (API::UserContentExtensionStore::compileContentExtension):
3529         API entry point to compile an extension and write it to store. On a background queue, it 
3530         compiles the file to disk and if successful, returns the memory mapped data via the callback
3531         function passed in.
3532
3533         (API::UserContentExtensionStore::removeContentExtension):
3534         API entry point to remove an extension from the store. On a background queue, it 
3535         unlinks the extension (based on the identifier passed in) and tells the caller it completed
3536         the action vial the callback function passed in.
3537
3538         (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
3539         Helper for testing which synchronously unlinks all the files in the store.
3540
3541         (API::userContentExtensionStoreErrorCategory):
3542         std::error_code adaptor for some generic errors that can happen in the store. We will want
3543         to flesh these out further.
3544
3545         * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: Added.
3546         (API::UserContentExtensionStore::defaultStorePath):
3547         Helper to get the platform specific path for the store.
3548
3549         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
3550         (WKUserContentExtensionStoreGetTypeID):
3551         Add ENABLE(CONTENT_EXTENSIONS) guards.
3552
3553         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
3554         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
3555         (-[_WKUserContentExtensionStore dealloc]):
3556         (+[_WKUserContentExtensionStore defaultStore]):
3557         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
3558         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
3559         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
3560         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
3561         (-[_WKUserContentExtensionStore init]): Deleted.
3562         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
3563         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: Added.
3564         SPI wrappers for the store.
3565
3566         * WebKit2.xcodeproj/project.pbxproj:
3567         Add new files.
3568
3569 2015-03-30  Antti Koivisto  <antti@apple.com>
3570
3571         Don't cache resources that are very unlikely to be reused
3572         https://bugs.webkit.org/show_bug.cgi?id=143226
3573
3574         Reviewed by Chris Dumez.
3575
3576         Follow-up to cover Cache-control: no-cache case which also has zero cache lifetime.
3577
3578         * NetworkProcess/cache/NetworkCache.cpp:
3579         (WebKit::NetworkCache::makeStoreDecision):
3580
3581 2015-03-30  Antti Koivisto  <antti@apple.com>
3582
3583         Include cache entry worth to json dump
3584         https://bugs.webkit.org/show_bug.cgi?id=143202
3585
3586         Follow-up fix.
3587
3588         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3589         (WebKit::NetworkCache::computeRecordWorth):
3590
3591             This accidentally gave the error case worth 1 rather than 0 as it should be.
3592
3593 2015-03-30  Antti Koivisto  <antti@apple.com>
3594
3595         Don't cache resources that are very unlikely to be reused
3596         https://bugs.webkit.org/show_bug.cgi?id=143226
3597         <rdar://problem/20347160>
3598
3599         Reviewed by Geoff Garen.
3600
3601         We are writing lots of resources to the cache that are never used again.
3602
3603         In browse-around-randomly test this reduced number of cache entries created by ~20% and bytes written by ~5%.
3604
3605         * NetworkProcess/cache/NetworkCache.cpp:
3606         (WebKit::NetworkCache::makeUseDecision):
3607         (WebKit::NetworkCache::makeRetrieveDecision):
3608
3609             Rename for clarity.
3610
3611         (WebKit::NetworkCache::makeStoreDecision):
3612
3613             Store only if the resource has non-zero expiration or has validation headers.
3614
3615             Very High priority resources (main resources) keep the existing policy to minimize impact
3616             on back navigation and tab restore.
3617
3618         (WebKit::NetworkCache::Cache::retrieve):
3619         (WebKit::NetworkCache::Cache::store):
3620         (WebKit::NetworkCache::canUse): Deleted.
3621         (WebKit::NetworkCache::canRetrieve): Deleted.
3622         (WebKit::NetworkCache::canStore): Deleted.
3623         * NetworkProcess/cache/NetworkCache.h:
3624         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3625         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
3626
3627 2015-03-30  Tim Horton  <timothy_horton@apple.com>
3628
3629         Swipe snapshot removed too early (jumps around) on arstechnica and NYT
3630         https://bugs.webkit.org/show_bug.cgi?id=143199
3631         <rdar://problem/18420467>
3632
3633         Reviewed by Dan Bernstein.
3634
3635         Make ViewGestureControllerIOS's snapshot removal timing behave more like the Mac version.
3636
3637         * UIProcess/API/Cocoa/WKWebView.mm:
3638         (-[WKWebView _didCommitLayerTree:]):
3639         Let ViewGestureController know when the page has finished state restoration.
3640
3641         (-[WKWebView _didFinishLoadForMainFrame]):
3642         (-[WKWebView _didSameDocumentNavigationForMainFrame:]):
3643         Forward these to ViewGestureController.
3644
3645         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3646         * UIProcess/ios/PageClientImplIOS.mm:
3647         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
3648         Forward didFinishLoadForMainFrame to WKWebView.
3649
3650         * UIProcess/ios/ViewGestureControllerIOS.mm:
3651         (WebKit::ViewGestureController::ViewGestureController):
3652         (WebKit::ViewGestureController::endSwipeGesture):
3653         Split the swipe snapshot removal state into a bunch of bools.
3654
3655         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
3656         (WebKit::ViewGestureController::setRenderTreeSize):
3657         (WebKit::ViewGestureController::removeSwipeSnapshotIfReady):
3658         (WebKit::ViewGestureController::removeSwipeSnapshot):
3659         Unify the snapshot removal logic into one function; removeSwipeSnapshotIfReady
3660         completely owns the decision. For now, we're waiting for everything, but
3661         we can do better in the future (using firstVisuallyNonEmptyLayout like Mac used to).
3662
3663         (WebKit::ViewGestureController::didRestoreScrollPosition):
3664         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
3665         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
3666         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
3667         Add more conditions for swipe snapshot removal. We'll now wait for
3668         didFinishLoadForMainFrame (or didSameDocumentNavigationForMainFrame),
3669         for active loads to finish, and for the scroll position to be restored.
3670         This brings the iOS implementation in line with the slightly better Mac
3671         implementation, and also sets the stage for deduplication of all of this code.
3672         
3673         * UIProcess/mac/ViewGestureController.h:
3674         * UIProcess/mac/ViewGestureControllerMac.mm:
3675         (WebKit::ViewGestureController::ViewGestureController):
3676
3677 2015-03-30  Chris Dumez  <cdumez@apple.com>
3678
3679         [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
3680         https://bugs.webkit.org/show_bug.cgi?id=143159
3681         <rdar://problem/20333296>
3682
3683         Reviewed by Antti Koivisto.
3684
3685         Add support for "Cache-Control: max-stale" request header:
3686         https://tools.ietf.org/html/rfc7234#section-5.2.1.2
3687
3688         * NetworkProcess/cache/NetworkCache.cpp:
3689         (WebKit::NetworkCache::responseHasExpired):
3690         (WebKit::NetworkCache::requestRequiresRevalidation):
3691         (WebKit::NetworkCache::canUse):
3692
3693 2015-03-30  Csaba Osztrogonác  <ossy@webkit.org>
3694
3695         [EFL][GTK] WebKit2's generate-forwarding-headers.pl should fail if clashing headers found
3696         https://bugs.webkit.org/show_bug.cgi?id=142909
3697
3698         Reviewed by Philippe Normand.
3699
3700         * Scripts/generate-forwarding-headers.pl:
3701         (createForwardingHeadersForFramework):
3702
3703 2015-03-29  Antti Koivisto  <antti@apple.com>
3704
3705         Include cache entry worth to json dump
3706         https://bugs.webkit.org/show_bug.cgi?id=143202
3707
3708         Reviewed by Darin Adler.
3709
3710         This is useful for analyzing cache performance.
3711         Also include the body size, total item count and average worth.
3712
3713         * NetworkProcess/cache/NetworkCache.cpp:
3714         (WebKit::NetworkCache::Cache::traverse):
3715         (WebKit::NetworkCache::Cache::dumpContentsToFile):
3716         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3717         (WebKit::NetworkCache::Entry::asJSON):
3718         * NetworkProcess/cache/NetworkCacheEntry.h:
3719         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3720         (WebKit::NetworkCache::Storage::traverse):
3721
3722             Add flags for specificying what sort of information is needed.
3723
3724         (WebKit::NetworkCache::computeRecordWorth):
3725
3726             Factor to a function.
3727
3728         (WebKit::NetworkCache::deletionProbability):
3729         * NetworkProcess/cache/NetworkCacheStorage.h:
3730
3731 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
3732
3733         Fix iOS scrollperf crash after a web process crash
3734         https://bugs.webkit.org/show_bug.cgi?id=143110
3735
3736         Reviewed by Dean Jackson.
3737         
3738         When we destroy the drawing area after a web process crash, we also need to destroy
3739         the scrollingPerformanceData which has a reference to the drawing area.
3740
3741         * UIProcess/WebPageProxy.cpp:
3742         (WebKit::WebPageProxy::resetState):
3743
3744 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
3745
3746         Convert arguments to ScrollingCoordinator functions to references
3747         https://bugs.webkit.org/show_bug.cgi?id=143198
3748
3749         Reviewed by Darin Adler.
3750
3751         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
3752         references, and use references in a few other places.
3753
3754         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
3755         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3756         (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):
3757
3758 2015-03-29  Enrica Casucci  <enrica@apple.com>
3759
3760         [iOS WK2] WKContentView should implement _selectionClipRect
3761         https://bugs.webkit.org/show_bug.cgi?id=143143
3762         rdar://problem/20330075
3763
3764         Reviewed by Benjamin Poulain.
3765
3766         UIKit checks if the text delegate responds to this selector
3767         to retrieve the clipping rectangle for the editable element
3768         where the selection is being create.
3769
3770         * UIProcess/ios/WKContentViewInteraction.mm:
3771         (-[WKContentView _selectionClipRect]):
3772
3773 2015-03-29  Antti Koivisto  <antti@apple.com>
3774
3775         Use st_mtime instead of st_atime to track file access time
3776         https://bugs.webkit.org/show_bug.cgi?id=143200
3777
3778         Reviewed by Darin Adler.
3779
3780         On OS X atime updates automatically on read so calling Storage::traverse() would always ends up updating access times
3781         for all cache entries to the current time. This would make entry worth computation produce unexpected results.
3782         We update mtime manually on successful cache retrieve only so switching to it fixes the problem.
3783
3784         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
3785         (WebKit::NetworkCache::fileTimes):
3786         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
3787         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded): Deleted.
3788         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3789         (WebKit::NetworkCache::Storage::updateFileModificationTime):
3790         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3791         (WebKit::NetworkCache::deletionProbability):
3792         (WebKit::NetworkCache::Storage::updateFileAccessTime): Deleted.
3793         * NetworkProcess/cache/NetworkCacheStorage.h:
3794
3795 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
3796
3797         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
3798         https://bugs.webkit.org/show_bug.cgi?id=142386
3799
3800         Reviewed by Žan Doberšek.
3801
3802         TextureMapper and TextureMapperGL are bloated and tightly coupled with
3803         BitmapTexture. We should move these classes to seperated file of their own.
3804         Also, this patch removes friend relationship from TextureMapperGL and  its
3805         subsidiary classes.
3806
3807         The main purpose of this refactoring is to expose BitmapTexturePool to
3808         renderers of platformlayers like Video and Canvas. By doing this, each
3809         renderer can acquire textures from the global texture pool to paint
3810         their contents directly.
3811
3812         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly
3813
3814 2015-03-27  Anders Carlsson  <andersca@apple.com>
3815
3816         Use a typedef for the WKPluginLoadClientPolicy enum
3817         https://bugs.webkit.org/show_bug.cgi?id=143161
3818
3819         Reviewed by Tim Horton.
3820
3821         * UIProcess/API/C/WKPluginLoadPolicy.h:
3822
3823 2015-03-27  Chris Dumez  <cdumez@apple.com>
3824
3825         [WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics
3826         https://bugs.webkit.org/show_bug.cgi?id=143154
3827
3828         Reviewed by Antti Koivisto.
3829
3830         Use WTF::WorkQueue abstraction inside NetworkCacheStatistics, like we
3831         already do in NetworkCacheStorage.
3832
3833         * NetworkProcess/cache/NetworkCacheStatistics.cpp: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm.
3834         (WebKit::NetworkCache::executeSQLCommand):
3835         (WebKit::NetworkCache::executeSQLStatement):
3836         (WebKit::NetworkCache::Statistics::open):
3837         (WebKit::NetworkCache::Statistics::Statistics):
3838         (WebKit::NetworkCache::Statistics::initialize):
3839         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
3840         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
3841         (WebKit::NetworkCache::Statistics::recordRetrievalRequest):
3842         (WebKit::NetworkCache::Statistics::recordNotCachingResponse):
3843         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
3844         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
3845         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
3846         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
3847         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
3848         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
3849         (WebKit::NetworkCache::Statistics::markAsRequested):
3850         (WebKit::NetworkCache::Statistics::writeTimerFired):
3851         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
3852         (WebKit::NetworkCache::Statistics::clear):
3853         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
3854         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
3855         * NetworkProcess/cache/NetworkCacheStatistics.h:
3856         (WebKit::NetworkCache::Statistics::serialBackgroundIOQueue):
3857         * WebKit2.xcodeproj/project.pbxproj:
3858
3859 2015-03-27  Ryosuke Niwa  <rniwa@webkit.org>
3860
3861         Safari clears selection when its window gets activated via mouse down
3862         https://bugs.webkit.org/show_bug.cgi?id=143157
3863
3864         Reviewed by Anders Carlsson.
3865
3866         The bug was caused by PlatformMouseEvent created in WebKit2 not having its event number
3867         even though we were correctly calling setActivationEventNumber in WebPage::acceptsFirstMouse.
3868
3869         Fixed the bug by storing [NSEvent eventNumber] in WebMouseEvent on Mac in WebKit2 as done in WebKit1.
3870
3871         * Shared/WebEvent.h:
3872         (WebKit::WebMouseEvent::eventNumber):
3873         * Shared/WebEventConversion.cpp:
3874         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
3875         * Shared/WebMouseEvent.cpp:
3876         (WebKit::WebMouseEvent::WebMouseEvent):
3877         (WebKit::WebMouseEvent::encode):
3878         (WebKit::WebMouseEvent::decode):
3879         * Shared/mac/WebEventFactory.mm:
3880         (WebKit::WebEventFactory::createWebMouseEvent):
3881
3882 2015-03-27  Anders Carlsson  <andersca@apple.com>
3883
3884         Only do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary
3885         https://bugs.webkit.org/show_bug.cgi?id=143141
3886         rdar://problem/19471284
3887
3888         Reviewed by Andreas Kling.
3889
3890         * Platform/IPC/Connection.h:
3891         * Platform/IPC/mac/ConnectionMac.mm:
3892         (IPC::Connection::platformInvalidate):
3893         (IPC::Connection::platformInitialize):
3894         (IPC::Connection::open):
3895         * Shared/ChildProcessProxy.cpp:
3896         (WebKit::ChildProcessProxy::didFinishLaunching):
3897         * UIProcess/Plugins/PluginProcessProxy.cpp:
3898         (WebKit::PluginProcessProxy::didFinishLaunching):
3899
3900 2015-03-27  Tim Horton  <timothy_horton@apple.com>
3901
3902         Implement iOS WebKit2 PDF Find-in-Page
3903         https://bugs.webkit.org/show_bug.cgi?id=143065
3904         <rdar://problem/16793370>
3905
3906         Reviewed by Dan Bernstein.
3907
3908         * Platform/spi/ios/CorePDFSPI.h:
3909         Add some SPI.
3910
3911         * UIProcess/API/Cocoa/WKWebView.mm:
3912         (-[WKWebView _countStringMatches:options:maxCount:]):
3913         (-[WKWebView _findString:options:maxCount:]):
3914         (-[WKWebView _hideFindUI]):
3915         If we have a custom content view, forward find-in-page methods to it.
3916         
3917         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3918         * UIProcess/API/Cocoa/_WKFindOptions.h:
3919         Move _WKFindOptions into its own file.
3920
3921         * UIProcess/Cocoa/WKWebViewContentProvider.h:
3922         Add find-related methods to the WKWebViewContentProvider protocol.
3923
3924         * UIProcess/ios/WKPDFView.mm:
3925         (-[WKPDFView web_initWithFrame:webView:]):
3926         (-[WKPDFView dealloc]):
3927         Maintain a dispatch queue for searching the PDF.
3928
3929         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
3930         Fix a type.
3931
3932         (-[WKPDFView _ensureViewForPage:]):
3933         Split the code to create/parent a page view out from _revalidateViews,
3934         so that the find code can create/parent the targetted UIPDFPageView
3935         in order to install the find highlight in it, but before it is scrolled into view.
3936
3937         (-[WKPDFView _revalidateViews]):
3938         Use the stored page index instead of counting again.
3939         Don't unparent page views that have find-in-page highlights in them, because
3940         we won't know enough to recreate them later.
3941
3942         (-[WKPDFView _computePageAndDocumentFrames]):
3943         Put the page index in PDFPageInfo, for reference elsewhere.
3944
3945         (-[WKPDFView _stringCompareOptionsFromWKFindOptions:]):
3946         (-[WKPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
3947         Asynchronously (and on our serial queue) search the PDF for the given string.
3948         We'll cache the most recent results to avoid searching more than once,
3949         cancel existing searches when another begins (since it's a serial queue,
3950         this ensures we'll only have one search active at a time).
3951
3952         (-[WKPDFView web_countStringMatches:options:maxCount:]):
3953         Count the number of matches for the given string, and inform the FindClient
3954         of the result.
3955
3956         (-[WKPDFView _didFindMatch:]):
3957         When we find a match, create a view for it, highlight the match, and
3958         zoom so that it's in-view.
3959
3960         (-[WKPDFView web_findString:options:maxCount:]):
3961         Incrementally search the document for the given string. We do an incremental
3962         search even if we have all of the results so that we can anchor the search
3963         in the right place if the new string is a prefix of the old string, etc.
3964         Wrap around appropriately when searching past the beginning or end of the
3965         document. If we have all of the results (there were less than maxCount results),
3966         look through the cached matches for the incrementally-found result and
3967         report its index to the client.
3968
3969         (-[WKPDFView web_hideFindUI]):
3970         Dismiss the selection and clear some state so we start the next search afresh.
3971
3972         * WebKit2.xcodeproj/project.pbxproj:
3973
3974 2015-03-27  Andreas Kling  <akling@apple.com>
3975
3976         WebProcessProxy should not retain WebBackForwardListItems forever.
3977         <https://webkit.org/b/143152>
3978         <rdar://problem/19925709>
3979
3980         Reviewed by Anders Carlsson.
3981
3982         Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from
3983         the WebBackForwardList.
3984
3985         This ensures that we don't accumulate too many of these objects, which can get quite large
3986         due to the session state encoded in them.
3987
3988         We already have graceful handling of the case where an incoming IPC message references
3989         a removed back/forward list item.
3990
3991         * UIProcess/WebBackForwardList.cpp:
3992         (WebKit::WebBackForwardList::didRemoveItem):
3993         * UIProcess/WebPageProxy.cpp:
3994         (WebKit::WebPageProxy::backForwardRemovedItem):
3995         * UIProcess/WebProcessProxy.cpp:
3996         (WebKit::WebProcessProxy::removeBackForwardItem):
3997         * UIProcess/WebProcessProxy.h:
3998
3999 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
4000
4001         Use the correct timebase to log scrollperf blank pixel counts on iOS
4002         https://bugs.webkit.org/show_bug.cgi?id=143149
4003
4004         Reviewed by Tim Horton.
4005         
4006         MobileSafari and WebKit need to collect scrollperf data using the same timebase;
4007         MobileSafari can't call WTF::monotonicallyIncreasingTime(), so use CFAbsoluteTimeGetCurrent()
4008         everywhere.
4009
4010         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm:
4011         (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
4012
4013 2015-03-27  Chris Dumez  <cdumez@apple.com>
4014
4015         [WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation()
4016         https://bugs.webkit.org/show_bug.cgi?id=143137
4017
4018         Reviewed by Antti Koivisto.
4019
4020         Rename requestNeedsRevalidation() to requestRequiresRevalidation() as I
4021         think it is more accurate. It is not the request that needs revalidating.
4022         The requests just requires us to revalidate the response.
4023
4024         * NetworkProcess/cache/NetworkCache.cpp:
4025         (WebKit::NetworkCache::requestRequiresRevalidation):
4026         (WebKit::NetworkCache::canUse):
4027         (WebKit::NetworkCache::requestNeedsRevalidation): Deleted.
4028
4029 2015-03-27  Oliver Hunt  <oliver@apple.com>
4030
4031         Forward additional CFNetwork ATS information to child processes
4032         https://bugs.webkit.org/show_bug.cgi?id=143136
4033
4034         Reviewed by Anders Carlsson.
4035
4036         Add additional process creation parameter information, and pass it
4037         to the child processes that actually use CFNetwork.
4038
4039         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
4040         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
4041         * Shared/Network/NetworkProcessCreationParameters.cpp:
4042         (WebKit::NetworkProcessCreationParameters::encode):
4043         (WebKit::NetworkProcessCreationParameters::decode):
4044         * Shared/Network/NetworkProcessCreationParameters.h:
4045         * Shared/Plugins/PluginProcessCreationParameters.cpp:
4046         (WebKit::PluginProcessCreationParameters::encode):
4047         (WebKit::PluginProcessCreationParameters::decode):
4048         * Shared/Plugins/PluginProcessCreationParameters.h:
4049         * Shared/WebProcessCreationParameters.cpp:
4050         (WebKit::WebProcessCreationParameters::encode):
4051         (WebKit::WebProcessCreationParameters::decode):
4052         * Shared/WebProcessCreationParameters.h:
4053         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
4054         (WebKit::WebProcessPool::platformInitializeWebProcess):
4055         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
4056         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: