Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
2
3         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
4         https://bugs.webkit.org/show_bug.cgi?id=142776
5         <rdar://problem/18921338>
6
7         Reviewed by Alexey Proskuryakov.
8
9         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
10         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
11         * WebProcess/WebCoreSupport/WebChromeClient.h:
12         Adjust to the new signature.
13
14 2015-03-17  Antti Koivisto  <antti@apple.com>
15
16         Disk cache should support Vary: Cookie
17         https://bugs.webkit.org/show_bug.cgi?id=142770
18         rdar://problem/19764945
19
20         Reviewed by Anders Carlsson.
21
22         Cookies are not part of the original request but are added by the networking layer when submitting the request.
23         Fetch them explicitly when resolving Vary: Cookie.
24
25         The implementation is not perfect as it fetches the cookie for the cache entry when saving a Vary:Cookie response,
26         not when making the request. In principle the cookie may have changed in-between. This should be enough to handle
27         reasonable cases though. Fetching cookies for every request might be too expensive for this rarely used feature.
28
29         * NetworkProcess/cache/NetworkCache.cpp:
30         (WebKit::NetworkCache::headerValueForVary):
31         (WebKit::NetworkCache::encodeStorageEntry):
32         (WebKit::NetworkCache::verifyVaryingRequestHeaders):
33
34 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
35
36         [WK2] Use C++ lambdas in IPC::Connection
37         https://bugs.webkit.org/show_bug.cgi?id=138018
38
39         Reviewed by Anders Carlsson.
40
41         Replace uses of WTF::bind() in the IPC::Connection class with C++ lambdas.
42
43         * Platform/IPC/Connection.cpp:
44         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
45         (IPC::Connection::invalidate):
46         (IPC::Connection::sendMessage):
47         (IPC::Connection::processIncomingMessage): Simplify the error messages so we
48         don't have to format strings on-the-fly, removing the issues of cross-thread
49         string copying altogether.
50         (IPC::Connection::dispatchDidReceiveInvalidMessage): The parameters are now
51         of the StringReference type.
52         (IPC::Connection::enqueueIncomingMessage):
53         * Platform/IPC/Connection.h:
54         * Platform/IPC/mac/ConnectionMac.mm:
55         (IPC::Connection::receiveSourceEventHandler):
56         * Platform/IPC/unix/ConnectionUnix.cpp:
57         (IPC::Connection::open):
58
59 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
60
61         [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers
62         https://bugs.webkit.org/show_bug.cgi?id=142530
63
64         Reviewed by Darin Adler.
65
66         * CMakeLists.txt: Replace the Source/ThirdParty/ANGLE/include/GLSLANG entry
67         in the list of inclusion directories for WebKit2 with Source/ThirdParty/ANGLE,
68         possible due to the new forwarding header for ANGLE's ShaderLang.h.
69
70 2015-03-17  Gwang Yoon Hwang  <yoon@igalia.com>
71
72         REGRESSION(r180924): Unable to build WebKitGTK+ with threaded compositor
73
74         Unreviewed build fix.
75
76         * WebProcess/WebPage/LayerTreeHost.h:
77         Remove duplicated declaration of setNativeSurfaceHandleForCompositing.
78
79 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
80
81         Enable ES6 classes by default
82         https://bugs.webkit.org/show_bug.cgi?id=142774
83
84         Reviewed by Gavin Barraclough.
85
86         * Configurations/FeatureDefines.xcconfig:
87
88 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
89
90         Don't pass nil as a fireDate for NSTimer
91         https://bugs.webkit.org/show_bug.cgi?id=142765
92
93         Reviewed by Dan Bernstein.
94
95         While we're here, switch to a selector that conforms to documented NSTimer API.
96
97         * UIProcess/mac/WKFullScreenWindowController.mm:
98         (-[WKFullScreenWindowController cancelOperation:]):
99         Set the timer's fireDate as the future date matching the former interval; update the selector.
100         (-[WKFullScreenWindowController _watchdogTimerFired:]):
101         Timer callback; wrap -exitFullScreen.
102
103 2015-03-16  Alex Christensen  <achristensen@webkit.org>
104
105         Progress towards CMake on Mac
106         https://bugs.webkit.org/show_bug.cgi?id=142747
107
108         Reviewed by Chris Dumez.
109
110         * PlatformMac.cmake:
111         Started adding Mac-specific directories and headers.
112
113 2015-03-16  Alexey Proskuryakov  <ap@apple.com>
114
115         ASSERT(m_plugin) on plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
116         https://bugs.webkit.org/show_bug.cgi?id=142637
117
118         Reviewed by Dean Jackson.
119
120         * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired):
121         m_plugin can be legitimately null.
122
123 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
124
125         One more URTBF after r181578.
126
127         * WebProcess/WebPage/WebPage.cpp:
128         (WebKit::WebPage::updatePreferences):
129
130 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
131
132         URTBF after r181578.
133
134         * WebProcess/InjectedBundle/InjectedBundle.cpp:
135         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled): Copy/paste error fixed.
136
137 2015-03-16  Dean Jackson  <dino@apple.com>
138
139         Expose WK2 preference for Animation Triggers runtime flag
140         https://bugs.webkit.org/show_bug.cgi?id=142744
141
142         Reviewed by Anders Carlsson.
143
144         Expose CSSAnimationTriggersEnabled, linking it to the runtime enabled
145         feature flag.
146
147         * Shared/WebPreferencesDefinitions.h:
148         * UIProcess/API/C/WKPreferences.cpp:
149         (WKPreferencesSetCSSAnimationTriggersEnabled):
150         (WKPreferencesGetCSSAnimationTriggersEnabled):
151         * UIProcess/API/C/WKPreferencesRefPrivate.h:
152         * WebProcess/InjectedBundle/InjectedBundle.cpp:
153         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
154         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled):
155         * WebProcess/InjectedBundle/InjectedBundle.h:
156         * WebProcess/WebPage/WebPage.cpp:
157         (WebKit::WebPage::updatePreferences):
158
159 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
160
161         Allow clients to selectively disable plug-ins
162         https://bugs.webkit.org/show_bug.cgi?id=142506
163
164         Reviewed by Anders Carlsson.
165
166         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
167         from the page). As part of this:
168
169         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
170            set of plug-ins.
171
172         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
173            down the stack.
174
175         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
176            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
177
178         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
179
180         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
181         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
182
183         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
184         (WebKit::NetscapePluginModule::getPluginInfo):
185         Set new PluginInfo members.
186
187         * Shared/WebCoreArgumentCoders.cpp:
188         (IPC::ArgumentCoder<PluginInfo>::encode):
189         Handle new PluginInfo members.
190         (IPC::ArgumentCoder<PluginInfo>::decode):
191         Ditto.
192
193         * Shared/WebProcessCreationParameters.h:
194         Declare a member to store client plug-in policies.
195
196         * Shared/WebProcessCreationParameters.cpp:
197         (WebKit::WebProcessCreationParameters::encode):
198         Encode the policies.
199         (WebKit::WebProcessCreationParameters::decode):
200         Decode the policies.
201
202         * UIProcess/API/C/WKAPICast.h:
203         (WebKit::toWKPluginLoadClientPolicy):
204         Teach how to cast between WebCore and WebKit2 policy definitions.
205         (WebKit::toPluginLoadClientPolicy):
206         Ditto.
207
208         * UIProcess/API/C/WKPluginLoadPolicy.h:
209         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
210
211         * UIProcess/API/C/mac/WKContextPrivateMac.h:
212         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
213         (WKContextSetPluginLoadClientPolicy):
214         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
215         (WKContextClearPluginClientPolicies):
216         New function; wrap WebProcessPool::clearPluginClientPolicies().
217
218         * UIProcess/WebProcessPool.h:
219         * UIProcess/WebProcessPool.cpp:
220         (WebKit::WebProcessPool::createNewWebProcess):
221         Copy any client plug-in policies to the new process' creation parameters.
222         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
223         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
224         (WebKit::WebProcessPool::clearPluginClientPolicies):
225         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
226
227         * WebProcess/Plugins/PDF/PDFPlugin.mm:
228         (WebKit::PDFPlugin::pluginInfo):
229         Set new PluginInfo member.
230
231         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
232         (WebKit::pluginSupportsExtension):
233         Adopt getWebVisibleMimesAndPluginIndices().
234         (WebKit::WebFrameLoaderClient::objectContentType):
235         Update to reflect reflect function rename.
236
237         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
238         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
239         (WebKit::WebPlatformStrategies::getPluginInfo):
240         Pass the Page to populatePluginCache().
241         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
242         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
243         to block on the current page.
244         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
245         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
246         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
247         New member function; empty m_hostsToPluginIdentifierData.
248         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
249         New member function; look up the most specific policy for the given plug-in and host.
250         (WebKit::WebPlatformStrategies::populatePluginCache):
251         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
252         been populated since the Page, and therefore host, may change.
253
254         * WebProcess/WebPage/WebPage.cpp:
255         (WebKit::WebPage::canShowMIMEType):
256         Update to reflect function rename.
257
258         * WebProcess/WebProcess.h:
259         * WebProcess/WebProcess.cpp:
260         (WebKit::WebProcess::initializeWebProcess):
261         Enumerate and process the client plug-in policies in the creation parameters.
262         (WebKit::WebProcess::setPluginLoadClientPolicy):
263         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
264         (WebKit::WebProcess::clearPluginClientPolicies):
265         New member function; wrap PluginStrategy::clearPluginClientPolicies().
266
267         * WebProcess/WebProcess.messages.in:
268         Add messages for setting and clearing policies.
269
270 2015-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
271
272         Unreviewed. Add new Notification classes to GTK+ API documentation.
273
274         Add WebKitNotification and WebKitNotificationPermissionRequest to
275         the documentation and fix some other typos causing warnings when
276         generating HTML documentation.
277
278         * UIProcess/API/gtk/WebKitUserContent.cpp:
279         * UIProcess/API/gtk/WebKitWebView.cpp:
280         (webkit_web_view_class_init):
281         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
282
283 2015-03-16  Przemyslaw Piorkowski  <p.piorkowski@samsung.com>
284
285         [EFL][WK2] REGRESSION(r178526): test_ewk2_storage_manager has been failed for a long time
286         https://bugs.webkit.org/show_bug.cgi?id=141249
287
288         Reviewed by Gyuyoung Kim.
289
290         * PlatformEfl.cmake: Enable test_ewk2_storage_manager for EFL port - it is passing now.
291
292 2015-03-16  David Kilzer  <ddkilzer@apple.com>
293
294         [iOS] REGRESSION (r181511): Most layout tests crash with a NULL deref
295
296         Follow-up fix for:
297         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
298         <http://webkit.org/b/142702>
299
300         * UIProcess/ios/PageClientImplIOS.mm:
301         (WebKit::PageClientImpl::isViewWindowActive): Add NULL check for m_webView.
302         (WebKit::PageClientImpl::isViewFocused): Ditto.
303
304 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
305
306         Clean up related to wheelEvent names
307         https://bugs.webkit.org/show_bug.cgi?id=142713
308
309         Reviewed by Anders Carlsson.
310
311         Add EventNames::isWheelEventType() and use it in places that test for the
312         two wheel event names.
313
314         * WebProcess/Plugins/PluginView.cpp:
315         (WebKit::PluginView::handleEvent):
316
317 2015-03-15  Dan Bernstein  <mitz@apple.com>
318
319         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
320         https://bugs.webkit.org/show_bug.cgi?id=142702
321
322         Reviewed by Anders Carlsson.
323
324         * UIProcess/API/Cocoa/WKWebView.mm:
325         (-[WKWebView becomeFirstResponder]): Override to delegate first responder status to the
326         WKContentView if possible.
327         (-[WKWebView _retainActiveFocusedState]): New SPI that prevents view hierarchy changes from
328         affecting the active and focused state of the view. Increments a counter ivar and returns a
329         completion block (which callers must call when they’re done) that decrements it back.
330         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared new _activeFocusedStateRetainCount ivar
331         with @package access.
332         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method.
333
334         * UIProcess/ios/PageClientImplIOS.mm:
335         (WebKit::PageClientImpl::isViewWindowActive): Return true if active/focused state is to be
336         maintained despite not being visible.
337         (WebKit::PageClientImpl::isViewFocused): Return true if active/focused state is to be
338         maintained despite not being active.
339
340         * UIProcess/ios/WKContentViewInteraction.mm:
341         (-[WKContentView resignFirstResponder]): Don’t blur the assisted node if active/focused
342         state is to be maintained.
343
344 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
345
346         Clean up use of flags in localToContainer-type functions
347         https://bugs.webkit.org/show_bug.cgi?id=142704
348
349         Reviewed by Alexey Proskuryakov.
350         
351         Pass UseTransforms explicitly to localToContainerPoint()
352
353         * WebProcess/WebPage/ios/WebPageIOS.mm:
354         (WebKit::WebPage::getAssistedNodeInformation):
355
356 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
357
358         [iOS] scroll snap points are animating to the wrong positions.
359         https://bugs.webkit.org/show_bug.cgi?id=142705
360         <rdar://problem/20136946>
361
362         Reviewed by Simon Fraser.
363
364         Scroll snapping was landing in the wrong place on iOS because of two problems:
365         (1) It was searching for the closest snap offset point using unscaled 'screen' pixels,
366         which caused it to always choose one of the earliest snap point options.
367         (2) It was then selecting a scaled snap point coordinate and passing it back to UIKit
368         to animate the snap. This caused it to select a target point beyond the 'screen' pixel
369         we want to hit.
370         
371         The solution to both problems are to scale the scroll destination UIKit suggests so that
372         we search among the scaled points with a valid value. Then, we need to scale the returned
373         value back to screen units before handing it back to UIKit to process.
374
375         * UIProcess/API/Cocoa/WKWebView.mm:
376         (-[WKWebView scrollViewWillBeginDragging:]): Drive-by fix. Get rid of extra ';' at
377         the end of the line.
378         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
379         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
380
381 2015-03-14  Dean Jackson  <dino@apple.com>
382
383         Feature flag for Animations Level 2
384         https://bugs.webkit.org/show_bug.cgi?id=142699
385         <rdar://problem/20165097>
386
387         Reviewed by Brent Fulgham.
388
389         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
390
391         * Configurations/FeatureDefines.xcconfig:
392
393 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
394
395         [GStreamer] share GL context in pipeline
396         https://bugs.webkit.org/show_bug.cgi?id=142693
397
398         Reviewed by Philippe Normand.
399
400         * WebProcess/gtk/WebProcessMainGtk.cpp: Enable XInitThreads() if
401         GSTREAMER_GL is used, since GstGL elements use another thread for
402         queuing GL operations.
403
404 2015-03-13  Alex Christensen  <achristensen@webkit.org>
405
406         Progress towards CMake on Mac.
407         https://bugs.webkit.org/show_bug.cgi?id=142680
408
409         Reviewed by Gyuyoung Kim.
410
411         * PlatformMac.cmake: Added.
412
413 2015-03-13  Commit Queue  <commit-queue@webkit.org>
414
415         Unreviewed, rolling out r181483.
416         https://bugs.webkit.org/show_bug.cgi?id=142688
417
418         Caused use-after-free on many tests (Requested by ap on
419         #webkit).
420
421         Reverted changeset:
422
423         "Allow clients to selectively disable plug-ins"
424         https://bugs.webkit.org/show_bug.cgi?id=142506
425         http://trac.webkit.org/changeset/181483
426
427 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
428
429         [Mac] Enable WIRELESS_PLAYBACK_TARGET
430         https://bugs.webkit.org/show_bug.cgi?id=142635
431
432         Reviewed by Darin Adler.
433
434         * Configurations/FeatureDefines.xcconfig:
435
436 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
437
438         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
439         https://bugs.webkit.org/show_bug.cgi?id=142664
440         <rdar://problem/18859470>
441
442         Reviewed by Benjamin Poulain.
443
444         * UIProcess/ios/WKScrollView.mm:
445         (-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]):
446         Now that the WKContentView can (without pinching) be smaller than the unobscured
447         region of the WKWebView, we need to take that into account when deciding where
448         to retarget scrolling.
449
450 2015-03-13  Mark Lam  <mark.lam@apple.com>
451
452         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
453         <https://webkit.org/b/142674>
454
455         Reviewed by Filip Pizlo.
456
457         * WebProcess/WebPage/EventDispatcher.cpp:
458         (WebKit::EventDispatcher::EventDispatcher):
459         * WebProcess/WebPage/EventDispatcher.h:
460         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
461         (WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
462         * WebProcess/WebPage/ViewUpdateDispatcher.h:
463
464 2015-03-10  Conrad Shultz  <conrad_shultz@apple.com>
465
466         Allow clients to selectively disable plug-ins
467         https://bugs.webkit.org/show_bug.cgi?id=142506
468
469         Reviewed by Anders Carlsson.
470
471         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
472         from the page). As part of this:
473
474         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
475            set of plug-ins.
476
477         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
478            down the stack.
479
480         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
481            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
482
483         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
484
485         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
486         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
487
488         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
489         (WebKit::NetscapePluginModule::getPluginInfo):
490         Set new PluginInfo members.
491
492         * Shared/WebCoreArgumentCoders.cpp:
493         (IPC::ArgumentCoder<PluginInfo>::encode):
494         Handle new PluginInfo members.
495         (IPC::ArgumentCoder<PluginInfo>::decode):
496         Ditto.
497
498         * Shared/WebProcessCreationParameters.h:
499         Declare a member to store client plug-in policies.
500
501         * Shared/WebProcessCreationParameters.cpp:
502         (WebKit::WebProcessCreationParameters::encode):
503         Encode the policies.
504         (WebKit::WebProcessCreationParameters::decode):
505         Decode the policies.
506
507         * UIProcess/API/C/WKAPICast.h:
508         (WebKit::toWKPluginLoadClientPolicy):
509         Teach how to cast between WebCore and WebKit2 policy definitions.
510         (WebKit::toPluginLoadClientPolicy):
511         Ditto.
512
513         * UIProcess/API/C/WKPluginLoadPolicy.h:
514         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
515
516         * UIProcess/API/C/mac/WKContextPrivateMac.h:
517         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
518         (WKContextSetPluginLoadClientPolicy):
519         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
520         (WKContextClearPluginClientPolicies):
521         New function; wrap WebProcessPool::clearPluginClientPolicies().
522
523         * UIProcess/WebProcessPool.h:
524         * UIProcess/WebProcessPool.cpp:
525         (WebKit::WebProcessPool::createNewWebProcess):
526         Copy any client plug-in policies to the new process' creation parameters.
527         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
528         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
529         (WebKit::WebProcessPool::clearPluginClientPolicies):
530         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
531
532         * WebProcess/Plugins/PDF/PDFPlugin.mm:
533         (WebKit::PDFPlugin::pluginInfo):
534         Set new PluginInfo member.
535
536         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
537         (WebKit::pluginSupportsExtension):
538         Adopt getWebVisibleMimesAndPluginIndices().
539         (WebKit::WebFrameLoaderClient::objectContentType):
540         Update to reflect reflect function rename.
541
542         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
543         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
544         (WebKit::WebPlatformStrategies::getPluginInfo):
545         Pass the Page to populatePluginCache().
546         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
547         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
548         to block on the current page.
549         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
550         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
551         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
552         New member function; empty m_hostsToPluginIdentifierData.
553         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
554         New member function; look up the most specific policy for the given plug-in and host.
555         (WebKit::WebPlatformStrategies::populatePluginCache):
556         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
557         been populated since the Page, and therefore host, may change.
558
559         * WebProcess/WebPage/WebPage.cpp:
560         (WebKit::WebPage::canShowMIMEType):
561         Update to reflect function rename.
562
563         * WebProcess/WebProcess.h:
564         * WebProcess/WebProcess.cpp:
565         (WebKit::WebProcess::initializeWebProcess):
566         Enumerate and process the client plug-in policies in the creation parameters.
567         (WebKit::WebProcess::setPluginLoadClientPolicy):
568         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
569         (WebKit::WebProcess::clearPluginClientPolicies):
570         New member function; wrap PluginStrategy::clearPluginClientPolicies().
571
572         * WebProcess/WebProcess.messages.in:
573         Add messages for setting and clearing policies.
574
575 2015-03-12  Jon Honeycutt  <jhoneycutt@apple.com>
576
577         Use UIDocumentMenuViewController to allow selection of files from
578         iCloud Drive in WKFileUploadPanel
579
580         Part of <https://bugs.webkit.org/show_bug.cgi?id=142596> WebKit on
581         iOS should support file upload from iCloud Drive
582         <rdar://problem/12178991>
583
584         Reviewed by Andy Estes.
585
586         * Platform/spi/ios/UIKitSPI.h:
587         Include UIDocumentMenuViewController_Private.h if it exists. If not,
588         declare this new SPI.
589
590         * UIProcess/ios/forms/WKFileUploadPanel.mm:
591         (fallbackIconForFile):
592         Create a UIDocumentInteractionController for the file, and return a
593         thumbnail image from its smallest icon.
594
595         (iconForImageFile):
596         If we can get a UIImage from the file, create a thumbnail from it.
597         Otherwise, call fallbackIconForFile().
598
599         (iconForVideoFile):
600         Code moved from -[_WKVideoFileUploadItem displayImage].
601
602         (iconForFile):
603         Get the file's extension, and get the extension's preferred UTI. If the
604         UTI is an image type, call iconForImageFile(). If it's a video type,
605         call iconForVideoFile(). Otherwise, return the fallback icon.
606
607         (-[_WKFileUploadItem initWithFileURL:]):
608         Added an initializer that takes a file URL.
609
610         (-[_WKFileUploadItem fileURL]):
611         (-[_WKImageFileUploadItem initWithFileURL:originalImage:]):
612         (-[_WKVideoFileUploadItem displayImage]):
613         (WKFileUploadPanel):
614         Inherit from UIDocumentPickerDelegate and UIDocumentMenuDelegate. Add
615         an ivar for the document menu controller.
616
617         (-[WKFileUploadPanel dealloc]):
618         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
619         If instances of UIDocumentMenuViewController respond to
620         -_setIgnoreApplicationEntitlementForImport:, meaning we can disable the
621         assertion that the current app has the iCloud Documents entitlement,
622         then show the document picker menu. Otherwise, show the current source
623         selection UI. The runtime check will be removed when a newer UIKit is
624         available.
625
626         (UTIsForMIMETypes):
627         Return the UTIs for the <input> element's "accept" attribute's MIME
628         type list.
629
630         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
631         Call UTIsForMIMETypes(). Fall back to available source types for this
632         picker type.
633
634         (-[WKFileUploadPanel _documentPickerMenuMediaTypes]):
635         Call UTIsForMIMETypes(). Fall back to the all-encompassing
636         "public.item" UTI.
637
638         (-[WKFileUploadPanel _photoLibraryButtonLabel]):
639         (-[WKFileUploadPanel _cameraButtonLabel]):
640         Factored out of -_showMediaSourceSelectionSheet. Return the
641         appropriate label for the camera button, based on whether it can take a
642         photo or video, or return nil if the camera is not available.
643
644         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
645         Changed to use -_cameraButtonLabel and
646         -_presentForCurrentInterfaceIdiom:.
647
648         (-[WKFileUploadPanel _showDocumentPickerMenu]):
649         Create a UIDocumentMenuViewController, and populate it with options to
650         open the photo library or take a picture or video. If iCloud Drive or
651         other document sources are available, they will be added automatically.
652
653         (-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]):
654         (-[WKFileUploadPanel documentMenu:didPickDocumentPicker:]):
655         (-[WKFileUploadPanel documentMenuWasCancelled:]):
656         (-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
657         (-[WKFileUploadPanel documentPickerWasCancelled:]):
658         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
659
660         (-[_WKImageFileUploadItem initWithFilePath:originalImage:]): Deleted.
661         (-[_WKImageFileUploadItem fileURL]): Deleted.
662         (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]): Deleted.
663         (-[_WKVideoFileUploadItem fileURL]): Deleted.
664
665 2015-03-11  Enrica Casucci  <enrica@apple.com>
666
667         Adopt new API for keyboard event handling.
668         https://bugs.webkit.org/show_bug.cgi?id=142602
669         rdar://problem/19966087
670
671         Reviewed by Sam Weinig.
672
673         Adopts the new API.
674
675         * UIProcess/ios/WKContentViewInteraction.mm:
676         (-[WKContentView _didHandleKeyEvent:]):
677
678 2015-03-12  Alexey Proskuryakov  <ap@apple.com>
679
680         testRunner.setAlwaysAcceptCookies does not work with NetworkProcess
681         https://bugs.webkit.org/show_bug.cgi?id=138687
682
683         Reviewed by Carlos Garcia Campos.
684
685         * UIProcess/WebCookieManagerProxy.cpp:
686         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): Don't change system-wide
687         cookie accept policy when in testing mode. Also, update the policy in WebProcesses too,
688         as we still do some networking there.
689
690         * UIProcess/WebProcessPool.h:
691         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
692         (WKBundleSetAlwaysAcceptCookies): Deleted.
693         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
694         * WebProcess/InjectedBundle/InjectedBundle.cpp:
695         (WebKit::InjectedBundle::setAlwaysAcceptCookies): Deleted.
696         * WebProcess/InjectedBundle/InjectedBundle.h:
697         Remove WKBundleSetAlwaysAcceptCookies SPI, as WKTR now uses an API in UI process.
698
699 2015-03-12  Anders Carlsson  <andersca@apple.com>
700
701         WKErrorDomain should be declared nonnull
702         https://bugs.webkit.org/show_bug.cgi?id=142628
703
704         Reviewed by Antti Koivisto.
705
706         Add WK_ASSUME_NONNULL_BEGIN and WK_ASSUME_NONNULL_END so everything will be implicitly nonnull.
707
708         * UIProcess/API/Cocoa/WKError.h:
709
710 2015-03-12  Ian Henderson  <ian@ianhenderson.org>
711
712         PDFs don't snapshot properly in iOS Safari
713         https://bugs.webkit.org/show_bug.cgi?id=142623
714
715         Reviewed by Tim Horton.
716
717         * UIProcess/API/Cocoa/WKWebView.mm:
718         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
719         If we have a _customContentView, use UIView snapshotting instead of
720         trying to snapshot the web page.
721
722 2015-03-12  Eric Carlson  <eric.carlson@apple.com>
723
724         [Mac] Update AirPlay handling
725         https://bugs.webkit.org/show_bug.cgi?id=142541
726
727         Unreviewed, respond to post-review comments and add previously reviewed changes
728         missed by a bungled merge.
729
730         * Shared/mac/WebCoreArgumentCodersMac.mm:
731         * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp:
732         (WebKit::WebMediaPlaybackTargetPickerProxy::~WebMediaPlaybackTargetPickerProxy):
733         * UIProcess/mac/PageClientImpl.h:
734         * UIProcess/mac/PageClientImpl.mm:
735         (WebKit::PageClientImpl::createPlaybackTargetPicker):
736         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Added.
737         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Added.
738         * WebKit2.xcodeproj/project.pbxproj:
739         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
740         * WebProcess/WebCoreSupport/WebChromeClient.h:
741         * WebProcess/WebPage/WebPage.h:
742         * WebProcess/WebPage/WebPage.messages.in:
743         * WebProcess/WebPage/mac/WebPageMac.mm:
744         * WebProcess/com.apple.WebProcess.sb.in:
745
746 2015-03-11  Antti Koivisto  <antti@apple.com>
747
748         Cache traversal missing large entries
749         https://bugs.webkit.org/show_bug.cgi?id=142601
750
751         Reviewed by Andreas Kling.
752
753         When traversing cache entries we only read the header data from disk. This didn't work
754         correctly for entries larger than the read size.
755
756         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
757         (WebKit::NetworkCache::IOChannel::read):
758
759             Partial reads only receive one callback with 'done' set to true.
760             Ensure we actually return data in this case.
761
762         * NetworkProcess/cache/NetworkCacheStorage.cpp:
763         (WebKit::NetworkCache::decodeEntryHeader):
764
765             Add some logging.
766
767 2015-03-11  Eric Carlson  <eric.carlson@apple.com>
768
769         [Mac] Update AirPlay handling
770         https://bugs.webkit.org/show_bug.cgi?id=142541
771
772         Reviewed by Sam Weinig.
773
774         * Shared/WebCoreArgumentCoders.h:
775         * Shared/mac/WebCoreArgumentCodersMac.mm:
776         (IPC::ArgumentCoder<AVPlaybackTarget>::encode):
777         (IPC::ArgumentCoder<AVPlaybackTarget>::decode):
778         * UIProcess/PageClient.h:
779         * UIProcess/WebAVPlaybackTargetPickerProxy.cpp: Added.
780         (WebKit::WebAVPlaybackTargetPickerProxy::WebAVPlaybackTargetPickerProxy):
781         (WebKit::WebAVPlaybackTargetPickerProxy::~WebAVPlaybackTargetPickerProxy):
782         (WebKit::WebAVPlaybackTargetPickerProxy::showPlaybackTargetPicker):
783         (WebKit::WebAVPlaybackTargetPickerProxy::startingMonitoringPlaybackTargets):
784         (WebKit::WebAVPlaybackTargetPickerProxy::stopMonitoringPlaybackTargets):
785         * UIProcess/WebAVPlaybackTargetPickerProxy.h: Added.
786         (WebKit::WebAVPlaybackTargetPickerProxy::Client::~Client):
787         * UIProcess/WebPageProxy.cpp:
788         (WebKit::WebPageProxy::devicePickerProxy):
789         (WebKit::WebPageProxy::showPlaybackTargetPicker):
790         (WebKit::WebPageProxy::startingMonitoringPlaybackTargets):
791         (WebKit::WebPageProxy::stopMonitoringPlaybackTargets):
792         (WebKit::WebPageProxy::didChoosePlaybackTarget):
793         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
794         * UIProcess/WebPageProxy.h:
795         * UIProcess/WebPageProxy.messages.in:
796         * UIProcess/mac/PageClientImpl.h:
797         * UIProcess/mac/PageClientImpl.mm:
798         (WebKit::PageClientImpl::createPlaybackTargetPicker):
799         * UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.h: Added.
800         * UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.mm: Added.
801         (WebKit::WebAVPlaybackTargetPickerProxyMac::create):
802         (WebKit::WebAVPlaybackTargetPickerProxyMac::WebAVPlaybackTargetPickerProxyMac):
803         (WebKit::WebAVPlaybackTargetPickerProxyMac::~WebAVPlaybackTargetPickerProxyMac):
804         (WebKit::WebAVPlaybackTargetPickerProxyMac::outputeDeviceAvailabilityChangedTimerFired):
805         (WebKit::WebAVPlaybackTargetPickerProxyMac::availableDevicesDidChange):
806         (WebKit::WebAVPlaybackTargetPickerProxyMac::devicePicker):
807         (WebKit::WebAVPlaybackTargetPickerProxyMac::showPlaybackTargetPicker):
808         (WebKit::WebAVPlaybackTargetPickerProxyMac::currentDeviceDidChange):
809         (WebKit::WebAVPlaybackTargetPickerProxyMac::startingMonitoringPlaybackTargets):
810         (WebKit::WebAVPlaybackTargetPickerProxyMac::stopMonitoringPlaybackTargets):
811         (-[WebAVOutputDevicePickerMenuControllerHelper initWithCallback:]):
812         (-[WebAVOutputDevicePickerMenuControllerHelper clearCallback]):
813         (-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
814         * WebKit2.xcodeproj/project.pbxproj:
815         * WebProcess/WebCoreSupport/WebAVPlaybackTargetPicker.cpp: Added.
816         (WebKit::WebAVPlaybackTargetPicker::WebAVPlaybackTargetPicker):
817         (WebKit::WebAVPlaybackTargetPicker::showPlaybackDevicePicker):
818         (WebKit::WebAVPlaybackTargetPicker::configureWireLessTargetMonitoring):
819         (WebKit::WebAVPlaybackTargetPicker::addClient):
820         (WebKit::WebAVPlaybackTargetPicker::removeClient):
821         (WebKit::WebAVPlaybackTargetPicker::didChoosePlaybackTarget):
822         (WebKit::WebAVPlaybackTargetPicker::playbackTargetAvailabilityDidChange):
823         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
824         (WebKit::WebChromeClient::showPlaybackTargetPicker):
825         (WebKit::WebChromeClient::startingMonitoringPlaybackTargets):
826         (WebKit::WebChromeClient::stopMonitoringPlaybackTargets):
827         * WebProcess/WebCoreSupport/WebChromeClient.h:
828         * WebProcess/WebPage/WebPage.h:
829         * WebProcess/WebPage/WebPage.messages.in:
830         * WebProcess/WebPage/mac/WebPageMac.mm:
831         (WebKit::WebPage::playbackTargetSelected):
832         (WebKit::WebPage::playbackTargetAvailabilityDidChange):
833         * WebProcess/com.apple.WebProcess.sb.in:
834
835 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
836
837         Fix the build
838
839         Unreviewed.
840
841         * Shared/Downloads/mac/DownloadMac.mm:
842         (WebKit::Download::start):
843         (WebKit::Download::resume):
844
845 2015-03-10  Sam Weinig  <sam@webkit.org>
846
847         Allow adding a button in input elements for auto fill related functionality
848         <rdar://problem/19782066>
849         https://bugs.webkit.org/show_bug.cgi?id=142564
850
851         Reviewed by Anders Carlsson.
852
853         - Adds new SPI to respond to clicks on the AutoFill button (both bundle and UIProcess).
854         - Adds new SPI to enable/disable the display of the AutoFill button on an element.
855         - Adds new SPI to get the bounds of the AutoFill button.
856         - Updates spelling of AutoFill to be consistent.
857
858         * UIProcess/API/APIUIClient.h:
859         (API::UIClient::didClickAutoFillButton):
860         * UIProcess/API/C/WKPage.cpp:
861         (WKPageSetPageUIClient):
862         * UIProcess/API/C/WKPageUIClient.h:
863         * UIProcess/WebPageProxy.cpp:
864         (WebKit::WebPageProxy::handleAutoFillButtonClick):
865         * UIProcess/WebPageProxy.h:
866         * UIProcess/WebPageProxy.messages.in:
867         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
868         (API::InjectedBundle::PageUIClient::didClickAutoFillButton):
869         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
870         (WebKit::InjectedBundlePageUIClient::didClickAutoFillButton):
871         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
872         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
873         (WebKit::WebChromeClient::handleAutoFillButtonClick):
874         * WebProcess/WebCoreSupport/WebChromeClient.h:
875         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
876         Pipe the didClickAutoFillButton to the SPI layer.
877
878         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
879         (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilled]):
880         (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilled:]):
881         Update for new spelling of AutoFill.
882
883         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
884         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
885         (WKBundleNodeHandleGetHTMLInputElementAutoFilled):
886         (WKBundleNodeHandleSetHTMLInputElementAutoFilled):
887         Added. Replaces WKBundleNodeHandleGetHTMLInputElementAutofilled/WKBundleNodeHandleSetHTMLInputElementAutofilled
888         which are now deprecated due to inconsistent spelling of AutoFill.
889
890         (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled):
891         (WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabled):
892         (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonBounds):
893         Added.
894
895         (WKBundleNodeHandleGetHTMLInputElementAutofilled):
896         (WKBundleNodeHandleSetHTMLInputElementAutofilled):
897         Deprecated.
898
899         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
900         (WebKit::InjectedBundleNodeHandle::getOrCreate):
901         (WebKit::InjectedBundleNodeHandle::create):
902         (WebKit::InjectedBundleNodeHandle::InjectedBundleNodeHandle):
903         (WebKit::InjectedBundleNodeHandle::~InjectedBundleNodeHandle):
904         (WebKit::InjectedBundleNodeHandle::coreNode):
905         (WebKit::InjectedBundleNodeHandle::document):
906         (WebKit::InjectedBundleNodeHandle::elementBounds):
907         (WebKit::InjectedBundleNodeHandle::renderRect):
908         (WebKit::InjectedBundleNodeHandle::renderedImage):
909         (WebKit::InjectedBundleNodeHandle::visibleRange):
910         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementValueForUser):
911         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilled):
912         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilled):
913         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFillButtonEnabled):
914         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFillButtonEnabled):
915         (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonBounds):
916         (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
917         (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
918         (WebKit::InjectedBundleNodeHandle::isTextField):
919         (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
920         (WebKit::InjectedBundleNodeHandle::documentFrame):
921         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
922         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
923         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutofilled): Deleted.
924         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutofilled): Deleted.
925         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
926         Fix-up InjectedBundleNodeHandle to store its underlying Node in a Ref, rather than a RefPtr.
927         Add helpers to implement the new SPI for WKBundleNodeHandleRef.
928
929 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
930
931         Make it possible to zoom on pages that claim to lay out to device size and then fail to do so
932         https://bugs.webkit.org/show_bug.cgi?id=142549
933
934         Reviewed by Simon Fraser.
935
936         * Shared/WebPreferencesDefinitions.h:
937         * WebProcess/WebPage/WebPage.cpp:
938         (WebKit::WebPage::updatePreferences):
939         Flip the pref on by default.
940
941 2015-03-11  Carlos Garcia Campos  <cgarcia@igalia.com>
942
943         [GTK] Do not look for child processes in the UI process binary path
944         https://bugs.webkit.org/show_bug.cgi?id=135752
945
946         Reviewed by Gustavo Noronha Silva.
947
948         It's only useful for internal tools and tests, but never when
949         installed, since we don't install the processes in the bin dir but
950         in the libexec dir.
951
952         * Shared/gtk/ProcessExecutablePathGtk.cpp:
953         (WebKit::findWebKitProcess): Only look or the executables in the
954         UI process binary path or WEBKIT_EXEC_PATH for development builds.
955         * UIProcess/API/gtk/WebKitWebContext.cpp:
956         (injectedBundleDirectory): Only check
957         WEBKIT_INJECTED_BUNDLE_PATH env var for development builds.
958
959 2015-03-10  Antti Koivisto  <antti@apple.com>
960
961         Add interface to delete disk cache entries
962         https://bugs.webkit.org/show_bug.cgi?id=142546
963
964         Reviewed by Anders Carlsson.
965
966         * NetworkProcess/cache/NetworkCache.cpp:
967         (WebKit::NetworkCache::Cache::remove):
968         * NetworkProcess/cache/NetworkCache.h:
969         * NetworkProcess/cache/NetworkCacheStorage.cpp:
970         (WebKit::NetworkCache::Storage::Storage):
971         (WebKit::NetworkCache::Storage::remove):
972
973             Move deletion to a serial queue so we can't create large number of threads.
974
975         (WebKit::NetworkCache::Storage::dispatchReadOperation):
976         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
977         (WebKit::NetworkCache::Storage::removeEntry): Deleted.
978         * NetworkProcess/cache/NetworkCacheStorage.h:
979         (WebKit::NetworkCache::Storage::deleteQueue):
980
981 2015-03-10  Chris Dumez  <cdumez@apple.com>
982
983         5 tests fail on Apple Mac WK2 performance bots
984         https://bugs.webkit.org/show_bug.cgi?id=142485
985
986         Reviewed by Andreas Kling.
987
988         Only log errors in debug builds if SandboxExtension::createHandle() fails
989         so that performance tests don't fail because of it. Such error is not
990         fatal and is expected under certain circumstances. In particular,
991         SandboxExtension::createHandle() is sometimes called for non-existing
992         files (e.g. from NetworkResourceLoadParameters::encode()).
993
994         * Shared/mac/SandboxExtensionMac.mm:
995         (WebKit::SandboxExtension::createHandle):
996
997 2015-03-10  Timothy Horton  <timothy_horton@apple.com>
998
999         Fix the build
1000
1001         * Shared/Downloads/ios/DownloadIOS.mm:
1002         (WebKit::Download::startWithHandle):
1003         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
1004         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:connection:]):
1005
1006 2015-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1007
1008         [GTK] Contents not shown when entering AC mode unless the window is resized
1009         https://bugs.webkit.org/show_bug.cgi?id=142347
1010
1011         Reviewed by Žan Doberšek.
1012
1013         The problem is once again that we are now creating the redirected
1014         X window in realize method. When entering AC mode we resize the
1015         redirected window to the drawing area size. Since the size hasn't
1016         changed from the drawing area point of view, the web process is
1017         not notified. The WebProcess always uses the window size, instead
1018         of the root layer size, to make sure it's in sync, see the comment
1019         in LayerTreeHostGtk::compositeLayersToContext(). So, we need to
1020         enforce a resize when we change the size of the redirected window
1021         when entering AC mode.
1022
1023         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1024         (webkitWebViewBaseEnterAcceleratedCompositingMode):
1025         * UIProcess/DrawingAreaProxyImpl.h:
1026         (WebKit::DrawingAreaProxyImpl::forceResize):
1027
1028 2015-03-10  Csaba Osztrogonác  <ossy@webkit.org>
1029
1030         [cmake] Handle unused parameter warnings as build errors except in WebKit2
1031         https://bugs.webkit.org/show_bug.cgi?id=142338
1032
1033         Reviewed by Gyuyoung Kim.
1034
1035         * CMakeLists.txt:
1036
1037 2015-03-10  Dan Bernstein  <mitz@apple.com>
1038
1039         WebKit2 part of <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
1040         https://bugs.webkit.org/show_bug.cgi?id=142461
1041
1042         Reviewed by Sam Weinig.
1043
1044         * UIProcess/API/Cocoa/WKWebView.mm:
1045         (-[WKWebView initWithFrame:configuration:]): Initialize
1046         webPageConfiguration.treatsSHA1SignedCertificatesAsInsecure from the WKWebViewConfiguration.
1047
1048         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1049         Added _treatsSHA1SignedCertificatesAsInsecure ivar.
1050         (-[WKWebViewConfiguration copyWithZone:]): Copy _treatsSHA1SignedCertificatesAsInsecure.
1051         (-[WKWebViewConfiguration _treatsSHA1SignedCertificatesAsInsecure]): Added this getter.
1052         (-[WKWebViewConfiguration _setTreatsSHA1SignedCertificatesAsInsecure:]): Added this setter.
1053
1054         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Declared new
1055         _treatsSHA1SignedCertificatesAsInsecure property.
1056
1057         * UIProcess/PageLoadState.cpp:
1058         (WebKit::PageLoadState::didCommitLoad): Use new hasInsecureContent parameter to initialize
1059         hasInsecureContent parameter in the uncommitted state.
1060         * UIProcess/PageLoadState.h:
1061
1062         * UIProcess/WebPageProxy.cpp:
1063         (WebKit::WebPageProxy::WebPageProxy): Initialize new m_treatsSHA1CertificatesAsInsecure
1064         member variable from the WebPageConfiguration.
1065         (WebKit::WebPageProxy::didCommitLoadForFrame): Pass true for the new hasInsecureContent to
1066         PageLoadState::didCommitLoad if we are treating SHA1-signed certificates as insecure and
1067         the certificate info contains a non-root SHA1-signed certificate.
1068         * UIProcess/WebPageProxy.h: Added m_treatsSHA1CertificatesAsInsecure member variable.
1069
1070 2015-03-09  Geoffrey Garen  <ggaren@apple.com>
1071
1072         bmalloc: tryFastMalloc shouldn't crash
1073         https://bugs.webkit.org/show_bug.cgi?id=142443
1074
1075         Reviewed by Anders Carlsson.
1076
1077         Part 1: Stop using tryFastRealloc.
1078
1079         * Shared/ShareableBitmap.cpp:
1080         (WebKit::ShareableBitmap::resize): Deleted.
1081         * Shared/ShareableBitmap.h: Removed the resize function because it has
1082         no clients.
1083
1084         * WebProcess/Plugins/PluginProxy.cpp:
1085         (WebKit::PluginProxy::updateBackingStore): Changed to allocate a new
1086         backing store instead of resizing the old one. This has three advantages:
1087
1088         (1) Might be more memory-efficient, since you don't have to keep the old
1089         one around while allocating the new one.
1090
1091         (2) Avoids the overhead of realloc() copying the contents of the old
1092         backing store even though we only want uninitialized memory.
1093
1094         (3) Makes resize failure consistent with initial allocation failure.
1095         Previously, while initial allocation failure would set the backing store
1096         to null, resize failure would keep the old wrong backing store and then
1097         tell it not to paint. Now, resize failure also sets the backing store to
1098         null.
1099
1100 2015-03-09  Martin Robinson  <mrobinson@igalia.com>
1101
1102         [EFL] Move DispatchQueue to WTF
1103         https://bugs.webkit.org/show_bug.cgi?id=142493
1104
1105         Reviewed by Csaba Osztrogonác.
1106
1107         * PlatformEfl.cmake: Remove DispatchQueue from the source list.
1108
1109 2015-03-08  Dean Jackson  <dino@apple.com>
1110
1111         [iOS Media] Video buffer progress missing on iPhones
1112         https://bugs.webkit.org/show_bug.cgi?id=142462
1113
1114         Reviewed by Eric Carlson.
1115
1116         Coordinate the SetBufferedTime message between the Web and UI
1117         processes.
1118
1119         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: New message SetBufferedTime.
1120         * WebProcess/ios/WebVideoFullscreenManager.h:
1121         * WebProcess/ios/WebVideoFullscreenManager.mm:
1122         (WebKit::WebVideoFullscreenManager::setBufferedTime):
1123
1124 2015-03-08  Sam Weinig  <sam@webkit.org>
1125
1126         [Content Extensions] Add scaffolding for the WKUserContentExtensionStore
1127         https://bugs.webkit.org/show_bug.cgi?id=142464
1128
1129         Reviewed by Dan Bernstein.
1130
1131         * Shared/API/APIObject.h:
1132         Add a UserContentExtensionStore type and move the UserContentExtension type into the correct section (UIProcess).
1133
1134         * Shared/API/c/WKBase.h:
1135         Add the WKUserContentExtensionStoreRef C-SPI type.
1136
1137         * Shared/Cocoa/APIObject.mm:
1138         (API::Object::newObject):
1139         Add allocation support for UserContentExtensionStore (and UserContentExtension while we are there, it will be
1140         needed shortly).
1141
1142         * UIProcess/API/APIUserContentExtensionStore.cpp: Added.
1143         (API::UserContentExtensionStore::UserContentExtensionStore):
1144         (API::UserContentExtensionStore::~UserContentExtensionStore):
1145         * UIProcess/API/APIUserContentExtensionStore.h: Added.
1146         Stub out the UserContentExtensionStore.
1147
1148         * UIProcess/API/C/WKAPICast.h:
1149         Add casting for the UserContentExtensionStore.
1150
1151         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: Added.
1152         (WKUserContentExtensionStoreGetTypeID):
1153         * UIProcess/API/C/WKUserContentExtensionStoreRef.h: Added.
1154         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h: Added.
1155         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: Added.
1156         (-[_WKUserContentExtensionStore init]):
1157         (-[_WKUserContentExtensionStore dealloc]):
1158         (-[_WKUserContentExtensionStore _apiObject]):
1159         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h: Added.
1160         (WebKit::wrapper):
1161         Stub out SPI for the UserContentExtensionStore.
1162
1163         * WebKit2.xcodeproj/project.pbxproj:
1164         * CMakeLists.txt:
1165         Add new files.
1166
1167 2015-03-08  Sam Weinig  <sam@webkit.org>
1168
1169         AX: Expose a frame's accessible name through WK2 C SPI
1170         <rdar://problem/19653068>
1171         https://bugs.webkit.org/show_bug.cgi?id=142468
1172
1173         Reviewed by Dan Bernstein.
1174
1175         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1176         (WKBundleFrameSetAccessibleName):
1177         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
1178         * WebProcess/WebPage/WebFrame.cpp:
1179         (WebKit::WebFrame::setAccessibleName):
1180         * WebProcess/WebPage/WebFrame.h:
1181         Add SPI to set a frame's accessible name. This matches the Legacy WebKit SPI -[WebFrame setAccessibleName:]. 
1182
1183 2015-03-08  Sam Weinig  <sam@webkit.org>
1184
1185         [Content Extensions] Pass compiled content extensions as read-only shared memory rather than copying them
1186         https://bugs.webkit.org/show_bug.cgi?id=142458
1187
1188         Reviewed by Dan Bernstein.
1189
1190         * Shared/WebCompiledContentExtensionData.cpp:
1191         (WebKit::WebCompiledContentExtensionData::encode):
1192         (WebKit::WebCompiledContentExtensionData::decode):
1193         * Shared/WebCompiledContentExtensionData.h:
1194         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
1195         Store the compiled data as a SharedMemory block with offset/size pairs for the
1196         bytecode and actions. While the bytecode offset is currently always 0, this won't
1197         be the case when we map these in from files due to metadata that will be placed
1198         at the top of the files.
1199
1200         * Shared/WebCompiledContentExtension.h:
1201         * Shared/WebCompiledContentExtension.cpp:
1202         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
1203         Temporary creation helper. In subsequent patches, this will be removed and replaced
1204         by always passing in shared/mapped data.
1205
1206         (WebKit::WebCompiledContentExtension::create):
1207         (WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
1208         (WebKit::WebCompiledContentExtension::bytecode):
1209         (WebKit::WebCompiledContentExtension::bytecodeLength):
1210         (WebKit::WebCompiledContentExtension::actions):
1211         (WebKit::WebCompiledContentExtension::actionsLength):
1212         Convert to work with the new WebCompiledContentExtension format.
1213         
1214         * UIProcess/API/C/WKUserContentFilterRef.cpp:
1215         (WKUserContentFilterCreate):
1216         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1217         (-[_WKUserContentFilter initWithName:serializedRules:]):
1218         Switch to using WebCompiledContentExtension::createFromCompiledContentExtensionData().
1219
1220         * WebProcess/UserContent/WebUserContentController.cpp:
1221         (WebKit::WebUserContentController::addUserContentExtensions):
1222         * WebProcess/WebPage/WebPageGroupProxy.cpp:
1223         (WebKit::WebPageGroupProxy::addUserContentExtension):
1224         Update to pass the WebCompiledContentExtensionData directly to the WebCompiledContentExtension.
1225
1226 2015-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1227
1228         Remove willDestroyFrame in WKBundlePageLoaderClient
1229         https://bugs.webkit.org/show_bug.cgi?id=142389
1230
1231         Reviewed by Anders Carlsson.
1232
1233         I added willDestroyFrame in r154540 but I realized recently that
1234         it has never actually worked. Adding the callback to
1235         WKBundlePageLoaderClient was the first mistake, since frames are
1236         handled by WebProcess and DidDestroyFrame message is indeed a
1237         WebProcessProxy not a WebPageProxy one. Second mistake was calling
1238         the callback from WebFrameLoaderClient::frameLoaderDestroyed(),
1239         since at that point the frame has already been detached from the
1240         page and so WebFrame::page() always returns nullptr. So, this in
1241         fact dead code and since r180211 nobody is using it.
1242
1243         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
1244         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1245         (webkitWebPageCreate): Use verion 6 instead of version 7 of loader client.
1246         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1247         (WebKit::InjectedBundlePageLoaderClient::willDestroyFrame): Deleted.
1248         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1249         (WebKit::WebFrameLoaderClient::frameLoaderDestroyed):
1250
1251 2015-03-06  Sam Weinig  <sam@webkit.org>
1252
1253         [Content Extensions] Move compiling of content extensions to the UIProcess
1254         https://bugs.webkit.org/show_bug.cgi?id=142402
1255
1256         Reviewed by Benjamin Poulain.
1257
1258         * Shared/API/APIObject.h:
1259         Rename UserContentFilter type to UserContentExtension to match new unified naming.
1260
1261         * Shared/WebCompiledContentExtension.cpp: Added.
1262         (WebKit::WebCompiledContentExtension::create):
1263         (WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
1264         (WebKit::WebCompiledContentExtension::~WebCompiledContentExtension):
1265         (WebKit::WebCompiledContentExtension::bytecode):
1266         (WebKit::WebCompiledContentExtension::bytecodeLength):
1267         (WebKit::WebCompiledContentExtension::actions):
1268         (WebKit::WebCompiledContentExtension::actionsLength):
1269         * Shared/WebCompiledContentExtension.h: Added.
1270         Add new WebKit2 implementation of CompiledContentExtension. Right now it is the same as the old
1271         WebCore based CompiledContentExtension, but in subsequent patches, it will use shared/file backed
1272         memory.
1273
1274         * Shared/WebCompiledContentExtensionData.cpp: Added.
1275         (WebKit::WebCompiledContentExtensionData::encode):
1276         (WebKit::WebCompiledContentExtensionData::decode):
1277         * Shared/WebCompiledContentExtensionData.h: Added.
1278         Add encodable/decodable holder for the compiled content extension data for use in IPC. Right
1279         now it is doing the naive thing and always copying the data, but in subsequent patches, it will
1280         use shared/file backed memory.
1281
1282         * Shared/WebPageGroupData.cpp:
1283         (WebKit::WebPageGroupData::encode):
1284         (WebKit::WebPageGroupData::decode):
1285         * Shared/WebPageGroupData.h:
1286         Rename member to match new unification on the name userContentExtension. Change the value from
1287         the serialized JSON (as a String) to WebCompiledContentExtensionData.
1288
1289         * UIProcess/API/APIUserContentExtension.cpp: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp.
1290         (API::UserContentExtension::UserContentExtension):
1291         (API::UserContentExtension::~UserContentExtension):
1292         (API::UserContentFilter::UserContentFilter): Deleted.
1293         (API::UserContentFilter::~UserContentFilter): Deleted.
1294         * UIProcess/API/APIUserContentExtension.h: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.h.
1295         * UIProcess/API/APIUserContentFilter.cpp: Removed.
1296         * UIProcess/API/APIUserContentFilter.h: Removed.
1297         Renamed UserContentFilter to APIUserContentExtension. Updated to store the compiled extension (as a WebCompiledContentExtension)
1298         rather than the serialized JSON.
1299
1300         * UIProcess/API/C/WKAPICast.h:
1301         * UIProcess/API/C/WKPageGroup.cpp:
1302         (WKPageGroupAddUserContentFilter):
1303         (WKPageGroupRemoveUserContentFilter):
1304         (WKPageGroupRemoveAllUserContentFilters):
1305         * UIProcess/API/C/WKUserContentControllerRef.cpp:
1306         (WKUserContentControllerAddUserContentFilter):
1307         (WKUserContentControllerRemoveAllUserContentFilters):
1308         * UIProcess/API/Cocoa/WKUserContentController.mm:
1309         (-[WKUserContentController _addUserContentFilter:]):
1310         (-[WKUserContentController _removeUserContentFilter:]):
1311         (-[WKUserContentController _removeAllUserContentFilters]):
1312         Update for rename of APIUserContentFilter -> UserContentExtension.
1313
1314         * UIProcess/API/C/WKUserContentFilterRef.cpp:
1315         (WKUserContentFilterGetTypeID):
1316         (WKUserContentFilterCreate):
1317         Update for rename of APIUserContentFilter -> UserContentExtension. Also make WKUserContentFilterCreate eagerly
1318         compile rule list to a WebCompiledContentExtensionData.
1319
1320         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1321         (-[_WKUserContentFilter initWithName:serializedRules:]):
1322         (-[_WKUserContentFilter dealloc]):
1323         (-[_WKUserContentFilter _apiObject]):
1324         Update for rename of APIUserContentFilter -> UserContentExtension. Also make initWithName:serializedRules: eagerly
1325         compile rule list to a WebCompiledContentExtensionData.
1326
1327         * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h:
1328         (WebKit::wrapper):
1329         Update for rename of APIUserContentFilter -> UserContentExtension.
1330
1331         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1332         (WebKit::WebUserContentControllerProxy::addProcess):
1333         (WebKit::WebUserContentControllerProxy::addUserContentExtension):
1334         (WebKit::WebUserContentControllerProxy::removeUserContentExtension):
1335         (WebKit::WebUserContentControllerProxy::removeAllUserContentExtensions):
1336         (WebKit::WebUserContentControllerProxy::addUserContentFilter): Deleted.
1337         (WebKit::WebUserContentControllerProxy::removeUserContentFilter): Deleted.
1338         (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters): Deleted.
1339         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1340         * UIProcess/WebPageGroup.cpp:
1341         (WebKit::WebPageGroup::addUserContentExtension):
1342         (WebKit::WebPageGroup::removeUserContentExtension):
1343         (WebKit::WebPageGroup::removeAllUserContentExtensions):
1344         (WebKit::WebPageGroup::addUserContentFilter): Deleted.
1345         (WebKit::WebPageGroup::removeUserContentFilter): Deleted.
1346         (WebKit::WebPageGroup::removeAllUserContentFilters): Deleted.
1347         * UIProcess/WebPageGroup.h:
1348         * WebKit2.xcodeproj/project.pbxproj:
1349         * WebProcess/UserContent/WebUserContentController.cpp:
1350         (WebKit::WebUserContentController::addUserContentExtensions):
1351         (WebKit::WebUserContentController::removeUserContentExtension):
1352         (WebKit::WebUserContentController::removeAllUserContentExtensions):
1353         (WebKit::WebUserContentController::addUserContentFilters): Deleted.
1354         (WebKit::WebUserContentController::removeUserContentFilter): Deleted.
1355         (WebKit::WebUserContentController::removeAllUserContentFilters): Deleted.
1356         * WebProcess/UserContent/WebUserContentController.h:
1357         * WebProcess/UserContent/WebUserContentController.messages.in:
1358         * WebProcess/WebPage/WebPageGroupProxy.cpp:
1359         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
1360         (WebKit::WebPageGroupProxy::addUserContentExtension):
1361         (WebKit::WebPageGroupProxy::removeUserContentExtension):
1362         (WebKit::WebPageGroupProxy::removeAllUserContentExtensions):
1363         (WebKit::WebPageGroupProxy::addUserContentFilter): Deleted.
1364         (WebKit::WebPageGroupProxy::removeUserContentFilter): Deleted.
1365         (WebKit::WebPageGroupProxy::removeAllUserContentFilters): Deleted.
1366         * WebProcess/WebPage/WebPageGroupProxy.h:
1367         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
1368         Pipe the compiled extension from the UIProcess to the WebProcess.
1369
1370 2015-03-06  Dean Jackson  <dino@apple.com>
1371
1372         Support "plus-lighter" in mix-blend mode
1373         https://bugs.webkit.org/show_bug.cgi?id=142416
1374         <rdar://problem/19993979>
1375
1376         Reviewed by Darin Adler and Sam Weinig.
1377
1378         Output the appropriate blending type when logging.
1379
1380         * Shared/mac/RemoteLayerTreeTransaction.mm:
1381         (WebKit::RemoteLayerTreeTextStream::operator<<):
1382
1383 2015-03-06  Beth Dakin  <bdakin@apple.com>
1384
1385         REGRESSION (r180782): Data Detector popovers are not dismissed on scroll or zoom
1386         https://bugs.webkit.org/show_bug.cgi?id=142371
1387         -and corresponding-
1388         rdar://problem/20059224
1389
1390         Reviewed by Tim Horton.
1391
1392         This patch has the WKImmediateActionController keep track of whether or not it has 
1393         an active immediate action. Then we only call into Lookup and DD if the window is 
1394         key OR if the WKView’s immediateActionController has an active action.
1395         * UIProcess/API/mac/WKView.mm:
1396         (-[WKView _dismissContentRelativeChildWindows]):
1397         * UIProcess/mac/WKImmediateActionController.h:
1398         * UIProcess/mac/WKImmediateActionController.mm:
1399         (-[WKImmediateActionController initWithPage:view:recognizer:]):
1400         (-[WKImmediateActionController willDestroyView:]):
1401         (-[WKImmediateActionController _clearImmediateActionState]):
1402         (-[WKImmediateActionController hasActiveImmediateAction]):
1403         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1404
1405 2015-03-06  Jeremy Jones  <jeremyj@apple.com>
1406
1407         Scroll to make the video element visible when exiting fullscreen.
1408         https://bugs.webkit.org/show_bug.cgi?id=141439
1409
1410         Reviewed by Simon Fraser.
1411
1412         This patch will restore interface state when exiting fullscreen.
1413         Adds preparedToReturnToInline to continue exiting once the interface is updated.
1414
1415         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1416         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
1417         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1418         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1419         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
1420         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline): added.
1421         * WebProcess/ios/WebVideoFullscreenManager.h:
1422         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
1423         * WebProcess/ios/WebVideoFullscreenManager.mm:
1424         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
1425
1426 2015-03-06  Antti Koivisto  <antti@apple.com>
1427
1428         Rename NetworkCacheStorageCocoa.mm to NetworkCacheStorage.cpp
1429         https://bugs.webkit.org/show_bug.cgi?id=142401
1430
1431         Rubber-stamped by Anders Carlsson.
1432
1433         It is now fully cross-platform.
1434
1435         * NetworkProcess/cache/NetworkCacheStorage.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm.
1436         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
1437         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm: Removed.
1438         * WebKit2.xcodeproj/project.pbxproj:
1439
1440 2015-03-06  Antti Koivisto  <antti@apple.com>
1441
1442         Don't use dispatch_semaphore in NetworkCacheStorage
1443         https://bugs.webkit.org/show_bug.cgi?id=142395
1444
1445         Reviewed by Anders Carlsson.
1446
1447         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1448         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1449         (WebKit::NetworkCache::IOChannel::read):
1450         (WebKit::NetworkCache::IOChannel::readSync):
1451
1452             Add readSync to encapsulate the semaphore.
1453
1454         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1455         (WebKit::NetworkCache::Storage::traverse):
1456
1457 2015-03-06  Antti Koivisto  <antti@apple.com>
1458
1459         Move dispatch_data use behind NetworkCache::Data abstraction
1460         https://bugs.webkit.org/show_bug.cgi?id=142392
1461
1462         Reviewed by Anders Carlsson.
1463
1464         * NetworkProcess/cache/NetworkCacheData.h:
1465         (WebKit::NetworkCache::DispatchPtr::DispatchPtr):
1466         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
1467         (WebKit::NetworkCache::Data::Data):
1468         (WebKit::NetworkCache::Data::apply):
1469         (WebKit::NetworkCache::Data::subrange):
1470         (WebKit::NetworkCache::concatenate):
1471         (WebKit::NetworkCache::mapFile):
1472         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1473         (WebKit::NetworkCache::IOChannel::read):
1474         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1475         (WebKit::NetworkCache::hashData):
1476         (WebKit::NetworkCache::decodeEntryMetaData):
1477         (WebKit::NetworkCache::decodeEntryHeader):
1478         (WebKit::NetworkCache::decodeEntry):
1479         (WebKit::NetworkCache::encodeEntryMetaData):
1480         (WebKit::NetworkCache::encodeEntryHeader):
1481         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
1482         (WebKit::NetworkCache::mapFile): Deleted.
1483
1484 2015-03-06  Antti Koivisto  <antti@apple.com>
1485
1486         Use WTF abstraction for page size in NetworkCacheStorage
1487         https://bugs.webkit.org/show_bug.cgi?id=142396
1488
1489         Reviewed by Darin Adler.
1490
1491         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1492         (WebKit::NetworkCache::decodeEntryMetaData):
1493         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
1494
1495 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
1496
1497         [iOS] SVG fonts are garbled
1498         https://bugs.webkit.org/show_bug.cgi?id=142377
1499
1500         Reviewed by Simon Fraser.
1501
1502         * Configurations/FeatureDefines.xcconfig:
1503
1504 2015-03-06  Zan Dobersek  <zdobersek@igalia.com>
1505
1506         Unguarded GTK-specific member and method usage in DrawingAreaImpl
1507         https://bugs.webkit.org/show_bug.cgi?id=142391
1508
1509         Reviewed by Carlos Garcia Campos.
1510
1511         r180924 introduced unguarded use of m_nativeSurfaceHandleForCompositing
1512         and LayerTreeHost::setNativeSurfaceHandleForCompositing() in DrawingAreaImpl.
1513         Definitions for both of these are guarded with USE(TEXTURE_MAPPER_GL) and PLATFORM(GTK),
1514         so their use should be as well.
1515
1516         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1517         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1518
1519 2015-03-06  David Kilzer  <ddkilzer@apple.com>
1520
1521         REGRESSION (r181140): WebKit2 fails to build on Mavericks buildbot
1522
1523         Work around Xcode dependency tracking issues by making changes
1524         to source files that need to be recompiled.
1525
1526         * NetworkProcess/NetworkProcess.cpp: Update copyright.  Include
1527         NetworkCache.h since it didn't appear to be included by
1528         NetworkCacheCoders.h.
1529         * NetworkProcess/cocoa/NetworkProcessCocoa.mm: Update copyright.
1530
1531 2015-03-05  Antti Koivisto  <antti@apple.com>
1532
1533         Move disk cache classes to namespace
1534         https://bugs.webkit.org/show_bug.cgi?id=142339
1535
1536         Reviewed by Anders Carlsson.
1537
1538         Move everything to NetworkCache namespace. 
1539
1540 2015-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1541
1542         REGRESSION(r180924): ASSERTION FAILED: !from.isEmpty() in WebCore::TransformationMatrix::rectToRect
1543         https://bugs.webkit.org/show_bug.cgi?id=142345
1544
1545         Reviewed by Martin Robinson.
1546
1547         This was caused by r180924 that postpones the creation of the
1548         TextureMapper, which could cause that a layer has not yet a size
1549         when TextureMapper::paint() is called. This patch moves the
1550         creation of the TextureMapper to
1551         LayerTreeHostGtk::setNativeSurfaceHandleForCompositing(), so that
1552         it's created as soon as it's possible to create. This method is
1553         called by the drawing area right after creating the
1554         LayerTreeHostGtk if it already have a handler, or when the handle
1555         is received from the UI process.
1556
1557         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1558         (WebKit::LayerTreeHostGtk::initialize): Remove the
1559         nsureTextureMapper call because at this point the layer context ID
1560         is always 0, so it's impossible to create the TextureMapper.
1561         (WebKit::LayerTreeHostGtk::compositeLayersToContext): Remove the
1562         ensureTextureMapper call from here too, since at this point, if we
1563         have a context, we should also have a TextureMapper. Add an ASSERT
1564         right before using the TextureMapper.
1565         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
1566         Create the TextureMapper here.
1567         (WebKit::LayerTreeHostGtk::ensureTextureMapper): Deleted.
1568         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
1569
1570 2015-03-05  Anders Carlsson  <andersca@apple.com>
1571
1572         WKWebView Encoder for remote object communication does not implement encodeInt32:forKey:
1573         https://bugs.webkit.org/show_bug.cgi?id=142356
1574         rdar://problem/20058952
1575
1576         Reviewed by Tim Horton.
1577
1578         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1579         (-[WKRemoteObjectEncoder encodeInt32:forKey:]):
1580         (-[WKRemoteObjectDecoder decodeInt32ForKey:]):
1581
1582 2015-03-05  Chris Dumez  <cdumez@apple.com>
1583
1584         NetworkCache efficacy logging is using too much CPU
1585         https://bugs.webkit.org/show_bug.cgi?id=142186
1586         <rdar://problem/19632080>
1587
1588         Reviewed by Antti Koivisto.
1589
1590         NetworkCache efficacy logging was using too much CPU mostly due to
1591         database writes. Logging was using ~11.3% of the NetworkProcess'
1592         CPU usage (~9.2% for writes / ~1.3% for reads).
1593
1594         This patch buffers writes requests in memory and only writes them
1595         to disk every 10 seconds. We are thus writing to this less frequently
1596         and writing more at once, in a single SQL transaction. After this
1597         change, efficacy logging only accounts for ~3.5% of the NetworkProcess'
1598         CPU activity (1.5% for writes / 1.2% for reads).
1599
1600         Now that CPU usage is more acceptable, this patch re-enables the
1601         network cache efficicy logging.
1602
1603         * NetworkProcess/cache/NetworkCacheStatistics.h:
1604
1605         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1606         (WebKit::executeSQLCommand):
1607         (WebKit::executeSQLStatement):
1608         Call step() instead of executeCommand() because:
1609         - The input statement is already prepared.
1610         - step() does not finalize() the statement and thus we caller can
1611           reuse it after calling reset().
1612
1613         (WebKit::NetworkCacheStatistics::NetworkCacheStatistics):
1614         (WebKit::NetworkCacheStatistics::initialize):
1615         (WebKit::NetworkCacheStatistics::bootstrapFromNetworkCache):
1616         (WebKit::NetworkCacheStatistics::recordNotCachingResponse):
1617         (WebKit::NetworkCacheStatistics::recordNotUsingCacheForRequest):
1618         (WebKit::NetworkCacheStatistics::recordRetrievalFailure):
1619         (WebKit::NetworkCacheStatistics::markAsRequested):
1620         (WebKit::NetworkCacheStatistics::writeTimerFired):
1621         (WebKit::NetworkCacheStatistics::queryWasEverRequested):
1622         (WebKit::NetworkCacheStatistics::addHashesToDatabase):
1623         (WebKit::NetworkCacheStatistics::addStoreDecisionsToDatabase):
1624         (WebKit::NetworkCacheStatistics::addHashToDatabase): Deleted.
1625
1626         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1627         (WebKit::registerUserDefaultsIfNeeded):
1628         Re-enable the network cache efficacy logging.
1629
1630 2015-03-05  Antti Koivisto  <antti@apple.com>
1631
1632         Switch NetworkCacheStorage to WorkQueue abstraction
1633         https://bugs.webkit.org/show_bug.cgi?id=142337
1634
1635         Reviewed by Anders Carlsson.
1636
1637         Don't use dispatch_async directly.
1638
1639         * NetworkProcess/cache/NetworkCacheStorage.h:
1640         (WebKit::NetworkCacheStorage::ioQueue):
1641         (WebKit::NetworkCacheStorage::backgroundIOQueue):
1642         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1643         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
1644         (WebKit::NetworkCacheStorage::initialize):
1645         (WebKit::NetworkCacheStorage::removeEntry):
1646         (WebKit::NetworkCacheStorage::dispatchReadOperation):
1647         (WebKit::retrieveFromMemory):
1648         (WebKit::NetworkCacheStorage::traverse):
1649         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
1650         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
1651         (WebKit::NetworkCacheStorage::clear):
1652         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
1653         (WebKit::NetworkCacheStorage::deleteOldVersions):
1654
1655 2015-03-05  Lukasz Bialek  <l.bialek@samsung.com>
1656
1657         [EFL][WK2] Crash when "Download Linked File" from MiniBrowser context menu is clicked
1658         https://bugs.webkit.org/show_bug.cgi?id=131162
1659
1660         Reviewed by Gyuyoung Kim.
1661
1662         "Download Linked File" crashes because of null-pointer exception of Download Job.
1663         Due to architectural difficulties, easy fix is not possible (EwkView is needed in
1664         DownloadManager to create DownloadJobs and it is only used to notify the client 
1665         about download (finished, error, cancel) via smart callback using EwkView (Evas_Object).
1666
1667         Propose a new callbacks which are view independent and detach EFL's DownloadManager
1668         from EwkView. It makes DownloadManagerEFL consistent with WKContextDownload.
1669         Fix the crash and restore download functionality.
1670
1671         * PlatformEfl.cmake:
1672         Enable newly reimplemented tests
1673         * UIProcess/API/efl/EwkViewCallbacks.h:
1674         Remove old callback mechanism
1675         * UIProcess/API/efl/ewk_context.cpp:
1676         (ewk_context_download_callbacks_set):
1677         * UIProcess/API/efl/ewk_context.h:
1678         Declare new callback functions and registration functions
1679         * UIProcess/API/efl/ewk_download_job.cpp:
1680         (EwkDownloadJob::EwkDownloadJob):
1681         (EwkDownloadJob::view): Deleted.
1682         * UIProcess/API/efl/ewk_download_job.h:
1683         * UIProcess/API/efl/ewk_download_job_private.h:
1684         (EwkDownloadJob::create):
1685         Remove EwkView dependency
1686         * UIProcess/API/efl/ewk_view.h:
1687         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
1688         Alter tests to new callback mechanism
1689         * UIProcess/efl/DownloadManagerEfl.cpp:
1690         (WebKit::DownloadManagerEfl::decideDestinationWithSuggestedFilename):
1691         (WebKit::DownloadManagerEfl::didStart):
1692         (WebKit::DownloadManagerEfl::didFail):
1693         (WebKit::DownloadManagerEfl::didCancel):
1694         (WebKit::DownloadManagerEfl::didFinish):
1695         (WebKit::DownloadManagerEfl::DownloadManagerEfl):
1696         (WebKit::DownloadManagerEfl::registerDownloadJob):
1697         (WebKit::DownloadManagerEfl::setCallbacks):
1698         * UIProcess/efl/DownloadManagerEfl.h:
1699         * UIProcess/efl/WebViewEfl.cpp:
1700         (WebKit::WebViewEfl::handleDownloadRequest):
1701         Add support of new callback mechanism
1702
1703 2015-03-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1704
1705         [SOUP] Disable RC4
1706         https://bugs.webkit.org/show_bug.cgi?id=140014
1707
1708         Reviewed by Carlos Garcia Campos.
1709
1710         Disallow RC4-based ciphersuites when performing TLS negotiation,
1711         because it is no longer considered secure.
1712
1713         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
1714         (main):
1715         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
1716         (main):
1717
1718 2015-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1719
1720         Hide Promise with runtime flags under Cocoa JSContext API
1721         https://bugs.webkit.org/show_bug.cgi?id=141965
1722
1723         Reviewed by Filip Pizlo.
1724
1725         Add new JSC runtime flag, PromiseDisabled.
1726
1727         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1728         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1729
1730 2015-03-04  Beth Dakin  <bdakin@apple.com>
1731
1732         Attempted build fix.
1733
1734         * UIProcess/API/Cocoa/WKViewPrivate.h:
1735
1736 2015-03-04  Beth Dakin  <bdakin@apple.com>
1737
1738         Message UI process when contentSize changes
1739         https://bugs.webkit.org/show_bug.cgi?id=142294
1740         -and corresponding-
1741         rdar://problem/19963165
1742
1743         Reviewed by Andreas Kling.
1744
1745         This patch un-ifdefs the didChangeContentSize message so that we can use it on Mac 
1746         as well. 
1747
1748         New private method that subclasses can override when they need to do something 
1749         with contentSize changes.
1750         * UIProcess/API/Cocoa/WKViewPrivate.h:
1751         * UIProcess/API/mac/WKView.mm:
1752         (-[WKView _didChangeContentSize:]):
1753         * UIProcess/PageClient.h:
1754
1755         Un-ifdef.
1756         * UIProcess/WebPageProxy.cpp:
1757         (WebKit::WebPageProxy::didChangeContentSize):
1758         * UIProcess/WebPageProxy.h:
1759         * UIProcess/WebPageProxy.messages.in:
1760         * UIProcess/mac/PageClientImpl.h:
1761         * UIProcess/mac/PageClientImpl.mm:
1762         (WebKit::PageClientImpl::didChangeContentSize):
1763         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1764         (WebKit::WebChromeClient::contentsSizeChanged):
1765
1766         Stubs for other platforms now that the pure-virtual is un-masked.
1767         * UIProcess/ios/PageClientImplIOS.h:
1768         * UIProcess/ios/PageClientImplIOS.mm:
1769         (WebKit::PageClientImpl::didChangeContentSize):
1770         * UIProcess/API/gtk/PageClientImpl.h:
1771
1772 2015-03-04  Antti Koivisto  <antti@apple.com>
1773
1774         Factor platform I/O out from NetworkCacheStorage
1775         https://bugs.webkit.org/show_bug.cgi?id=142279
1776
1777         Reviewed by Chris Dumez.
1778
1779         * NetworkProcess/cache/NetworkCacheData.h: Added.
1780         * NetworkProcess/cache/NetworkCacheDataCocoa.mm: Added.
1781
1782             NetworkCacheStorage::Data -> NetworkCacheData
1783             Move to files of its own.
1784
1785         * NetworkProcess/cache/NetworkCacheIOChannel.h: Added.
1786         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: Added.
1787
1788             Add abstraction for dispatch IO channels.
1789
1790 2015-03-04  Joseph Pecoraro  <pecoraro@apple.com>
1791
1792         Remove WK_AVAILABLE and related macros when we cannot determine iOS/Mac version
1793         https://bugs.webkit.org/show_bug.cgi?id=142252
1794         rdar://problem/19983833
1795
1796         Reviewed by David Kilzer.
1797
1798         When mac / ios version was unable to be determined strip the WK_AVAILABLE
1799         and WK_DEPRECATED macros to avoid outputing a broken macro.
1800
1801         * mac/postprocess-framework-headers.sh:
1802
1803 2015-03-04  Debarshi Ray  <debarshir@gnome.org>
1804
1805         [GTK] WebView should hold a reference on WebContext because non-default contexts are a reality
1806         https://bugs.webkit.org/show_bug.cgi?id=142225
1807
1808         Reviewed by Carlos Garcia Campos.
1809
1810         * UIProcess/API/gtk/WebKitWebView.cpp:
1811         (webkitWebViewRequestFavicon):
1812         (webkitWebViewWatchForChangesInFavicon):
1813         (webkitWebViewDisconnectFaviconDatabaseSignalHandlers):
1814         (webkitWebViewConstructed):
1815         (webkitWebViewGetProperty):
1816         (webkitWebViewDispose):
1817         (webkitWebViewLoadChanged):
1818         (webkitWebViewLoadFailedWithTLSErrors):
1819         (webkit_web_view_get_context):
1820         (webkit_web_view_download_uri):
1821
1822 2015-03-03  Shivakumar JM  <shiva.jm@samsung.com>
1823
1824         Fix build warning in WebKit2/Shared module.
1825         https://bugs.webkit.org/show_bug.cgi?id=142213
1826
1827         Reviewed by Simon Fraser.
1828
1829         Fix build warning by removing argument name from function.
1830
1831         * Shared/WebCoreArgumentCoders.cpp:
1832         (IPC::pathPointCountApplierFunction):
1833
1834 2015-03-03  Andy Estes  <aestes@apple.com>
1835
1836         [Content Filtering] Separate unblock handling into its own class
1837         https://bugs.webkit.org/show_bug.cgi?id=142251
1838
1839         Reviewed by Andreas Kling.
1840
1841         Adopted ContentFilterUnblockHandler.
1842
1843         * Shared/WebCoreArgumentCoders.h:
1844         * Shared/mac/WebCoreArgumentCodersMac.mm:
1845         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
1846         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode):
1847         (IPC::ArgumentCoder<ContentFilter>::encode): Deleted.
1848         (IPC::ArgumentCoder<ContentFilter>::decode): Deleted.
1849         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1850         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
1851         * UIProcess/WebFrameProxy.cpp:
1852         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1853         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction):
1854         * UIProcess/WebFrameProxy.h:
1855         (WebKit::WebFrameProxy::setContentFilterUnblockHandler):
1856         (WebKit::WebFrameProxy::setContentFilterForBlockedLoad): Deleted.
1857         * UIProcess/WebPageProxy.h:
1858         * UIProcess/WebPageProxy.messages.in:
1859         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1860         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad):
1861         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1862
1863 2015-03-03  Chris Dumez  <cdumez@apple.com>
1864
1865         [WK2] Fix memory leak in _getCookieHeadersForTask
1866         https://bugs.webkit.org/show_bug.cgi?id=142245
1867
1868         Reviewed by Alexey Proskuryakov.
1869
1870         Fix memory leak in _getCookieHeadersForTask. We are leaking the CFDictionary
1871         returned by webKitCookieStorageCopyRequestHeaderFieldsForURL().
1872
1873         This patch addresses the issue by storing the return CFDictionary in a
1874         RetainPtr<CFDictionaryRef>.
1875
1876         * Shared/mac/CookieStorageShim.mm:
1877         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
1878
1879 2015-03-03  Enrica Casucci  <enrica@apple.com>
1880
1881         Incomplete dictation results in text fields in a web page.
1882         https://bugs.webkit.org/show_bug.cgi?id=142240
1883         rdar://problem/19953432
1884
1885         Reviewed by Tim Horton.
1886
1887         The empty stub for insertDictationResult:withCorrectionIdentifier
1888         must be removed. This way UIKit will call insertText and do the right thing.
1889
1890         * UIProcess/ios/WKContentViewInteraction.mm:
1891         (-[WKContentView insertDictationResult:withCorrectionIdentifier:]): Deleted.
1892
1893 2015-03-03  Dean Jackson  <dino@apple.com>
1894
1895         Controls panel should have system blurry background
1896         https://bugs.webkit.org/show_bug.cgi?id=142154
1897         <rdar://problem/20000964>
1898
1899         Reviewed by Simon Fraser.
1900
1901         In order to replicate the system style of media controls
1902         on OS X and iOS, we need to expose a special -webkit-appearance.
1903         This patch adds the new property value, and implements
1904         the iOS part of the appearance, which is a blurry shaded
1905         background.
1906
1907         * Shared/mac/RemoteLayerBackingStore.mm:
1908         (WebKit::RemoteLayerBackingStore::drawInContext): Add entries for
1909         the new layer types, even though they are not correct yet.
1910
1911         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1912         (WebKit::updateCustomAppearance):
1913         (WebKit::RemoteLayerTreePropertyApplier::applyProperties): UIBackdropViews
1914         have a defined hierarchy that we don't create. We need to make sure we add our
1915         children to the right subview.
1916         * Shared/mac/RemoteLayerTreeTransaction.mm:
1917         (WebKit::RemoteLayerTreeTransaction::description): Logging.
1918
1919         * UIProcess/ios/RemoteLayerTreeHostIOS.mm: Rename existing WKBackdropView
1920         to WKSimpleBackdropView, and add a new WKBackdropView that inherits
1921         from UIBackdropView.
1922         (-[WKBackdropView hitTest:withEvent:]):
1923         (-[WKBackdropView description]):
1924         (WebKit::RemoteLayerTreeHost::createLayer): Handle the new LayerTypes.
1925         * UIProcess/mac/RemoteLayerTreeHost.mm:
1926         (WebKit::RemoteLayerTreeHost::createLayer):
1927
1928 2015-03-03  Chris Dumez  <cdumez@apple.com>
1929
1930         Access ApplicationCacheStorage global instance via singleton() static member function
1931         https://bugs.webkit.org/show_bug.cgi?id=142239
1932
1933         Reviewed by Anders Carlsson.
1934
1935         Access ApplicationCacheStorage global instance via singleton() static
1936         member function as per WebKit coding style.
1937
1938 2015-03-03  Joseph Pecoraro  <pecoraro@apple.com>
1939
1940         Build Fix: Add fall back handling in postprocess script for missing/unknown platform name.
1941
1942         Rubber-stamped by David Kilzer.
1943
1944         * mac/postprocess-framework-headers.sh:
1945
1946 2015-03-03  Enrica Casucci  <enrica@apple.com>
1947
1948         Build fix for iOS.
1949
1950         Unreviewed.
1951
1952         * UIProcess/ios/WKContentViewInteraction.mm: Adding forward declaration.
1953
1954 2015-03-03  Antti Koivisto  <antti@apple.com>
1955
1956         Include key to NetworkCacheStorage::Entry
1957         https://bugs.webkit.org/show_bug.cgi?id=142215
1958
1959         Reviewed by Chris Dumez.
1960
1961         This simplified code. The key is saved as part of the entry so it makes logical sense too.
1962
1963         * NetworkProcess/cache/NetworkCache.cpp:
1964         (WebKit::makeCacheKey):
1965         (WebKit::encodeStorageEntry):
1966         (WebKit::NetworkCache::retrieve):
1967         (WebKit::NetworkCache::store):
1968         (WebKit::NetworkCache::update):
1969         (WebKit::NetworkCache::traverse):
1970         (WebKit::entryAsJSON):
1971         (WebKit::NetworkCache::dumpContentsToFile):
1972         * NetworkProcess/cache/NetworkCacheKey.cpp:
1973         (WebKit::NetworkCacheKey::operator=):
1974         * NetworkProcess/cache/NetworkCacheKey.h:
1975         (WebKit::NetworkCacheKey::isNull):
1976         * NetworkProcess/cache/NetworkCacheStorage.h:
1977         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1978         (WebKit::decodeEntry):
1979         (WebKit::encodeEntryHeader):
1980         (WebKit::retrieveFromMemory):
1981         (WebKit::NetworkCacheStorage::retrieve):
1982         (WebKit::NetworkCacheStorage::store):
1983         (WebKit::NetworkCacheStorage::update):
1984         (WebKit::NetworkCacheStorage::traverse):
1985         (WebKit::NetworkCacheStorage::dispatchPendingWriteOperations):
1986         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
1987         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
1988
1989 2015-03-03  Antti Koivisto  <antti@apple.com>
1990
1991         Cache shrink leaves behind empty partition directories
1992         https://bugs.webkit.org/show_bug.cgi?id=142217
1993
1994         Reviewed by Andreas Kling.
1995
1996         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
1997         (WebKit::traverseCacheFiles):
1998
1999             No need for std::function.
2000
2001         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2002         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
2003
2004             After shrink traverse through the partition directories and try to delete them.
2005             System knows if they are actually empty.
2006
2007 2015-03-03  Anders Carlsson  <andersca@apple.com>
2008
2009         Use the correct display name for website data for local files
2010         https://bugs.webkit.org/show_bug.cgi?id=142228
2011
2012         Reviewed by Dan Bernstein.
2013
2014         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2015         (displayNameForLocalFiles):
2016         Add new helper function.
2017
2018         (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
2019         Check if the hostname is kCFHTTPCookieLocalFileDomain.
2020
2021         (WebKit::WebsiteDataRecord::displayNameForOrigin):
2022         Handle file URLs as well.
2023
2024 2015-03-03  Enrica Casucci  <enrica@apple.com>
2025
2026         Fixed typo in platform guard in http://trac.webkit.org/changeset/180939.
2027
2028         Unreviewed.
2029
2030         * UIProcess/ios/WKContentViewInteraction.mm:
2031
2032 2015-03-03  Enrica Casucci  <enrica@apple.com>
2033
2034         Adopt new API for keyboard interaction.
2035         https://bugs.webkit.org/show_bug.cgi?id=142201
2036         rdar://problem/19924949
2037
2038         Reviewed by Joseph Pecoraro.
2039
2040         * UIProcess/ios/WKContentViewInteraction.mm:
2041         (-[WKContentView inputAssistantItem]):
2042         (-[WKContentView _inputAssistantItem]):
2043
2044 2015-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2045
2046         REGRESSION(r177075): WebProcess crashes when entering accelerating compositing mode before the WebView is realized
2047         https://bugs.webkit.org/show_bug.cgi?id=142079
2048
2049         Reviewed by Žan Doberšek.
2050
2051         The problem is that the texture mapper and native window handler
2052         are initialized when the LayerTreeHost is initialized, assuming
2053         the UI process has already sent the native window handler to the
2054         web process, but that doesn't always happen since we moved the
2055         redirected window creation to realize in r177075.
2056
2057         * WebProcess/WebPage/DrawingArea.h:
2058         (WebKit::DrawingArea::nativeSurfaceHandleForCompositing): Deleted.
2059         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2060         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Call
2061         LayerTreeHost::setNativeSurfaceHandleForCompositing if we
2062         already have a native window handle at this point.
2063         (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
2064         Call LayerTreeHost::setNativeSurfaceHandleForCompositing also when
2065         not using threaded compositing.
2066         * WebProcess/WebPage/LayerTreeHost.h:
2067         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2068         (WebKit::LayerTreeHostGtk::makeContextCurrent): Helper function to
2069         ensure a context and making it current.
2070         (WebKit::LayerTreeHostGtk::ensureTextureMapper): Ensure a texture
2071         is created for the current context.
2072         (WebKit::LayerTreeHostGtk::initialize): Use makeContextCurrent()
2073         and ensureTextureMapper(), and remove the LayerTreeContext
2074         initialization since that's is now always initialized in
2075         setNativeSurfaceHandleForCompositing().
2076         (WebKit::LayerTreeHostGtk::compositeLayersToContext): Use
2077         makeContextCurrent() helper function and also call
2078         ensureTextureMapper() just in case the texture could not be
2079         created during initialization because the native window handle was
2080         not yet available.
2081         (WebKit::LayerTreeHostGtk::flushAndRenderLayers): Use makeContextCurrent().
2082         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
2083         Initialize the LayerTreeContext.
2084         (WebKit::LayerTreeHostGtk::glContext): Deleted.
2085         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
2086
2087 2015-03-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2088
2089         [WK2] Remove unnecessary create() factory functions.
2090         https://bugs.webkit.org/show_bug.cgi?id=142161
2091
2092         Reviewed by Chris Dumez.
2093
2094         We can replace some create() factory functions with std::make_unique(). Because
2095         it just returns new instance. Even some of those functions have used std::unique_ptr<>
2096         instead of std::make_unique<>. Fixed all.
2097
2098         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
2099         (WebKit::SQLiteIDBTransaction::create): Deleted.
2100         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2101         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
2102         * Platform/efl/DispatchQueueWorkItemEfl.h:
2103         (WorkItem::dispatch):
2104         (WorkItem::create): Deleted.
2105         * UIProcess/API/gtk/PageClientImpl.h:
2106         (WebKit::PageClientImpl::create): Deleted.
2107         * UIProcess/API/gtk/WebKitTextChecker.h:
2108         (WebKitTextChecker::create): Deleted.
2109         * UIProcess/API/gtk/WebKitWebContext.cpp:
2110         (webkitWebContextConstructed):
2111         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2112         (webkitWebViewBaseConstructed):
2113
2114 2015-03-02  Brady Eidson  <beidson@apple.com>
2115
2116         Lots of: ERROR: Unhandled web process message WebPageGroupProxy:RemoveAllUserContentFilters
2117         https://bugs.webkit.org/show_bug.cgi?id=142155
2118
2119         Reviewed by Simon Fraser.
2120
2121         * WebProcess/WebProcess.cpp:
2122         (WebKit::WebProcess::didReceiveMessage): Return after handling WebPageGroupProxy messages
2123           instead of logging an error.
2124
2125 2015-03-02  Antti Koivisto  <antti@apple.com>
2126
2127         Add way to dump cache meta data to file
2128         https://bugs.webkit.org/show_bug.cgi?id=142183
2129
2130         Add a missing return so we don't try to decode a null entry.
2131
2132         * NetworkProcess/cache/NetworkCache.cpp:
2133         (WebKit::NetworkCache::dumpContentsToFile):
2134
2135 2015-03-02  Anders Carlsson  <andersca@apple.com>
2136
2137         Return disk cache entries from the new disk cache
2138         https://bugs.webkit.org/show_bug.cgi?id=142190
2139
2140         Reviewed by Antti Koivisto.
2141
2142         * NetworkProcess/NetworkProcess.cpp:
2143         (WebKit::fetchDiskCacheEntries):
2144         Call NetworkCache::traverse() to get all the cache entries, unique their origins and pass them back with the completion handler.
2145
2146         * NetworkProcess/cache/NetworkCache.cpp:
2147         (WebKit::NetworkCache::traverse):
2148         New helper function that traverses network cache entries.
2149
2150         * NetworkProcess/cache/NetworkCache.h:
2151
2152 2015-03-02  Antti Koivisto  <antti@apple.com>
2153
2154         Add way to dump cache meta data to file
2155         https://bugs.webkit.org/show_bug.cgi?id=142183
2156
2157         Reviewed by Andreas Kling.
2158
2159         Dump goes to WebKitCache/dump.json. On OSX it can be triggered with
2160
2161         notifyutil -p com.apple.WebKit.Cache.dump
2162
2163         * NetworkProcess/cache/NetworkCache.cpp:
2164         (WebKit::NetworkCache::initialize):
2165         (WebKit::NetworkCache::dumpFilePath):
2166         (WebKit::entryAsJSON):
2167         (WebKit::NetworkCache::dumpContentsToFile):
2168         (WebKit::NetworkCache::clear):
2169
2170             Also clear any dumps.
2171
2172         * NetworkProcess/cache/NetworkCache.h:
2173         * NetworkProcess/cache/NetworkCacheStorage.h:
2174         (WebKit::NetworkCacheStorage::baseDirectoryPath):
2175         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2176         (WebKit::fileNameForKey):
2177         (WebKit::filePathForKey):
2178         (WebKit::openFile):
2179         (WebKit::openFileForKey):
2180         (WebKit::decodeEntryHeader):
2181
2182             Separate header decoding.
2183
2184         (WebKit::decodeEntry):
2185         (WebKit::NetworkCacheStorage::traverse):
2186
2187             Add asynchronous cache traversal inteface.
2188
2189 2015-03-02  Anders Carlsson  <andersca@apple.com>
2190
2191         WebsiteDataStore should handle deleting cookies
2192         https://bugs.webkit.org/show_bug.cgi?id=142185
2193
2194         Reviewed by Beth Dakin.
2195
2196         * NetworkProcess/NetworkProcess.cpp:
2197         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2198         When asked to delete cookies, do so.
2199
2200         * NetworkProcess/NetworkProcess.h:
2201         Update the deleteWebsiteDataForOrigins signature.
2202
2203         * NetworkProcess/NetworkProcess.messages.in:
2204         Add cookieHostNames to DeleteWebsiteDataForOrigins.
2205
2206         * UIProcess/Network/NetworkProcessProxy.cpp:
2207         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2208         * UIProcess/Network/NetworkProcessProxy.h:
2209         Update to take a vector of cookie host names.
2210
2211         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2212         (WebKit::WebsiteDataStore::removeData):
2213         Figure out if we need to ask the network process to delete data.
2214
2215 2015-03-02  Anders Carlsson  <andersca@apple.com>
2216
2217         WebsiteDataStore should support getting cookie host names
2218         https://bugs.webkit.org/show_bug.cgi?id=142178
2219
2220         Reviewed by Dan Bernstein.
2221
2222         * NetworkProcess/NetworkProcess.cpp:
2223         (WebKit::NetworkProcess::fetchWebsiteData):
2224         Assert that we're destroyed from the main thread since we end up copying the website data struct.
2225
2226         * Shared/WebsiteData/WebsiteData.cpp:
2227         (WebKit::WebsiteData::encode):
2228         (WebKit::WebsiteData::decode):
2229         * Shared/WebsiteData/WebsiteData.h:
2230         Add a hostnamesWithCookies member.
2231
2232         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2233         (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
2234         Add a new function that will return the display name for a cookie host name.
2235
2236         (WebKit::WebsiteDataRecord::addCookieHostName):
2237         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2238         Add a hash set of cookie host names.
2239
2240         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2241         (WebKit::WebsiteDataStore::fetchData):
2242         Create data records for each host name with cookies.
2243
2244 2015-03-02  Jer Noble  <jer.noble@apple.com>
2245
2246         [WK2][Mac] WebPageProxy::supressVisibilityUpdates() should suppress visibility updates.
2247         https://bugs.webkit.org/show_bug.cgi?id=141907
2248
2249         Reviewed by Tim Horton.
2250
2251         At some point, the window/view/page visibility update code was refactored such that setting
2252         WebPageProxy::setSuppressVisibilityUpdate() no longer suppressed visibility updates. This causes
2253         full screen animations to become "flashy" when moving the WebView between the regular and full
2254         screen window, as a HTMLMediaElement in the full screen animation will receive a "!visible"
2255         notification and disconnect its rendering pipeline.
2256
2257         In WebPageProxy::viewStateDidChange(), respect m_suppressVisibilityUpdates and bail out early
2258         if set. In WebPageProxy::setSuppressVisibilityUpdates(), trigger an explicit update after
2259         clearing m_suppressVisibilityUpdates.
2260
2261         * UIProcess/WebPageProxy.cpp:
2262         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
2263         (WebKit::WebPageProxy::viewStateDidChange):
2264         * UIProcess/WebPageProxy.h:
2265         (WebKit::WebPageProxy::setSuppressVisibilityUpdates): Deleted.
2266
2267 2015-03-02  Jer Noble  <jer.noble@apple.com>
2268
2269         [WK1][WK2][Mac] Fullscreen animation is incorrect when page is scaled.
2270         https://bugs.webkit.org/show_bug.cgi?id=142121
2271
2272         Reviewed by Simon Fraser.
2273
2274         Change the order of operations when entering or exiting fullscreen. Change the page scale to
2275         1 before entering, so the final screen rect takes that scale into account, and vice-versa on
2276         exiting.
2277
2278         * UIProcess/mac/WKFullScreenWindowController.mm:
2279         (-[WKFullScreenWindowController enterFullScreen:]):
2280         (-[WKFullScreenWindowController exitFullScreen]):
2281
2282 2015-03-01  Simon Fraser  <simon.fraser@apple.com>
2283
2284         Make clip-path work on <video>, <canvas> etc.
2285         https://bugs.webkit.org/show_bug.cgi?id=138684
2286
2287         Reviewed by Darin Adler.
2288         
2289         Support encode/decode for WebCore Path objects, which is done by traversing
2290         the path.
2291
2292         * Shared/WebCoreArgumentCoders.cpp:
2293         (IPC::pathPointCountApplierFunction):
2294         (IPC::pathEncodeApplierFunction):
2295         (IPC::ArgumentCoder<Path>::encode):
2296         (IPC::ArgumentCoder<Path>::decode):
2297         * Shared/WebCoreArgumentCoders.h:
2298         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2299         (WebKit::applyPropertiesToLayer): Actually apply the path and wind rule to the shape layer.
2300         * Shared/mac/RemoteLayerTreeTransaction.h: Include path and wind rule in the layer properties.
2301         * Shared/mac/RemoteLayerTreeTransaction.mm:
2302         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2303         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): Encode shape and wind rule.
2304         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): Decode shape and wind rule.
2305         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2306         (WebKit::PlatformCALayerRemote::shapePath):
2307         (WebKit::PlatformCALayerRemote::setShapePath):
2308         (WebKit::PlatformCALayerRemote::shapeWindRule):
2309         (WebKit::PlatformCALayerRemote::setShapeWindRule):
2310         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2311
2312 2015-03-01  Chris Dumez  <cdumez@apple.com>
2313
2314         Make NotificationCenter / Notification suspendable
2315         https://bugs.webkit.org/show_bug.cgi?id=142117
2316         <rdar://problem/19923085>
2317
2318         Reviewed by Andreas Kling.
2319
2320         Provide implementation for NotificationClient::hasPendingPermissionRequests().
2321
2322         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
2323         (WebKit::NotificationPermissionRequestManager::hasPendingPermissionRequests):
2324         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
2325         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
2326         (WebKit::WebNotificationClient::hasPendingPermissionRequests):
2327         * WebProcess/WebCoreSupport/WebNotificationClient.h:
2328
2329 2015-03-01  Antti Koivisto  <antti@apple.com>
2330
2331         Enable new disk cache on iOS
2332         https://bugs.webkit.org/show_bug.cgi?id=142148
2333
2334         Reviewed by Sam Weinig.
2335
2336         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2337
2338             iOS build fix.
2339
2340         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2341         (WebKit::registerUserDefaultsIfNeeded):
2342
2343             Disable the efficacy logging by default for now. It has significant performance impact.
2344
2345         * config.h:
2346
2347             Enable it.
2348
2349 2015-02-28  Anders Carlsson  <andersca@apple.com>
2350
2351         WebsiteDataStore should handle fetching and deleting local storage data
2352         https://bugs.webkit.org/show_bug.cgi?id=142137
2353
2354         Reviewed by Sam Weinig.
2355
2356         * UIProcess/Storage/StorageManager.cpp:
2357         (WebKit::StorageManager::deleteEntriesForOrigins):
2358         Add a new function that deletes entries from multiple origins.
2359
2360         * UIProcess/Storage/StorageManager.h:
2361         Add new members.
2362
2363         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2364         (WebKit::WebsiteDataStore::fetchData):
2365         Fetch local storage data as well.
2366
2367         (WebKit::WebsiteDataStore::removeData):
2368         Delete local storage data as well.
2369
2370 2015-02-28  Anders Carlsson  <andersca@apple.com>
2371
2372         Fetch cache origins from the network process
2373         https://bugs.webkit.org/show_bug.cgi?id=142135
2374
2375         Reviewed by Dan Bernstein.
2376
2377         * NetworkProcess/NetworkProcess.cpp:
2378         (WebKit::cfURLCacheOrigins):
2379         Add a new helper function that returns a vector of CFURL cache origins.
2380
2381         (WebKit::fetchDiskCacheOrigins):
2382         Fetch the disk cache origins and pass them along to the completion handler. Currently we don't handle the new disk cache.
2383
2384         (WebKit::NetworkProcess::fetchWebsiteData):
2385         Create a callback aggregator and fetch disk cache origins if we're asked for it.
2386
2387         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2388         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
2389         New helper function that computes if we need to launch the network process in order to fetch data.
2390
2391         (WebKit::WebsiteDataStore::fetchData):
2392         Fetch website data from the network process as well.
2393
2394 2015-02-28  Anders Carlsson  <andersca@apple.com>
2395
2396         Simplify WebResourceCacheManagerCFNet.mm code
2397         https://bugs.webkit.org/show_bug.cgi?id=142134
2398
2399         Reviewed by Dan Bernstein.
2400
2401         - ENABLE(CACHE_PARTITIONING) is always true on Mac and iOS, so remove those #ifdefs.
2402         - Make cfURLCacheHostNamesWithCallback and clearCFURLCacheForHostNames public
2403           so they can be used by the new WebsiteDataStore code in an upcoming patch.
2404         - Change cfURLCacheHostNamesWithCallback to take an std::function instead of a block.
2405
2406         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
2407         (WebKit::WebResourceCacheManager::getCacheOrigins):
2408         * WebProcess/ResourceCache/WebResourceCacheManager.h:
2409         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.mm:
2410         (WebKit::partitionName):
2411         (WebKit::WebResourceCacheManager::cfURLCacheHostNamesWithCallback):
2412         (WebKit::WebResourceCacheManager::clearCFURLCacheForHostNames):
2413         (WebKit::WebResourceCacheManager::cfURLCacheHostNames): Deleted.
2414
2415 2015-02-28  Commit Queue  <commit-queue@webkit.org>
2416
2417         Unreviewed, rolling out r180804.
2418         https://bugs.webkit.org/show_bug.cgi?id=142131
2419
2420         Broke nightlies (Requested by ap on #webkit).
2421
2422         Reverted changeset:
2423
2424         "[WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API"
2425         https://bugs.webkit.org/show_bug.cgi?id=141176
2426         http://trac.webkit.org/changeset/180804
2427
2428 2015-02-27  Hunseop Jeong  <hs85.jeong@samsung.com>
2429
2430         [EFL][GTK] Fix build break after r180790,180798 
2431         https://bugs.webkit.org/show_bug.cgi?id=142127
2432
2433         Reviewed by Gyuyoung Kim.
2434
2435         * CMakeLists.txt:
2436
2437 2015-02-27  Chris Dumez  <cdumez@apple.com>
2438
2439         [WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API
2440         https://bugs.webkit.org/show_bug.cgi?id=141176
2441
2442         Reviewed by Sam Weinig.
2443
2444         Drop legacy WKBundlePageDiagnosticLoggingClient WK2 API as we are now
2445         exposing this functionality via WKPageDiagnosticLoggingClient.h on
2446         UIProcess side. The client-side has already been ported over.
2447
2448         * CMakeLists.txt:
2449         * Shared/API/c/WKSharedAPICast.h:
2450         (WebKit::toAPI): Deleted.
2451         (WebKit::toDiagnosticLoggingResultType): Deleted.
2452         * UIProcess/API/C/WKAPICast.h:
2453         (WebKit::toAPI):
2454         * UIProcess/API/C/WKDiagnosticLoggingResultType.h: Renamed from Source/WebKit2/Shared/API/c/WKDiagnosticLoggingResultType.h.
2455         * WebKit2.xcodeproj/project.pbxproj:
2456         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2457         (WKBundlePageSetDiagnosticLoggingClient): Deleted.
2458         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2459         * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h: Removed.
2460         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp: Removed.
2461         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h: Removed.
2462         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
2463         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
2464         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
2465         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
2466         * WebProcess/WebPage/WebPage.cpp:
2467         (WebKit::WebPage::WebPage):
2468         (WebKit::WebPage::close):
2469         (WebKit::WebPage::initializeInjectedBundleDiagnosticLoggingClient): Deleted.
2470         * WebProcess/WebPage/WebPage.h:
2471         (WebKit::WebPage::injectedBundleDiagnosticLoggingClient): Deleted.
2472
2473 2015-02-27  Anders Carlsson  <andersca@apple.com>
2474
2475         Rename WebResourceCacheManagerCFNet.cpp to WebResourceCacheManagerCFNet.mm
2476
2477         Rubber-stamped by Dan Bernstein.
2478
2479         This will let us use lambda to block conversion in a subsequent patch.
2480
2481         * WebKit2.xcodeproj/project.pbxproj:
2482         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.mm: Renamed from Source/WebKit2/WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp.
2483
2484 2015-02-27  Commit Queue  <commit-queue@webkit.org>
2485
2486         Unreviewed, rolling out r180203 and r180210.
2487         https://bugs.webkit.org/show_bug.cgi?id=142116
2488
2489         broke process suspension and tile map (Requested by thorton on
2490         #webkit).
2491
2492         Reverted changesets:
2493
2494         "Adopt CAMachPort-as-layer-contents"
2495         https://bugs.webkit.org/show_bug.cgi?id=141687
2496         http://trac.webkit.org/changeset/180203
2497
2498         "Fix the !USE(IOSURFACE) build"
2499         http://trac.webkit.org/changeset/180210
2500
2501 2015-02-27  Sam Weinig  <sam@webkit.org>
2502
2503         Add WebKit2 SPI to create a DOM File object
2504         https://bugs.webkit.org/show_bug.cgi?id=142109
2505
2506         Reviewed by Tim Horton.
2507
2508         Add a new handle type for exposing a DOM File object to script. Follow
2509         the pattern of WKBundleNodeHandleRef and WKBundleRangeHandleRef with the
2510         new class WKBundleFileHandleRef. It can be created for a specific path,
2511         and then the JS wrapper can be obtained via WKBundleFrameGetJavaScriptWrapperForFileForWorld.
2512
2513         * Shared/API/APIObject.h:
2514         * Shared/API/c/WKBase.h:
2515         * WebKit2.xcodeproj/project.pbxproj:
2516         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
2517         * WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp: Added.
2518         (WKBundleFileHandleGetTypeID):
2519         (WKBundleFileHandleCreateWithPath):
2520         * WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h: Added.
2521         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2522         (WKBundleFrameGetJavaScriptWrapperForFileForWorld):
2523         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2524         * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp: Added.
2525         (WebKit::domHandleCache):
2526         (WebKit::InjectedBundleFileHandle::create):
2527         (WebKit::InjectedBundleFileHandle::getOrCreate):
2528         (WebKit::InjectedBundleFileHandle::InjectedBundleFileHandle):
2529         (WebKit::InjectedBundleFileHandle::~InjectedBundleFileHandle):
2530         (WebKit::InjectedBundleFileHandle::coreFile):
2531         * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h: Added.
2532         * WebProcess/WebPage/WebFrame.cpp:
2533         (WebKit::WebFrame::jsWrapperForWorld):
2534         * WebProcess/WebPage/WebFrame.h:
2535
2536 2015-02-27  Beth Dakin  <bdakin@apple.com>
2537
2538         Lookup panel dismisses when pages are loading in other tabs/windows
2539         https://bugs.webkit.org/show_bug.cgi?id=142104
2540         -and corresponding-
2541         rdar://problem/19882137
2542
2543         Reviewed by Tim Horton.
2544
2545         Until rdar://problem/13875766 is resolved, we should only call into Lookup and 
2546         DataDetectors for key windows.
2547         * UIProcess/API/mac/WKView.mm:
2548         (-[WKView _dismissContentRelativeChildWindows]):
2549
2550 2015-02-27  Anders Carlsson  <andersca@apple.com>
2551
2552         Add infrastructure for handling website data in the network process
2553         https://bugs.webkit.org/show_bug.cgi?id=142092
2554
2555         Reviewed by Andreas Kling.
2556
2557         * NetworkProcess/NetworkProcess.cpp:
2558         (WebKit::NetworkProcess::fetchWebsiteData):
2559         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2560         Send back "Did" messages without actually doing anything for now.
2561
2562         * NetworkProcess/NetworkProcess.h:
2563         Add new members.
2564
2565         * NetworkProcess/NetworkProcess.messages.in:
2566         Add FetchWebsiteData and DeleteWebsiteDataForOrigins messages.
2567
2568         * UIProcess/Network/NetworkProcessProxy.cpp:
2569         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
2570         Assert that all maps are empty.
2571
2572         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2573         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2574         Add callbacks and send fetch and delete messages respectively.
2575
2576         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
2577         Make sure to invoke all callbacks.
2578
2579         (WebKit::NetworkProcessProxy::didFetchWebsiteData):
2580         Find the callback and invoke it.
2581
2582         (WebKit::NetworkProcessProxy::didDeleteWebsiteDataForOrigins):
2583         Ditto.
2584
2585         * UIProcess/Network/NetworkProcessProxy.h:
2586         Add new members.
2587
2588         * UIProcess/Network/NetworkProcessProxy.messages.in:
2589         Add DidFetchWebsiteData and DidDeleteWebsiteDataForOrigins messages.
2590
2591         * UIProcess/WebProcessProxy.cpp:
2592         (WebKit::WebProcessProxy::connectionDidClose):
2593         Just pass an empty WebsiteData object.
2594
2595 2015-02-26  Enrica Casucci  <enrica@apple.com>
2596
2597         [WK2] REGRESSION(r180465): WebKit::WebPage::editorState() triggers a layout.
2598         https://bugs.webkit.org/show_bug.cgi?id=142015
2599
2600         Reviewed by Alexey Proskuryakov.
2601
2602         We no longer compute the font information at selection
2603         when we update the editor state.
2604         Instead, we request the font information only when the selection
2605         changes and the font panel is visible.
2606         I added an observer to be notified of the font panel visibility
2607         changes to update NSFontManager to reflect the font at the
2608         current selection.
2609
2610         * Shared/EditorState.cpp:
2611         (WebKit::EditorState::encode):
2612         (WebKit::EditorState::decode):
2613         * Shared/EditorState.h:
2614         (WebKit::EditorState::EditorState):
2615         * UIProcess/API/mac/WKView.mm:
2616         (-[WKView updateFontPanelIfNeeded]):
2617         (-[WKView _selectionChanged]):
2618         (-[WKView addWindowObserversForWindow:]):
2619         (-[WKView removeWindowObservers]):
2620         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
2621         * UIProcess/WebPageProxy.h:
2622         * UIProcess/WebPageProxy.messages.in:
2623         * UIProcess/mac/WebPageProxyMac.mm:
2624         (WebKit::WebPageProxy::fontAtSelection):
2625         (WebKit::WebPageProxy::fontAtSelectionCallback):
2626         * WebProcess/WebPage/WebPage.h:
2627         * WebProcess/WebPage/WebPage.messages.in:
2628         * WebProcess/WebPage/mac/WebPageMac.mm:
2629         (WebKit::WebPage::platformEditorState):
2630         (WebKit::WebPage::fontAtSelection):
2631
2632 2015-02-27  Brady Eidson  <beidson@apple.com>
2633
2634         Add API to remove a single content filter.
2635         <rdar://problem/19977764> and https://bugs.webkit.org/show_bug.cgi?id=142088
2636
2637         Reviewed by Sam Weinig.
2638
2639         * Shared/WebPageGroupData.h:
2640
2641         * UIProcess/API/C/WKPageGroup.cpp:
2642         (WKPageGroupRemoveUserContentFilter):
2643
2644         * UIProcess/API/C/WKPageGroup.h:
2645         * UIProcess/API/Cocoa/WKUserContentController.mm:
2646         (-[WKUserContentController _removeUserContentFilter:]):
2647
2648         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2649         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2650         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2651         (WebKit::WebUserContentControllerProxy::addProcess):
2652         (WebKit::WebUserContentControllerProxy::addUserContentFilter):
2653         (WebKit::WebUserContentControllerProxy::removeUserContentFilter):
2654         (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
2655         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2656
2657         * UIProcess/WebPageGroup.cpp:
2658         (WebKit::WebPageGroup::addUserContentFilter):
2659         (WebKit::WebPageGroup::removeUserContentFilter):
2660         * UIProcess/WebPageGroup.h:
2661
2662         * WebProcess/UserContent/WebUserContentController.cpp:
2663         (WebKit::WebUserContentController::removeUserContentFilter):
2664         * WebProcess/UserContent/WebUserContentController.h:
2665         * WebProcess/UserContent/WebUserContentController.messages.in:
2666
2667         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2668         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
2669         (WebKit::WebPageGroupProxy::removeUserContentFilter):
2670         * WebProcess/WebPage/WebPageGroupProxy.h:
2671         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
2672
2673 2015-02-26  Anders Carlsson  <andersca@apple.com>
2674
2675         Add API to remove all website data for the given data records
2676         https://bugs.webkit.org/show_bug.cgi?id=142060
2677
2678         Reviewed by Beth Dakin.
2679
2680         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2681         Add new method declaration.
2682
2683         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2684         (toWebsiteDataRecords):
2685         Add a helper function that converts an NSArray of _WKWebsiteDataRecords to a Vector of WebsiteDataRecords.
2686
2687         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2688         Call through to the underlying WebsiteDataStore.
2689
2690         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2691         (WebKit::WebsiteDataStore::removeData):
2692         Figure out which processes to call deleteWebsiteDataForOrigins for and do so. Add a callback aggregator so we can
2693         call the completion handler at the right time.
2694
2695         * UIProcess/WebsiteData/WebsiteDataStore.h:
2696         Add new members.
2697
2698         * WebProcess/WebProcess.cpp:
2699         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
2700         Use the newly added MemoryCache member function to delete all resources matching the set of origins.
2701
2702 2015-02-26  Chris Dumez  <cdumez@apple.com>
2703
2704         Rename DatabaseManager::manager() to DatabaseManager::singleton()
2705         https://bugs.webkit.org/show_bug.cgi?id=142054
2706
2707         Reviewed by Ryosuke Niwa.
2708
2709         Rename DatabaseManager::manager() to DatabaseManager::singleton() as
2710         per coding style and use WTF::NeverDestroyed.
2711
2712         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2713         (WebKit::WebChromeClient::exceededDatabaseQuota):
2714         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2715         (WebKit::WebDatabaseManager::initialize):
2716         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
2717         (WebKit::WebDatabaseManager::getDatabaseOrigins):
2718         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
2719         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
2720         (WebKit::WebDatabaseManager::deleteAllDatabases):
2721         (WebKit::WebDatabaseManager::setQuotaForOrigin):
2722         * WebProcess/WebPage/WebPage.cpp:
2723         (WebKit::WebPage::updatePreferences):
2724
2725 2015-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
2726
2727         [Mac] [iOS] Parsing support for -apple-trailing-word
2728         https://bugs.webkit.org/show_bug.cgi?id=141939
2729
2730         Reviewed by Andreas Kling.
2731
2732         * Configurations/FeatureDefines.xcconfig:
2733
2734 2015-02-26  Brady Eidson  <beidson@apple.com>
2735
2736         Make WKPageGroupRemoveAllUserContentFilters actually remove all user content filters
2737         https://bugs.webkit.org/show_bug.cgi?id=142047
2738
2739         Reviewed by Geoff Garen.
2740
2741         * UIProcess/API/C/WKPageGroup.cpp:
2742         (WKPageGroupRemoveAllUserContentFilters): Remove all content filters instead of removing all user scripts.
2743
2744 2015-02-25  Anders Carlsson  <andersca@apple.com>
2745
2746         Add (unused for now) code to delete website data for a set of origins
2747         https://bugs.webkit.org/show_bug.cgi?id=142019
2748
2749         Reviewed by Beth Dakin.
2750
2751         * UIProcess/WebProcessProxy.cpp:
2752         (WebKit::WebProcessProxy::~WebProcessProxy):
2753         Assert that there are no pending callbacks.
2754
2755         (WebKit::WebProcessProxy::connectionDidClose):
2756         Invoke all the didDeleteWebsiteDataForOrigins callbacks.
2757
2758         (WebKit::WebProcessProxy::didDeleteWebsiteDataForOrigins):
2759         Grab the didDeleteWebsiteDataForOrigins and invoke it.
2760
2761         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
2762         Add the pending callback and send a DeleteWebsiteDataForOrigins to the web process.
2763
2764         * UIProcess/WebProcessProxy.h:
2765         Add new members.
2766
2767         * UIProcess/WebProcessProxy.messages.in:
2768         Add a DidDeleteWebsiteDataForOrigins message.
2769
2770         * WebProcess/WebProcess.cpp:
2771         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
2772         For now, just send back a DidDeleteWebsiteDataForOrigins message.
2773
2774         * WebProcess/WebProcess.h:
2775         Add new members.
2776
2777         * WebProcess/WebProcess.messages.in:
2778         Add a DeleteWebsiteDataForOrigins message.
2779
2780 2015-02-25  Shivakumar JM  <shiva.jm@samsung.com>
2781
2782         Fix build warning in WebKit2/UIProcess module.
2783         https://bugs.webkit.org/show_bug.cgi?id=142014
2784
2785         Reviewed by Anders Carlsson.
2786
2787         Fix build warning by using UNUSED_PARAM macro.
2788
2789         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2790         (WebKit::computeWebProcessAccessTypeForDataFetch):
2791
2792 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
2793
2794         Clarify some resizing terminology in ScrollView/FrameView
2795         https://bugs.webkit.org/show_bug.cgi?id=141996
2796
2797         Reviewed by Zalan Bujtas.
2798
2799         ScrollableArea/ScrollView/FrameView had some confusing terminology around
2800         contentsResized/visibleContentsResized/fixedLayoutSizeChanged.
2801         
2802         Clarify this by distinguishing between:
2803         1. Available size changes because of
2804             i) non-overlay scrollbar presence
2805            ii) ScrollableArea frame change
2806         2. Removing fixedLayoutSizeChanged() and just treating it like an
2807            available size change.
2808            
2809         contentsResized() is relegated to simply being a hook that allows Mac to
2810         flash overlay scrollbars.
2811         
2812         The confusingly named visibleContentsResized() is now updateContentsSize(),
2813         and is the way that a ScrollableArea tells its subclasss that it should recompute
2814         the size of the contents (i.e. do a layout).
2815
2816         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2817         (WebKit::PDFPlugin::scrollbarStyleChanged): Call the base class method,
2818         which takes care of 
2819
2820 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
2821
2822         Use an enum for scrollbar style
2823         https://bugs.webkit.org/show_bug.cgi?id=141985
2824
2825         Reviewed by Beth Dakin.
2826         
2827         Switch to an enum class for the scrollbar style (normal or overlay).
2828         
2829         Sadly it still has to be passed as an int across the process boundary.
2830
2831         * UIProcess/PageClient.h:
2832         * UIProcess/WebPageProxy.cpp:
2833         (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
2834         * UIProcess/mac/PageClientImpl.h:
2835         * UIProcess/mac/PageClientImpl.mm:
2836         (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
2837         * WebProcess/Plugins/PDF/PDFPlugin.h:
2838         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2839         (WebKit::PDFPlugin::scrollbarStyleChanged):
2840         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2841         (WebKit::WebChromeClient::recommendedScrollbarStyleDidChange):
2842         * WebProcess/WebCoreSupport/WebChromeClient.h:
2843
2844 2015-02-24  Chris Dumez  <cdumez@apple.com>
2845
2846         [Mac][WK2] ASSERTION FAILED: m_sendPort in IPC::Connection::open()
2847         https://bugs.webkit.org/show_bug.cgi?id=141934
2848
2849         Reviewed by Darin Adler.
2850
2851         Speculative fix for "ASSERTION FAILED: m_sendPort" in
2852         IPC::Connection::open(). This assertion seems to indicate we ended
2853         up in IPC::Connection::open() with MACH_PORT_NULL as port.
2854
2855         I found that in XPCServiceInitializerDelegate::getConnectionIdentifier()
2856         we return true unconditionally, even though
2857         xpc_dictionary_copy_mach_send() can return MACH_PORT_NULL. This patch
2858         updates this method to add a check for MACH_PORT_NULL and return false
2859         in this case.
2860
2861         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2862         (WebKit::XPCServiceInitializerDelegate::getConnectionIdentifier):
2863
2864 2015-02-24  Commit Queue  <commit-queue@webkit.org>
2865
2866         Unreviewed, rolling out r180599.
2867         https://bugs.webkit.org/show_bug.cgi?id=141998
2868
2869         Lots of new test failures (Requested by smfr on #webkit).
2870
2871         Reverted changeset:
2872
2873         "Parsing support for -webkit-trailing-word"
2874         https://bugs.webkit.org/show_bug.cgi?id=141939
2875         http://trac.webkit.org/changeset/180599
2876
2877 2015-02-24  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2878
2879         Fix build break on EFL and GTK port since r180585.
2880         https://bugs.webkit.org/show_bug.cgi?id=141994
2881
2882         Reviewed by Joseph Pecoraro.
2883
2884         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2885         (WebKit::WebsiteDataRecord::displayNameForOrigin):
2886         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2887         (WebKit::WebsiteDataRecord::WebsiteDataRecord):
2888
2889 2015-02-24  Myles C. Maxfield  <mmaxfield@apple.com>
2890
2891         [Mac] [iOS] Parsing support for -apple-trailing-word
2892         https://bugs.webkit.org/show_bug.cgi?id=141939
2893
2894         Reviewed by Andreas Kling.
2895
2896         * Configurations/FeatureDefines.xcconfig:
2897
2898 2015-02-24  Csaba Osztrogonác  <ossy@webkit.org>
2899
2900         Buildfix after r180585.
2901
2902         * CMakeLists.txt:
2903
2904 2015-02-24  Anders Carlsson  <andersca@apple.com>
2905
2906         Pass _WKWebsiteDataRecord objects to the fetchData completion handler
2907         https://bugs.webkit.org/show_bug.cgi?id=141984
2908
2909         Reviewed by Andreas Kling.
2910
2911         * Shared/Cocoa/APIObject.mm:
2912         (API::Object::newObject):
2913         Create _WKWebsiteDataRecord objects for WebsiteDataRecord API objects.
2914
2915         * UIProcess/API/APIWebsiteDataRecord.h:
2916         Add WebsiteDataRecord getter.
2917
2918         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
2919         Add displayName and dataTypes properties.
2920
2921         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
2922         (dataTypesToString):
2923         Helper function to convert dataTypes bit-fields to strings.
2924
2925         (-[_WKWebsiteDataRecord description]):
2926         Include the display name and data types in the description.
2927
2928         (-[_WKWebsiteDataRecord displayName]):
2929         Return the display name.
2930
2931         (-[_WKWebsiteDataRecord dataTypes]):
2932         Return the data types.
2933
2934         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
2935         (WebKit::toWebsiteDataTypes):
2936         Move this here from _WKWebsiteDataStore.mm.
2937
2938         (WebKit::toWKWebsiteDataTypes):
2939         Add new function to convert WebsiteDataTypes to WKWebsiteDataTypes.
2940
2941         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2942         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2943         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2944         Qualify toWebsiteDataTypes calls.
2945
2946         * UIProcess/WebsiteData/WebsiteDataRecord.cpp: Added.
2947         (WebKit::WebsiteDataRecord::displayNameForOrigin):
2948         New helper that returns a display name given an origin.
2949
2950         (WebKit::WebsiteDataRecord::add):
2951         Add the origin as well as the type.
2952
2953         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2954         Add new members.
2955
2956         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2957         (WebKit::WebsiteDataStore::fetchData):
2958         Loop through the entries and add them to the m_websiteDataRecords hash map, which
2959         is keyed off of the display name. Pass the m_websiteDataRecords values to the completion handler.
2960
2961         * WebKit2.xcodeproj/project.pbxproj:
2962
2963 2015-02-24  Csaba Osztrogonác  <ossy@webkit.org>
2964
2965         One more buildfix after r180575.
2966
2967         * UIProcess/WebProcessProxy.cpp:
2968         (WebKit::WebProcessProxy::connectionDidClose):
2969
2970 2015-02-24  Csaba Osztrogonác  <ossy@webkit.org>
2971
2972         URTBF after 180575.
2973
2974         * CMakeLists.txt:
2975
2976 2015-02-24  Anders Carlsson  <andersca@apple.com>
2977
2978         Implement more of the data fetching API
2979         https://bugs.webkit.org/show_bug.cgi?id=141975
2980
2981         Reviewed by Andreas Kling.
2982
2983         * Shared/WebsiteData/WebsiteData.cpp: Added.
2984         (WebKit::WebsiteData::Entry::encode):
2985         (WebKit::WebsiteData::Entry::decode):
2986         (WebKit::WebsiteData::encode):
2987         (WebKit::WebsiteData::decode):
2988         * Shared/WebsiteData/WebsiteData.h: Added.
2989         Add a new WebsiteData class that will store website data. Currently it only stores
2990         origin + website data type, but in the future it is going to store more things, like 
2991         host names that have cookies associated.
2992
2993         * UIProcess/WebProcessProxy.cpp:
2994         (WebKit::WebProcessProxy::~WebProcessProxy):
2995         Assert that we don't have any pending fetch data callbacks.
2996
2997         (WebKit::WebProcessProxy::connectionDidClose):
2998         Invoke any pending fetch website data callbacks.
2999
3000         (WebKit::WebProcessProxy::didFetchWebsiteData):
3001         Grab the callback and invoke it.
3002
3003         (WebKit::WebProcessProxy::fetchWebsiteData):
3004         Set up a pending callback and send a FetchWebsiteData message to the web process.
3005
3006         * UIProcess/WebProcessProxy.h:
3007         Add new member.
3008
3009         * UIProcess/WebProcessProxy.messages.in:
3010         Add a DidFetchWebsiteData message.
3011
3012         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3013         (WebKit::computeWebProcessAccessTypeForDataFetch):
3014         Return the web process access type for the given set of data types.
3015
3016         (WebKit::WebsiteDataStore::fetchData):
3017         Set up a callback aggregator that will assemble the needed website data into a vector of website data records.
3018
3019         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
3020         (WebKit::computeWebProcessAccessTypeForDataRemoval):
3021         Rename these functions to indicate that they are about data removal.
3022
3023         (WebKit::WebsiteDataStore::removeData):
3024         Append "ForDataRemoval" to function calls.
3025
3026         * WebKit2.xcodeproj/project.pbxproj:
3027         Add new files.
3028
3029         * WebProcess/Storage/StorageAreaMap.cpp:
3030         (WebKit::StorageAreaMap::StorageAreaMap):
3031         Tighten types.
3032
3033         * WebProcess/WebProcess.cpp:
3034         (WebKit::WebProcess::fetchWebsiteData):
3035         For now, just fetch memory cache data.
3036
3037         * WebProcess/WebProcess.h:
3038         Add new members.
3039
3040         * WebProcess/WebProcess.messages.in:
3041         Add FetchWebsiteData message.
3042
3043 2015-02-24  Yusuke Suzuki  <utatane.tea@gmail.com>
3044
3045         REGRESSION(r179429): Can't type comments in Facebook
3046         https://bugs.webkit.org/show_bug.cgi?id=141859
3047
3048         Reviewed by Brent Fulgham.
3049
3050         Enable SymbolEnabled in inspector context.
3051
3052         * Shared/WebPreferencesDefinitions.h:
3053         * UIProcess/API/C/WKPreferences.cpp:
3054         (WKPreferencesSetJavaScriptRuntimeFlags):
3055         (WKPreferencesGetJavaScriptRuntimeFlags):
3056         (WKPreferencesSetJavaScriptExperimentsEnabled): Deleted.
3057         (WKPreferencesGetJavaScriptExperimentsEnabled): Deleted.
3058         * UIProcess/API/C/WKPreferencesRef.h:
3059         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3060         * UIProcess/API/Cocoa/WKPreferences.mm:
3061         (-[WKPreferences _javaScriptRuntimeFlags]):
3062         (-[WKPreferences _setJavaScriptRuntimeFlags:]):
3063         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3064         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3065         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3066         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3067         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3068         * UIProcess/mac/WebInspectorProxyMac.mm:
3069         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3070         * WebProcess/WebPage/WebPage.cpp:
3071         (WebKit::WebPage::updatePreferences):
3072         * mac/WebKit2.order:
3073
3074 2015-02-24  Anders Carlsson  <andersca@apple.com>
3075
3076         Tighten up some SecurityOrigin related code, use references where possible
3077         https://bugs.webkit.org/show_bug.cgi?id=141971
3078
3079         Reviewed by Antti Koivisto.
3080
3081         * DatabaseProcess/DatabaseProcess.cpp:
3082         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
3083         * Shared/SecurityOriginData.cpp:
3084         (WebKit::SecurityOriginData::fromSecurityOrigin):
3085         (WebKit::SecurityOriginData::securityOrigin):
3086         * Shared/SecurityOriginData.h:
3087         * UIProcess/Storage/StorageManager.cpp:
3088         (WebKit::StorageManager::createTransientLocalStorageMap):
3089         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3090         (WebKit::WebIDBServerConnection::WebIDBServerConnection):
3091         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3092         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
3093         * WebProcess/Storage/StorageAreaMap.cpp:
3094         (WebKit::StorageAreaMap::create):
3095         (WebKit::StorageAreaMap::StorageAreaMap):
3096         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
3097         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
3098         * WebProcess/Storage/StorageAreaMap.h:
3099         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3100         (WebKit::StorageNamespaceImpl::storageArea):
3101
3102 2015-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3103
3104         Crash loading local file with WebPageProxy::loadAlternateHTMLString
3105         https://bugs.webkit.org/show_bug.cgi?id=141867
3106
3107         Reviewed by Anders Carlsson.
3108
3109         WebPageProxy::loadAlternateHTMLString needs to assume read access to unreachableURL as well
3110         as baseURL, because unreachableURL will get added to the back/forward list, causing us to
3111         crash later on when we notice the unexpected URL received in checkURLReceivedFromWebProcess.
3112
3113         * UIProcess/WebPageProxy.cpp:
3114         (WebKit::WebPageProxy::loadAlternateHTMLString):
3115
3116 2015-02-24  Ryuan Choi  <ryuan.choi@navercorp.com>
3117
3118         [EFL] Add message APIs to communicate between ewk_context and extensions
3119         https://bugs.webkit.org/show_bug.cgi?id=137660
3120
3121         Reviewed by Gyuyoung Kim.
3122
3123         * PlatformEfl.cmake: Added dependencies for ewk2UnitTestExtensionSample
3124         * UIProcess/API/efl/ewk_context.cpp:
3125         (EwkContext::EwkContext):
3126         (EwkContext::didReceiveMessageFromInjectedBundle):
3127         (EwkContext::setMessageFromExtensionCallback):
3128         (EwkContext::processReceivedMessageFromInjectedBundle):
3129         (ewk_context_message_post_to_extensions):
3130         (ewk_context_message_from_extensions_callback_set):
3131         (EwkContext::didReceiveSynchronousMessageFromInjectedBundle):
3132         Deleted to split synchronouse message APIs from asynchronuous message APIs.
3133         ewebkit will not support this until there are requirements.
3134         (EwkContext::setMessageFromInjectedBundleCallback): Renamed to setMessageFromExtensionCallback.
3135         (ewk_context_message_post_to_injected_bundle): Renamed to ewk_context_message_post_to_extensions.
3136         (ewk_context_message_from_injected_bundle_callback_set): Renamed to ewk_context_message_from_injected_bundle_callback_set.
3137         * UIProcess/API/efl/ewk_context.h:
3138         * UIProcess/API/efl/ewk_context_private.h:
3139         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
3140         Improved test case for ewk_context_new_with_extensions_path using the message APIs.
3141         (EWK2UnitTest::EWK2UnitTestBase::EWK2UnitTestBase):
3142         (EWK2UnitTest::EWK2UnitTestBase::SetUp):
3143         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
3144         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp:
3145         (EWK2UnitTest::EWK2UnitTestEnvironment::extensionSample): Deleted.
3146         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h:
3147         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
3148         Improved test case for ewk_context_new_with_extensions_path using the message APIs.
3149         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Ditto.
3150         (EWK2ContextTestWithExtension::messageReceivedCallback):
3151         (EWK2ContextTestWithExtension::EWK2ContextTestWithExtension):
3152         (TEST_F):
3153         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
3154         (toEwkExtendion):
3155         (EwkExtension::EwkExtension):
3156         (EwkExtension::didCreatePage):
3157         (EwkExtension::willDestroyPage):
3158         (EwkExtension::didReceiveMessage):
3159         (EwkExtension::didReceiveMessageToPage):
3160         (ewk_extension_message_post): Implemented to post message to ewk_context.
3161         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
3162         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h:
3163         (EwkExtension::bundle):
3164         * WebProcess/efl/ExtensionManagerEfl.cpp:
3165         (WebKit::ExtensionManagerEfl::initialize):
3166         Fixed the bug when there are different shared objects in extension path.
3167         This is spotted while improving test case.
3168
3169 2015-02-23  Commit Queue  <commit-queue@webkit.org>
3170
3171         Unreviewed, rolling out r180547 and r180550.
3172         https://bugs.webkit.org/show_bug.cgi?id=141957
3173
3174         Broke 10 Windows tests. (Requested by bfulgham_ on #webkit).
3175
3176         Reverted changesets:
3177
3178         "REGRESSION(r179429): Can't type comments in Facebook"
3179         https://bugs.webkit.org/show_bug.cgi?id=141859
3180         http://trac.webkit.org/changeset/180547
3181
3182         "Constructor returning null should construct an object instead
3183         of null"
3184         https://bugs.webkit.org/show_bug.cgi?id=141640
3185         http://trac.webkit.org/changeset/180550
3186
3187 2015-02-23  Ryosuke Niwa  <rniwa@webkit.org>
3188
3189         Disable font loading events until our implementation gets updated to match the latest spec
3190         https://bugs.webkit.org/show_bug.cgi?id=141938
3191
3192         Reviewed by Andreas Kling.
3193
3194         * Configurations/FeatureDefines.xcconfig:
3195
3196 2015-02-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3197
3198         REGRESSION(r179429): Can't type comments in Facebook
3199         https://bugs.webkit.org/show_bug.cgi?id=141859
3200
3201         Reviewed by Geoffrey Garen.
3202
3203         Enable SymbolEnabled in inspector context.
3204
3205         * Shared/WebPreferencesDefinitions.h:
3206         * UIProcess/API/C/WKPreferences.cpp:
3207         (WKPreferencesSetJavaScriptRuntimeFlags):
3208         (WKPreferencesGetJavaScriptRuntimeFlags):
3209         (WKPreferencesSetJavaScriptExperimentsEnabled): Deleted.
3210         (WKPreferencesGetJavaScriptExperimentsEnabled): Deleted.
3211         * UIProcess/API/C/WKPreferencesRef.h:
3212         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3213         * UIProcess/API/Cocoa/WKPreferences.mm:
3214         (-[WKPreferences _javaScriptRuntimeFlags]):
3215         (-[WKPreferences _setJavaScriptRuntimeFlags:]):
3216         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3217         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3218         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3219         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3220         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3221         * UIProcess/mac/WebInspectorProxyMac.mm:
3222         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3223         * WebProcess/WebPage/WebPage.cpp:
3224         (WebKit::WebPage::updatePreferences):
3225         * mac/WebKit2.order:
3226
3227 2015-02-23  Benjamin Poulain  <bpoulain@apple.com>
3228
3229         [iOS WK2] The WebProcess keep scrolling pages based on the last velocity after scrolling has been interrupted
3230         https://bugs.webkit.org/show_bug.cgi?id=141933
3231         rdar://problem/18746673
3232         rdar://problem/19711490
3233
3234         Reviewed by Simon Fraser.
3235
3236         The bug happened like this:
3237         1) The user scroll the page. WKContentView tracks the velocity and send
3238            the update rect + velocity to the WebProcess.
3239         2) The user interupts the scrolling but does not commit to either scrolling
3240            again or cancelling the scrolling.
3241            Since we were not notified of this state, the WebProcess still believed
3242            the velocity is stable.
3243         3) With any paint update, the WebProcess would account for the last velocity
3244            and try to guess the best repaint area. This would drift endlessly out
3245            of the view since the view is not really moving.
3246
3247         This patch fixes the issue by adding special handling for interrupted scrolling.
3248
3249         Kudos to Kurt Revis for providing us the required APIs.
3250
3251         * Shared/VisibleContentRectUpdateInfo.h:
3252         (WebKit::operator==):
3253         We can no longer filter VisibleContentRectUpdateInfo ignoring the velocity.
3254
3255         Typically, UIScrollView would call -scrollViewDidScroll: before being interrupted.
3256         If we filter based on the VisibleContentRectUpdateInfo, we have two identical
3257         states differing only by the velocity. If we filter the second update, the WebProcess
3258         would never know the velocity should be zero.
3259
3260         * UIProcess/API/Cocoa/WKWebView.mm:
3261         (-[WKWebView _scrollViewDidInterruptDecelerating:]):
3262         We get this callback when scrolling is interrupted. We just need to clear
3263         the velocity and re-send a new update for the current state.
3264
3265         (-[WKWebView _updateVisibleContentRects]):
3266         Do not consider an interrupted scroll as a stable state. We don't know if scrolling
3267         will resume or will stop.
3268
3269         * UIProcess/ios/WKContentView.h:
3270         * UIProcess/ios/WKContentView.mm:
3271         (-[WKContentView didInterruptScrolling]):
3272
3273 2015-02-23  Anders Carlsson  <andersca@apple.com>
3274
3275         Add API for fetching website data records to _WKWebsiteDataStore
3276         https://bugs.webkit.org/show_bug.cgi?id=141926
3277
3278         Reviewed by Beth Dakin.
3279
3280         * UIProcess/API/APIWebsiteDataRecord.cpp:
3281         (API::WebsiteDataRecord::create):
3282         (API::WebsiteDataRecord::WebsiteDataRecord):
3283         * UIProcess/API/APIWebsiteDataRecord.h:
3284         Update to take a WebsiteDataRecord parameter.
3285
3286         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3287         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3288         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3289         Call down to the WebsiteDataStore.
3290
3291         * UIProcess/WebsiteData/WebsiteDataRecord.h: Added.
3292         This will be the data-container part of WebsiteDataRecord, but it's currently empty.
3293
3294         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3295         (WebKit::WebsiteDataStore::fetchData):
3296         Just dispatch the completion handler for now.
3297
3298         * UIProcess/WebsiteData/WebsiteDataStore.h:
3299         Add new member.
3300
3301         * WebKit2.xcodeproj/project.pbxproj:
3302         Add new files.
3303
3304 2015-02-23  Chris Dumez  <cdumez@apple.com>
3305
3306         Add support for diagnostic logging messages sampling
3307         https://bugs.webkit.org/show_bug.cgi?id=141823
3308         <rdar://problem/19899030>
3309
3310         Reviewed by Andreas Kling.
3311
3312         Add support for diagnostic logging messages sampling to decrease the
3313         impact of diagnostic logging on CPU usage, while still getting useful
3314         overall results. This patch adds a ShouldSample argument to
3315         logDiagnosticMessage*() functions and logs 5% of the messages when
3316         sampling. Sampling is turned on for keys that are known to be verbose
3317         (e.g. per resource load logging).
3318
3319         On the page load test I am tracking, CPU usage caused by diagnostic
3320         logging went down to 0.3% of UIProcess from 2.8% with this change.
3321
3322         * NetworkProcess/NetworkProcess.cpp:
3323         (WebKit::NetworkProcess::logDiagnosticMessage):
3324         (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
3325         (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
3326         * NetworkProcess/NetworkProcess.h:
3327         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
3328         (WebKit::NetworkCacheStatistics::recordNotUsingCacheForRequest):
3329         (WebKit::NetworkCacheStatistics::recordRetrievalFailure):
3330         (WebKit::NetworkCacheStatistics::recordRetrievedCachedEntry):
3331         * UIProcess/Network/NetworkProcessProxy.cpp:
3332         (WebKit::NetworkProcessProxy::logDiagnosticMessage):
3333         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
3334         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
3335         * UIProcess/Network/NetworkProcessProxy.h:
3336         * UIProcess/Network/NetworkProcessProxy.messages.in:
3337         * UIProcess/WebPageProxy.cpp:
3338         (WebKit::shouldLogDiagnosticMessage):
3339         (WebKit::WebPageProxy::logDiagnosticMessage):
3340         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
3341         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
3342         * UIProcess/WebPageProxy.h:
3343         * UIProcess/WebPageProxy.messages.in:
3344         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
3345         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
3346         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
3347         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
3348         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
3349         * WebProcess/WebPage/ios/WebPageIOS.mm:
3350         (WebKit::WebPage::willStartUserTriggeredZooming):
3351
3352 2015-02-23  Anders Carlsson  <andersca@apple.com>
3353
3354         Add a stubbed out _WKWebsiteDataRecord class
3355         https://bugs.webkit.org/show_bug.cgi?id=141919
3356
3357         Reviewed by Beth Dakin.
3358
3359         Also add the corresponding API::WebsiteDataRecord C++ class. A website data record is going to represent
3360         a set of associated websites and the types of website data that exist for said websites.
3361
3362         * Shared/API/APIObject.h:
3363         * UIProcess/API/APIWebsiteDataRecord.cpp: Added.
3364         * UIProcess/API/APIWebsiteDataRecord.h: Added.
3365         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: Added.
3366         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm: Added.
3367         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h: Added.
3368         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3369         * WebKit2.xcodeproj/project.pbxproj:
3370
3371 2015-02-23  Timothy Horton  <timothy_horton@apple.com>
3372
3373         Reproducible crash in ViewGestureController::removeSwipeSnapshot()
3374         https://bugs.webkit.org/show_bug.cgi?id=141917
3375         <rdar://problem/19918590>
3376
3377         Reviewed by Brian Weinstein.
3378
3379         * UIProcess/mac/ViewGestureControllerMac.mm:
3380         (WebKit::ViewGestureController::removeSwipeSnapshot):
3381         If the snapshot was purged and we're showing a white snapshot, we won't
3382         be able to mark the (null) snapshot surface as volatile. Add a null check.
3383
3384 2015-02-23  Anders Carlsson  <andersca@apple.com>
3385
3386         Replace another straight-up cast with a toImpl call
3387         https://bugs.webkit.org/show_bug.cgi?id=141914
3388         rdar://problem/19913016
3389
3390         Reviewed by Andreas Kling.
3391
3392         This fixes a problem where Mail would not display message bodies.
3393
3394         * UIProcess/API/Cocoa/WKConnection.mm:
3395         (didReceiveMessage):
3396
3397 2015-02-20  Brent Fulgham  <bfulgham@apple.com>
3398
3399         Scrollbars and ScrollAnimators must always have a ScrollableArea
3400         https://bugs.webkit.org/show_bug.cgi?id=141855
3401
3402         Reviewed by Simon Fraser.
3403         
3404         Change users of the scrollAnimator() method to expect a reference instead of a pointer.
3405
3406         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3407         (WebKit::PDFPlugin::createScrollbar):
3408         (WebKit::PDFPlugin::destroyScrollbar):
3409
3410 2015-02-20  Jessie Berlin  <jberlin@webkit.org>
3411
3412         Build fix after r180465.
3413
3414         * UIProcess/mac/PageClientImpl.h:
3415
3416 2015-02-20  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3417
3418         [GTK] Unreviewed build fix after r180449.
3419
3420         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
3421         (webkit_file_chooser_request_get_selected_files):
3422
3423 2015-02-20  Enrica Casucci  <enrica@apple.com>
3424
3425         [WK2] Add support for font panel on OS X.
3426         https://bugs.webkit.org/show_bug.cgi?id=141777
3427
3428         Reviewed by Tim Horton.
3429
3430         This patch adds the necessary hooks to WKView to support
3431         the font panel. It also includes refactoring of WebPage::editorState
3432         and WebPageProxy::editorStateChanged to separate the different platform
3433         specific tasks.
3434
3435         * Shared/EditorState.cpp:
3436         (WebKit::EditorState::encode):
3437         (WebKit::EditorState::decode):
3438         * Shared/EditorState.h:
3439         (WebKit::EditorState::EditorState):
3440         * UIProcess/API/mac/WKView.mm:
3441         (-[WKView _selectionChanged]):
3442         (-[WKView changeFont:]):
3443         * UIProcess/API/mac/WKViewInternal.h:
3444         * UIProcess/PageClient.h:
3445         * UIProcess/WebPageProxy.cpp:
3446         (WebKit::WebPageProxy::editorStateChanged): Deleted.
3447         * UIProcess/WebPageProxy.h:
3448         * UIProcess/efl/WebPageProxyEfl.cpp:
3449         (WebKit::WebPageProxy::editorStateChanged):
3450         * UIProcess/gtk/WebPageProxyGtk.cpp:
3451         (WebKit::WebPageProxy::editorStateChanged):
3452         * UIProcess/ios/WebPageProxyIOS.mm:
3453         (WebKit::WebPageProxy::editorStateChanged):
3454         * UIProcess/mac/PageClientImpl.h:
3455         * UIProcess/mac/PageClientImpl.mm:
3456         (WebKit::PageClientImpl::selectionDidChange):
3457         * UIProcess/mac/WebPageProxyMac.mm:
3458         (WebKit::WebPageProxy::setFont):
3459         (WebKit::WebPageProxy::editorStateChanged):
3460         * WebProcess/WebPage/WebPage.cpp:
3461         (WebKit::WebPage::editorState):
3462         * WebProcess/WebPage/WebPage.h:
3463         * WebProcess/WebPage/WebPage.messages.in:
3464         * WebProcess/WebPage/efl/WebPageEfl.cpp:
3465         (WebKit::WebPage::platformEditorState):
3466         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3467         (WebKit::WebPage::platformEditorState):
3468         * WebProcess/WebPage/ios/WebPageIOS.mm:
3469         (WebKit::WebPage::platformEditorState):
3470         * WebProcess/WebPage/mac/WebPageMac.mm:
3471         (WebKit::WebPage::platformEditorState):
3472         (WebKit::WebPage::setFont):
3473
3474 2015-02-20  Chris Dumez  <cdumez@apple.com>
3475
3476         [WK2] Add more detailed diagnostic logging for measuring network cache efficacy
3477         https://bugs.webkit.org/show_bug.cgi?id=141803
3478         <rdar://problem/19632080>
3479
3480         Reviewed by Antti Koivisto.
3481
3482         Add more detailed diagnostic logging for measuring network cache
3483         efficacy.
3484
3485         We want to know the reason the network cache is being by-passed, why
3486         the network cache decided not to cache a response and why it cannot
3487         reuse a cache entry.
3488
3489         This patch adds a new "UncachedReason" table to the SQLite database
3490         to store the reason the network cache is deciding not to cache a
3491         given response. This information is used later, when the resource is
3492         requested again to log the reason why the request cannot be satistied
3493         by the cache.
3494
3495         * NetworkProcess/cache/NetworkCache.cpp:
3496         (WebKit::decodeStorageEntry):
3497         (WebKit::canRetrieve):
3498         (WebKit::NetworkCache::retrieve):