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