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