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