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