c9dc11ddf6a14e2b4a11e58bb281d776cffb896d
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-05-11  Daniel Bates  <dabates@apple.com>
2
3         [iOS] Close all open databases in expiration handler of process assertion
4         https://bugs.webkit.org/show_bug.cgi?id=144661
5         <rdar://problem/20845052>
6
7         Reviewed by Darin Adler.
8
9         For WebKit2, close all open databases when the process assertion expiration
10         handler is called.
11
12         When the process assertion expiration handler is called we dispatch a synchronous
13         message called ProcessWillSuspendImminently to the {Web, Network} processes to inform
14         them that they will be suspended imminently. The {Web, Network} process will always
15         service this message regardless if they were waiting for another message. In the
16         WebProcess, we will close all open databases among other tasks upon receiving this
17         message. In the NetworkProcess, we will purge some data from memory.
18
19         * NetworkProcess/NetworkProcess.cpp:
20         (WebKit::NetworkProcess::didReceiveSyncMessage): Modified to call NetworkProcess::didReceiveSyncNetworkProcessMessage()
21         to process the synchronous ProcessWillSuspendImminently message.
22         (WebKit::NetworkProcess::processWillSuspendImminently): Added; free some memory.
23         * NetworkProcess/NetworkProcess.h:
24         * NetworkProcess/NetworkProcess.messages.in: Added synchronous message ProcessWillSuspendImminently.
25         * Shared/ChildProcessProxy.h:
26         (WebKit::ChildProcessProxy::sendSync): Added parameter sendSyncFlags so that we can send
27         a sync message with flag IPC::InterruptWaitingIfSyncMessageArrives to cause the {Web, Network}Process
28         to process the message regardless of whether it is waiting for another message.
29         * UIProcess/Network/NetworkProcessProxy.cpp:
30         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently): Added. Sends the message
31         ProcessWillSuspendImminently to the NetworkProcess.
32         * UIProcess/Network/NetworkProcessProxy.h:
33         * UIProcess/ProcessAssertion.cpp:
34         (WebKit::ProcessAndUIAssertion::setClient): Added.
35         * UIProcess/ProcessAssertion.h: Added abstract class ProcessAssertionClient.
36         (WebKit::ProcessAssertionClient::~ProcessAssertionClient): Added.
37         (WebKit::ProcessAssertion::setClient): Added.
38         (WebKit::ProcessAssertion::client): Added.
39         * UIProcess/ProcessThrottler.cpp:
40         (WebKit::ProcessThrottler::didConnectToProcess):
41         (WebKit::ProcessThrottler::assertionWillExpireImminently): Added; implements the ProcessAssertionClient
42         interface. Notify the process throttler clients that the assertion is near expiration.
43         * UIProcess/ProcessThrottler.h:
44         * UIProcess/ProcessThrottlerClient.h: Added 
45         * UIProcess/WebProcessProxy.cpp:
46         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently): Added. Sends the message
47         ProcessWillSuspendImminently to the WebProcess.
48         * UIProcess/WebProcessProxy.h:
49         * UIProcess/ios/ProcessAssertionIOS.mm:
50         (-[WKProcessAssertionBackgroundTaskManager addClient:]): Added.
51         (-[WKProcessAssertionBackgroundTaskManager removeClient:]): Added.
52         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): Modified expiration handler
53         to notify ProcessAssertionClient clients that the assertion is near expiration.
54         (WebKit::ProcessAssertion::~ProcessAssertion): Remove the client on destruction.
55         (WebKit::ProcessAndUIAssertion::setClient): Added.
56         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
57         (WebKit::WebDatabaseManager::closeAllDatabases): Added; turns around and calls DatabaseManager::closeAllDatabases().
58         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
59         * WebProcess/WebProcess.cpp:
60         (WebKit::WebProcess::didReceiveSyncMessage): Call WebProcess::didReceiveSyncWebProcessMessage() to process
61         the synchronous ProcessWillSuspendImminently message. Removed logging for an unhandled synchronous message
62         since WebProcess::didReceiveSyncWebProcessMessage() will ASSERT_NOT_REACHED() for such a message.
63         (WebKit::WebProcess::prepareToSuspend): Extracted code from WebProcess::processWillSuspend() so that it can
64         be used from both WebProcess::processWillSuspend() and WebProcess::processWillSuspendImminently(). And modified
65         it to conditionally dispatch a ProcessReadyToSuspend message to the WebProcessProxy. We only want to dispatch
66         such a message as part of a coordinated suspension by the ProcessThrottler. That is, we do not want to dispatch
67         the ProcessReadyToSuspend message when the background assertion is near expiration (i.e. WebProcess::processWillSuspendImminently()
68         is called).
69         (WebKit::WebProcess::processWillSuspendImminently): Added. Suspend all open databases among other tasks.
70         (WebKit::WebProcess::processWillSuspend): Implemented in terms of WebProcess::prepareToSuspend().
71         (WebKit::WebProcess::processSuspensionCleanupTimerFired): Modified to conditionally dispatch a ProcessReadyToSuspend
72         message to the WebProcessProxy.
73         (WebKit::WebProcess::processDidResume): Stop the suspension cleanup timer, which may be active if the WebProcess
74         did not mark all its graphics layers as volatile before process suspension.
75         * WebProcess/WebProcess.h:
76         * WebProcess/WebProcess.messages.in: Added synchronous message ProcessWillSuspendImminently.
77
78 2015-05-10  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
79
80         Use Ref instead of PassRefPtr in WebCore/page
81         https://bugs.webkit.org/show_bug.cgi?id=144841
82
83         Reviewed by Darin Adler.
84
85         To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
86         in WebCore/page.
87
88         (WebKit::WebUserContentController::WebUserContentController):
89         * UIProcess/WebPageProxy.cpp:
90         (WebKit::WebPageProxy::setTextIndicator):
91         * UIProcess/mac/PageClientImpl.mm:
92         (WebKit::PageClientImpl::didPerformDictionaryLookup):
93         * WebProcess/UserContent/WebUserContentController.cpp:
94         (WebKit::WebUserContentController::WebUserContentController):
95
96 2015-05-10  Philip Chimento  <philip.chimento@gmail.com>
97
98         [GTK][SOUP] Web and Network processes don't know how to get memory size on OSX
99         https://bugs.webkit.org/show_bug.cgi?id=144554
100
101         Reviewed by Darin Adler.
102
103         * NetworkProcess/soup/NetworkProcessSoup.cpp:
104         (WebKit::NetworkProcess::platformSetCacheModel): Use WTF::ramSize()
105         instead of local function. Also use WTF::MB instead of dividing by
106         1024 * 1024.
107         (WebKit::getMemorySize): Deleted.
108         * WebProcess/soup/WebProcessSoup.cpp:
109         (WebKit::WebProcess::platformSetCacheModel): Ditto.
110         (WebKit::getMemorySize): Deleted.
111
112 2015-05-10  Yongjun Zhang  <yongjun_zhang@apple.com>
113
114         Use preview view controller from WebKitSystemInterface.
115         https://bugs.webkit.org/show_bug.cgi?id=144836
116
117         Add a property _allowsLinkPreview to WKWebView so that we can turn on/off preview at runtime. Also,
118         for client that doesn't provide preview view controller, use the default view controller prepared
119         by WebKitSystemInterface.
120
121         Reviewed by Dan Bernstein.
122
123         * UIProcess/API/Cocoa/WKWebView.mm:
124         (-[WKWebView initWithFrame:configuration:]):
125         (-[WKWebView _allowsLinkPreview]):
126         (-[WKWebView _setAllowsLinkPreview:]):
127         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _allowsLinkPreview property
128         * UIProcess/ios/WKContentView.mm:
129         (-[WKContentView willMoveToWindow:]):
130         * UIProcess/ios/WKContentViewInteraction.h:
131         * UIProcess/ios/WKContentViewInteraction.mm:
132         (-[WKContentView _registerPreviewInWindow:]):
133         (-[WKContentView _unregisterPreviewInWindow:]):
134         (-[WKContentView previewViewControllerForPosition:inSourceView:]): : For client that doesn't provide
135             preview delegate, use preview view controller in WebKitSystemInterface.
136         (-[WKContentView commitPreviewViewController:]):
137
138 2015-05-10  Darin Adler  <darin@apple.com>
139
140         Fix internal Apple builds on Mavericks.
141
142         * UIProcess/API/mac/WKView.mm:
143         (-[WKView _dismissContentRelativeChildWindows]): Added missing conditionals around
144         some code that is for OS X 10.10 or newer only. There were similar conditionals around
145         other nearby code in this file, and around other uses of the same method in other files,
146         so matched the style.
147
148 2015-05-10  Dan Bernstein  <mitz@apple.com>
149
150         iOS internal build fix.
151
152         * Platform/mac/MenuUtilities.mm:
153
154 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
155
156         Remove unnecessary semicolons.
157         https://bugs.webkit.org/show_bug.cgi?id=144844
158
159         Reviewed by Darin Adler.
160
161         No new tests, no behavior change.
162
163         * Shared/Downloads/mac/DownloadMac.mm:
164         (-[WKDownloadAsDelegate download:shouldDecodeSourceDataOfMIMEType:]):
165         * UIProcess/WebProcessProxy.cpp:
166         (WebKit::WebProcessProxy::transformHandlesToObjects):
167         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
168         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
169         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
170         (WebKit::idToHistoryItemMap):
171
172 2015-05-10  Darin Adler  <darin@apple.com>
173
174         Fix build.
175
176         * Platform/mac/MenuUtilities.mm: Added includes that were somehow omitted in what
177         I committed before.
178
179 2015-05-10  Darin Adler  <darin@apple.com>
180
181         [Cocoa] Don't soft link DataDetectorsCore
182         https://bugs.webkit.org/show_bug.cgi?id=144837
183
184         Reviewed by Dan Bernstein.
185
186         * Platform/mac/MenuUtilities.mm: Use DataDetectorsSPI.h instead of doing it here.
187
188         * WebProcess/WebPage/mac/WebPageMac.mm: Removed unneeded include of unused header,
189         DataDetectorsSPI.h.
190
191 2015-05-09  Dan Bernstein  <mitz@apple.com>
192
193         Deployment-target __NSi_ and __NSd_ definitions in WKFoundation.h are redundant
194         https://bugs.webkit.org/show_bug.cgi?id=144831
195
196         Reviewed by Sam Weinig.
197
198         Reverted r182846 and r182904.
199
200         * Shared/API/Cocoa/WKFoundation.h:
201         * WebKit2.xcodeproj/project.pbxproj:
202
203 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
204
205         Remove the PICTURE_SIZES build flag
206         https://bugs.webkit.org/show_bug.cgi?id=144679
207
208         Reviewed by Benjamin Poulain.
209
210         Removed the PICTURE_SIZES build time flag.
211
212         * Configurations/FeatureDefines.xcconfig:
213
214 2015-05-08  Beth Dakin  <bdakin@apple.com>
215
216         Shuffle touch-related code to keep the internal builds working
217         https://bugs.webkit.org/show_bug.cgi?id=144812
218
219         Reviewed by Benjamin Poulain.
220
221         * Shared/NativeWebTouchEvent.h:
222         * Shared/WebEvent.h:
223         * Shared/WebEventConversion.cpp:
224         * Shared/ios/NativeWebTouchEventIOS.mm:
225         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
226         (WebKit::extractWebTouchPoint): Deleted.
227         * Shared/ios/WebPlatformTouchPointIOS.cpp:
228
229 2015-05-08  Dan Bernstein  <mitz@apple.com>
230
231         <rdar://problem/20757196> NSInternalInconsistencyException raised in -[NSString encodeWithCoder:] beneath createEncodedObject when using WKRemoteObjectEncoder for Safari AutoFill
232         https://bugs.webkit.org/show_bug.cgi?id=144818
233
234         Reviewed by Anders Carlsson.
235
236         Allow NSString instances that contain unpaired surrogates to be encoded by
237         WKRemoteObjectCoder by encoding them directly rather than using
238         -[NSString encodeWithCoder:].
239
240         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
241         (encodeString): Added. Sets an API::String as the object to encode.
242         (encodeObject): Changed to use encodeString for NSString instances.
243         (decodeString): Added. Gets an API::String from the dictionary and returns it as an
244         NSString.
245         (decodeObject): Changed to use decodeString for NSString instances.
246
247 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
248
249         Fix the build.
250
251         * Platform/mac/LayerHostingContext.mm:
252         (WebKit::LayerHostingContext::createFencePort):
253
254 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
255
256         Periodically repaint during resize while using the DynamicSizeWithMinimumViewSize layout strategy
257         https://bugs.webkit.org/show_bug.cgi?id=144816
258
259         Reviewed by Simon Fraser.
260
261         * UIProcess/mac/WKViewLayoutStrategy.mm:
262         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy initWithPage:view:mode:]):
263         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy _updateTransientScale:]):
264         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
265         Factor out _updateTransientScale from updateLayout.
266         Keep track of the last viewScaleFactor that we know is being displayed
267         (_lastCommittedViewScale) and use that for computing the transient scale,
268         so that we can recompute the transient scale while the UI process's notion
269         of the actual view scale might have moved ahead of what the Web process has
270         painted.
271
272 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
273
274         Fix the build.
275
276         * UIProcess/WebPageProxy.cpp:
277
278 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
279
280         Fix the build.
281
282         * Platform/mac/LayerHostingContext.mm:
283         (WebKit::LayerHostingContext::createFencePort):
284
285 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
286
287         Fix the build.
288
289         * Platform/mac/LayerHostingContext.mm:
290         (WebKit::LayerHostingContext::createFencePort):
291
292 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
293
294         Flip the direction of the fence in scaleViewAndUpdateGeometryFenced
295         https://bugs.webkit.org/show_bug.cgi?id=144810
296
297         Reviewed by Simon Fraser.
298
299         Send the fence from the Web process to the UI process, instead of vice versa.
300         This means that we won't keep the UI process CAContext blocked for the whole
301         time that the Web process is doing layout/painting/etc. Instead, we'll start
302         blocking the Web process CAContext immediately after flushing and before committing,
303         and send the fence to the UI process to be applied immediately. This minimizes
304         the amount of time in both processes spent blocked on the fence.
305
306         * Platform/mac/LayerHostingContext.h:
307         * Platform/mac/LayerHostingContext.mm:
308         (WebKit::LayerHostingContext::createFencePort):
309         Add createFencePort, which creates a MachSendRight wrapping a CA fence port.
310         Note that you must setFencePort() with this port if you want the LayerHostingContext's
311         CAContext to block on it!
312
313         * UIProcess/WebPageProxy.cpp:
314         (WebKit::WebPageProxy::scaleViewAndUpdateGeometryFenced):
315         (WebKit::WebPageProxy::machSendRightCallback):
316         * UIProcess/WebPageProxy.h:
317         * UIProcess/WebPageProxy.messages.in:
318         Create a callback and send it to the Web process along with scaleViewAndUpdateGeometryFenced.
319
320         * UIProcess/mac/WKViewLayoutStrategy.mm:
321         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
322         When called back, install the fence port in our CAContext; when the commit goes through,
323         remove the transient scale as we did previously.
324
325         * WebProcess/WebPage/DrawingArea.h:
326         (WebKit::DrawingArea::replyWithFenceAfterNextFlush):
327         (WebKit::DrawingArea::updateGeometry): Deleted.
328         * WebProcess/WebPage/WebPage.cpp:
329         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
330         * WebProcess/WebPage/WebPage.h:
331         * WebProcess/WebPage/WebPage.messages.in:
332         Instead of installing a fence created in the UI process, tell the DrawingArea
333         to create one and reply to the UI process with it after the next flush.
334
335         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
336         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
337         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
338         (WebKit::TiledCoreAnimationDrawingArea::replyWithFenceAfterNextFlush):
339         After flushing, before committing, create a fence and reply to any
340         callbacks that requested fences, and install it in our context.
341
342 2015-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>, Martin Robinson <mrobinson@igalia.com>
343
344         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
345         https://bugs.webkit.org/show_bug.cgi?id=144746
346
347         Reviewed by Carlos Garcia Campos.
348
349         Use ENABLE(DEVELOPER_MODE) rather than DEVELOPMENT_BUILD.
350
351         * Shared/gtk/ProcessExecutablePathGtk.cpp:
352         (WebKit::findWebKitProcess):
353         * UIProcess/API/gtk/WebKitWebContext.cpp:
354         (injectedBundleDirectory):
355         * UIProcess/gtk/TextCheckerGtk.cpp:
356         (WebKit::enchantTextChecker):
357
358 2015-05-08  Anders Carlsson  <andersca@apple.com>
359
360         Fix ProcessLauncher port leak
361         https://bugs.webkit.org/show_bug.cgi?id=144807
362         rdar://problem/20593291
363
364         Reviewed by Sam Weinig.
365
366         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
367         (WebKit::connectToService):
368         xpc_dictionary_set_mach_send increments the send right count so make sure to
369         balance it with a call to mach_port_deallocate.
370
371 2015-05-08  Beth Dakin  <bdakin@apple.com>
372
373         Fix performance tests after r183954
374         https://bugs.webkit.org/show_bug.cgi?id=144805
375
376         Reviewed by Alexey Proskuryakov.
377
378         Web* is traditionally a WK1 prefix, so use the WK2 prefix instead in WK2 so that 
379         we don’t have two classes with the same name in the two projects.
380         * UIProcess/mac/WKImmediateActionController.mm:
381         (-[WKImmediateActionController _defaultAnimationController]):
382
383 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
384
385         [GTK] Expose allowFileAccessFromFileURLs setting to WebKit2 GTK+ API
386         https://bugs.webkit.org/show_bug.cgi?id=144748
387
388         Reviewed by Sergio Villar Senin.
389
390         This is needed by local applications loaded as a file URI that do XMLHttpRequests.
391
392         * UIProcess/API/gtk/WebKitSettings.cpp:
393         (webKitSettingsSetProperty):
394         (webKitSettingsGetProperty):
395         (webkit_settings_class_init):
396         (webkit_settings_get_allow_file_access_from_file_urls):
397         (webkit_settings_set_allow_file_access_from_file_urls):
398         * UIProcess/API/gtk/WebKitSettings.h:
399         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
400         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
401
402 2015-05-08  Andreas Kling  <akling@apple.com>
403
404         Optimize serialization of quoted JSON strings.
405         <https://webkit.org/b/144754>
406
407         Reviewed by Darin Adler.
408
409         * NetworkProcess/cache/NetworkCacheEntry.cpp:
410         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
411
412 2015-05-08  Commit Queue  <commit-queue@webkit.org>
413
414         Unreviewed, rolling out r183945.
415         https://bugs.webkit.org/show_bug.cgi?id=144789
416
417         "It broke all the GTK+ tests" (Requested by KaL on #webkit).
418
419         Reverted changeset:
420
421         "[GTK] Checks for DEVELOPMENT_BUILD are all wrong"
422         https://bugs.webkit.org/show_bug.cgi?id=144746
423         http://trac.webkit.org/changeset/183945
424
425 2015-05-07  Conrad Shultz  <conrad_shultz@apple.com>
426
427         Don't register for Lookup notifications until needed
428         https://bugs.webkit.org/show_bug.cgi?id=144783
429
430         Reviewed by Tim Horton.
431
432         * UIProcess/API/mac/WKView.mm:
433         Add a WKViewData ivar to track whether we've already registered for popover notifications.
434         (-[WKView _prepareForDictionaryLookup]):
435         Added; moved notification registration from -[WKView initWithFrame:processPool:configuration:webView:.
436         (-[WKView initWithFrame:processPool:configuration:webView:]):
437         Move notification registration to -_prepareForDictionaryLookup.
438
439         * UIProcess/API/mac/WKViewInternal.h:
440         Expose -_prepareForDictionaryLookup.
441
442         * UIProcess/mac/PageClientImpl.mm:
443         (WebKit::PageClientImpl::didPerformDictionaryLookup):
444         Send -[WKView _prepareForDictionaryLookup].
445
446         * UIProcess/mac/WKImmediateActionController.mm:
447         (-[WKImmediateActionController _animationControllerForText]):
448         Ditto.
449
450 2015-05-07  Commit Queue  <commit-queue@webkit.org>
451
452         Unreviewed, rolling out r183961.
453         https://bugs.webkit.org/show_bug.cgi?id=144784
454
455         Broke js/dom/JSON-stringify.html (Requested by kling on
456         #webkit).
457
458         Reverted changeset:
459
460         "Optimize serialization of quoted JSON strings."
461         https://bugs.webkit.org/show_bug.cgi?id=144754
462         http://trac.webkit.org/changeset/183961
463
464 2015-05-07  Anders Carlsson  <andersca@apple.com>
465
466         Build fixes.
467
468         * UIProcess/API/mac/WKView.mm:
469         (-[WKView initWithFrame:processPool:configuration:webView:]):
470         Use the regular init method.
471
472         * UIProcess/mac/WKSharingServicePickerDelegate.mm:
473         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
474         * WebProcess/WebPage/mac/WebPageMac.mm:
475         (WebKit::WebPage::handleSelectionServiceClick):
476         Pass empty dictionaries instead of nil.
477
478 2015-05-07  Chris Dumez  <cdumez@apple.com>
479
480         ASSERTION when pasting text into the WebInspector console
481         https://bugs.webkit.org/show_bug.cgi?id=144774
482
483         Reviewed by Ryosuke Niwa.
484
485         Fix assertion in didChangeSelection() meant to check that calling
486         editorState() does not cause a synchronous layout. The assertion
487         was not correct as it was relying on FrameView::needsLayout() and
488         we would hit it if calling editorState() would schedule a layout.
489         Instead, the new assertion relies on FrameView::layoutCount(),
490         which is more accurate.
491
492         * WebProcess/WebPage/WebPage.cpp:
493         (WebKit::WebPage::didChangeSelection):
494
495 2015-05-07  Andreas Kling  <akling@apple.com>
496
497         Optimize serialization of quoted JSON strings.
498         <https://webkit.org/b/144754>
499
500         Reviewed by Darin Adler.
501
502         * NetworkProcess/cache/NetworkCacheEntry.cpp:
503         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
504
505 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
506
507         Followup fixes to r183936
508
509         I neglected to include a few review comments when I landed the patch.
510
511         * UIProcess/gtk/TextCheckerGtk.cpp:
512         (WebKit::checkerState): Remove double semicolons.
513         (WebKit::updateStateForAllProcessPools): Use range-based-for loop here and
514         give the function a better name.
515         (WebKit::TextChecker::setContinuousSpellCheckingEnabled): Use new function name
516         (WebKit::TextChecker::setGrammarCheckingEnabled):Use new function name
517         (WebKit::TextChecker::ignoreWord): Fix unused parameter warning.
518         (WebKit::updateStateForAllContexts): Deleted.
519
520 2015-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
521
522         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
523         https://bugs.webkit.org/show_bug.cgi?id=144746
524
525         Reviewed by Martin Robinson.
526
527         Use DEVELOPER_MODE rather than DEVELOPMENT_BUILD.
528
529         * Shared/gtk/ProcessExecutablePathGtk.cpp:
530         (WebKit::findWebKitProcess):
531         * UIProcess/API/gtk/WebKitWebContext.cpp:
532         (injectedBundleDirectory):
533         * UIProcess/gtk/TextCheckerGtk.cpp:
534         (WebKit::enchantTextChecker):
535
536 2015-05-06  Dean Jackson  <dino@apple.com>
537
538         Handle backdrop views that have to tile
539         https://bugs.webkit.org/show_bug.cgi?id=142317
540         <rdar://problem/20049088>
541
542         Reviewed by Simon Fraser.
543
544         Take 2 - this was rolled out because Mavericks was crashing.
545
546         Add some better logging for custom appearance.
547
548         * Shared/mac/RemoteLayerTreeTransaction.mm:
549         (WebKit::RemoteLayerTreeTextStream::operator<<):
550
551 2015-05-07  Sungmann Cho  <sungmann.cho@navercorp.com>
552
553         Add PLUGIN_ARCHITECTURE(X11) around m_frameRectInWindowCoordinates in NetscapePlugin.
554         https://bugs.webkit.org/show_bug.cgi?id=144490
555
556         Reviewed by Darin Adler.
557
558         m_frameRectInWindowCoordinates in NetscapePlugin is currently being used only for
559         the windowed plugins, and the windowed plugins are only supported on X11. So we can
560         guard it with PLUGIN_ARCHITECTURE(X11).
561
562         No new tests, no behavior change.
563
564         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
565         (WebKit::NetscapePlugin::geometryDidChange):
566         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
567
568 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
569
570         Revert "Introducing the Platform Abstraction Layer (PAL)"
571         https://bugs.webkit.org/show_bug.cgi?id=144751
572
573         Unreviewed.
574
575         PAL should be a new target inside WebCore, rather than a top-level folder.
576
577         * Configurations/FeatureDefines.xcconfig: Updated
578
579 2015-05-07  Jer Noble  <jer.noble@apple.com>
580
581         [WK2][Fullscreen] Fullscreen video does not enter low-power mode.
582         https://bugs.webkit.org/show_bug.cgi?id=144744
583
584         Reviewed by Darin Adler.
585
586         One of the requirements of entering low-power compositing mode is that no masking layers
587         are present in any of the ancestors of the fullscreen video layer. So once our fullscreen
588         transition animation completes, remove the mask layer entirely from our clipping layer.
589         This means it needs to be re-created and added when entering fullscreen, rather than just
590         at initialization time.
591
592         * UIProcess/mac/WKFullScreenWindowController.mm:
593         (-[WKFullScreenWindowController initWithWindow:webView:]):
594         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
595         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
596
597 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
598
599         [GTK] All spell checking layout tests fail
600         https://bugs.webkit.org/show_bug.cgi?id=144648
601
602         Reviewed by Carlos Garcia Campos.
603
604         Simplify and complete the GTK+ spell-checking implementation. Instead of using
605         the EFL/GTK+ only WKTextChecker interface, directly implement Enchant spell-checking
606         in TextCheckerGtk. The per-context spell checking API is an illusion, since all
607         WKTextChecker implementations will adjust the same singleton. This can be a first step
608         toward removing it entirely.
609
610         Also complete the implementation of the TextChecker interface by duplicating the EFL code,
611         which reuses other methods in the same class. Eventually this duplication will collapse,
612         once GTK+ and EFL can share an Enchant implementation.
613
614         * PlatformGTK.cmake:
615         * UIProcess/API/gtk/WebKitPrivate.h:
616         * UIProcess/API/gtk/WebKitTextChecker.cpp: Removed.
617         * UIProcess/API/gtk/WebKitTextChecker.h: Removed.
618         * UIProcess/API/gtk/WebKitWebContext.cpp: Remove WebTextChecker usage and
619         replace it with calls directly to the TextChecker singleton via static methods.
620         * UIProcess/TextChecker.h:
621         * UIProcess/gtk/TextCheckerGtk.cpp: Move the WebTextChecker enchant implementation
622         here and reuse the EFL version of WebKit::TextChecker::requestCheckingOfString.
623         Also initialize languages properly when building for developer builds. This
624         allows WebKitTestRunner to work even when it doesn't explicitly set the languages.
625
626 2015-05-07  Ada Chan  <adachan@apple.com>
627
628         Fix a couple of cases where the backForwardListState's currentIndex is not set correctly in WebBackForwardList::backForwardListState().
629         https://bugs.webkit.org/show_bug.cgi?id=144666
630
631         Reviewed by Darin Adler.
632
633         * UIProcess/WebBackForwardList.cpp:
634         (WebKit::WebBackForwardList::backForwardListState):
635         If the first item is filtered out and the currentIndex is 0, don't decrement currentIndex.
636         If all the items are filtered out, set currentIndex to the uninitialized value.
637
638 2015-05-07  Csaba Osztrogonác  <ossy@webkit.org>
639
640         [WK2] Remove Windows cruft
641         https://bugs.webkit.org/show_bug.cgi?id=144745
642
643         Reviewed by Darin Adler.
644
645         * NetworkProcess/soup/NetworkProcessSoup.cpp:
646         (WebKit::getMemorySize):
647         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
648         (IPC::ArgumentCoder<WebCore::GraphicsSurfaceToken>::encode):
649         (IPC::ArgumentCoder<WebCore::GraphicsSurfaceToken>::decode):
650         * WebProcess/soup/WebProcessSoup.cpp:
651         (WebKit::getMemorySize):
652
653 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
654
655         REGRESSION(r182032): [GTK] Production build is broken after r182032
656         https://bugs.webkit.org/show_bug.cgi?id=144736
657
658         Reviewed by Martin Robinson.
659
660         The problem is that r182032 moved the NetworkProcess sources from
661         WebKit2 sources to NetworkProcess sources. That's not a problem
662         for developer builds where all internal symbols are exported, but
663         doesn't work for production builds because all those internal
664         symbols are private.
665
666         * CMakeLists.txt: Use a different name for common network process
667         sources variable.
668         * PlatformMac.cmake: Append common network process sources to the
669         network process source list for Mac.
670
671 2015-05-07  Dan Bernstein  <mitz@apple.com>
672
673         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
674         https://bugs.webkit.org/show_bug.cgi?id=144727
675
676         Reviewed by Darin Adler.
677
678         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig, and define
679         INSTALL_PATH_PREFIX and LD_DYLIB_INSTALL_NAME for the iOS 8.x Simulator.
680         * Configurations/WebKit2.xcconfig: Define INSTALL_PATH_ACTUAL and let INSTALL_PATH be
681         derived from it and INSTALL_PATH_PREFIX. Don’t override DYLIB_INSTALL_NAME_BASE for iOS,
682         because we define LD_DYLIB_INSTALL_NAME directly where needed.
683
684 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
685
686         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.1 release.
687
688         * gtk/NEWS: Add release notes for 2.9.1.
689
690 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
691
692         [GTK] Remove dock button from Web Inspector window
693         https://bugs.webkit.org/show_bug.cgi?id=144728
694
695         Reviewed by Sergio Villar Senin.
696
697         We added the dock buttons to the headerbar, because they were
698         removed from the inspector toolbar, but with the new tabbed
699         design, the dock buttons are back in the toolbar and look redundant.
700
701         * UIProcess/WebInspectorProxy.h:
702         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
703         (WebKit::WebInspectorProxy::createInspectorWindow):
704         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
705         (WebKit::WebInspectorProxy::dockButtonClicked): Deleted.
706
707 2015-05-06  Jer Noble  <jer.noble@apple.com>
708
709         [WK2][Fullscreen] Elements whose children extend beyond their bounds are clipped in fullscreen mode.
710         https://bugs.webkit.org/show_bug.cgi?id=144716
711
712         Reviewed by Darin Adler.
713
714         We create a mask animation for the transition between windowed and fullscreen modes, on the
715         assumption that the element being taken into fullscreen mode does not have visible children
716         who extend beyond that elements bounds. This assumption breaks down in the case where div
717         with absolutely positioned children is taken fullscreen. While we can't necessarily make the
718         transition look correct in this case, we can remove the mask after the transition completes.
719
720         * UIProcess/mac/WKFullScreenWindowController.mm:
721         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
722         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
723         (WebKit::removeAllMediaKeyStorageForOriginPath):
724
725 2015-05-06  Jinwoo Jeong  <jw00.jeong@samsung.com>
726
727         Fix a build break on EFL debug build
728         https://bugs.webkit.org/show_bug.cgi?id=144654
729
730         Reviewed by Gyuyoung Kim.
731
732         No new tests, just build fix.
733
734         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
735         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
736         (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext):
737
738 2015-05-06  Daniel Bates  <dabates@apple.com>
739
740         [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
741         https://bugs.webkit.org/show_bug.cgi?id=144657
742         <rdar://problem/18894598>
743
744         Reviewed by Andy Estes.
745
746         Pause and resume the database thread when the UIProcess enters and leaves the background,
747         respectively, so that we avoid WebProcess termination due to holding a locked SQLite
748         database file when the WebProcess is suspended. This behavior matches the analagous
749         behavior in Legacy WebKit.
750
751         * UIProcess/WebPageProxy.h:
752         * UIProcess/ios/WKContentView.mm:
753         (-[WKContentView _applicationDidEnterBackground:]): Call WebPageProxy::applicationDidEnterBackground()
754         when the UIProcess enters the background.
755         * UIProcess/ios/WebPageProxyIOS.mm:
756         (WebKit::WebPageProxy::applicationDidEnterBackground): Added; notify the WebProcess to pause the database thread.
757         We temporarily take out background assertion on the WebProcess before sending this notification to ensure that the
758         WebProcess is running to receive it. We'll release this assertion when the WebProcess replies that it received the
759         notification.
760         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
761         (WebKit::WebDatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseManager::setPauseAllDatabases().
762         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
763         * WebProcess/WebPage/WebPage.h:
764         * WebProcess/WebPage/WebPage.messages.in: Add message ApplicationDidEnterBackground(). Also,
765         add empty lines to help demarcate this message and the other UIKit application lifecycle-related
766         messages from the rest of the list of messages.
767         * WebProcess/WebPage/ios/WebPageIOS.mm:
768         (WebKit::WebPage::applicationWillEnterForeground): Resume the database thread.
769         (WebKit::WebPage::applicationDidEnterBackground): Pause the database thread.
770
771 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
772
773         [EFL] ewk_view_page_contents_get() API test is flaky
774         https://bugs.webkit.org/show_bug.cgi?id=144683
775
776         Reviewed by Gyuyoung Kim.
777
778         Callback of WKPageGetContentsAsMHTMLData contains WKData which does not contain null terminated character.
779
780         * UIProcess/API/efl/ewk_view.cpp: Pass the data of string instead of WKData directly.
781         (ewkViewPageContentsAsMHTMLCallback):
782
783 2015-05-06  Joseph Pecoraro  <pecoraro@apple.com>
784
785         Web Inspector: Docking Toolbar Buttons do not respect Docking Availability
786         https://bugs.webkit.org/show_bug.cgi?id=144714
787
788         Reviewed by Timothy Hatcher.
789
790         * UIProcess/WebInspectorProxy.cpp:
791         (WebKit::WebInspectorProxy::createInspectorPage):
792         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
793         * WebProcess/WebPage/WebInspectorUI.cpp:
794         (WebKit::WebInspectorUI::setDockingUnavailable):
795         * WebProcess/WebPage/WebInspectorUI.h:
796         * WebProcess/WebPage/WebInspectorUI.messages.in:
797         When docking availability changes, inform the inspector page
798         so it can respond by updating its UI.
799
800 2015-05-06  Joonghun Park  <jh718.park@samsung.com>
801
802         [WK2] Simplify AsyncRequestImpl::ArgumentType parameters
803         https://bugs.webkit.org/show_bug.cgi?id=144689
804
805         Reviewed by Darin Adler.
806
807         Remove duplicated typename and ::type from AsyncRequestImpl related
808         function parameters.
809
810         * Shared/AsyncRequest.h:
811
812 2015-05-06  Commit Queue  <commit-queue@webkit.org>
813
814         Unreviewed, rolling out r183894.
815         https://bugs.webkit.org/show_bug.cgi?id=144719
816
817         crashes on mavericks (Requested by dino on #webkit).
818
819         Reverted changeset:
820
821         "Handle backdrop views that have to tile"
822         https://bugs.webkit.org/show_bug.cgi?id=142317
823         http://trac.webkit.org/changeset/183894
824
825 2015-05-06  Brady Eidson  <beidson@apple.com>
826
827         Addition review followup for:
828         Crash executing null AsyncRequest in IDB code.
829         <rdar://problem/18854856> and https://bugs.webkit.org/show_bug.cgi?id=144715
830
831         Reviewed by Darin Adler.
832
833         This patch adds a layer on top of the UniqueIDBDatabase request map to catch this coding mistake in the future. 
834  
835          * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
836         (WebKit::UniqueIDBDatabase::didCompleteBoolRequest): Get rid of the ASSERT and the temporary variable,
837           make it a single line which reads better.
838         (WebKit::UniqueIDBDatabase::didPutRecordInBackingStore): Ditto.
839         (WebKit::UniqueIDBDatabase::didGetRecordFromBackingStore): Ditto.
840         (WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore): Ditto.
841         (WebKit::UniqueIDBDatabase::didAdvanceCursorInBackingStore): Ditto.
842         (WebKit::UniqueIDBDatabase::didIterateCursorInBackingStore): Ditto.
843         (WebKit::UniqueIDBDatabase::didCountInBackingStore): Ditto.
844         (WebKit::UniqueIDBDatabase::didDeleteRangeInBackingStore): Ditto.
845         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Ditto.
846
847         Add the class AsyncRequestMap which shadows a HashMap but does aggressive runtime checks
848         in ::take() to make sure the same request was not dispatched twice in a row, and makes sure we
849         never try to execute a null AsyncRequest by way of a RELEASE_ASSERT.
850         * Shared/AsyncRequest.h:
851         (WebKit::AsyncRequestMap::AsyncRequestMap):
852         (WebKit::AsyncRequestMap::take):
853         (WebKit::AsyncRequestMap::add):
854         (WebKit::AsyncRequestMap::clear):
855         (WebKit::AsyncRequestMap::values):
856
857 2015-05-06  Brady Eidson  <beidson@apple.com>
858
859         Crash executing null AsyncRequest in IDB code.
860         <rdar://problem/18854856> and https://bugs.webkit.org/show_bug.cgi?id=144715
861
862         Reviewed by Darin Adler.
863
864         When UniqueIDBDatabase fails to execute an operation on the database work queue it usually
865         dispatches an AsyncRequest ID back to the main thread with an error callback.
866
867         For two of its operations it would then also dispatch the success callback.
868
869         In those cases the main thread would first take the AsyncRequest for the error callback out
870         of a map and then execute it.
871
872         It would then try to take the same AsyncRequest out of the map again, fail to do so, then
873         execute a null AsyncRequest.
874
875         This patch fixes the two functions to not dispatch both an error and success callback.
876
877         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
878         (WebKit::UniqueIDBDatabase::countInBackingStore): Return after dispatching the error callback.
879         (WebKit::UniqueIDBDatabase::deleteRangeInBackingStore): Ditto.
880
881 2015-05-06  Dean Jackson  <dino@apple.com>
882
883         Handle backdrop views that have to tile
884         https://bugs.webkit.org/show_bug.cgi?id=142317
885         <rdar://problem/20049088>
886
887         Reviewed by Simon Fraser.
888
889         Add some better logging for custom appearance.
890
891         * Shared/mac/RemoteLayerTreeTransaction.mm:
892         (WebKit::RemoteLayerTreeTextStream::operator<<):
893
894 2015-05-06  Chris Dumez  <cdumez@apple.com>
895
896         Disable network cache efficacy logging
897         https://bugs.webkit.org/show_bug.cgi?id=144703
898         <rdar://problem/20439143>
899
900         Reviewed by Andreas Kling.
901
902         Disable network cache efficacy logging by default as we have sufficient
903         data for now.
904
905         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
906         (WebKit::registerUserDefaultsIfNeeded):
907
908 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
909
910         Fix the build.
911
912         * UIProcess/mac/WKViewLayoutStrategy.mm:
913         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
914
915 2015-05-06  Dan Bernstein  <mitz@apple.com>
916
917         No way to get a WKWebProcessPlugInFrame’s parent frame
918         https://bugs.webkit.org/show_bug.cgi?id=144705
919
920         Reviewed by Sam Weinig.
921
922         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
923         (-[WKWebProcessPlugInFrame _parentFrame]): Added this getter.
924         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: Declared new
925         _parentFrame property.
926
927 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
928
929         Fix the build.
930
931         * UIProcess/mac/WKViewLayoutStrategy.mm:
932         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
933
934 2015-04-02  Myles C. Maxfield  <mmaxfield@apple.com>
935
936         Introducing the Platform Abstraction Layer (PAL)
937         https://bugs.webkit.org/show_bug.cgi?id=143358
938
939         Reviewed by Simon Fraser.
940
941         * Configurations/FeatureDefines.xcconfig: Updated
942
943 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
944
945         [GTK][WK2] The WebKit network disk cache is not enabled
946         https://bugs.webkit.org/show_bug.cgi?id=142821
947
948         Reviewed by Martin Robinson.
949
950         Enable NetworkCache for the GTK+ port.
951
952         * config.h:
953
954 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
955
956         [EFL] Remove redudant condition in ViewClientEfl::didChangeViewportAttributes
957         https://bugs.webkit.org/show_bug.cgi?id=144672
958
959         Reviewed by Gyuyoung Kim.
960
961         ViewClientEfl::didChangeViewportAttributes is always called when fixed layout is disabled.
962
963         * UIProcess/efl/ViewClientEfl.cpp:
964         (WebKit::ViewClientEfl::didChangeViewportAttributes):
965         Removes condition that checks whether fixed layout is enabled.
966
967 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
968
969         NetworkResourceLoader::cleanup() should clear ResourceHandle client pointer.
970         https://bugs.webkit.org/show_bug.cgi?id=144641
971         rdar://problem/20250960
972
973         Reviewed by David Kilzer.
974
975         * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup):
976         Clear the client pointer.
977
978         * Shared/Authentication/AuthenticationManager.cpp:
979         (WebKit::AuthenticationManager::useCredentialForChallenge):
980         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
981         (WebKit::AuthenticationManager::cancelChallenge):
982         (WebKit::AuthenticationManager::performDefaultHandling):
983         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
984         Updated comments, which were not accurate, at least on Mac.
985
986 2015-05-05  Tim Horton  <timothy_horton@apple.com>
987
988         Views get stuck with viewScale < 1 after switching from DynamicSizeWithMinimumViewSize to ViewSize
989         https://bugs.webkit.org/show_bug.cgi?id=144656
990
991         Reviewed by Dan Bernstein.
992
993         * UIProcess/mac/WKViewLayoutStrategy.mm:
994         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
995         Reset the viewScale when we leave the DynamicSizeWithMinimumViewSize strategy.
996
997 2015-05-05  Tim Horton  <timothy_horton@apple.com>
998
999         Fix the build.
1000
1001         * Platform/mac/LayerHostingContext.mm:
1002         (WebKit::LayerHostingContext::setFencePort):
1003
1004 2015-05-05  Tim Horton  <timothy_horton@apple.com>
1005
1006         Fix the build.
1007
1008         * UIProcess/mac/WKViewLayoutStrategy.mm:
1009         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
1010
1011 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
1012
1013         Add a layout mode for computing fixed layout size from a minimum size
1014         https://bugs.webkit.org/show_bug.cgi?id=144610
1015         <rdar://problem/19790341>
1016
1017         Reviewed by Simon Fraser.
1018
1019         Add a layout mode where WebKit determines the layout size with a set of
1020         (still in flux) heuristics, trying hard to keep the page usable below a
1021         particular client-defined threshold view size.
1022
1023         This can mean that WebKit will start scaling down the page inside the view
1024         to make the whole page fit, using the viewScale mechanism.
1025
1026         * UIProcess/API/C/WKLayoutMode.h:
1027         * UIProcess/API/Cocoa/_WKLayoutMode.h:
1028         Add the new layout mode, and documentation for the two complicated ones.
1029         
1030         * UIProcess/API/Cocoa/WKWebView.mm:
1031         (-[WKWebView _layoutMode]):
1032         (-[WKWebView _setLayoutMode:]):
1033         (-[WKWebView _setViewScale:]):
1034         (-[WKWebView _setMinimumViewSize:]):
1035         (-[WKWebView _minimumViewSize]):
1036         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1037         Forward the layoutMode and viewScale parameters to WKView if we have one.
1038
1039         * UIProcess/API/Cocoa/WKViewPrivate.h:
1040         * UIProcess/API/mac/WKView.mm:
1041         (-[WKView dealloc]):
1042         (-[WKView viewWillStartLiveResize]):
1043         (-[WKView viewDidEndLiveResize]):
1044         (-[WKView setFrameSize:]):
1045         (-[WKView initWithFrame:processPool:configuration:webView:]):
1046         (-[WKView disableFrameSizeUpdates]):
1047         (-[WKView enableFrameSizeUpdates]):
1048         (-[WKView frameSizeUpdatesDisabled]):
1049         (-[WKView _layoutMode]):
1050         (-[WKView _setLayoutMode:]):
1051         (-[WKView _setViewScale:]):
1052         (-[WKView _setMinimumViewSize:]):
1053         (-[WKView _minimumViewSize]):
1054         Store the minimum view size, and update the fixed layout size if needed.
1055
1056         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Deleted.
1057         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Deleted.
1058         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Deleted.
1059         Store the WKLayoutMode on the WKViewLayoutStrategy instead of having a
1060         bunch of things like _automaticallyComputesFixedLayoutSizeFromViewScale.
1061
1062         * UIProcess/API/mac/WKViewInternal.h:
1063
1064         * UIProcess/mac/WKViewLayoutStrategy.h: Added.
1065         * UIProcess/mac/WKViewLayoutStrategy.mm: Added.
1066         (+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]):
1067         (-[WKViewLayoutStrategy initWithPage:view:mode:]):
1068         (-[WKViewLayoutStrategy willDestroyView:]):
1069         (-[WKViewLayoutStrategy layoutMode]):
1070         (-[WKViewLayoutStrategy updateLayout]):
1071         (-[WKViewLayoutStrategy disableFrameSizeUpdates]):
1072         (-[WKViewLayoutStrategy enableFrameSizeUpdates]):
1073         (-[WKViewLayoutStrategy frameSizeUpdatesDisabled]):
1074         (-[WKViewLayoutStrategy didChangeViewScale]):
1075         (-[WKViewLayoutStrategy didChangeMinimumViewSize]):
1076         (-[WKViewLayoutStrategy willStartLiveResize]):
1077         (-[WKViewLayoutStrategy didEndLiveResize]):
1078         (-[WKViewLayoutStrategy didChangeFrameSize]):
1079         (-[WKViewLayoutStrategy willChangeLayoutStrategy]):
1080         (-[WKViewViewSizeLayoutStrategy initWithPage:view:mode:]):
1081         (-[WKViewViewSizeLayoutStrategy updateLayout]):
1082         (-[WKViewFixedSizeLayoutStrategy initWithPage:view:mode:]):
1083         (-[WKViewFixedSizeLayoutStrategy updateLayout]):
1084         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:mode:]):
1085         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy updateLayout]):
1086         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeViewScale]):
1087         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeFrameSize]):
1088         Move the existing layout strategies from WKView into WKViewLayoutStrategy subclasses.
1089
1090         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy initWithPage:view:mode:]):
1091         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
1092         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeMinimumViewSize]):
1093         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willStartLiveResize]):
1094         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didEndLiveResize]):
1095         While in live resize with the new layout mode, disable frame size updates.
1096         The new layout mode will do a live scale during part of the resize, and
1097         we don't always want to send the new view size to the Web process.
1098
1099         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeFrameSize]):
1100         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
1101         While in the new layout mode, maintain the viewScale as the minimum of the
1102         scale required to fit the current view frame size inside the minimumViewSize.
1103         If no scaling is required, carry on as usual, pushing the new view frame size
1104         to the DrawingArea and on to the Web process.
1105         If scaling is required, apply a transform to the view in the UI process,
1106         until the live resize completes, in which case we send a fenced viewScale
1107         adjustment to the Web process (so that the tiles paint at the new viewScale
1108         synchronized with the removal of the transform in the UI process).
1109
1110         * UIProcess/WebPageProxy.cpp:
1111         (WebKit::WebPageProxy::scaleViewFenced):
1112         * UIProcess/WebPageProxy.h:
1113         * WebProcess/WebPage/DrawingArea.h:
1114         (WebKit::DrawingArea::addFence):
1115         (WebKit::DrawingArea::acceleratedAnimationDidEnd): Deleted.
1116         * WebProcess/WebPage/WebPage.cpp:
1117         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
1118         * WebProcess/WebPage/WebPage.h:
1119         * WebProcess/WebPage/WebPage.messages.in:
1120         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1121         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1122         (WebKit::TiledCoreAnimationDrawingArea::addFence):
1123         Add scaleViewAndUpdateGeometryFenced and the ability to install CoreAnimation fences on
1124         TiledCoreAnimationDrawingArea's CAContext.
1125
1126         Add the ability to send updateGeometry out-of-band, so that
1127         we can send it synchronously inside the message along with the CA fence.
1128         We have to both change the viewScale and updateGeometry simultaneously
1129         in the same CA commit that we install the fence into, in order to ensure
1130         that there is no flash.
1131
1132 2015-05-05  Alex Christensen  <achristensen@webkit.org>
1133
1134         [Content Extensions] Release input NSString when finished copying it.
1135         https://bugs.webkit.org/show_bug.cgi?id=144642
1136
1137         Reviewed by Brian Weinstein.
1138
1139         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
1140         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
1141         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
1142
1143 2015-05-05  Alex Christensen  <achristensen@webkit.org>
1144
1145         [Content Extensions] Use less memory to store the json input.
1146         https://bugs.webkit.org/show_bug.cgi?id=144604
1147
1148         Reviewed by Benjamin Poulain.
1149
1150         * UIProcess/API/APIUserContentExtensionStore.cpp:
1151         (API::compiledToFile):
1152         (API::UserContentExtensionStore::compileContentExtension):
1153         * UIProcess/API/APIUserContentExtensionStore.h:
1154         Don't copy strings as much or keep them alive after done using them.
1155
1156 2015-05-04  Alex Christensen  <achristensen@webkit.org>
1157
1158         [Content Extensions] Use less memory when writing byte code to file
1159         https://bugs.webkit.org/show_bug.cgi?id=144602
1160
1161         Reviewed by Darin Adler.
1162
1163         * UIProcess/API/APIUserContentExtensionStore.cpp:
1164         (API::decodeContentExtensionMetaData):
1165         (API::writeDataToFile):
1166         (API::compiledToFile):
1167         (API::createExtension):
1168         Compile and write each DFA to file, then come back and write the header when finalizing.
1169         Also don't copy the DFA bytecode. This way, we don't need to keep more than one DFA's
1170         bytecode in memory at a time.
1171
1172 2015-05-05  Sungmann Cho  <sungmann.cho@navercorp.com>
1173
1174         Make all FrameLoadState data members private.
1175         https://bugs.webkit.org/show_bug.cgi?id=144562
1176
1177         Reviewed by Darin Adler.
1178
1179         Previously, all of the data members in FrameLoadState were public and accessed directly
1180         from outside the class. But these should all be private as noted in FrameLoadState.h
1181         for better encapsulation.
1182
1183         No new tests, no behavior change.
1184
1185         * UIProcess/API/C/WKFrame.cpp:
1186         (WKFrameGetFrameLoadState):
1187         * UIProcess/FrameLoadState.h:
1188         (WebKit::FrameLoadState::state):
1189         (WebKit::FrameLoadState::url):
1190         (WebKit::FrameLoadState::provisionalURL):
1191         (WebKit::FrameLoadState::unreachableURL):
1192         * UIProcess/WebFrameProxy.h:
1193         (WebKit::WebFrameProxy::url):
1194         (WebKit::WebFrameProxy::provisionalURL):
1195         (WebKit::WebFrameProxy::unreachableURL):
1196
1197 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
1198
1199         Crashes in SandboxExtension::consumePermanently when uploading
1200         https://bugs.webkit.org/show_bug.cgi?id=144611
1201         rdar://problem/10156710
1202
1203         Reviewed by Darin Adler.
1204
1205         This only fixes the crashes, uploading still won't work.
1206         Added null checks and some logging that may help us get to the root cause eventually.
1207
1208         * Shared/SandboxExtension.h:
1209         (WebKit::SandboxExtension::createHandle):
1210         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
1211         * Shared/mac/SandboxExtensionMac.mm:
1212         (WebKit::SandboxExtension::createHandle):
1213         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
1214         * UIProcess/WebPageProxy.cpp:
1215         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
1216         * WebProcess/WebPage/WebPage.cpp:
1217         (WebKit::WebPage::extendSandboxForFileFromOpenPanel):
1218
1219 2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
1220
1221         Remove TextureMapperImageBuffer
1222         https://bugs.webkit.org/show_bug.cgi?id=143561
1223
1224         Reviewed by Žan Doberšek.
1225
1226         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1227         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1228         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1229         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
1230
1231 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1232
1233         [SOUP] Network Cache: IOChannel operations are not sent to the right thread
1234         https://bugs.webkit.org/show_bug.cgi?id=144542
1235
1236         Reviewed by Darin Adler.
1237
1238         We are ignoring the given WorkQueue and running the async
1239         operations in the current thread. Check the given WorkQueue
1240         instead and schedule the operation to the given queue. If the
1241         given queue is nullptr, which means the operation should be run in
1242         the main context, the operation is run directly if the current
1243         context is the main one or sent to the main context using a
1244         GMainLoopSource.
1245
1246         Fixes crashes due to asserts when running disk-cache layout tests
1247         in a Debug build.
1248
1249         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1250         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1251         (WebKit::NetworkCache::runTaskInQueue):
1252         (WebKit::NetworkCache::IOChannel::read):
1253         (WebKit::NetworkCache::IOChannel::readSync):
1254         (WebKit::NetworkCache::IOChannel::write):
1255
1256 2015-05-04  Dan Bernstein  <mitz@apple.com>
1257
1258         WebKit always goes through LaunchServices for main frame navigation actions
1259         https://bugs.webkit.org/show_bug.cgi?id=144608
1260
1261         Reviewed by Tim Horton.
1262
1263         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Defined
1264         _WKNavigationActionPolicyAllowWithoutTryingAppLink.
1265         * UIProcess/Cocoa/NavigationState.mm:
1266         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): If the policy
1267         is _WKNavigationActionPolicyAllowWithoutTryingAppLink, don’t go through tryAppLink.
1268
1269 2015-05-04  Enrica Casucci  <enrica@apple.com>
1270
1271         [iOS WK2] editorState should include information about selection clipping rectangle.
1272         https://bugs.webkit.org/show_bug.cgi?id=144603
1273         rdar://problem/20521252
1274
1275         Reviewed by Chris Dumez.
1276
1277         Adding selectionClipRect to the post-layout portion of EditorState.
1278         This way we can compute the selection clipping rectangle based on
1279         up-to-date information instead of using the rectangle provided when
1280         then element was first focused.
1281
1282         * Shared/EditorState.cpp:
1283         (WebKit::EditorState::PostLayoutData::encode):
1284         (WebKit::EditorState::PostLayoutData::decode):
1285         * Shared/EditorState.h:
1286         * UIProcess/ios/WKContentViewInteraction.mm:
1287         (-[WKContentView _selectionClipRect]):
1288         * WebProcess/WebPage/ios/WebPageIOS.mm:
1289         (WebKit::WebPage::platformEditorState):
1290
1291 2015-05-04  Antti Koivisto  <antti@apple.com>
1292
1293         Network Cache: Support time based cache clearing
1294         https://bugs.webkit.org/show_bug.cgi?id=144568
1295         <rdar://problem/19769820>
1296
1297         Reviewed by Andreas Kling.
1298
1299         Support clearing cache entries newer than given time only.
1300
1301         * NetworkProcess/cache/NetworkCache.cpp:
1302         (WebKit::NetworkCache::Cache::deleteDumpFile):
1303         (WebKit::NetworkCache::Storage::traverse):
1304
1305             Also fix thread safety of traverse handler function.
1306
1307         (WebKit::NetworkCache::Cache::clear):
1308
1309             Also add completion handler to support the API properly.
1310
1311         * NetworkProcess/cache/NetworkCache.h:
1312         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1313         (WebKit::NetworkCache::Storage::clear):
1314         * NetworkProcess/cache/NetworkCacheStorage.h:
1315         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1316         (WebKit::clearNSURLCache):
1317
1318             Factor to a function.
1319
1320         (WebKit::NetworkProcess::clearDiskCache):
1321
1322 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
1323
1324         [WTF] Remove Functional.h inclusions
1325         https://bugs.webkit.org/show_bug.cgi?id=144400
1326
1327         Reviewed by Darin Adler.
1328
1329         Remove unnecessary inclusions of the <wtf/Functional.h> header in WebKit2.
1330
1331         * Platform/IPC/unix/ConnectionUnix.cpp:
1332         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: Import the <objc/runtime.h>
1333         header that was previously indirectly included through the Functional.h header.
1334         * WebProcess/WebPage/DrawingArea.cpp:
1335
1336 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
1337
1338         [ARM] Don't compare unsigned chars to EOF (-1)
1339         https://bugs.webkit.org/show_bug.cgi?id=144439
1340
1341         Reviewed by Geoffrey Garen.
1342
1343         * Shared/linux/WebMemorySamplerLinux.cpp:
1344         (WebKit::nextToken): Don't cast return value of fgetc() to char.
1345
1346 2015-05-04  Antti Koivisto  <antti@apple.com>
1347
1348         Remove NetworkResourceLoadScheduler
1349         https://bugs.webkit.org/show_bug.cgi?id=144550
1350
1351         Reviewed by Sam Weinig.
1352
1353         It doesn't really do anything.
1354
1355         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1356         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
1357         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1358         * NetworkProcess/NetworkProcess.cpp:
1359         (WebKit::NetworkProcess::getNetworkProcessStatistics):
1360         * NetworkProcess/NetworkProcess.h:
1361         (WebKit::NetworkProcess::networkResourceLoadScheduler): Deleted.
1362         * NetworkProcess/NetworkResourceLoadScheduler.cpp: Removed.
1363         * NetworkProcess/NetworkResourceLoadScheduler.h: Removed.
1364         * NetworkProcess/NetworkResourceLoader.cpp:
1365         (WebKit::NetworkResourceLoader::cleanup):
1366         * NetworkProcess/NetworkResourceLoader.h:
1367         (WebKit::NetworkResourceLoader::create):
1368         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1369         (WebKit::initializeNetworkSettings):
1370
1371             Moved from NetworkResourceLoadSchedulerMac.mm.
1372
1373         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1374         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm: Removed.
1375         * NetworkProcess/soup/NetworkResourceLoadSchedulerSoup.cpp: Removed.
1376         * WebKit2.xcodeproj/project.pbxproj:
1377
1378 2015-05-03  Alexey Proskuryakov  <ap@apple.com>
1379
1380         Crash in SandboxExtension::consume when uploading iWork -tef documents to iCloud
1381         https://bugs.webkit.org/show_bug.cgi?id=144509
1382         rdar://problem/18731910
1383
1384         Reviewed by Daniel Bates.
1385
1386         No test, because testRunner.beginDragWithFiles doesn't work in WKTR, and making
1387         it work is hard.
1388
1389         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp:
1390         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
1391         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
1392
1393 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1394
1395         [GTK][EFL] Unify platform display handling
1396         https://bugs.webkit.org/show_bug.cgi?id=144517
1397
1398         Reviewed by Martin Robinson.
1399
1400         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1401         (webkitWebViewBaseRealize): Use PlatformDisplay::sharedDisplay()
1402         to checkt the display type.
1403         (webkitWebViewBaseCreateWebPage): Ditto.
1404         * UIProcess/cairo/BackingStoreCairo.cpp:
1405         (WebKit::BackingStore::createBackend): Pass the native X11 shared
1406         display to BackingStoreBackendCairoX11.
1407         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1408         (WebKit::NetscapePlugin::x11HostDisplay): Return the native X11
1409         shared display.
1410
1411 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1412
1413         Unreviewed. Fix Debug build with NETWORK_CACHE enabled and CACHE_PARTITIONING disabled.
1414
1415         * NetworkProcess/cache/NetworkCache.cpp:
1416         (WebKit::NetworkCache::Cache::store):
1417
1418 2015-05-01  Dan Bernstein  <mitz@apple.com>
1419
1420         WebKit2 part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
1421         https://bugs.webkit.org/show_bug.cgi?id=144501
1422
1423         Reviewed by Darin Adler.
1424
1425         * UIProcess/WebPageProxy.cpp:
1426         (WebKit::WebPageProxy::loadAlternateHTMLString): If this is called during
1427         didFailProvisionalLoadForFrame, send back the provisional URL captured at the time of
1428         failure.
1429         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Get the provisioinal URL and keep
1430         it in new member variable m_failingProvisionalLoadURL for the duration of the client’s
1431         handling of this message.
1432         * UIProcess/WebPageProxy.h:
1433
1434         * UIProcess/WebPageProxy.messages.in: Added provisionalURL parameter to
1435         DidFailProvisionalLoadForFrame.
1436
1437         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1438         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): Send the URL for this error
1439         to the UI process.
1440
1441         * WebProcess/WebPage/WebPage.cpp:
1442         (WebKit::WebPage::loadAlternateHTMLString): Temporarily restore the loader’s state to
1443         reflect the provisional load error being handled.
1444
1445         * WebProcess/WebPage/WebPage.h:
1446         * WebProcess/WebPage/WebPage.messages.in: Added provisionalLoadErrorURL parameter to
1447         LoadAlternateHTMLString.
1448
1449 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
1450
1451         USE(...) macro should expect unprefixed variables
1452         https://bugs.webkit.org/show_bug.cgi?id=144454
1453
1454         Reviewed by Daniel Bates.
1455
1456         * Shared/API/c/WKBase.h: Replace all occurrences WTF_USE with USE.
1457         * WebKit2.xcodeproj/project.pbxproj: Ditto.
1458
1459 2015-05-01  Brady Eidson  <beidson@apple.com>
1460
1461         Add API to disable meta refreshes.
1462         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
1463
1464         Reviewed by Alexey Proskuryakov.
1465
1466         Add a preference to enable/disable meta refreshes, enabled by default.
1467
1468         * Shared/WebPreferencesDefinitions.h:
1469         * UIProcess/API/C/WKPreferences.cpp:
1470         (WKPreferencesSetMetaRefreshEnabled):
1471         (WKPreferencesGetMetaRefreshEnabled):
1472         (WKPreferencesGetIgnoreViewportScalingConstraints): Deleted.
1473         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1474         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1475         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1476         * WebProcess/WebPage/WebPage.cpp:
1477         (WebKit::WebPage::updatePreferences):
1478
1479 2015-05-01  Antti Koivisto  <antti@apple.com>
1480
1481         Remove network process load serialization code
1482         https://bugs.webkit.org/show_bug.cgi?id=144448
1483
1484         Reviewed by Alexey Proskuryakov.
1485
1486         TestRunner.setSerializeHTTPLoads is used by a few tests but it is unnecessary
1487         with network process. We don't reorder loads anyway so test results are consistent.
1488         There or no other clients for this code.
1489
1490         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1491         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
1492         (WebKit::NetworkConnectionToWebProcess::setSerialLoadingEnabled): Deleted.
1493         * NetworkProcess/NetworkConnectionToWebProcess.h:
1494         (WebKit::NetworkConnectionToWebProcess::isSerialLoadingEnabled): Deleted.
1495         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1496         * NetworkProcess/NetworkProcess.cpp:
1497         (WebKit::NetworkProcess::getNetworkProcessStatistics):
1498         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
1499         (WebKit::NetworkResourceLoadScheduler::scheduleLoader):
1500         (WebKit::NetworkResourceLoadScheduler::removeLoader):
1501         (WebKit::NetworkResourceLoadScheduler::loadsPendingCount): Deleted.
1502         * NetworkProcess/NetworkResourceLoadScheduler.h:
1503         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1504         (WKBundleSetTabKeyCyclesThroughElements):
1505         (WKBundleSetSerialLoadingEnabled): Deleted.
1506         (WKBundleDispatchPendingLoadRequests): Deleted.
1507         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1508         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1509         (WebKit::InjectedBundle::setSerialLoadingEnabled): Deleted.
1510         (WebKit::InjectedBundle::dispatchPendingLoadRequests): Deleted.
1511
1512             Remove also this as it does nothing.
1513
1514         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1515         (WebKit::WebResourceLoadScheduler::WebResourceLoadScheduler):
1516         (WebKit::WebResourceLoadScheduler::suspendPendingRequests):
1517         (WebKit::WebResourceLoadScheduler::resumePendingRequests):
1518
1519             Remove implementation, it does nothing.
1520
1521         (WebKit::WebResourceLoadScheduler::setSerialLoadingEnabled):
1522         * WebProcess/Network/WebResourceLoadScheduler.h:
1523
1524 2015-04-30  Timothy Horton  <timothy_horton@apple.com>
1525
1526         Remove long-deprecated unused WKView minimumLayoutWidth properties
1527         https://bugs.webkit.org/show_bug.cgi?id=144480
1528
1529         Reviewed by Alexey Proskuryakov.
1530
1531         * UIProcess/API/Cocoa/WKViewPrivate.h:
1532         * UIProcess/API/mac/WKView.mm:
1533         (-[WKView minimumLayoutWidth]): Deleted.
1534         (-[WKView setMinimumLayoutWidth:]): Deleted.
1535         (-[WKView minimumWidthForAutoLayout]): Deleted.
1536         (-[WKView setMinimumWidthForAutoLayout:]): Deleted.
1537         These were replaced with minimumSizeForAutoLayout long ago.
1538
1539 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
1540
1541         Fixed elements end up in the middle of the view with pageScale < 1
1542         https://bugs.webkit.org/show_bug.cgi?id=144428
1543         rdar://problem/20404982
1544
1545         Reviewed by Tim Horton.
1546
1547         Encode/decode fixedElementsLayoutRelativeToFrame.
1548
1549         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1550         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1551         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1552
1553 2015-04-30  Tim Horton  <timothy_horton@apple.com>
1554
1555         Asynchronous (or timed-out synchronous) resize flashes white instead of page background color
1556         https://bugs.webkit.org/show_bug.cgi?id=144468
1557
1558         Reviewed by Simon Fraser and Dan Bernstein.
1559
1560         * UIProcess/API/mac/WKView.mm:
1561         (-[WKView _viewBackgroundColor]):
1562         (-[WKView updateLayer]):
1563         Use the pageExtendedBackgroundColor for the background color of the WKView,
1564         if we have one (and aren't using a transparent background). This means
1565         during asynchronous resize or other cases where the Web process isn't keeping
1566         up with the UI process during a resize, we'll see background color instead of white.
1567
1568 2015-04-30  Beth Dakin  <bdakin@apple.com>
1569
1570         Should choose UIScrollView indicatorStyle based on the document background color
1571         https://bugs.webkit.org/show_bug.cgi?id=144473
1572         -and corresponding-
1573         rdar://problem/19897699
1574
1575         Reviewed by Simon Fraser.
1576
1577         Update the indicator style whenever the background color changes.  
1578         * UIProcess/API/Cocoa/WKWebView.mm:
1579         (-[WKWebView _updateScrollViewBackground]):
1580
1581 2015-04-30  Enrica Casucci  <enrica@apple.com>
1582
1583         [iOS] tapping in the middle of a word in editable content should not select the word.
1584         https://bugs.webkit.org/show_bug.cgi?id=144421
1585         rdar://problem/20710948
1586
1587         Reviewed by Tim Horton.
1588
1589         Reverting to the original behavior.
1590
1591         * WebProcess/WebPage/ios/WebPageIOS.mm:
1592         (WebKit::WebPage::selectWithGesture):
1593
1594 2015-04-29  Hunseop Jeong  <hs85.jeong@samsung.com>
1595
1596         Fix the EFL build after r183595
1597         https://bugs.webkit.org/show_bug.cgi?id=144427
1598
1599         Reviewed by Gyuyoung Kim.
1600
1601         updateWheelEventTestTriggersIfNeeded() is guarded by #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING).
1602
1603         * WebProcess/WebPage/EventDispatcher.cpp:
1604         (WebKit::updateWheelEventTestTriggersIfNeeded):
1605
1606 2015-04-29  Brent Fulgham  <bfulgham@apple.com>
1607
1608         Expand test infrastructure to support scrolling tests
1609         https://bugs.webkit.org/show_bug.cgi?id=143684
1610         <rdar://problem/20375516>
1611
1612         Reviewed by Simon Fraser.
1613
1614         Update test programs to activate (and deactivate) the new WheelEventTestTrigger logic.
1615
1616         * UIProcess/API/C/WKPage.cpp:
1617         (WKPageClearWheelEventTestTriggers): Added.
1618         * UIProcess/API/C/WKPage.h:
1619         * UIProcess/WebPageProxy.cpp:
1620         (WebKit::WebPageProxy::clearWheelEventTestTrigger): Added.
1621         * UIProcess/WebPageProxy.h:
1622         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1623         (WKBundlePageStartMonitoringScrollOperations): Interact with WheelEventTestTrigger through
1624         the Page, rather than MainFrame.
1625         (WKBundlePageRegisterScrollOperationCompletionCallback): Ditto.
1626         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1627         (WebKit::PDFPlugin::createScrollbar): Make sure scroll animator knows about any
1628         active test triggers.
1629         * WebPage/EventDispatcher.mm:
1630         (WebKit::EventDispatcher::wheelEvent): If the wheel event was passed to the scrolling thread,
1631         defer tests until a Scrolling Thread Sync has occurred.
1632         * WebPage/WebPage.cpp:
1633         (WebKit::WebPage::clearWheelEventTestTrigger): Added.
1634         * WebPage/WebPage.h:
1635         * WebPage/WebPage.message.in: Added ClearWheelEventTestTrigger message.
1636
1637 2015-04-29  Enrica Casucci  <enrica@apple.com>
1638
1639         Adding the ability to move selection by granularity on iOS.
1640         https://bugs.webkit.org/show_bug.cgi?id=144410
1641         rdar://problem/19213337
1642
1643         Reviewed by Benjamin Poulain.
1644
1645         This patch also correctly sets _usingGestureForSelection for all
1646         the functions that change the selection with a gesture.
1647         This way we make sure that the selection drawing is not delayed
1648         until the next time we paint.
1649
1650         * UIProcess/WebPageProxy.h:
1651         * UIProcess/ios/WKContentViewInteraction.mm:
1652         (-[WKContentView moveSelectionAtBoundary:inDirection:completionHandler:]):
1653         * UIProcess/ios/WebPageProxyIOS.mm:
1654         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
1655         * WebProcess/WebPage/WebPage.h:
1656         * WebProcess/WebPage/WebPage.messages.in:
1657         * WebProcess/WebPage/ios/WebPageIOS.mm:
1658         (WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
1659
1660 2015-04-29  Tim Horton  <timothy_horton@apple.com>
1661
1662         UI process sometimes crashes under _takeViewSnapshot when the window is off-screen
1663         https://bugs.webkit.org/show_bug.cgi?id=144418
1664         <rdar://problem/20740278>
1665
1666         Reviewed by Alexey Proskuryakov.
1667
1668         * UIProcess/API/mac/WKView.mm:
1669         (-[WKView _takeViewSnapshot]):
1670         Null-check the array before checking if it has any items.
1671         If the window is off-screen, we can't snapshot it.
1672
1673 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
1674
1675         Allow testing of plug-ins that handle wheel events.
1676         https://bugs.webkit.org/show_bug.cgi?id=144413
1677
1678         Reviewed by Tim Horton.
1679         
1680         Allow the Test Netscape Plug-in to pretend to handle wheel events,
1681         so layout tests can use it.
1682
1683         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1684         (WebKit::NetscapePluginModule::determineQuirks):
1685
1686 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
1687
1688         JSTypeInfo should have an inline type flag to indicate if getCallData() has been overridden
1689         https://bugs.webkit.org/show_bug.cgi?id=144397
1690
1691         Reviewed by Andreas Kling.
1692
1693         If you override getCallData() and you want to be called a "function", then you need to use the
1694         new TypeOfShouldCallGetCallData flag.
1695
1696         * WebProcess/Plugins/Netscape/JSNPObject.h:
1697
1698 2015-04-29  Antti Koivisto  <antti@apple.com>
1699
1700         ResourceLoadPriority should be enum class
1701         https://bugs.webkit.org/show_bug.cgi?id=144326
1702
1703         Reviewed by Darin Adler.
1704
1705         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1706         (WebKit::NetworkConnectionToWebProcess::servePendingRequests): Deleted.
1707
1708             Remove this unused message.
1709
1710         * NetworkProcess/NetworkConnectionToWebProcess.h:
1711         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1712         * NetworkProcess/cache/NetworkCache.cpp:
1713         (WebKit::NetworkCache::makeStoreDecision):
1714         (WebKit::NetworkCache::Cache::retrieve):
1715         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
1716         (WebKit::NetworkResourceLoadScheduler::platformInitializeNetworkSettings):
1717         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1718         (WebKit::WebResourceLoadScheduler::servePendingRequests):
1719         * WebProcess/Network/WebResourceLoadScheduler.h:
1720
1721 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
1722
1723         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
1724         https://bugs.webkit.org/show_bug.cgi?id=132159
1725
1726         Reviewed by Darin Adler.
1727
1728         Add SPI to set the font whitelist.
1729
1730         * Shared/WebProcessCreationParameters.cpp:
1731         (WebKit::WebProcessCreationParameters::encode):
1732         (WebKit::WebProcessCreationParameters::decode):
1733         * Shared/WebProcessCreationParameters.h:
1734         * UIProcess/API/C/WKContext.cpp:
1735         (WKContextSetFontWhitelist):
1736         * UIProcess/API/C/WKContextPrivate.h:
1737         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1738         (WebKit::WebProcessPool::platformInitializeWebProcess):
1739         * UIProcess/WebProcessPool.cpp:
1740         (WebKit::WebProcessPool::setFontWhitelist):
1741         * UIProcess/WebProcessPool.h:
1742         * WebProcess/cocoa/WebProcessCocoa.mm:
1743         (WebKit::WebProcess::platformInitializeWebProcess):
1744
1745 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
1746
1747         [CMake] [GTK] Organize and clean up unused CMake variables
1748         https://bugs.webkit.org/show_bug.cgi?id=144364
1749
1750         Reviewed by Gyuyoung Kim.
1751
1752         * PlatformGTK.cmake: Add variables specific to this project.
1753         * webkit2gtk-web-extension.pc.in: Hardcode the GTK+ API version. It rarely changes.
1754         * webkit2gtk.pc.in: Ditto.
1755
1756 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1757
1758         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
1759         https://bugs.webkit.org/show_bug.cgi?id=144388
1760
1761         Reviewed by Brady Eidson.
1762
1763         Move the WebContextMenuClient::shareMenuItem() implementation to
1764         platform files, since platforms not supporting share menu item
1765         should return a null ContextMenuIem instead.
1766
1767         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
1768         (WebKit::WebContextMenuClient::shareMenuItem): Deleted.
1769         * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp:
1770         (WebKit::WebContextMenuClient::shareMenuItem):
1771         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
1772         (WebKit::WebContextMenuClient::shareMenuItem):
1773         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1774         (WebKit::WebContextMenuClient::shareMenuItem):
1775
1776 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1777
1778         REGRESSION(r183467): [SOUP] isMainResource is no longer passed as resource load parameters to the network process
1779         https://bugs.webkit.org/show_bug.cgi?id=144381
1780
1781         Reviewed by Darin Adler.
1782
1783         A requester enum value is passed now as part of the
1784         ResourceRequest, but it's not encoded/decoded for soup.
1785
1786         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1787         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData): Encode requester.
1788         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData): Decode requester.
1789
1790 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1791
1792         [SOUP] Use xattrs to get/set the creation time of disk cache files
1793         https://bugs.webkit.org/show_bug.cgi?id=144251
1794
1795         Reviewed by Martin Robinson.
1796
1797         The network process disk cache uses the creation time to compute a
1798         worth value used to determine the order in which cached resources
1799         are deleted when the cache is shrunk. In some operating systems
1800         like Linux there's no st_birthtime in struct stat, but since cache
1801         files are always created and deleted by us, we could use a custom
1802         xattr to store and retrieve the creation time of cached resources.
1803
1804         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
1805         (WebKit::NetworkCache::fileTimes):
1806         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1807         (WebKit::NetworkCache::IOChannel::IOChannel):
1808
1809 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1810
1811         Network Cache: Do not create a SharedBuffer for mapped resources unless explicitly requested
1812         https://bugs.webkit.org/show_bug.cgi?id=144337
1813
1814         Reviewed by Antti Koivisto.
1815
1816         We send a buffer or a memory mapped handler to the web process
1817         depending on whether the resource body is mapped or not, but we
1818         are always creating a shared buffer even for mapped resources.
1819         Split initializeBufferFromStorageRecord() moving the mapped memory
1820         handler initialization to its own method.
1821
1822         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1823         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
1824         Initialize the mapped memory handler if the body data is mapped.
1825         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
1826         Initialize the buffer by wrapping the mapped memory if the body
1827         data is mapped, or using the body data directly otherwise.
1828         (WebKit::NetworkCache::Entry::shareableResourceHandle): Call
1829         initializeShareableResourceHandleFromStorageRecord() if the
1830         handler is null.
1831         * NetworkProcess/cache/NetworkCacheEntry.h:
1832
1833 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
1834
1835         Make a non-static version of FrameView::yPositionForRootContentLayer()
1836         https://bugs.webkit.org/show_bug.cgi?id=144375
1837
1838         Reviewed by Andy Estes.
1839
1840         There were two calls to the static FrameView::yPositionForRootContentLayer()
1841         which passed in all the arguments for the same FrameView. Make a member
1842         function for convenience.
1843
1844         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1845         (WebKit::shadowLayerPositionForFrame):
1846
1847 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
1848
1849         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
1850         https://bugs.webkit.org/show_bug.cgi?id=143001
1851
1852         Reviewed by Gyuyoung Kim.
1853
1854         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
1855         (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
1856         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1857         (WebKit::WebChromeClient::dispatchViewportPropertiesDidChange):
1858         * WebProcess/WebCoreSupport/WebChromeClient.h:
1859         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1860         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1861         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1862         * WebProcess/WebPage/WebPage.cpp:
1863         (WebKit::WebPage::setSize):
1864         (WebKit::WebPage::setUseFixedLayout):
1865         (WebKit::WebPage::canHandleUserEvents):
1866         * WebProcess/WebPage/WebPage.h:
1867
1868 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
1869
1870         [TextIndicator] Yellow highlight takes too long to fade out on scroll
1871         https://bugs.webkit.org/show_bug.cgi?id=144358
1872         <rdar://problem/19451011>
1873
1874         Reviewed by Beth Dakin.
1875
1876         * UIProcess/API/Cocoa/WKViewPrivate.h:
1877         * UIProcess/API/mac/WKView.mm:
1878         (-[WKView renewGState]):
1879         (-[WKView viewDidMoveToWindow]):
1880         (-[WKView _dictionaryLookupPopoverWillClose:]):
1881         (-[WKView _setTextIndicator:]):
1882         (-[WKView _setTextIndicator:withLifetime:]):
1883         (-[WKView _clearTextIndicatorWithAnimation:]):
1884         (-[WKView magnifyWithEvent:]):
1885         (-[WKView smartMagnifyWithEvent:]):
1886         (-[WKView setMagnification:centeredAtPoint:]):
1887         (-[WKView setMagnification:]):
1888         (-[WKView _dismissContentRelativeChildWindows]):
1889         (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
1890         (-[WKView _setTextIndicator:fadeOut:]): Deleted.
1891         * UIProcess/API/mac/WKViewInternal.h:
1892         * UIProcess/PageClient.h:
1893         * UIProcess/WebPageProxy.cpp:
1894         (WebKit::WebPageProxy::pageDidScroll):
1895         (WebKit::WebPageProxy::setTextIndicator):
1896         (WebKit::WebPageProxy::clearTextIndicator):
1897         * UIProcess/WebPageProxy.h:
1898         * UIProcess/WebPageProxy.messages.in:
1899         * UIProcess/ios/PageClientImplIOS.h:
1900         * UIProcess/ios/PageClientImplIOS.mm:
1901         (WebKit::PageClientImpl::setTextIndicator):
1902         (WebKit::PageClientImpl::clearTextIndicator):
1903         * UIProcess/mac/PageClientImpl.h:
1904         * UIProcess/mac/PageClientImpl.mm:
1905         (WebKit::PageClientImpl::setTextIndicator):
1906         (WebKit::PageClientImpl::clearTextIndicator):
1907         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1908         (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
1909         * UIProcess/mac/WKActionMenuController.mm:
1910         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
1911         * UIProcess/mac/WKImmediateActionController.mm:
1912         (-[WKImmediateActionController _defaultAnimationController]):
1913         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
1914         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
1915         (-[WKImmediateActionController _animationControllerForText]):
1916         * WebProcess/WebPage/FindController.cpp:
1917         (WebKit::FindController::updateFindIndicator):
1918         Make _setTextIndicator take a reference.
1919         Add a variant of _setTextIndicator that takes a Lifetime.
1920         Make _clearTextIndicatorWithAnimation take a DismissalAnimation.
1921         Make dismissContentRelativeChildWindows take a parameter indicating
1922         whether the dismissal should include animation or not (currently
1923         only applies to TextIndicator).
1924         Don't animate when dismissal occurs because of scrolling, zooming,
1925         or other things in which the content will have changed significantly
1926         underneath the indicator and shouldn't have a slowly-fading-out yellow highlight.
1927
1928 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1929
1930         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
1931         https://bugs.webkit.org/show_bug.cgi?id=144304
1932
1933         Reviewed by Geoffrey Garen.
1934
1935         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
1936
1937         * Configurations/FeatureDefines.xcconfig:
1938
1939 2015-04-28  Commit Queue  <commit-queue@webkit.org>
1940
1941         Unreviewed, rolling out r183514.
1942         https://bugs.webkit.org/show_bug.cgi?id=144359
1943
1944         It broke cloop test bots (Requested by mcatanzaro on #webkit).
1945
1946         Reverted changeset:
1947
1948         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
1949         https://bugs.webkit.org/show_bug.cgi?id=144304
1950         http://trac.webkit.org/changeset/183514
1951
1952 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1953
1954         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
1955         https://bugs.webkit.org/show_bug.cgi?id=144304
1956
1957         Reviewed by Geoffrey Garen.
1958
1959         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
1960
1961         * Configurations/FeatureDefines.xcconfig:
1962
1963 2015-04-28  Enrica Casucci  <enrica@apple.com>
1964
1965         Add support for lookup on iOS.
1966         https://bugs.webkit.org/show_bug.cgi?id=144342
1967         rdar://problem/19994090
1968
1969         Reviewed by Tim Horton.
1970
1971         * UIProcess/WebPageProxy.h:
1972         * UIProcess/ios/WKContentViewInteraction.mm:
1973         (-[WKContentView _lookup:]):
1974         (-[WKContentView canPerformAction:withSender:]):
1975         * UIProcess/ios/WebPageProxyIOS.mm:
1976         (WebKit::WebPageProxy::getLookupContextAtPoint):
1977         * WebProcess/WebPage/WebPage.h:
1978         * WebProcess/WebPage/WebPage.messages.in:
1979         * WebProcess/WebPage/ios/WebPageIOS.mm:
1980         (WebKit::WebPage::getLookupContextAtPoint):
1981
1982 2015-04-28  Brady Eidson  <beidson@apple.com>
1983
1984         Consolidate most "frame load" arguments into FrameLoadRequest.
1985         https://bugs.webkit.org/show_bug.cgi?id=144276
1986
1987         Reviewed by Alexey Proskuryakov.
1988
1989         * WebProcess/Plugins/PluginView.cpp:
1990         (WebKit::PluginView::loadURL):
1991         
1992         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1993         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
1994         
1995         * WebProcess/WebPage/WebInspector.cpp:
1996         (WebKit::WebInspector::openInNewTab):
1997
1998 2015-04-28  Chris Dumez  <cdumez@apple.com>
1999
2000         [WK2][Mac] Update WebContent process' sandbox profile for AWD
2001         https://bugs.webkit.org/show_bug.cgi?id=144315
2002         <rdar://problem/20719293>
2003
2004         Reviewed by Alexey Proskuryakov.
2005
2006         Update sandbox profile for AWD similarly to what was done for iOS in
2007         r182278.
2008
2009         * WebProcess/com.apple.WebProcess.sb.in:
2010
2011 2015-04-28  Antti Koivisto  <antti@apple.com>
2012
2013         Network Cache: Disk cache getting filled by YouTube video data
2014         https://bugs.webkit.org/show_bug.cgi?id=144259
2015
2016         Reviewed by Darin Adler.
2017
2018         MSE media is loaded via XHR and tends to eventually fill the cache.
2019
2020         YouTube serves the media chunks cacheable, however they are rarely (if ever) reused.
2021         We can reduce disk writes and keep more useful resources around by not caching them
2022
2023         * NetworkProcess/NetworkResourceLoader.cpp:
2024         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2025         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2026         * NetworkProcess/cache/NetworkCache.cpp:
2027         (WebKit::NetworkCache::makeStoreDecision):
2028
2029             Don't store if the requester is XHR and response has video or audio content type.
2030
2031         * NetworkProcess/cache/NetworkCache.h:
2032         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2033         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
2034         * Shared/Network/NetworkResourceLoadParameters.cpp:
2035         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
2036         (WebKit::NetworkResourceLoadParameters::encode):
2037         (WebKit::NetworkResourceLoadParameters::decode):
2038         * Shared/Network/NetworkResourceLoadParameters.h:
2039
2040             The requester type is now part of the ResourceRequest, no need for separate parameter.
2041
2042         * Shared/mac/WebCoreArgumentCodersMac.mm:
2043         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2044         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2045         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2046         (WebKit::WebResourceLoadScheduler::scheduleLoad):
2047
2048 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
2049
2050         [WK2] API::UserContentURLPattern creation functions should return Ref<>
2051         https://bugs.webkit.org/show_bug.cgi?id=144225
2052
2053         Reviewed by Darin Adler.
2054
2055         Have API::UserContentURLPattern creation functions return Ref<>.
2056         Call-sites are also updated, using and operating on the returned Ref<>
2057         object where possible.
2058
2059         * Shared/API/APIUserContentURLPattern.h:
2060         (API::UserContentURLPattern::create):
2061         * Shared/API/c/WKUserContentURLPattern.cpp:
2062         (WKUserContentURLPatternCreate):
2063
2064 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
2065
2066         [WK2] API::URLRequest, API::URLResponse creation functions should return Ref<>
2067         https://bugs.webkit.org/show_bug.cgi?id=144224
2068
2069         Reviewed by Darin Adler.
2070
2071         Have API::URLRequest and API::URLResponse creation functions return Ref<>.
2072         The call-sites are also updated, using and operating on the returned Ref<> object
2073         where possible.
2074
2075         * Shared/API/APIURLRequest.h:
2076         (API::URLRequest::create):
2077         * Shared/API/APIURLResponse.h:
2078         (API::URLResponse::create):
2079         * Shared/API/c/WKURLRequest.cpp:
2080         (WKURLRequestCreateWithWKURL):
2081         * Shared/API/c/mac/WKURLRequestNS.mm:
2082         (WKURLRequestCreateWithNSURLRequest):
2083         * Shared/API/c/mac/WKURLResponseNS.mm:
2084         (WKURLResponseCreateWithNSURLResponse):
2085         * UIProcess/API/C/WKContext.cpp:
2086         (WKContextSetDownloadClient):
2087         * UIProcess/API/C/WKDownload.cpp:
2088         (WKDownloadCopyRequest):
2089         * UIProcess/API/C/WKNavigationDataRef.cpp:
2090         (WKNavigationDataCopyOriginalRequest):
2091         * UIProcess/API/C/WKPage.cpp:
2092         (WKPageSetPagePolicyClient):
2093         (WKPageSetPageUIClient):
2094         * UIProcess/Cocoa/NavigationState.mm:
2095         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2096         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp:
2097         (WebKit::WebSoupCustomProtocolRequestManagerClient::startLoading):
2098         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2099         (willSendRequestForFrame):
2100         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
2101         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
2102         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
2103         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse):
2104
2105 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2106
2107         [WK2] API::Point, API::Size, API::Rect creation functions should return Ref<>
2108         https://bugs.webkit.org/show_bug.cgi?id=144223
2109
2110         Reviewed by Darin Adler.
2111
2112         Have API::Point, API::Size and API::Rect creation functions return Ref<>.
2113         Call-sites are also updated, using and operating on the returned Ref<> object
2114         where possible.
2115
2116         * Shared/API/APIGeometry.h:
2117         (API::Size::create):
2118         (API::Point::create):
2119         (API::Rect::create):
2120         * Shared/API/c/WKGeometry.cpp:
2121         (WKPointCreate):
2122         (WKSizeCreate):
2123         (WKRectCreate):
2124
2125 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2126
2127         [WK2] API::Error creation functions should return Ref<>
2128         https://bugs.webkit.org/show_bug.cgi?id=144222
2129
2130         Reviewed by Darin Adler.
2131
2132         Have API::Error creation functions return Ref<>.
2133         The call-sites are also updated, using and operating
2134         on the returned Ref<> object where possible.
2135
2136         * Shared/API/APIError.h:
2137         (API::Error::create):
2138         * Shared/API/c/cf/WKErrorCF.cpp:
2139         (WKErrorCreateWithCFError):
2140         * UIProcess/API/C/WKOriginDataManager.cpp:
2141         (WKOriginDataManagerDeleteEntriesForOrigin):
2142         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates):
2143         (WKOriginDataManagerDeleteAllEntries):
2144         * UIProcess/API/C/WKPage.cpp:
2145         (toGenericCallbackFunction):
2146         (WKPageForceRepaint):
2147         (WKPageValidateCommand):
2148         (WKPageComputePagesForPrinting):
2149         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
2150         (WKPluginSiteDataManagerClearSiteData):
2151         (WKPluginSiteDataManagerClearAllSiteData):
2152         * UIProcess/GenericCallback.h:
2153         (WebKit::toGenericCallbackFunction):
2154         * UIProcess/WebPageProxy.cpp:
2155         (WebKit::WebPageProxy::printFinishedCallback):
2156
2157 2015-04-27  Sungmann Cho  <sungmann.cho@navercorp.com>
2158
2159         [GTK] Remove unnecessary semicolon from WebKitNotificationProvider.h.
2160         https://bugs.webkit.org/show_bug.cgi?id=144312
2161
2162         Reviewed by Martin Robinson.
2163
2164         No new tests, no behavior change.
2165
2166         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2167
2168 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
2169
2170         PDF action menu fixes
2171         https://bugs.webkit.org/show_bug.cgi?id=144299
2172         <rdar://problem/20702215>
2173
2174         Reviewed by Tim Horton.
2175
2176         Make two corrections to how PDFs are handled:
2177         1. When calculating the view rect for the user's selection, make sure
2178         that we get coordinates for the correct PDF page. The existing code assumed
2179         that the current PDFLayerControler's current page was correct, but this will
2180         not be true if you zoom the PDF out so that several pages are displayed at
2181         once. Each selection keeps track of the page it is referenced against.
2182         
2183         2. Revise the offsets calculated for the TextIndicator to take into account
2184         the font descender (as well as the ascender), and to adjust by the scaled
2185         amount of margin around the selected text.
2186
2187         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2188         (WebKit::PDFPlugin::viewRectForSelection): Use correct page for calculating
2189         the coordinates.
2190         * WebProcess/WebPage/mac/WebPageMac.mm:
2191         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Include font 'descendant'
2192         and (scaled) margin when adjusting the hit target for the TextIndicator to draw.
2193
2194 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2195
2196         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
2197         https://bugs.webkit.org/show_bug.cgi?id=144193
2198
2199         Reviewed by Darin Adler.
2200
2201         * CMakeLists.txt:
2202
2203 2015-04-24  Jon Honeycutt  <jhoneycutt@apple.com>
2204
2205         Context menus are not reshown after an orientation change
2206
2207         <https://bugs.webkit.org/show_bug.cgi?id=144143>
2208         <rdar://problem/20679931>
2209
2210         Reviewed by Darin Adler.
2211
2212         * UIProcess/ios/WKActionSheet.mm:
2213         (-[WKActionSheet updateSheetPosition]):
2214         Return early if we're still in a rotation, not if the rotation is
2215         complete.
2216
2217 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2218
2219         [WK2] API::Dictionary creation functions should return Ref<>
2220         https://bugs.webkit.org/show_bug.cgi?id=144221
2221
2222         Reviewed by Darin Adler.
2223
2224         Have API::Dictionary creation functions return Ref<>.
2225         The call-sites are also updated, using and operating
2226         on the returned Ref<> object where possible.
2227
2228         * Shared/API/APIDictionary.cpp:
2229         (API::Dictionary::create):
2230         * Shared/API/APIDictionary.h:
2231         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2232         (createEncodedObject):
2233         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
2234         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
2235         * Shared/API/c/WKDictionary.cpp:
2236         (WKDictionaryCreate):
2237         * Shared/API/c/WKMutableDictionary.cpp:
2238         (WKMutableDictionaryCreate):
2239         * Shared/Plugins/Netscape/PluginInformation.cpp:
2240         (WebKit::createPluginInformationDictionary):
2241         * Shared/Plugins/Netscape/PluginInformation.h:
2242         * UIProcess/API/C/WKPage.cpp:
2243         (WKPageSetPageUIClient):
2244         * UIProcess/API/gtk/WebKitWebContext.cpp:
2245         (webkit_web_context_prefetch_dns):
2246         * UIProcess/API/gtk/WebKitWebView.cpp:
2247         (webkit_web_view_get_snapshot):
2248         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
2249         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy):
2250         * UIProcess/Plugins/PlugInAutoStartProvider.h:
2251         * UIProcess/StatisticsRequest.cpp:
2252         (WebKit::createDictionaryFromHashMap):
2253         (WebKit::StatisticsRequest::completedRequest):
2254         * UIProcess/WebFormClient.cpp:
2255         (WebKit::WebFormClient::willSubmitForm):
2256         * UIProcess/WebPageProxy.cpp:
2257         (WebKit::WebPageProxy::didFailToInitializePlugin):
2258         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2259         (didInitiateLoadForResource):
2260         (willSendRequestForFrame):
2261         (didReceiveResponseForResource):
2262         (didReceiveContentLengthForResource):
2263         (didFinishLoadForResource):
2264         (didFailLoadForResource):
2265         (webkitWebPageDidReceiveMessage):
2266         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
2267         (WebKit::InjectedBundlePageFormClient::willSendSubmitEvent):
2268         (WebKit::InjectedBundlePageFormClient::willSubmitForm):
2269
2270 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2271
2272         [WK2] API::Data creation functions should return Ref<>
2273         https://bugs.webkit.org/show_bug.cgi?id=144220
2274
2275         Reviewed by Darin Adler.
2276
2277         Have API::Data creation functions return Ref<>.
2278         The call-sites are also updated, using and operating
2279         on the returned Ref<> object where possible.
2280
2281         * Shared/API/APIData.h:
2282         (API::Data::createWithoutCopying):
2283         (API::Data::create):
2284         * Shared/API/c/WKData.cpp:
2285         (WKDataCreate):
2286         * Shared/API/c/mac/WKWebArchive.cpp:
2287         (WKWebArchiveCopyData):
2288         * Shared/API/c/mac/WKWebArchiveResource.cpp:
2289         (WKWebArchiveResourceCopyData):
2290         * Shared/APIWebArchive.h:
2291         * Shared/APIWebArchive.mm:
2292         (API::WebArchive::data):
2293         * Shared/APIWebArchiveResource.h:
2294         * Shared/APIWebArchiveResource.mm:
2295         (API::WebArchiveResource::data):
2296         * Shared/Cocoa/APIDataCocoa.mm:
2297         (API::Data::createWithoutCopying):
2298         * UIProcess/API/Cocoa/WKWebView.mm:
2299         (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
2300         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
2301         (webkitURISchemeRequestReadCallback):
2302         * UIProcess/API/gtk/WebKitWebView.cpp:
2303         (webkit_web_view_load_bytes):
2304         * UIProcess/Downloads/DownloadProxy.cpp:
2305         (WebKit::createData):
2306         * UIProcess/WebPageProxy.cpp:
2307         (WebKit::WebPageProxy::dataCallback):
2308         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
2309
2310 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2311
2312         [WK2] API::URL creation functions should return Ref<>
2313         https://bugs.webkit.org/show_bug.cgi?id=144219
2314
2315         Reviewed by Darin Adler.
2316
2317         Have API::URL creation functions return Ref<>.
2318         The call-sites are also updated, using and operating in the
2319         returned Ref<> object, where possible.
2320
2321         * Shared/API/APIURL.h:
2322         (API::URL::create):
2323         * Shared/API/c/WKSharedAPICast.h:
2324         (WebKit::toCopiedURLAPI):
2325         * Shared/API/c/WKURL.cpp:
2326         (WKURLCreateWithUTF8CString):
2327         (WKURLCreateWithBaseURL):
2328         * UIProcess/API/gtk/WebKitWebResource.cpp:
2329         (webkit_web_resource_get_data):
2330         * UIProcess/WebIconDatabase.cpp:
2331         (WebKit::WebIconDatabase::didChangeIconForPageURL):
2332         (WebKit::WebIconDatabase::notifyIconDataReadyForPageURL):
2333         * WebProcess/WebPage/WebPage.cpp:
2334         (WebKit::WebPage::userAgent):
2335
2336 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2337
2338         [WK2] API::String creation functions should return Ref<>
2339         https://bugs.webkit.org/show_bug.cgi?id=144218
2340
2341         Reviewed by Darin Adler.
2342
2343         Have API::String creation functions return Ref<>.
2344         The call-sites are also updated, using and operating on the returned
2345         Ref<> object, where possible.
2346
2347         * Shared/API/APIString.h:
2348         * Shared/API/c/WKPluginInformation.cpp:
2349         (WKPluginInformationBundleIdentifierKey):
2350         (WKPluginInformationBundleVersionKey):
2351         (WKPluginInformationBundleShortVersionKey):
2352         (WKPluginInformationPathKey):
2353         (WKPluginInformationDisplayNameKey):
2354         (WKPluginInformationDefaultLoadPolicyKey):
2355         (WKPluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
2356         (WKPluginInformationHasSandboxProfileKey):
2357         (WKPluginInformationFrameURLKey):
2358         (WKPluginInformationMIMETypeKey):
2359         (WKPluginInformationPageURLKey):
2360         (WKPluginInformationPluginspageAttributeURLKey):
2361         (WKPluginInformationPluginURLKey):
2362         (WKPlugInInformationReplacementObscuredKey):
2363         * Shared/API/c/WKSharedAPICast.h:
2364         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
2365         (WebKit::toCopiedAPI):
2366         * Shared/API/c/WKString.cpp:
2367         (WKStringCreateWithUTF8CString):
2368         (WKStringCreateWithJSString):
2369         * UIProcess/API/C/WKDatabaseManager.cpp:
2370         (WKDatabaseManagerGetOriginKey):
2371         (WKDatabaseManagerGetOriginQuotaKey):
2372         (WKDatabaseManagerGetOriginUsageKey):
2373         (WKDatabaseManagerGetDatabaseDetailsKey):
2374         (WKDatabaseManagerGetDatabaseDetailsNameKey):
2375         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey):
2376         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey):
2377         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey):
2378         (WKDatabaseManagerGetDatabaseDetailsCreationTimeKey):
2379         (WKDatabaseManagerGetDatabaseDetailsModificationTimeKey):
2380         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2381         (WKKeyValueStorageManagerGetOriginKey):
2382         (WKKeyValueStorageManagerGetCreationTimeKey):
2383         (WKKeyValueStorageManagerGetModificationTimeKey):
2384         * UIProcess/API/C/WKPage.cpp:
2385         (WKPageGetSessionHistoryURLValueType):
2386         (WKPageGetSessionBackForwardListItemValueType):
2387         (toGenericCallbackFunction):
2388         (WKPageValidateCommand):
2389         * UIProcess/WebProcessPool.cpp:
2390         (WebKit::WebProcessPool::didReceiveInvalidMessage):
2391
2392 2015-04-27  Brady Eidson  <beidson@apple.com>
2393
2394         Make 'enum NavigationType' be an enum class
2395         https://bugs.webkit.org/show_bug.cgi?id=144270
2396
2397         Reviewed by Alex Christensen.
2398
2399         * Shared/API/c/WKSharedAPICast.h:
2400         (WebKit::toAPI):
2401         
2402         * Shared/NavigationActionData.cpp:
2403         (WebKit::NavigationActionData::NavigationActionData):
2404         
2405         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2406         (toWKNavigationType):
2407         
2408         * UIProcess/API/gtk/WebKitPrivate.cpp:
2409         (toWebKitNavigationType):
2410         
2411         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2412         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2413         
2414         * WebProcess/WebPage/WebInspector.cpp:
2415         (WebKit::WebInspector::openInNewTab):
2416
2417 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
2418
2419         REGRESSION(r182879): Images and video can no longer be downloaded
2420         https://bugs.webkit.org/show_bug.cgi?id=144267
2421         <rdar://problem/20702844>
2422
2423         Reviewed by Simon Fraser.
2424
2425         * UIProcess/mac/WKActionMenuController.mm:
2426         (-[WKActionMenuController _createActionMenuItemForTag:]): Check for
2427         "!WebCore::protocolIs(..., "file")" for image and media downloads.
2428
2429 2015-04-27  Csaba Osztrogonác  <ossy@webkit.org>
2430
2431         [EFL] TestWebKitAPI's forwarding header generator should depend on WebKit2's generator
2432         https://bugs.webkit.org/show_bug.cgi?id=143874
2433
2434         Reviewed by Gyuyoung Kim.
2435
2436         * PlatformEfl.cmake: Rename the generator to have consistent name with other generators.
2437         * Scripts/generate-forwarding-headers.pl: Removed the unnecessary multiple include-path support.
2438
2439 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2440
2441         [SOUP] Add initial implementation of NetworkProcess disk cache
2442         https://bugs.webkit.org/show_bug.cgi?id=143872
2443
2444         Reviewed by Martin Robinson.
2445
2446         Implement the platform specific parts of the disk cache
2447         implementation for Soup. It's mainly NetworkCache::Data and
2448         NetworkCache::IOChannel.
2449
2450         * CMakeLists.txt:
2451         * NetworkProcess/cache/NetworkCache.cpp:
2452         (WebKit::NetworkCache::dumpFileChanged):
2453         (WebKit::NetworkCache::Cache::initialize):
2454         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2455         * NetworkProcess/cache/NetworkCacheData.h:
2456         (WebKit::NetworkCache::Data::soupBuffer):
2457         * NetworkProcess/cache/NetworkCacheDataSoup.cpp: Added.
2458         (WebKit::NetworkCache::Data::Data):
2459         (WebKit::NetworkCache::Data::empty):
2460         (WebKit::NetworkCache::Data::data):
2461         (WebKit::NetworkCache::Data::isNull):
2462         (WebKit::NetworkCache::Data::apply):
2463         (WebKit::NetworkCache::Data::subrange):
2464         (WebKit::NetworkCache::concatenate):
2465         (WebKit::NetworkCache::MapWrapper::~MapWrapper):
2466         (WebKit::NetworkCache::deleteMapWrapper):
2467         (WebKit::NetworkCache::mapFile):
2468         (WebKit::NetworkCache::Data::adoptMap):
2469         (WebKit::NetworkCache::computeSHA1):
2470         (WebKit::NetworkCache::bytesEqual):
2471         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2472         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: Added.
2473         (WebKit::NetworkCache::IOChannel::IOChannel):
2474         (WebKit::NetworkCache::IOChannel::open):
2475         (WebKit::NetworkCache::fillDataFromReadBuffer):
2476         (WebKit::NetworkCache::inputStreamReadReadyCallback):
2477         (WebKit::NetworkCache::IOChannel::read):
2478         (WebKit::NetworkCache::IOChannel::readSync):
2479         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
2480         (WebKit::NetworkCache::IOChannel::write):
2481         * NetworkProcess/cache/NetworkCacheStorageSoup.cpp: Removed.
2482         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
2483         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2484         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2485         (WebKit::NetworkProcess::platformSetCacheModel):
2486         (WebKit::NetworkProcess::clearDiskCache):
2487         * PlatformGTK.cmake:
2488
2489 2015-04-26  Yusuke Suzuki  <utatane.tea@gmail.com>
2490
2491         [ES6] Implement ES6 template literals
2492         https://bugs.webkit.org/show_bug.cgi?id=142691
2493
2494         Reviewed by Darin Adler.
2495
2496         Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
2497
2498         * Configurations/FeatureDefines.xcconfig:
2499
2500 2015-04-26  Sungmann Cho  <sungmann.cho@navercorp.com>
2501
2502         Remove PluginView::renderer().
2503         https://bugs.webkit.org/show_bug.cgi?id=144216
2504
2505         Reviewed by Darin Adler.
2506
2507         Nobody should have to know about the plug-in view's renderer except the plug-in view itself.
2508
2509         No new tests, no behavior change.
2510
2511         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2512         (WebKit::PDFPlugin::convertFromScrollbarToContainingView):
2513         (WebKit::PDFPlugin::convertFromContainingViewToScrollbar):
2514         * WebProcess/Plugins/PluginView.cpp:
2515         (WebKit::PluginView::renderer): Deleted.
2516         * WebProcess/Plugins/PluginView.h:
2517
2518 2015-04-26  Doug Russell  <d_russell@apple.com>
2519
2520         AX: richer text change notifications (142719)
2521         https://bugs.webkit.org/show_bug.cgi?id=142719
2522
2523         Reviewed by Darin Adler.
2524
2525         Richer accessibility value change notifications. Introduce AXTextEditType,
2526         postTextStateChangeNotification and postTextReplacementNotification to give assistive
2527         tech apps more reliable context for responding to changes in web content. Also implement
2528         a mechanism to post value changes in password form fields in coalesced ticks to thwart
2529         analyzing the cadence of changes.
2530
2531         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
2532         and an overload of postTextReplacementNotification to give assistive tech apps more
2533         reliable context for responding to changes in web content selection. Also block posting
2534         selection changes on password fields.
2535
2536         * UIProcess/WebEditCommandProxy.cpp:
2537         (WebKit::WebEditCommandProxy::nameForEditAction):
2538
2539 2015-04-26  Dan Bernstein  <mitz@apple.com>
2540
2541         <rdar://problem/20702337> REGRESSION (r182952): Plug-in service fails to load because it links against WebKit2.framework
2542         https://bugs.webkit.org/show_bug.cgi?id=144233
2543
2544         Reviewed by Simon Fraser.
2545
2546         Have the plug-in service link against WebKit.framework rather than WebKit2.framework.
2547
2548         * Configurations/PluginService.32.xcconfig: Removed linker flags for linking against WebKit2
2549         and Foundation from the definition of OTHER_LDFLAGS. Since linking is no longer conditional,
2550         we can just do it in the target’s Link Binary With Libraries build phase.
2551
2552         * Configurations/PluginService.64.xcconfig: Ditto.
2553
2554         * WebKit2.xcodeproj/project.pbxproj: Have Foundation and WebKit listed in the services’ Link
2555         Binariy With Libraries build phases (one service already had WebKit).
2556
2557 2015-04-26  Dan Bernstein  <mitz@apple.com>
2558
2559         Fixed the build.
2560
2561         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2562         (-[WKFileUploadPanel _showDocumentPickerMenu]): Suppressed deprecation warnings around use
2563         of -[UIDocumentMenuViewController _setIgnoreApplicationEntitlementForImport:].
2564
2565 2015-04-25  Tim Horton  <timothy_horton@apple.com>
2566
2567         Further update gesture swipe shadow style
2568         https://bugs.webkit.org/show_bug.cgi?id=144215
2569         <rdar://problem/19295843>
2570
2571         Reviewed by Dan Bernstein.
2572
2573         * Resources/mac/SwipeShadow.png: Removed.
2574         * Resources/mac/SwipeShadow@2x.png: Removed.
2575         * UIProcess/mac/ViewGestureController.h:
2576         * UIProcess/mac/ViewGestureControllerMac.mm:
2577         (WebKit::ViewGestureController::beginSwipeGesture):
2578         * WebKit2.xcodeproj/project.pbxproj:
2579         Use a CAGradientLayer instead of PNGs for the swipe shadow.
2580
2581 2015-04-25  Dan Bernstein  <mitz@apple.com>
2582
2583         WebKit2 part of <rdar://problem/20697966> Avoid using TBD as an argument to NS_AVAILABLE
2584         https://bugs.webkit.org/show_bug.cgi?id=144201
2585
2586         Reviewed by Darin Adler.
2587
2588         Instead of TBD, we use the high version number to which it corresponds in CFAvailability.h,
2589         9876.5.
2590
2591         * mac/MigrateHeadersFromWebKitLegacy.make: To detect not-yet-available declarations in
2592         headers, look for "9876_5" rather than "TBA".
2593
2594 2015-04-24  Timothy Hatcher  <timothy@apple.com>
2595
2596         Web Inspector: Remove native window dock controls
2597         https://bugs.webkit.org/show_bug.cgi?id=144184
2598
2599         Reviewed by Joseph Pecoraro.
2600
2601         * Resources/DockBottom.pdf: Removed.
2602         * Resources/DockBottomLegacy.pdf: Removed.
2603         * Resources/DockRight.pdf: Removed.
2604         * Resources/DockRightLegacy.pdf: Removed.
2605         * UIProcess/WebInspectorProxy.h:
2606         * UIProcess/mac/WebInspectorProxyMac.mm:
2607         (WebKit::WebInspectorProxy::createInspectorWindow):
2608         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
2609         * WebKit2.xcodeproj/project.pbxproj:
2610
2611 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
2612
2613         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
2614         https://bugs.webkit.org/show_bug.cgi?id=144182
2615
2616         Reviewed by Simon Fraser.
2617
2618         * Configurations/FeatureDefines.xcconfig: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2619
2620 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
2621
2622         Have the web inspector report accurate memory use for layers with detached backing store
2623         https://bugs.webkit.org/show_bug.cgi?id=144179
2624
2625         Reviewed by Dean Jackson.
2626         
2627         Remote layers can make their backing store volatile, so the backing only contributes
2628         to reported memory use when attached.
2629
2630         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2631
2632 2015-04-24  Andreas Kling  <akling@apple.com>
2633
2634         theverge.com burning 100% CPU on iPad (due to window.screenX/Y)
2635         <https://webkit.org/b/144175>
2636         <rdar://problem/20694585>
2637
2638         Reviewed by Anders Carlsson.
2639
2640         Return an empty window rect on iOS WK2 builds. This avoids sending a synchronous
2641         IPC request to the UI process that would give the same result, but spend way
2642         more time and CPU cycles to do so.
2643
2644         With this change, theverge.com CPU usage goes from 100% to ~20% when idle.
2645
2646         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2647         (WebKit::WebChromeClient::windowRect):
2648
2649 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
2650
2651         TextIndicator for embedded PDFs is slightly offset
2652         https://bugs.webkit.org/show_bug.cgi?id=144172
2653         <rdar://problem/20691304>
2654
2655         Reviewed by Tim Horton.
2656
2657         When I converted the existing DOM Range logic to work with PDFSelections, I omitted the
2658         step where the font ascent was used to adjust the origin used for the TextIndicator. This
2659         patch determines the correct ascent for the range of characters in the selection, and
2660         adjusts the offset by the difference between the ascent and the height of the selection rect.
2661         
2662         Also, since the PDFSelection only supplies the bounding rect for the selection, I calculate
2663         an equivalent text bounding box by insetting the rect by half the size of the ascent.
2664
2665         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2666         (WebKit::PDFPlugin::scaleFactor): Add accessor for PDF scale factor.
2667         * WebProcess/Plugins/PDF/PDFPlugin.h:
2668         * WebProcess/WebPage/mac/WebPageMac.mm:
2669         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Adjusted to take the
2670         font ascent and scale factor into account.
2671
2672 2015-04-24  David Kilzer  <ddkilzer@apple.com>
2673
2674         REGRESSION (r183293): Fix iOS EWS build by adding SPI declaration for +[UIPeripheralHost visiblePeripheralFrame]
2675
2676         Fixes the following build failures:
2677
2678             WebKit2/UIProcess/ios/WKPDFView.mm:740:45: error: class method '+visiblePeripheralFrame' not found (return type defaults to 'id') [-Werror,-Wobjc-method-access]
2679                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
2680                                                         ^~~~~~~~~~~~~~~~~~~~~~
2681             WebKit2/UIProcess/ios/WKPDFView.mm:740:12: error: no viable conversion from 'id' to 'CGRect'
2682                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
2683                        ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2684
2685         * Platform/spi/ios/UIKitSPI.h:
2686         (+[UIPeripheralHost visiblePeripheralFrame]): Add declaration.
2687
2688 2015-04-24  Anders Carlsson  <andersca@apple.com>
2689
2690         Change _WKWebsiteDataStore to hold on to an internal WKWebsiteDataStore
2691         https://bugs.webkit.org/show_bug.cgi?id=144171
2692
2693         Reviewed by Tim Horton.
2694
2695         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2696         (-[WKWebViewConfiguration _websiteDataStore]):
2697         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
2698         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2699         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2700         (-[_WKWebsiteDataStore initWithDataStore:]):
2701         (+[_WKWebsiteDataStore defaultDataStore]):
2702         (+[_WKWebsiteDataStore nonPersistentDataStore]):
2703         (-[_WKWebsiteDataStore isNonPersistent]):
2704         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2705         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2706         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2707         * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
2708         * WebKit2.xcodeproj/project.pbxproj:
2709
2710 2015-04-24  Tim Horton  <timothy_horton@apple.com>
2711
2712         WKPDFView does not support password-protected PDFs
2713         https://bugs.webkit.org/show_bug.cgi?id=144162
2714         <rdar://problem/18411512>
2715
2716         Reviewed by Andy Estes.
2717
2718         * Platform/spi/ios/UIKitSPI.h:
2719         Add some SPI.
2720
2721         * UIProcess/ios/WKPDFView.h:
2722         * UIProcess/ios/WKPDFView.mm:
2723         (-[WKPDFView _didLoadPDFDocument]):
2724         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2725         Move creation of the UIPDFDocument (only possible if the CGPDFDocument is unlocked)
2726         and initial setup of the page views out into _didLoadPDFDocument.
2727
2728         If the CGPDFDocument is locked, we'll show some UI to unlock it; otherwise
2729         we'll continue on to _didLoadPDFDocument as previously.
2730
2731         (-[WKPDFView web_setMinimumSize:]):
2732         Resize the password UI instead of the PDF pages if we have it.
2733
2734         (-[WKPDFView _computePageAndDocumentFrames]):
2735         Don't bother doing any work revalidating PDF pages if the document is locked.
2736
2737         (-[WKPDFView _updatePasswordEntryField]):
2738         Make sure that the UIDocumentPassword view is always the size of the scrollview.
2739         This takes care of rotation.
2740
2741         (-[WKPDFView _keyboardDidShow:]):
2742         Make sure that we scroll the password field around, if necessary, to keep it
2743         on screen when editing begins.
2744
2745         (-[WKPDFView _showPasswordEntryField]):
2746         (-[WKPDFView _hidePasswordEntryField]):
2747         Adjust the background color (to match the UIDocumentPasswordView) and disable zooming
2748         while it's up. The UIDocumentPassword view is installed into the scroll view
2749         to match UIWebView behavior.
2750
2751         (-[WKPDFView userDidEnterPassword:forPasswordView:]):
2752         (-[WKPDFView didBeginEditingPassword:inView:]):
2753         (-[WKPDFView didEndEditingPassword:inView:]):
2754         (-[WKPDFView _didFailToUnlock]):
2755         Pop up a dialog informing the user that they entered the wrong password.
2756
2757         (-[WKPDFView _tryToUnlockWithPassword:]):
2758         Try to unlock the document. If it succeeds, hide the unlock UI and go back to
2759         _didLoadPDFDocument.
2760
2761 2015-04-24  Commit Queue  <commit-queue@webkit.org>
2762
2763         Unreviewed, rolling out r183266.
2764         https://bugs.webkit.org/show_bug.cgi?id=144164
2765
2766         Broke 32-bit build and a test. (Requested by ap on #webkit).
2767
2768         Reverted changeset:
2769
2770         "AX: richer text change notifications (142719)"
2771         https://bugs.webkit.org/show_bug.cgi?id=142719
2772         http://trac.webkit.org/changeset/183266
2773
2774 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
2775
2776         REGRESSION: WebKit2.ActionMenusTest API test fails
2777         https://bugs.webkit.org/show_bug.cgi?id=144149
2778         <rdar://problem/20677770>
2779
2780         Reviewed by Tim Horton.
2781
2782         Tested by TestWebKitAPI 
2783
2784         The 'lookupTextAtLocation' method was not converting the NSEvent coordinates it
2785         was receiving from root view to the plugin view. Consequently, full page PDFs
2786         did hit testing correctly, but an <embed> PDF would not.
2787
2788         Since 'existingSelectionContainsPoint' is exposed as API, I also modified it to
2789         expect 'root view' coordinates and perform the requisite conversions, rather
2790         than expecting 'plugin view' coordinates.
2791
2792         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2793         (WebKit::PDFPlugin::existingSelectionContainsPoint): Expect 'root view' coordinates
2794         for the input.
2795         (WebKit::PDFPlugin::lookupTextAtLocation): Properly convert the passed 'root view'
2796         coordinates to the PDF's view coordinate space.
2797         * WebProcess/WebPage/mac/WebPageMac.mm:
2798         (WebKit::WebPage::performActionMenuHitTestAtLocation): Pass hit point using view coordinates,
2799         not content coordinates.
2800
2801 2015-04-24  Anders Carlsson  <andersca@apple.com>
2802
2803         Address a review comment from Joe Pecoraro.
2804
2805         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2806
2807 2015-04-24  Anders Carlsson  <andersca@apple.com>
2808
2809         Rename -[WKWebsiteDataStore isNonPersistent] to -[WKWebsiteDataStore isPersistent]
2810         https://bugs.webkit.org/show_bug.cgi?id=144158
2811
2812         Reviewed by Beth Dakin.
2813
2814         * UIProcess/API/APIWebsiteDataStore.cpp:
2815         (API::WebsiteDataStore::isPersistent):
2816         (API::WebsiteDataStore::isNonPersistent): Deleted.
2817         * UIProcess/API/APIWebsiteDataStore.h:
2818         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2819         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2820         (-[WKWebsiteDataStore isPersistent]):
2821         (-[WKWebsiteDataStore isNonPersistent]): Deleted.
2822         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2823         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2824         (-[_WKWebsiteDataStore isNonPersistent]):
2825         * UIProcess/WebsiteData/WebsiteDataStore.h:
2826
2827 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
2828
2829         Immediate action not functional for embedded PDFs
2830         https://bugs.webkit.org/show_bug.cgi?id=143952
2831         <rdar://problem/19842365>        
2832
2833         Reviewed by Tim Horton.
2834
2835         Add a new method to retrieve appropriate dictionary lookup content and update the
2836         hit test result with relevant dictionary content and the bounding rect of the
2837         selection.
2838
2839         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Add stub.
2840         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: Initialize plugin type.
2841         * WebProcess/Plugins/PDF/PDFPlugin.h:
2842         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2843         (WebKit::rectInWindowSpaceForRectInLayoutSpace): New helper function to
2844         convert PDF 'in page' units to the equivalent view units.
2845         (WebKit::PDFPlugin::PDFPlugin): Initialize plugin type.
2846         (WebKit::PDFPlugin::viewRectForSelection): Query a provided PDFSelection for
2847         its bounding rect and return the result in view units.
2848         * WebProcess/Plugins/Plugin.h:
2849         * WebProcess/Plugins/PluginProxy.cpp: Initialize plugin type.
2850         * WebProcess/Plugins/PluginProxy.h: Add stub.
2851         * WebProcess/Plugins/PluginView.cpp: 
2852         (WebKit::PluginView::viewRectForSelection): Added.
2853         * WebProcess/Plugins/PluginView.h:
2854         * WebProcess/WebPage/WebPage.h:
2855         * WebProcess/WebPage/mac/WebPageMac.mm:
2856         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Added.
2857         (WebKit::textIndicatorTransitionForActionMenu): Added helper function.
2858         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update the hit test information
2859         with relevant dictionary lookup content, and mark the result as a text node (if
2860         appropriate).
2861
2862 2015-04-24  Jer Noble  <jer.noble@apple.com>
2863
2864         [WK2] Only issue a isPlayingAudioDidChange() notification if the audio playing state actually changed.
2865         https://bugs.webkit.org/show_bug.cgi?id=144153
2866
2867         Reviewed by Alexey Proskuryakov.
2868
2869         Check the old state vs. the new state and only issue the change notification if the IsPlayingAudio state changed.
2870
2871         * UIProcess/WebPageProxy.cpp:
2872         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2873
2874 2015-04-24  Antti Koivisto  <antti@apple.com>
2875
2876         CrashTracer: [USER] com.apple.WebKit.Networking at com.apple.WebKit: WebKit::NetworkResourceLoader::~NetworkResourceLoader + 14
2877         https://bugs.webkit.org/show_bug.cgi?id=144147
2878
2879         Reviewed by Chris Dumez.
2880
2881         Storage::storeBodyAsBlob copies the std::function callback for handling mapped bodies in a thread.
2882         This is thread safe only if the function copy is thread safe. It is currently not as we are capturing
2883         RefPtr<NetworkResourceLoader> and NetworkResourceLoader doesn't use thread safe refcounting.
2884
2885         Fix by avoiding copying of the callback. Use same apporach for WriteOperation as we already use for
2886         ReadOperation: count the active operations in progress and delete WriteOperation when everything is
2887         finished. This way we don't need to copy the function out from WriteOperation.
2888
2889         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2890         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
2891         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
2892
2893             Move definition here from the header.
2894
2895         (WebKit::NetworkCache::Storage::~Storage):
2896         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
2897
2898             Increment the operation count when storing a blob, call finishWriteOperation when done.
2899
2900         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2901         (WebKit::NetworkCache::Storage::finishReadOperation):
2902
2903             Count active operations instead of finished operations. This makes the code clearer.
2904
2905         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
2906         (WebKit::NetworkCache::Storage::finishWriteOperation):
2907
2908             Mirror the way ReadOperations work.
2909
2910         * NetworkProcess/cache/NetworkCacheStorage.h:
2911         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation): Deleted.
2912
2913 2015-04-24  Timothy Hatcher  <timothy@apple.com>
2914
2915         REGRESSION: Web Inspector: Start Timeline Recording in Develop menu broken
2916         https://bugs.webkit.org/show_bug.cgi?id=144150
2917
2918         Reviewed by Brian Burg.
2919
2920         * WebProcess/WebPage/WebInspectorUI.cpp:
2921         (WebKit::WebInspectorUI::evaluateCommandOnLoad): Properly treat bools as literals
2922         instead of strings by not using the string version of evaluateCommandOnLoad.
2923
2924 2015-04-23  Anders Carlsson  <andersca@apple.com>
2925
2926         Add headerdocs for WKWebsiteDataRecord and WKWebsiteDataStore
2927         https://bugs.webkit.org/show_bug.cgi?id=144138
2928
2929         Reviewed by Darin Adler.
2930
2931         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2932         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2933         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2934         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2935         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2936         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2937
2938 2015-04-24  Doug Russell  <d_russell@apple.com>
2939
2940         AX: richer text change notifications (142719)
2941         https://bugs.webkit.org/show_bug.cgi?id=142719
2942
2943         Reviewed by Darin Adler.
2944
2945         Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes.
2946
2947         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields.
2948
2949         * UIProcess/WebEditCommandProxy.cpp:
2950         (WebKit::WebEditCommandProxy::nameForEditAction):
2951
2952 2015-04-24  Darin Adler  <darin@apple.com>
2953
2954         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
2955         https://bugs.webkit.org/show_bug.cgi?id=128007
2956
2957         Reviewed by Anders Carlsson.
2958
2959         * NetworkProcess/cache/NetworkCacheEncoder.h: Added an include now
2960         needed that was inherited from OwnPtr.h before.
2961
2962 2015-04-24  Antti Koivisto  <antti@apple.com>
2963
2964         Network Cache: Make path functions members
2965         https://bugs.webkit.org/show_bug.cgi?id=144146
2966
2967         Reviewed by Carlos Garcia Campos.
2968
2969         This simplifies the code.
2970
2971         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2972         (WebKit::NetworkCache::Storage::partitionPathForKey):
2973         (WebKit::NetworkCache::Storage::recordPathForKey):
2974         (WebKit::NetworkCache::Storage::bodyPathForKey):
2975         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
2976         (WebKit::NetworkCache::Storage::remove):
2977         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2978         (WebKit::NetworkCache::Storage::finishReadOperation):
2979         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
2980         (WebKit::NetworkCache::partitionPathForKey): Deleted.
2981         (WebKit::NetworkCache::recordPathForKey): Deleted.
2982         (WebKit::NetworkCache::bodyPathForKey): Deleted.
2983         * NetworkProcess/cache/NetworkCacheStorage.h:
2984
2985 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2986
2987         Unreviewed. Remove incorrect assert after r183189.
2988
2989         In this case the assert was already there, but it's incorrect
2990         because we are handling uninitialized attachments below in the
2991         same function, and also when sending messages. So, if it's ok to
2992         send uninitialized attachments, it's ok to receive them. This
2993         didn't fail before r183189, because we were only invaliding the
2994         attachments by setting the file descriptor to -1, and they were
2995         handled as null attachments. After r183189, the move operator
2996         resets the moved attachment leaving it uninitialized again.
2997
2998         * Platform/IPC/unix/ConnectionUnix.cpp:
2999         (IPC::Connection::processMessage):
3000
3001 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3002
3003         [SOUP] Use a webkit subdirectory for the disk cache
3004         https://bugs.webkit.org/show_bug.cgi?id=144048
3005
3006         Reviewed by Martin Robinson.
3007
3008         Recent versions of libsoup remove any file in cache dir not
3009         referenced by the index when the cache is loaded to workaround
3010         leaked resources when load/dump is unbalanced for whatever reason,
3011         like a crash. We currently use $XDG_CACHE_HOME/app-name as default
3012         disk cache directory, but that directory could be used by apps to
3013         cache other things, and the soup cache might end up deleting other
3014         stuff. The soup cache assumes the given directory is only for the
3015         disk cache, so we should ensure that.
3016
3017         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3018         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Append
3019         webkit to the given disk cache and clear the previous soup cache if it exists.
3020         * WebProcess/soup/WebProcessSoup.cpp:
3021         (WebKit::WebProcess::platformInitializeWebProcess): Ditto.
3022
3023 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3024
3025         Unreviewed. Remove incorrect ASSERT added in r183176.
3026
3027         We allow to encode null attachments.
3028
3029         * Platform/unix/SharedMemoryUnix.cpp:
3030         (WebKit::SharedMemory::Handle::releaseAttachment):
3031
3032 2015-04-23  Dan Bernstein  <mitz@apple.com>
3033
3034         <rdar://problem/20680694> Framework header postprocessing isn’t removing WK_DEPRECATED macros when it should.
3035
3036         Reviewed by Andy Estes.
3037
3038         * mac/postprocess-framework-headers.sh:
3039
3040 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3041
3042         Make it possible to detach GraphicsLayerCA backing store
3043         https://bugs.webkit.org/show_bug.cgi?id=144140
3044
3045         Reviewed by Tim Horton.
3046         
3047         This changes makes it possible to denote a GraphicsLayerCA's backing store
3048         as "attached" or not. When not attached, the backing store is made volatile
3049         and can be purged. This will be used in a future patch.
3050
3051         * Shared/mac/RemoteLayerBackingStore.mm:
3052         (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore): Whitespace.
3053         (WebKit::RemoteLayerBackingStore::display): If backingStoreWillBeDisplayed()
3054         returns true, this indicates that the backing store was brought out of the
3055         "unreachable" list, so return true even if the backing store doesn't require
3056         painting.
3057         * Shared/mac/RemoteLayerBackingStoreCollection.h: C++11 initializer, and comments.
3058         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
3059         (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
3060         (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed): Return true
3061         if the caller will need to submit the backing store in the current transaction.
3062         (WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable): This
3063         explicit dirtying is no longer necessary given the backingStoreWillBeDisplayed() change.
3064         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
3065         (WebKit::applyPropertiesToLayer): Only set the layer's backing if we both have backing
3066         store, and it's attached.
3067         * Shared/mac/RemoteLayerTreeTransaction.h: New bit, and data member.
3068         * Shared/mac/RemoteLayerTreeTransaction.mm:
3069         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
3070         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
3071         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
3072         (WebKit::dumpChangedLayers):
3073         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3074         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): Only call display()
3075         on the backing store if it's attached.
3076         (WebKit::PlatformCALayerRemote::setBackingStoreAttached):
3077         (WebKit::PlatformCALayerRemote::backingStoreAttached):
3078         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3079         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
3080         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3081         (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed):
3082
3083 2015-04-23  Tim Horton  <timothy_horton@apple.com>
3084
3085         Quick Look preview popover is not dismissed on scroll in Mail
3086         https://bugs.webkit.org/show_bug.cgi?id=144119
3087         <rdar://problem/19752045>
3088
3089         Reviewed by Anders Carlsson.
3090
3091         * UIProcess/API/mac/WKView.mm:
3092         (-[WKView renewGState]):
3093         If we have a TextIndicator, dismiss all content relative child windows
3094         on renewGState, not just the TextIndicator itself.
3095
3096         This will fix cases like Mail, where WebKit isn't driving the scrolling,
3097         and we have no way (except renewGState) to know that scrolling is happening.
3098
3099 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3100
3101         Changing TiledBacking velocity should schedule a tile revalidation
3102         https://bugs.webkit.org/show_bug.cgi?id=144123
3103
3104         Reviewed by Tim Horton.
3105         
3106         Drive-by fix: use the FrameView& that we have already.
3107
3108         * WebProcess/WebPage/ios/WebPageIOS.mm:
3109         (WebKit::WebPage::updateVisibleContentRects):
3110
3111 2015-04-23  Jer Noble  <jer.noble@apple.com>
3112
3113         [Mac] Disable QTKit by default on future OS X.
3114         https://bugs.webkit.org/show_bug.cgi?id=144082
3115
3116         Reviewed by Darin Adler.
3117
3118         QTKitEnabled defaults to false.
3119
3120         * Shared/WebPreferencesDefinitions.h:
3121
3122 2015-04-23  Jer Noble  <jer.noble@apple.com>
3123
3124         [WK2][Mac] Tweak the timing curve of the WebKit Fullscreen animation
3125         https://bugs.webkit.org/show_bug.cgi?id=144120
3126
3127         Reviewed by Eric Carlson.
3128
3129         Tweak the curve to ease-in faster when the fullscreen animation duration is short.
3130
3131         * UIProcess/mac/WKFullScreenWindowController.mm:
3132         (timingFunctionForDuration):
3133         (zoomAnimation):
3134         (maskAnimation):
3135         (fadeAnimation):
3136
3137 2015-04-23  Enrica Casucci  <enrica@apple.com>
3138
3139         iOS build fix after r183208.
3140
3141         Unreviewed.
3142
3143         * UIProcess/ios/WKContentViewInteraction.mm:
3144
3145 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
3146
3147         [iOS] WebKit services should inherit environment variables for home
3148         https://bugs.webkit.org/show_bug.cgi?id=144078
3149         rdar://problem/20571678
3150
3151         Reviewed by Dan Bernstein.
3152
3153         Pass current environment variables as XPC bootstrap. Also while at it, made
3154         _CFBundleSetupXPCBootstrap not soft linked.
3155
3156         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
3157         (main):
3158         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3159         (WebKit::connectToService):
3160
3161 2015-04-23  Enrica Casucci  <enrica@apple.com>
3162
3163         Support share button.
3164         https://bugs.webkit.org/show_bug.cgi?id=144077
3165         rdar://problem/19772892
3166
3167         Reviewed by Darin Adler.
3168
3169         * UIProcess/ios/WKContentViewInteraction.mm:
3170         (-[WKContentView _share:]):
3171         (-[WKContentView canPerformAction:withSender:]):
3172         (-[WKContentView _define:]):
3173         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
3174         (-[WKContentView moveByOffset:]):
3175         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
3176         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
3177         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
3178         (-[WKContentView accessoryTab:]):
3179         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
3180         (-[WKContentView executeEditCommandWithCallback:]):
3181
3182 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3183
3184         [UNIX] Do not allow copies of IPC::Attachment
3185         https://bugs.webkit.org/show_bug.cgi?id=144096
3186
3187         Reviewed by Darin Adler.
3188
3189         It ensures that the file descriptor ownership is always correctly
3190         transferred. This way we can remove the dispose() method to
3191         explicitly close the file descriptor and always close it in the
3192         Attachment destructor (unless explicitly transferred to
3193         IPC::Connection or SharedMemory). It simplifies the code and
3194         ensure we don't leak file descriptors.
3195
3196         * Platform/IPC/ArgumentDecoder.cpp:
3197         (IPC::ArgumentDecoder::~ArgumentDecoder): Remove the code to
3198         explicitly dispose attachments.
3199         (IPC::ArgumentDecoder::removeAttachment): Use WTF::move().
3200         * Platform/IPC/ArgumentEncoder.cpp:
3201         (IPC::ArgumentEncoder::~ArgumentEncoder): Remove the code to
3202         explicitly dispose attachments.
3203         (IPC::ArgumentEncoder::addAttachment): Use WTF::move().
3204         (IPC::ArgumentEncoder::releaseAttachments): Simplify by using WTF::move().
3205         * Platform/IPC/ArgumentEncoder.h:
3206         * Platform/IPC/Attachment.cpp:
3207         (IPC::Attachment::encode): Move a copy of the attachment, and
3208         reset the file descriptor, since the ownership is passed to the encoder.
3209         * Platform/IPC/Attachment.h: Make copy constructor and assignment
3210         private to not allow public copies. The only copy allowed is done
3211         by Attachment::encode(). Make m_fileDescriptor mutable so that we
3212         can reset it in Attachment::encode() after passing the ownership
3213         to the encoder.
3214         * Platform/IPC/unix/AttachmentUnix.cpp:
3215         (IPC::Attachment::~Attachment): Close the file descriptor if it
3216         hasn't been released explicitly.
3217         (IPC::Attachment::dispose): Deleted.
3218         * Platform/IPC/unix/ConnectionUnix.cpp:
3219         (IPC::Connection::processMessage): Do not use AttachmentResourceGuard.
3220         (IPC::Connection::sendOutgoingMessage): Ditto.
3221         (IPC::AttachmentResourceGuard::AttachmentResourceGuard): Deleted.
3222         (IPC::AttachmentResourceGuard::~AttachmentResourceGuard): Deleted.
3223         * Platform/unix/SharedMemoryUnix.cpp:
3224         (WebKit::SharedMemory::Handle::~Handle): Do not call clear().
3225         (WebKit::SharedMemory::Handle::clear): Reset the attachment.
3226         * UIProcess/WebInspectorProxy.cpp:
3227         (WebKit::WebInspectorProxy::createInspectorPage): Use WTF::move().
3228         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
3229         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
3230         Call releaseFileDescriptor() instead of fileDescritpro() since the
3231         ownership is passed to the connection.
3232
3233 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
3234
3235         Build fix.
3236
3237         * WebProcess/cocoa/WebProcessCocoa.mm: Correct the case of an include file name.
3238
3239 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3240
3241         Unreviewed. Fix debug build after r183176.
3242
3243         * Platform/unix/SharedMemoryUnix.cpp:
3244         (WebKit::SharedMemory::Handle::decode):
3245         (WebKit::SharedMemory::createHandle):
3246
3247 2015-04-23  Andreas Kling  <akling@apple.com>
3248
3249         There should only be one way to get the system memory size.
3250         <https://webkit.org/b/144081>
3251
3252         Reviewed by Antti Koivisto.
3253
3254         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3255         (WebKit::NetworkProcess::platformSetCacheModel):
3256         (WebKit::memorySize): Deleted.
3257         * WebProcess/cocoa/WebProcessCocoa.mm:
3258         (WebKit::WebProcess::platformSetCacheModel):
3259         (WebKit::memorySize): Deleted.
3260
3261 2015-04-23  Chris Dumez  <cdumez@apple.com>
3262
3263         [WK2] WebDiagnosticLoggingClient is leaking
3264         https://bugs.webkit.org/show_bug.cgi?id=144089
3265         <rdar://problem/19706214>
3266
3267         Reviewed by Darin Adler.
3268
3269         WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
3270         constructor but there is no code destroying it.
3271
3272         This patch adds a new xxxDestroyed() virtual function to
3273         DiagnosticLoggingClient and that is overriden in
3274         WebDiagnosticLoggingClient to call "delete this". This is the same
3275         pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
3276         WebProgressTrackerClient).
3277
3278         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
3279         (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed):
3280         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
3281
3282 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3283
3284         [UNIX] Simplify the file descriptor handling in SharedMemory
3285         https://bugs.webkit.org/show_bug.cgi?id=144046
3286
3287         Reviewed by Darin Adler.
3288
3289         Simplify the file descriptor handling and clarify its ownership by
3290         using IPC::Attachment in SharedMemory::Handle instead of fd and
3291         size members. SharedMemory::Handle::adoptFromAttachment() has been
3292         renamed as SharedMemory::Handle::adoptAttachment() and receives an
3293         IPC::Attachment. And SharedMemory::Handle::releaseToAttachment()
3294         has been renamed as SharedMemory::Handle::releaseAttachment().
3295
3296         * Platform/IPC/Attachment.h: Add move constructor and move assigned operator.
3297         * Platform/IPC/Connection.h:
3298         (IPC::Connection::identifierIsNull): A file descriptor is null
3299         when it's -1 no 0.
3300         * Platform/IPC/unix/AttachmentUnix.cpp:
3301         (IPC::Attachment::Attachment):
3302         (IPC::Attachment::operator=):
3303         (IPC::Attachment::dispose): Reset the file descriptor after
3304         closing it.
3305         * Platform/IPC/unix/ConnectionUnix.cpp:
3306         (IPC::Connection::processMessage): Use
3307         SharedMemory::Handle::adoptAttachment() that receives an
3308         IPC::Attachment now.
3309         (IPC::Connection::sendOutgoingMessage): Use
3310         SharedMemory::Handle::releaseAttachment().
3311         * Platform/SharedMemory.h:
3312         * Platform/unix/SharedMemoryUnix.cpp:
3313         (WebKit::SharedMemory::Handle::Handle): Remove initializers for
3314         file descriptor and size members.
3315         (WebKit::SharedMemory::Handle::clear): Dispose the attachment.
3316         (WebKit::SharedMemory::Handle::isNull): Handle is null if the
3317         attachment file descriptor is -1.
3318         (WebKit::SharedMemory::Handle::encode): Use releaseAttachment().
3319         (WebKit::SharedMemory::Handle::decode): Use adoptAttachment().
3320         (WebKit::SharedMemory::Handle::releaseAttachment): Implement it
3321         using move.
3322         (WebKit::SharedMemory::Handle::adoptAttachment): Ditto.
3323         (WebKit::SharedMemory::map): Use
3324         IPC::Attachment::releaseFileDescriptor() instead of manually
3325         changing the member.
3326         (WebKit::SharedMemory::createHandle): Initialize the handle
3327         attachment with the duplicated file descriptor and size.
3328
3329 2015-04-22  Darin Adler  <darin@apple.com>
3330
3331         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
3332         https://bugs.webkit.org/show_bug.cgi?id=143943
3333
3334         Reviewed by Anders Carlsson.
3335
3336         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3337         Removed unneeded include.
3338
3339 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
3340
3341         VisibleSelection should only accept Range by reference
3342         https://bugs.webkit.org/show_bug.cgi?id=144047
3343
3344         Reviewed by Tim Horton.
3345
3346         Update all uses of VisibleSelection to pass a Range reference instead
3347         of a Range pointer.
3348
3349         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3350         (WebKit::InjectedBundleRangeHandle::renderedImage):
3351         * WebProcess/WebPage/FindController.cpp:
3352         (WebKit::FindController::getImageForFindMatch):
3353         (WebKit::FindController::selectFindMatch):
3354         * WebProcess/WebPage/WebPage.cpp:
3355         (WebKit::WebPage::insertTextAsync):
3356         (WebKit::WebPage::setCompositionAsync):
3357         * WebProcess/WebPage/mac/WebPageMac.mm:
3358         (WebKit::WebPage::insertDictatedTextAsync):
3359
3360 2015-04-22  Anders Carlsson  <andersca@apple.com>
3361
3362         Add WK_ARRAY and WK_SET annotations
3363         https://bugs.webkit.org/show_bug.cgi?id=144075
3364         rdar://problem/19417770
3365
3366         Reviewed by Dan Bernstein.
3367
3368         * Shared/API/Cocoa/WKFoundation.h:
3369         * UIProcess/API/Cocoa/WKBackForwardList.h:
3370         * UIProcess/API/Cocoa/WKUserContentController.h:
3371         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3372         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3373         * mac/postprocess-framework-headers.sh:
3374
3375 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
3376
3377         Unreviewed build fix after r183136.
3378
3379         * WebProcess/WebPage/mac/WebPageMac.mm: Correct capitalization of
3380         'HTMLPluginImageElement.h' -> 'HTMLPlugInImageElement.h'
3381
3382 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
3383
3384         Extend action menus to support PDF
3385         https://bugs.webkit.org/show_bug.cgi?id=143895
3386         <rdar://problem/19003333>
3387
3388         Reviewed by Tim Horton.
3389
3390         If the mouse pointer is over a PDF, try to provide a relevant action menu for whatever
3391         content is under the mouse. For now, we only support copying text and handling URLs.
3392
3393         If no text is selected, use the dictionary lookup service to find a semantically appropriate
3394         selection underneath the mouse. This is consistent with how normal text is treated in pure HTML
3395         views. If some text is already selected, and the mouse is over the existing selection, continue
3396         using the selected text. Otherwise, discard the old selection and select the most appropriate
3397         region under the mouse pointer.
3398
3399         * Shared/API/c/WKActionMenuTypes.h: Add PDF menu option.
3400         * Shared/WebMouseEvent.cpp: Recognize mouse force events as valid mouse events.
3401         * UIProcess/mac/WKActionMenuController.mm:
3402         (-[WKActionMenuController _defaultMenuItemsForPDF]): Add simply copy text option.
3403         (-[WKActionMenuController _defaultMenuItems]): Recognize PDFs and add relevant action
3404         menu entries.
3405         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Provide stub for new method.
3406         * WebProcess/Plugins/PDF/PDFLayerControllerDetails.h: Expose 'rectsForSelectionInLayerSpace',
3407         'rectsForAnnotationInLayoutSpace', 'layout', and 'currentPage'.
3408         * WebProcess/Plugins/PDF/PDFPlugin.h:
3409         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3410         (WebKit::PDFPlugin::getSelectionForWordAtPoint): Added.
3411         (WebKit::PDFPlugin::existingSelectionContainsPoint): Added.
3412         (WebKit::PDFPlugin::lookupTextAtLocation): Added.
3413         * WebProcess/Plugins/Plugin.h: Add declaration for new 'getSelectionForWordAtPoint' method.
3414         * WebProcess/Plugins/PluginProxy.h: Provide stub for new method.
3415         * WebProcess/Plugins/PluginView.cpp:
3416         (WebKit::PluginView::getSelectionForWordAtPoint): Added.
3417         (WebKit::PluginView::existingSelectionContainsPoint): Added.
3418         (WebKit::PluginView::lookupTextAtLocation): Added.
3419         * WebProcess/Plugins/PluginView.h:
3420         * WebProcess/WebPage/mac/WebPageMac.mm:
3421         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update to support PDF documents and retrieve
3422         relevant content to support later action menu handling.
3423
3424 2015-04-22  Eric Carlson  <eric.carlson@apple.com>
3425
3426         Update AirPlay sandbox rules
3427         https://bugs.webkit.org/show_bug.cgi?id=144062
3428         <rdar://problem/19869448>
3429
3430         Reviewed by Alexey Proskuryakov.
3431
3432         * WebProcess/com.apple.WebProcess.sb.in: Remove obsolete rules.
3433
3434 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
3435
3436         [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure
3437         https://bugs.webkit.org/show_bug.cgi?id=144052
3438         rdar://problem/19754404
3439
3440         Reviewed by Darin Adler.
3441
3442         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
3443         (main): Make XPC transaction tracking work again after a re-exec.
3444
3445 2015-04-22  Zan Dobersek  <zdobersek@igalia.com>
3446
3447         [WK2] Have API::Array creation methods return Ref<>
3448         https://bugs.webkit.org/show_bug.cgi?id=143933
3449
3450         Reviewed by Darin Adler.
3451
3452         API::Array::create() and API::Array::createStringArray() should return Ref<> objects
3453         as the return values are never null. It's up to the caller to implicitly convert the
3454         returned objects to RefPtr<> if so required. All the call-sites have been updated to
3455         reflect that.
3456
3457         * Shared/API/APIArray.cpp:
3458         (API::Array::create):
3459         (API::Array::createStringArray):
3460         (API::Array::copy):
3461         * Shared/API/APIArray.h:
3462         * Shared/API/APIDictionary.cpp:
3463         (API::Dictionary::keys):
3464         * Shared/API/APIDictionary.h:
3465         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3466         (ensureObjectStream):
3467         * Shared/API/c/WKArray.cpp:
3468         (WKArrayCreate):
3469         (WKArrayCreateAdoptingValues):
3470         * Shared/API/c/WKContextMenuItem.cpp:
3471         (WKContextMenuCopySubmenuItems):
3472         * Shared/API/c/WKDictionary.cpp:
3473         (WKDictionaryCopyKeys):
3474         * Shared/API/c/WKMutableArray.cpp:
3475         (WKMutableArrayCreate):
3476         * Shared/Cocoa/WKNSDictionary.mm:
3477         (-[WKNSDictionary keyEnumerator]):
3478         * Shared/SecurityOriginData.cpp:
3479         (WebKit::performAPICallbackWithSecurityOriginDataVector):
3480         * Shared/WebContextMenuItem.cpp:
3481         (WebKit::WebContextMenuItem::submenuItemsAsAPIArray):
3482         * Shared/WebContextMenuItem.h:
3483         * Shared/WebOpenPanelParameters.cpp:
3484         (WebKit::WebOpenPanelParameters::acceptMIMETypes):
3485         (WebKit::WebOpenPanelParameters::selectedFileNames):
3486         * Shared/WebOpenPanelParameters.h:
3487         * UIProcess/API/C/WKBackForwardListRef.cpp:
3488         (WKBackForwardListCopyBackListWithLimit):
3489         (WKBackForwardListCopyForwardListWithLimit):
3490         * UIProcess/API/C/WKGrammarDetail.cpp:
3491         (WKGrammarDetailCopyGuesses):
3492         * UIProcess/API/C/WKOpenPanelParameters.cpp:
3493         (WKOpenPanelParametersCopyAcceptedMIMETypes):
3494         (WKOpenPanelParametersCopySelectedFileNames):
3495         * UIProcess/API/C/WKPage.cpp:
3496         (WKPageSetPageContextMenuClient):
3497         (WKPageCopyRelatedPages):
3498         * UIProcess/API/Cocoa/WKBackForwardList.mm:
3499         (-[WKBackForwardList backList]):
3500         (-[WKBackForwardList forwardList]):
3501         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
3502         (createWKArray):
3503         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3504         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3505         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
3506         (webkit_back_forward_list_get_back_list_with_limit):
3507         (webkit_back_forward_list_get_forward_list_with_limit):
3508         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
3509         (webkit_file_chooser_request_get_mime_types):
3510         (webkit_file_chooser_request_get_mime_types_filter):
3511         (webkit_file_chooser_request_select_files):
3512         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
3513         (WebKitNotificationProvider::notificationCloseCallback):
3514         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
3515         (WebKit::WebNotificationManagerProxy::populateCopyOfNotificationPermissions):
3516         * UIProcess/Notifications/WebNotificationProvider.cpp:
3517         (WebKit::WebNotificationProvider::clearNotifications):
3518         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
3519         (WebKit::WebPluginSiteDataManager::didGetSitesWithData):
3520         * UIProcess/StatisticsRequest.cpp:
3521         (WebKit::StatisticsRequest::completedRequest):
3522         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3523         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
3524         * UIProcess/WebBackForwardList.cpp:
3525         (WebKit::WebBackForwardList::backList):
3526         (WebKit::WebBackForwardList::forwardList):
3527         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit):
3528         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit):
3529         * UIProcess/WebBackForwardList.h:
3530         * UIProcess/WebCookieManagerProxy.cpp:
3531         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies):
3532         * UIProcess/WebDatabaseManagerProxy.cpp:
3533         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
3534         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
3535         * UIProcess/WebGrammarDetail.cpp:
3536         (WebKit::WebGrammarDetail::guesses):
3537         * UIProcess/WebGrammarDetail.h:
3538         * UIProcess/WebKeyValueStorageManager.cpp:
3539         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
3540         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
3541         * UIProcess/WebMediaCacheManagerProxy.cpp:
3542         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache):
3543         * UIProcess/WebOriginDataManagerProxy.cpp:
3544         (WebKit::WebOriginDataManagerProxy::didGetOrigins):
3545         * UIProcess/WebPageProxy.cpp:
3546         (WebKit::WebPageProxy::didFindStringMatches):
3547         * UIProcess/WebProcessPool.cpp:
3548         (WebKit::WebProcessPool::pluginInfoStoreDidLoadPlugins):
3549         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3550         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
3551         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
3552         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
3553         (-[WKWebProcessPlugInFrame childFrames]):
3554         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
3555         (WKBundleBackForwardListItemCopyChildren):
3556         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3557         (WKBundleFrameCopyChildFrames):
3558         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3559         (WKBundlePageCopyTrackedRepaintRects):
3560         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
3561         (WebKit::InjectedBundleBackForwardListItem::children):
3562         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
3563         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
3564         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
3565         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
3566         (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
3567         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3568         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
3569         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3570         (WebKit::findLargestFrameInFrameSet):
3571         * WebProcess/WebPage/WebFrame.cpp:
3572         (WebKit::WebFrame::childFrames):
3573         * WebProcess/WebPage/WebFrame.h:
3574         * WebProcess/WebPage/WebPage.cpp:
3575         (WebKit::WebPage::trackedRepaintRects):
3576         * WebProcess/WebPage/WebPage.h:
3577
3578 2015-04-21  Eric Carlson  <eric.carlson@apple.com>
3579
3580         [Mac] Use one playback target for all web processes
3581         https://bugs.webkit.org/show_bug.cgi?id=144009
3582
3583         Reviewed by Tim Horton.
3584
3585         Every WebPageProxy uses the WebMediaSessionManager singleton to talk to the playback target
3586         picker.
3587
3588         * UIProcess/PageClient.h:
3589         * UIProcess/WebPageProxy.cpp:
3590         (WebKit::WebPageProxy::WebPageProxy):
3591         (WebKit::WebPageProxy::resetState):
3592         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3593         (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
3594         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
3595         (WebKit::WebPageProxy::showPlaybackTargetPicker):
3596         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
3597         (WebKit::WebPageProxy::setPlaybackTarget):
3598         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
3599         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
3600         (WebKit::WebPageProxy::devicePickerProxy): Deleted.
3601         (WebKit::WebPageProxy::startingMonitoringPlaybackTargets): Deleted.
3602         (WebKit::WebPageProxy::stopMonitoringPlaybackTargets): Deleted.
3603         (WebKit::WebPageProxy::didChoosePlaybackTarget): Deleted.
3604         * UIProcess/WebPageProxy.h:
3605         (WebKit::WebPageProxy::isPlayingAudio):
3606         * UIProcess/WebPageProxy.messages.in:
3607         * UIProcess/mac/PageClientImpl.h:
3608         * UIProcess/mac/PageClientImpl.mm:
3609         (WebKit::PageClientImpl::mediaSessionManager):
3610         (WebKit::PageClientImpl::createPlaybackTargetPicker): Deleted.
3611         * UIProcess/mac/WebMediaSessionManagerMac.cpp: Added.
3612         (WebKit::WebMediaSessionManagerMac::singleton):
3613         (WebKit::WebMediaSessionManagerMac::WebMediaSessionManagerMac):
3614         (WebKit::WebMediaSessionManagerMac::~WebMediaSessionManagerMac):
3615         (WebKit::WebMediaSessionManagerMac::targetPicker):
3616         * UIProcess/mac/WebMediaSessionManagerMac.h: Added.
3617         * WebProcess/Plugins/PluginView.h:
3618         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3619         (WebKit::WebChromeClient::isPlayingMediaDidChange):
3620         (WebKit::WebChromeClient::addPlaybackTargetPickerClient):
3621         (WebKit::WebChromeClient::removePlaybackTargetPickerClient):
3622         (WebKit::WebChromeClient::showPlaybackTargetPicker):
3623         (WebKit::WebChromeClient::playbackTargetPickerClientStateDidChange):
3624         (WebKit::WebChromeClient::startingMonitoringPlaybackTargets): Deleted.
3625         (WebKit::WebChromeClient::stopMonitoringPlaybackTargets): Deleted.
3626         * WebProcess/WebCoreSupport/WebChromeClient.h:
3627         * WebProcess/WebPage/WebPage.h:
3628         * WebProcess/WebPage/WebPage.messages.in:
3629         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3630         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
3631         * WebProcess/WebPage/mac/WebPageMac.mm:
3632         (WebKit::WebPage::playbackTargetSelected):
3633         (WebKit::WebPage::playbackTargetAvailabilityDidChange):
3634         (WebKit::WebPage::setShouldPlayToPlaybackTarget):
3635
3636 2015-04-21  Anders Carlsson  <andersca@apple.com>
3637
3638         WKWebsiteDataStore doesn't track and remove IndexedDB databases
3639         https://bugs.webkit.org/show_bug.cgi?id=144032
3640         rdar://problem/20242856
3641
3642         Reviewed by Tim Horton.
3643
3644         * DatabaseProcess/DatabaseProcess.cpp:
3645         (WebKit::DatabaseProcess::fetchWebsiteData):
3646         (WebKit::DatabaseProcess::deleteWebsiteData):
3647         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
3648         * DatabaseProcess/DatabaseProcess.h:
3649         * DatabaseProcess/DatabaseProcess.messages.in:
3650         * Shared/WebsiteData/WebsiteDataTypes.h:
3651         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3652         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
3653         (dataTypesToString):
3654         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3655         (WebKit::toWebsiteDataTypes):
3656         (WebKit::toWKWebsiteDataTypes):
3657         * UIProcess/Databases/DatabaseProcessProxy.cpp:
3658         (WebKit::generateCallbackID):
3659         (WebKit::DatabaseProcessProxy::~DatabaseProcessProxy):
3660         (WebKit::DatabaseProcessProxy::fetchWebsiteData):
3661         (WebKit::DatabaseProcessProxy::deleteWebsiteData):
3662         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
3663         (WebKit::DatabaseProcessProxy::didClose):
3664         (WebKit::DatabaseProcessProxy::didFetchWebsiteData):
3665         (WebKit::DatabaseProcessProxy::didDeleteWebsiteData):
3666         (WebKit::DatabaseProcessProxy::didDeleteWebsiteDataForOrigins):
3667         * UIProcess/Databases/DatabaseProcessProxy.h:
3668         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
3669         * UIProcess/WebProcessPool.h:
3670         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3671         (WebKit::WebsiteDataStore::fetchData):
3672         (WebKit::WebsiteDataStore::removeData):
3673
3674 2015-04-21  Anders Carlsson  <andersca@apple.com>
3675
3676         Add module maps for WebKit
3677         https://bugs.webkit.org/show_bug.cgi?id=144026
3678         rdar://problem/19665428
3679
3680         Reviewed by Dan Bernstein.
3681
3682         * Configurations/WebKit.xcconfig:
3683         * Modules/OSX.modulemap: Added.
3684         * Modules/iOS.modulemap: Added.
3685
3686 2015-04-21  Tim Horton  <timothy_horton@apple.com>
3687
3688         Long pause under _takeViewSnapshot when screen updates are disabled
3689         https://bugs.webkit.org/show_bug.cgi?id=144017
3690         <rdar://problem/20548397>
3691
3692         Reviewed by Simon Fraser.
3693
3694         * UIProcess/API/mac/WKView.mm:
3695         (-[WKView _takeViewSnapshot]):
3696         Use CGSHWCaptureWindowList, for snapshotting that doesn't block on
3697         the next commit, and can succeed while screen updates are disabled
3698         without blocking.
3699
3700 2015-04-21  Chris Dumez  <cdumez@apple.com>
3701
3702         [WK2][NetworkCache] Better account of resource revalidations in efficacy logging
3703         https://bugs.webkit.org/show_bug.cgi?id=144014
3704
3705         Reviewed by Antti Koivisto.
3706
3707         Better account of resource revalidations in efficacy logging.
3708         Prevously, resources that were in the cache but needed revalidation
3709         were counted as retrieval successes, which is not entirely accurate.
3710
3711         We now distinguish "is in the cache and is directly usable" from
3712         "is in the cache but needs revalidation". We also log how many of these
3713         revalidations are successful.
3714
3715         * NetworkProcess/NetworkResourceLoader.cpp:
3716         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
3717         * NetworkProcess/cache/NetworkCache.cpp:
3718         (WebKit::NetworkCache::Cache::update):
3719         * NetworkProcess/cache/NetworkCache.h:
3720         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3721         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
3722         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
3723         * NetworkProcess/cache/NetworkCacheStatistics.h:
3724
3725 2015-04-21  Dan Bernstein  <mitz@apple.com>
3726
3727         [Cocoa] Framework header postprocessing should respect additional definitions
3728         https://bugs.webkit.org/show_bug.cgi?id=144018
3729
3730         Reviewed by Anders Carlsson.
3731
3732         * mac/postprocess-framework-headers.sh: Read definitons from
3733         /usr/local/include/WebKitAdditions/Scripts/postprocess-framework-headers-definitions, and
3734         have them take precedence over OSX_VERSION and IOS_VERSION and supply additional options to
3735         sed.
3736
3737 2015-04-21  Anders Carlsson  <andersca@apple.com>
3738
3739         Fix block signatures
3740         https://bugs.webkit.org/show_bug.cgi?id=144002
3741
3742         Reviewed by Andreas Kling.
3743
3744         * UIProcess/API/Cocoa/WKUIDelegate.h:
3745         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3746         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3747         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3748         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3749         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3750         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3751         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3752         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3753         * UIProcess/ios/WKPDFView.mm:
3754         (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]):
3755         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3756         (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
3757         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
3758         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
3759
3760 2015-04-21  Timothy Horton  <timothy_horton@apple.com>
3761
3762         PDFs still don't snapshot properly in iOS Safari
3763         https://bugs.webkit.org/show_bug.cgi?id=143976
3764         <rdar://problem/18283459>
3765
3766         Reviewed by Anders Carlsson.
3767
3768         * UIProcess/WebPageProxy.cpp:
3769         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
3770         * UIProcess/WebPageProxy.h:
3771         * UIProcess/API/Cocoa/WKWebView.mm:
3772         (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]):
3773         Inform the client that we've passed all reasonable layout milestones
3774         as soon as the custom content provider has been handed its data.
3775         WKPDFView, the only custom content provider, synchronously lays out
3776         its subviews upon initial receipt of data, so this works fine for it.
3777         This ensures that clients that normally depend on layout milestones firing
3778         won't break when a custom content view is installed.
3779
3780         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3781         Fall back to renderInContext: if the custom content view is not parented
3782         when a snapshot is requested.
3783
3784 2015-04-21  Dan Bernstein  <mitz@apple.com>
3785
3786         Merged WKBackForwardListItem’s Internal category into the class extension in WKBackForwardListItemInternal.h.
3787
3788         Reviewed by Anders Carlsson.
3789
3790         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
3791         (-[WKBackForwardListItem _item]):
3792         (-[WKBackForwardListItem _apiObject]):
3793         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
3794
3795 2015-04-21  Chris Dumez  <cdumez@apple.com>
3796
3797         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
3798         https://bugs.webkit.org/show_bug.cgi?id=143970
3799
3800         Reviewed by Darin Adler.
3801
3802         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
3803         constructor explicit as it copies the vector and it is easy to call it
3804         by mistake.
3805
3806         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3807         (WebKit::WebIDBServerConnection::setIndexKeys):
3808         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
3809
3810 2015-04-20  Dan Bernstein  <mitz@apple.com>
3811
3812         Expose more bundle form client functions as WKWebProcessPlugInFormDelegatePrivate methods
3813         https://bugs.webkit.org/show_bug.cgi?id=143973
3814
3815         Reviewed by Anders Carlsson.
3816
3817         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared new
3818         delegate methods.
3819
3820         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Declared new frame
3821         property.
3822         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
3823         (-[WKWebProcessPlugInNodeHandle frame]): Added. Returns the node’s document’s frame. This is
3824         useful to delegates getting an array of nodes via the new method.
3825
3826         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3827         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added overrides of
3828         shouldNotifyOnFormChanges and didAssociateFormControls, which call the new delegate methods.
3829
3830 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
3831
3832         Cleanup some StringBuilder use
3833         https://bugs.webkit.org/show_bug.cgi?id=143550
3834
3835         Reviewed by Darin Adler.
3836
3837         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
3838         (WebKit::buildObjectStoreStatement):
3839         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
3840         (WebKit::v2RecordsTableSchema):
3841         * Shared/Databases/IndexedDB/IDBUtilities.cpp:
3842         (WebKit::uniqueDatabaseIdentifier):
3843         * UIProcess/API/APIUserScript.cpp:
3844         (API::UserScript::generateUniqueURL):
3845         * UIProcess/WebProcessPool.cpp:
3846         (WebKit::WebProcessPool::didReceiveInvalidMessage):
3847         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
3848         (WebKit::combinedSecurityOriginIdentifier):
3849
3850 2015-04-20  Anders Carlsson  <andersca@apple.com>
3851
3852         Modify the WKWebsiteDataStore API to take a NSSet of types instead of a bitmask
3853         https://bugs.webkit.org/show_bug.cgi?id=143966
3854
3855         Reviewed by Dan Bernstein.
3856
3857         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3858         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
3859         (dataTypesToString):
3860         (-[WKWebsiteDataRecord dataTypes]):
3861         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3862         (WebKit::toWebsiteDataTypes):
3863         (WebKit::toWKWebsiteDataTypes):
3864         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3865         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3866         (+[WKWebsiteDataStore allWebsiteDataTypes]):
3867         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3868         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3869         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3870         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
3871         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3872         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3873         (toWKWebsiteDataTypes):
3874         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3875         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3876         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3877
3878 2015-04-20  Beth Dakin  <bdakin@apple.com>
3879
3880         Should remove mouseForceClick and mouseForceCancelled from DOM force events
3881         https://bugs.webkit.org/show_bug.cgi?id=143904
3882         -and corresponding-
3883         rdar://problem/20578842
3884
3885         Reviewed by Dan Bernstein.
3886
3887         * WebProcess/WebPage/mac/WebPageMac.mm:
3888         (WebKit::WebPage::immediateActionDidCancel):
3889
3890 2015-04-20  Tim Horton  <timothy_horton@apple.com>
3891
3892         Implement immediate action support for tel: and mailto: URLs
3893         https://bugs.webkit.org/show_bug.cgi?id=143916
3894         <rdar://problem/19721711>
3895
3896         Reviewed by Darin Adler.
3897
3898         * Shared/API/c/WKImmediateActionTypes.h:
3899         * UIProcess/mac/WKImmediateActionController.mm:
3900         (-[WKImmediateActionController _defaultAnimationController]):
3901         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
3902         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
3903         (-[WKImmediateActionController _menuItemForDataDetectedText]): Deleted.
3904         Add _animationControllerForDataDetectedLink and use it when
3905         building immediate actions for tel: and mailto: links.
3906
3907 2015-04-20  Alex Christensen  <achristensen@webkit.org>
3908
3909         Properly report errors from _WKUserContentExtensionStore.
3910         https://bugs.webkit.org/show_bug.cgi?id=143808
3911
3912         Reviewed by Darin Adler.
3913
3914         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
3915         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
3916         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
3917         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
3918
3919 2015-04-18  Simon Fraser  <simon.fraser@apple.com>
3920
3921         REGRESSION (r181656): Animated tiled layers are missing content
3922         https://bugs.webkit.org/show_bug.cgi?id=143911
3923         rdar://problem/20596328
3924
3925         Reviewed by Darin Adler.
3926         
3927         After r181656, all requestAnimationFrame was falling back to timers, and not
3928         using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
3929         fumble.
3930         
3931         Replace this confusing Optional<> code with simpler code that just forces the
3932         clients to make a DisplayRefreshMonitor if they can, first asking
3933         ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
3934         
3935         Make lots of things into references, and use C++11 initialization in some places.
3936
3937         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3938         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
3939         * WebProcess/WebCoreSupport/WebChromeClient.h:
3940
3941 2015-04-18  Dan Bernstein  <mitz@apple.com>
3942
3943         SwipeShadow images are installed on iOS
3944         https://bugs.webkit.org/show_bug.cgi?id=143915
3945
3946         Reviewed by Tim Horton.
3947
3948         * Configurations/WebKit.xcconfig: Added Resources/Mac/* to
3949         EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*]. We could move more resources there and remove
3950         individual patterns.
3951         * Resources/SwipeShadow.png: Moved to mac.
3952         * Resources/SwipeShadow@2x.png: Moved to mac.
3953         * Resources/mac: Added.
3954         * Resources/mac/SwipeShadow.png: Moved from Source/WebKit2/Resources/SwipeShadow.png.
3955         * Resources/mac/SwipeShadow@2x.png: Moved from Source/WebKit2/Resources/SwipeShadow@2x.png.
3956         * WebKit2.xcodeproj/project.pbxproj: Created mac group in the Resources group and moved
3957         SwipeShadow*.png into it. Updated for file moves.
3958
3959 2015-04-18  Chris Dumez  <cdumez@apple.com>
3960
3961         Fix NetworkCache Statistics database bootstrapping after r182803
3962         https://bugs.webkit.org/show_bug.cgi?id=143890
3963
3964         Reviewed by Darin Adler.
3965
3966         Update the NetworkCache Statistics database bootstrapping code to use
3967         the records path instead of the version path. Also check that the
3968         filenames in the folder are valid hashes to discard the *-body files.
3969
3970         * NetworkProcess/cache/NetworkCache.cpp:
3971         (WebKit::NetworkCache::Cache::recordsPath):
3972         (WebKit::NetworkCache::Cache::storagePath): Deleted.
3973         * NetworkProcess/cache/NetworkCache.h:
3974         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3975         (WebKit::NetworkCache::Statistics::initialize):
3976         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
3977         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
3978
3979 2015-04-17  Tim Horton  <timothy_horton@apple.com>
3980
3981         Clients sometimes block for 500ms in waitForPossibleGeometryUpdates
3982         https://bugs.webkit.org/show_bug.cgi?id=143901
3983         <rdar://problem/20488655>
3984
3985         Reviewed by Anders Carlsson.
3986
3987         * Platform/IPC/Connection.cpp:
3988         (IPC::Connection::waitForMessage):
3989         InterruptWaitingIfSyncMessageArrives already cancels waitForMessage if
3990         a sync message arrives while waiting, but it should also avoid waiting
3991         if there's a sync message already in the queue when the waiting starts,
3992         as that will have the same nasty effect.
3993
3994         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3995         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
3996         If a synchronous message comes in from the Web process while we're waiting,
3997         cancel our synchronous wait for DidUpdateGeometry. This will cause the size
3998         change to not synchronize with the Web process' painting, but that is better
3999         than pointlessly blocking for 500ms.
4000
4001 2015-04-17  Chris Dumez  <cdumez@apple.com>
4002
4003         Possible null pointer dereference in WebDiagnosticLoggingClient::logDiagnosticMessageWithValue()
4004         https://bugs.webkit.org/show_bug.cgi?id=143899
4005         <rdar://problem/20584215>
4006
4007         Reviewed by Anders Carlsson.
4008
4009         WebDiagnosticLoggingClient::logDiagnosticMessage*() methods failed to
4010         check that m_page.corePage() was non-null before dereferencing, thus
4011         causing crashes when it is null.
4012
4013         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
4014         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
4015         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
4016         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
4017
4018 2015-04-17  Yongjun Zhang  <yongjun_zhang@apple.com>
4019
4020         WebKit client should be able to add view controller for link preview.
4021         https://bugs.webkit.org/show_bug.cgi?id=143686
4022
4023         Add delegate methods to WKUIDelegatePrivate so that a WebKit client can prepare a view controller
4024         for link preview and react to the dismissal of this view controller. Also connect WKContentView to
4025         preview gesture recognizer and forwards the delegate callbacks to corresponding delegate methods
4026         in WKUIDelegatePrivate.
4027
4028         Reviewed by Beth Dakin.
4029
4030         * Platform/spi/ios/UIKitSPI.h:
4031         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
4032         * UIProcess/ios/WKContentView.mm:
4033         (-[WKContentView willMoveToWindow:]):
4034         * UIProcess/ios/WKContentViewInteraction.h:
4035         * UIProcess/ios/WKContentViewInteraction.mm:
4036         (-[WKContentView cleanupInteraction]):
4037         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
4038         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
4039         (-[WKContentView gestureRecognizerShouldBegin:]):
4040         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
4041         (-[WKContentView commitPreviewViewController:]):
4042         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
4043         (-[WKContentView didDismissPreviewViewController:committing:]):
4044
4045 2015-04-17  Beth Dakin  <bdakin@apple.com>
4046
4047         Force mouse events should go through normal mouse event handling code paths
4048         https://bugs.webkit.org/show_bug.cgi?id=143749
4049         -and corresponding-
4050         rdar://problem/20472895
4051
4052         Reviewed by Dean Jackson.
4053
4054         This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the 
4055         NSEventTypePressures that is gets and sends those down to the web process.
4056
4057         Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an 
4058         NSEventTypePressure, the new name makes it clear how the second parameter differs 
4059         from the first.
4060         * Shared/NativeWebMouseEvent.h:
4061
4062         New event types for the new types of events.
4063         * Shared/WebEvent.h:
4064         * Shared/WebEventConversion.cpp:
4065         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
4066         * Shared/mac/NativeWebMouseEventMac.mm:
4067         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
4068         * Shared/mac/WebEventFactory.h:
4069
4070         All of the square-peg, round-hole problems of massaging the NSEventTypePressures 
4071         events into WebMouseEvents is taken care of here.
4072         * Shared/mac/WebEventFactory.mm:
4073         (WebKit::mouseButtonForEvent):
4074         (WebKit::globalPointForEvent):
4075         (WebKit::pointForEvent):
4076         (WebKit::WebEventFactory::createWebMouseEvent):
4077
4078         Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent