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