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