b82cb91820fbe040d8060d674575649f4126aa38
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [Coordinated Graphics] Remove toCoordinatedGraphicsLayer and use downcast instead
4         https://bugs.webkit.org/show_bug.cgi?id=159469
5
6         Reviewed by Michael Catanzaro.
7
8         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
9         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
10         (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
11         (WebKit::CompositingCoordinator::mainContentsLayer):
12
13 2016-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
14
15         [GTK] WebKitGtk+ uses too many file descriptors
16         https://bugs.webkit.org/show_bug.cgi?id=152316
17
18         Reviewed by Michael Catanzaro.
19
20         The problem is that we are keeping file descriptors open in SharedMemory objects. Those objects can be kept
21         alive for a long time, for example in case of cached resources sent from the network process as shareable
22         resources. The thing is that we keep the file descriptor in the SharedMemory object only to be able to create a
23         Handle, duplicating the file descriptor. However, we are also assuming that we create handles for SharedMemory
24         objects created by another handle which is wrong. SharedMemory objects are created to map a file or data and
25         then a handle is created to send it to another process, or to map an existing file or data for a given handle
26         received from another process. They can also be created to wrap another map, but in that case we don't own the
27         file descritor nor the mapped data. So, after mapping from a handle, we no longer need the file descriptor, and
28         it can be closed to release it, while the mapped memory data will still be alive until munmap() is called. This
29         drastically reduces the amount of file descriptors used by WebKitGTK+.
30
31         * Platform/IPC/unix/ConnectionUnix.cpp:
32         (IPC::readBytesFromSocket): Use setCloseOnExec().
33         (IPC::Connection::createPlatformConnection): Ditto.
34         * Platform/SharedMemory.h:
35         * Platform/unix/SharedMemoryUnix.cpp:
36         (WebKit::SharedMemory::map): Close the file descriptor right after mmap.
37         (WebKit::SharedMemory::~SharedMemory): Close the file descriptor only if it hasn't been closed yet.
38         (WebKit::SharedMemory::createHandle): Add an ASSERT to ensure we only try to create a handle for SharedMemory
39         objects having a valid file descriptor. Use dupCloseOnExec() to duplicate the handle and set the close on exec flag.
40         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
41         (WebKit::ProcessLauncher::launchProcess): Use setCloseOnExec().
42
43 2016-07-12  Simon Fraser  <simon.fraser@apple.com>
44
45         [iOS WK2] After zooming and when under memory pressure, page tiles sometimes don't redraw while panning
46         https://bugs.webkit.org/show_bug.cgi?id=159697
47         rdar://problem/26314075
48
49         Reviewed by Benjamin Poulain.
50
51         When under memory pressure, and after pinching back to minimum scale, WebPage::updateVisibleContentRects()
52         would sometimes always bail under the "boundedScale != currentScale..." condition.
53
54         This happened because the visibleContentRectUpdateInfo.scale() is a double, but m_page->pageScaleFactor()
55         is a float, and the constraining between min and max scale (which are doubles) caused boundedScale
56         to be always different from currentScale.
57
58         Fix by using floats throughout.
59
60         No test because there's no way to simulate memory pressure for testing.
61
62         * WebProcess/WebPage/ios/WebPageIOS.mm:
63         (WebKit::WebPage::updateVisibleContentRects):
64
65 2016-07-12  Chris Dumez  <cdumez@apple.com>
66
67         [WK2][NetworkSession] Fix unsafe RunLoop::dispatch() in NetworkLoad constructor
68         https://bugs.webkit.org/show_bug.cgi?id=159691
69
70         Reviewed by Brady Eidson.
71
72         Remove unsafe RunLoop::dispatch() in NetworkLoad constructor. It captured |this| but there
73         was no guarantee the NetworkLoad would still be alive by the time the lambda gets executed.
74
75         Instead, the constructor now takes a NetworkSession& parameter so that the call sites
76         have to retrieve the NetworkSession for a given SessionID and deal with the fact that
77         there may be no such NetworkSession before constructing the NetworkLoad.
78
79         * NetworkProcess/Downloads/DownloadManager.cpp:
80         (WebKit::DownloadManager::startDownload):
81         * NetworkProcess/Downloads/PendingDownload.cpp:
82         (WebKit::PendingDownload::PendingDownload):
83         * NetworkProcess/Downloads/PendingDownload.h:
84         * NetworkProcess/NetworkLoad.cpp:
85         (WebKit::NetworkLoad::NetworkLoad):
86         * NetworkProcess/NetworkLoad.h:
87         * NetworkProcess/NetworkResourceLoader.cpp:
88         (WebKit::NetworkResourceLoader::startNetworkLoad):
89         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
90         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
91
92 2016-07-12  Chris Dumez  <cdumez@apple.com>
93
94         [WK2] Protect against bad database data in LocalStorageDatabase::importItems()
95         https://bugs.webkit.org/show_bug.cgi?id=159663
96         <rdar://problem/18995873>
97
98         Reviewed by Benjamin Poulain.
99
100         Protect against bad database data in LocalStorageDatabase::importItems(). We
101         crash if the database contains a null key or a null value so protect against
102         it given that we have evidence it can happen.
103
104         With this change, I can no longer reproduce the UIProcess crash on evernote.com
105         that is documented at <rdar://problem/18995873>.
106
107         * UIProcess/Storage/LocalStorageDatabase.cpp:
108         (WebKit::LocalStorageDatabase::importItems):
109
110 2016-07-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
111
112         Remove ENABLE_CSS3_TEXT_LINE_BREAK flag
113         https://bugs.webkit.org/show_bug.cgi?id=159671
114
115         Reviewed by Csaba Osztrogonác.
116
117         ENABLE_CSS3_TEXT_LINE_BREAK feature was implemented without guards.
118         https://bugs.webkit.org/show_bug.cgi?id=89235
119
120         So this guard can be removed in build scripts.
121
122         * Configurations/FeatureDefines.xcconfig:
123
124 2016-07-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
125
126         Purge PassRefPtr in platform/efl and platform/mac 
127         https://bugs.webkit.org/show_bug.cgi?id=159548
128
129         Reviewed by Alex Christensen.
130
131         Remove all use of PassRefPtr and clean up unnecessary tabs and spaces.
132         WebKit2 codes are also changed because of setBufferForType()'s modification.
133
134         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
135         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
136         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
137         (WebKit::WebPlatformStrategies::setBufferForType):
138         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
139
140 2016-07-11  Chris Dumez  <cdumez@apple.com>
141
142         [WK2][iOS] Intermittent crash in [UIApplication beginBackgroundTaskWithName] expiration handler
143         https://bugs.webkit.org/show_bug.cgi?id=159648
144         <rdar://problem/27219361>
145
146         Reviewed by Anders Carlsson.
147
148         We see an intermittent crash in [UIApplication beginBackgroundTaskWithName] expiration handler.
149         From the traces, we noticed the expiration handler can get called on a non-main thread under
150         certain conditions, which our code is designed to deal with.
151
152         In particular, we get called on a non-main thread when UIKit fails to acquire the assertion.
153         Update our expiration handler to always notify the clients on the main thread.
154
155         * UIProcess/ios/ProcessAssertionIOS.mm:
156         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
157
158 2016-07-11  Dan Bernstein  <mitz@apple.com>
159
160         Tried to fix the macOS build.
161
162         * UIProcess/API/Cocoa/WKNavigationAction.mm:
163         (-[WKNavigationAction description]):
164
165 2016-07-11  Dan Bernstein  <mitz@apple.com>
166
167         Cleaned up API availability.
168
169         Requested by Tim Horton.
170
171         * UIProcess/API/Cocoa/WKNavigationAction.mm:
172         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
173
174 2016-07-11  Enrica Casucci  <enrica@apple.com>
175
176         Add synthetic click origin to WKNavigationAction.
177         https://bugs.webkit.org/show_bug.cgi?id=159584
178         rdar://problem/25610422
179
180         Reviewed by Tim Horton.
181
182         Adds a private property to WKNavigationAction to retrieve
183         the origin of the synthetic click.
184
185         * Shared/NavigationActionData.cpp:
186         (WebKit::NavigationActionData::encode):
187         (WebKit::NavigationActionData::decode):
188         * Shared/NavigationActionData.h:
189         * Shared/WebEvent.h:
190         (WebKit::WebMouseEvent::button):
191         (WebKit::WebMouseEvent::menuTypeForEvent):
192         (WebKit::WebMouseEvent::force):
193         (WebKit::WebMouseEvent::syntheticClickType):
194         * Shared/WebMouseEvent.cpp:
195         (WebKit::WebMouseEvent::WebMouseEvent):
196         (WebKit::WebMouseEvent::encode):
197         (WebKit::WebMouseEvent::decode):
198         * Shared/mac/WebEventFactory.mm:
199         (WebKit::WebEventFactory::createWebMouseEvent):
200         (WebKit::WebEventFactory::createWebWheelEvent):
201         * UIProcess/API/APINavigationAction.h:
202         * UIProcess/API/Cocoa/WKNavigationAction.mm:
203         (toWKNavigationType):
204         (toWKSyntheticClickType):
205         (-[WKNavigationAction description]):
206         (-[WKNavigationAction sourceFrame]):
207         (-[WKNavigationAction request]):
208         (-[WKNavigationAction _syntheticClickType]):
209         (-[WKNavigationAction modifierFlags]):
210         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
211         * UIProcess/WebPageProxy.h:
212         * UIProcess/ios/WKContentViewInteraction.mm:
213         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
214         (-[WKContentView _longPressRecognized:]):
215         * UIProcess/ios/WebPageProxyIOS.mm:
216         (WebKit::WebPageProxy::getSelectionContext):
217         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
218         (WebKit::WebPageProxy::selectWithTwoTouches):
219         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
220         (WebKit::mouseButtonForMouseEvent):
221         (WebKit::syntheticClickTypeForMouseEvent):
222         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
223         (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
224         (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
225         (WebKit::InjectedBundleNavigationAction::create):
226         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
227         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
228         (WebKit::InjectedBundleNavigationAction::navigationType):
229         (WebKit::InjectedBundleNavigationAction::modifiers):
230         (WebKit::InjectedBundleNavigationAction::mouseButton):
231         (WebKit::InjectedBundleNavigationAction::hitTestResult):
232         (WebKit::InjectedBundleNavigationAction::formElement):
233         (WebKit::InjectedBundleNavigationAction::syntheticClickType):
234         (WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):
235         (WebKit::InjectedBundleNavigationAction::shouldTryAppLinks):
236         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
237         (WebKit::WebChromeClient::createWindow):
238         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
239         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
240         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
241         * WebProcess/WebPage/WebPage.cpp:
242         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
243         (WebKit::WebPage::contextMenuAtPointInWindow):
244         (WebKit::WebPage::dragEnded):
245         (WebKit::WebPage::simulateMouseDown):
246         (WebKit::WebPage::simulateMouseUp):
247         (WebKit::WebPage::simulateMouseMotion):
248         (WebKit::WebPage::setCompositionForTesting):
249         * WebProcess/WebPage/WebPage.h:
250         * WebProcess/WebPage/WebPage.messages.in:
251         * WebProcess/WebPage/ios/WebPageIOS.mm:
252         (WebKit::WebPage::handleSyntheticClick):
253         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
254         (WebKit::WebPage::completeSyntheticClick):
255         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
256         (WebKit::WebPage::handleTwoFingerTapAtPoint):
257         (WebKit::WebPage::potentialTapAtPosition):
258         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
259
260 2016-07-11  Anders Carlsson  <andersca@apple.com>
261
262         Able to open multiple payment sheets in Safari at the same time
263         https://bugs.webkit.org/show_bug.cgi?id=159637
264         rdar://problem/26411339
265
266         Reviewed by Beth Dakin.
267
268         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
269         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
270         Add result out parameter. Set the result to false if isShowingPaymentUI is true, otherwise set isShowingPaymentUI to true.
271     
272         (WebKit::WebPaymentCoordinatorProxy::didReachFinalState):
273         Set isShowingPaymentUI to false.
274
275         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
276         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
277         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
278         (WebKit::WebPaymentCoordinator::showPaymentUI):
279         * WebProcess/ApplePay/WebPaymentCoordinator.h:
280         The showPaymentUI message and client functions now return booleans.
281
282 2016-07-11  Commit Queue  <commit-queue@webkit.org>
283
284         Unreviewed, rolling out r203064.
285         https://bugs.webkit.org/show_bug.cgi?id=159642
286
287         This change causes LayoutTest crashes on WK1 ASan (Requested
288         by ryanhaddad on #webkit).
289
290         Reverted changeset:
291
292         "Use refs for ResourceLoaders"
293         https://bugs.webkit.org/show_bug.cgi?id=159592
294         http://trac.webkit.org/changeset/203064
295
296 2016-07-11  Nan Wang  <n_wang@apple.com>
297
298         AX: WKWebView should have API to prevent pinch-to-zoom always being allowed
299         https://bugs.webkit.org/show_bug.cgi?id=158364
300
301         Reviewed by Anders Carlsson.
302
303         Added a property in WKWebViewConfiguration so that developers can toggle the ignoring
304         viewport scale limits setting.
305
306         Changes are covered in modified tests.
307
308         * Shared/WebPageCreationParameters.cpp:
309         (WebKit::WebPageCreationParameters::encode):
310         (WebKit::WebPageCreationParameters::decode):
311         * Shared/WebPageCreationParameters.h:
312         * UIProcess/API/C/WKPage.cpp:
313         (WKPageSetResourceCachingDisabled):
314         (WKPageSetIgnoresViewportScaleLimits):
315         * UIProcess/API/C/WKPagePrivate.h:
316         * UIProcess/API/Cocoa/WKWebView.mm:
317         (shouldAllowPictureInPictureMediaPlayback):
318         (-[WKWebView _initializeWithConfiguration:]):
319         (-[WKWebView _navigationGestureDidEnd]):
320         (forceAlwaysUserScalableChangedCallback): Deleted.
321         (-[WKWebView _updateForceAlwaysUserScalable]): Deleted.
322         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
323         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
324         (-[WKWebViewConfiguration init]):
325         (-[WKWebViewConfiguration encodeWithCoder:]):
326         (-[WKWebViewConfiguration initWithCoder:]):
327         (-[WKWebViewConfiguration copyWithZone:]):
328         * UIProcess/API/Cocoa/WKWebViewInternal.h:
329         * UIProcess/WebPageProxy.cpp:
330         (WebKit::WebPageProxy::creationParameters):
331         * UIProcess/WebPageProxy.h:
332         * UIProcess/ios/WebPageProxyIOS.mm:
333         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
334         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
335         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
336         (WebKit::WebPageProxy::updateForceAlwaysUserScalable): Deleted.
337         * WebProcess/WebPage/WebPage.cpp:
338         (WebKit::WebPage::updatePreferences):
339         * WebProcess/WebPage/WebPage.h:
340         * WebProcess/WebPage/WebPage.messages.in:
341         * WebProcess/WebPage/ios/WebPageIOS.mm:
342         (WebKit::WebPage::disableInspectorNodeSearch):
343         (WebKit::WebPage::setForceAlwaysUserScalable):
344         (WebKit::innerFrameQuad):
345         (WebKit::WebPage::updateForceAlwaysUserScalable): Deleted.
346
347 2016-07-08  Alex Christensen  <achristensen@webkit.org>
348
349         Use refs for ResourceLoaders
350         https://bugs.webkit.org/show_bug.cgi?id=159592
351
352         Reviewed by Chris Dumez.
353
354         * WebProcess/Network/WebLoaderStrategy.cpp:
355         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
356         (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
357         (WebKit::WebLoaderStrategy::startLocalLoad):
358         (WebKit::WebLoaderStrategy::remove):
359         (WebKit::WebLoaderStrategy::setDefersLoading):
360         (WebKit::WebLoaderStrategy::crossOriginRedirectReceived):
361         * WebProcess/Network/WebLoaderStrategy.h:
362
363 2016-07-11  Antti Koivisto  <antti@apple.com>
364
365         Update stable cache version in NetworkCache::Storage::deleteOldVersions()
366         https://bugs.webkit.org/show_bug.cgi?id=159618
367         rdar://problem/26715745
368
369         Reviewed by Chris Dumez.
370
371         NetworkCache::Storage::deleteOldVersions() keeps the previous shipped cache version (4) for Mac around so
372         development WebKit doesn’t clobber system Safari cache. Update this to the current version so old caches
373         go away in customer systems.
374
375         * NetworkProcess/cache/NetworkCacheStorage.cpp:
376         (WebKit::NetworkCache::Storage::deleteOldVersions):
377         * NetworkProcess/cache/NetworkCacheStorage.h:
378
379             Move lastStableVersion to header next to the current version.
380
381 2016-07-10  Beth Dakin  <bdakin@apple.com>
382
383         Update mediaIcon.pdf
384         https://bugs.webkit.org/show_bug.cgi?id=159613
385         -and corresponding-
386         rdar://problem/27268111
387
388         Reviewed by Sam Weinig.
389
390         * Resources/mediaIcon.pdf: Replaced.
391
392 2016-07-10  Alex Christensen  <achristensen@webkit.org>
393
394         Add self to WebKit2 Owners
395         https://bugs.webkit.org/show_bug.cgi?id=159499
396
397         Reviewed by Sam Weinig.
398
399         * Owners:
400
401 2016-07-10  Alex Christensen  <achristensen@webkit.org>
402
403         Fix client certificate authentication after r200463
404         https://bugs.webkit.org/show_bug.cgi?id=159574
405         <rdar://problem/26931006>
406
407         Reviewed by Sam Weinig.
408
409         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
410         (WebKit::leafCertificate):
411         (WebKit::chain):
412         Handle the different types of CertificateInfos.
413
414 2016-07-08  Yongjun Zhang  <yongjun_zhang@apple.com>
415
416         When WKWebView prepares the session state blob, we should be able to filter it.
417         https://bugs.webkit.org/show_bug.cgi?id=159410
418
419         Add a SPI to WKWebView so that a client can decide how to filter backforward items
420         when WKWebView perparing session state.
421
422         Reviewed by Brady Eidson.
423
424         * UIProcess/API/Cocoa/WKWebView.mm:
425         (-[WKWebView _sessionStateWithFilter:]): When preparing session state, check each
426         backforward item against the filter block.
427         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add the SPI _sessionStateWithFilter:
428
429
430 2016-07-08  Tim Horton  <timothy_horton@apple.com>
431
432         Mail messages don't start loading until scrolling completes
433         https://bugs.webkit.org/show_bug.cgi?id=159585
434         <rdar://problem/27088405>
435
436         Reviewed by Andy Estes.
437
438         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
439         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:connection:]):
440         When scrolling, NSDefaultRunLoopMode isn't run, but NSRunLoopCommonModes are.
441         CFNetwork uses NSDefaultRunLoopMode if we tell NSURLConnection to "start immediately",
442         but we can instead schedule our NSURLConnection into NSRunLoopCommonModes
443         and start it ourselves, ensuring that it will be able to do work while scrolling is happening.
444
445 2016-07-08  Andy Estes  <aestes@apple.com>
446
447         [Content Filtering] Load blocked pages more like other error pages are loaded
448         https://bugs.webkit.org/show_bug.cgi?id=159485
449         <rdar://problem/26014076>
450
451         Reviewed by Brady Eidson.
452
453         * Shared/API/c/WKErrorRef.h: Defined kWKErrorCodeFrameLoadBlockedByContentFilter.
454         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
455         (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added the resource directories
456         of WebCore.framework and WebKit.framework as paths with assumed read access.
457         * UIProcess/WebProcessProxy.cpp:
458         (WebKit::WebProcessProxy::hasAssumedReadAccessToURL): Checked platformPathsWithAssumedReadAccess()
459         as well as m_localPathsWithAssumedReadAccess.
460         (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added a non-Cocoa implementation.
461         * UIProcess/WebProcessProxy.h:
462         * WebProcess/WebCoreSupport/WebErrors.h:
463         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
464         (WebKit::WebFrameLoaderClient::blockedByContentFilterError): Called WebKit::blockedByContentFilterError().
465         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
466         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
467         (WebKit::blockedByContentFilterError): Returned a ResourceError for kWKErrorCodeFrameLoadBlockedByContentFilter.
468
469 2016-07-08  Anders Carlsson  <andersca@apple.com>
470
471         Fix 32-bit build.
472
473         * PluginProcess/mac/PluginProcessShim.mm:
474
475 2016-07-07  Anders Carlsson  <andersca@apple.com>
476
477         REGRESSION (r196321): Adobe Reader DC + Safari : Zoom level pulldown is not displayed at the correct position
478         https://bugs.webkit.org/show_bug.cgi?id=159531
479         rdar://problem/26382579
480
481         Reviewed by Tim Horton.
482
483         There's code in the Adobe Acrobat framework that checks if the main bundle identifier is "com.apple.WebKit.PluginProcess"
484         and assumes that it's running inside the Adobe Reader app if it's something else. Since we're now using the XPC service
485         for all plug-ins, the bundle identifier is "com.apple.WebKit.Plugin.64", so the Acrobat framework assumes it's running in the app
486         and doesn't use any special tricks to show the popup menu.
487         
488         Work around this by shimming CFStringCompare, and looking for the exact conditions when this can happen and return kCFCompareEqualTo
489         when all conditions are true.
490         
491         * PluginProcess/mac/PluginProcessMac.mm:
492         (WebKit::isAdobeAcrobatAddress):
493         (WebKit::stringCompare):
494         (WebKit::initializeShim):
495         (WebKit::PluginProcess::platformInitializeProcess):
496         * PluginProcess/mac/PluginProcessShim.h:
497         * PluginProcess/mac/PluginProcessShim.mm:
498         (WebKit::shimCFStringCompare):
499
500 2016-07-08  Brady Eidson  <beidson@apple.com>
501
502         Unreviewed: Fix case-sensitive filesystem build.
503
504         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
505
506 2016-07-08  Commit Queue  <commit-queue@webkit.org>
507
508         Unreviewed, rolling out r202944.
509         https://bugs.webkit.org/show_bug.cgi?id=159570
510
511         caused some tests to crash under GuardMalloc (Requested by
512         estes on #webkit).
513
514         Reverted changeset:
515
516         "[Content Filtering] Load blocked pages more like other error
517         pages are loaded"
518         https://bugs.webkit.org/show_bug.cgi?id=159485
519         http://trac.webkit.org/changeset/202944
520
521 2016-07-08  Keith Rollin  <krollin@apple.com>
522
523         Add always-on logging for downloads
524         https://bugs.webkit.org/show_bug.cgi?id=159521
525         <rdar://problem/26630645>
526
527         Reviewed by Alex Christensen.
528
529         Add logging statements that track when a download starts, when it
530         first receives data, and when the download is done (due to completion,
531         cancelation, or failure).
532
533         * NetworkProcess/Downloads/Download.cpp:
534         (WebKit::Download::Download):
535         (WebKit::Download::didReceiveResponse):
536         (WebKit::Download::didReceiveData):
537         (WebKit::Download::didFinish):
538         (WebKit::Download::didFail):
539         (WebKit::Download::didCancel):
540         (WebKit::Download::isAlwaysOnLoggingAllowed):
541         * NetworkProcess/Downloads/Download.h:
542         (WebKit::Download::Download):
543         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
544         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
545
546 2016-07-08  Brady Eidson  <beidson@apple.com>
547
548         Clearing LocalStorage doesn't also delete -wal and -shm files.
549         <rdar://problem/27206772> and https://bugs.webkit.org/show_bug.cgi?id=159566
550
551         Reviewed by Brent Fulgham.
552         Also helpfully picked over by Andy "Never Forgets" Estes.
553
554         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
555         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
556
557 2016-07-07  Andy Estes  <aestes@apple.com>
558
559         [Content Filtering] Load blocked pages more like other error pages are loaded
560         https://bugs.webkit.org/show_bug.cgi?id=159485
561         <rdar://problem/26014076>
562
563         Reviewed by Brady Eidson.
564
565         * Shared/API/c/WKErrorRef.h: Defined kWKErrorCodeFrameLoadBlockedByContentFilter.
566         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
567         (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added the resource directories
568         of WebCore.framework and WebKit.framework as paths with assumed read access.
569         * UIProcess/WebProcessProxy.cpp:
570         (WebKit::WebProcessProxy::hasAssumedReadAccessToURL): Checked platformPathsWithAssumedReadAccess()
571         as well as m_localPathsWithAssumedReadAccess.
572         (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added a non-Cocoa implementation.
573         * UIProcess/WebProcessProxy.h:
574         * WebProcess/WebCoreSupport/WebErrors.h:
575         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
576         (WebKit::WebFrameLoaderClient::blockedByContentFilterError): Called WebKit::blockedByContentFilterError().
577         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
578         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
579         (WebKit::blockedByContentFilterError): Returned a ResourceError for kWKErrorCodeFrameLoadBlockedByContentFilter.
580
581 2016-07-07  Alex Christensen  <achristensen@webkit.org>
582
583         Followup to r202939.
584         https://bugs.webkit.org/show_bug.cgi?id=159526
585
586         * NetworkProcess/NetworkResourceLoader.cpp:
587         (WebKit::NetworkResourceLoader::didFailLoading):
588         We need the correct destination id when sending a message.
589
590 2016-07-07  Alex Christensen  <achristensen@webkit.org>
591
592         Fix crash when sending failure message to closed WebProcess
593         https://bugs.webkit.org/show_bug.cgi?id=159526
594         <rdar://problem/26767037>
595
596         Reviewed by Brady Eidson.
597
598         * NetworkProcess/NetworkResourceLoader.cpp:
599         (WebKit::NetworkResourceLoader::didFailLoading):
600         Check to see if there is a connection before using it to send a message.
601         Sometimes it was null.
602         I think this could be tested if we had real network loading from TestWebKitAPI
603         by cancelling slow loads and closing WebProcesses around the same time, but no such infrastructure exists yet.
604
605 2016-07-07  Alex Christensen  <achristensen@webkit.org>
606
607         Use SocketProvider to create WebSocketChannels
608         https://bugs.webkit.org/show_bug.cgi?id=158776
609
610         Reviewed by Brent Fulgham.
611
612         * CMakeLists.txt:
613         * WebKit2.xcodeproj/project.pbxproj:
614         * WebProcess/Network/WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
615         (WebKit::WebSocketProvider::createWebSocketChannel):
616         (WebCore::ThreadableWebSocketChannel::create): Deleted.
617         * WebProcess/Network/WebSocketProvider.h:
618         * WebProcess/WebPage/WebPage.cpp:
619         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
620
621 2016-07-07  Antoine Quint  <graouts@apple.com>
622
623         <img> with a wide gamut PDF does not display using a wide gamut color space
624         https://bugs.webkit.org/show_bug.cgi?id=158983
625         <rdar://problem/25720247>
626
627         Reviewed by Dean Jackson.
628
629         ColorSpace parameters have been replaced with CGColorSpaceRef parameters for IOSurface.
630
631         * Shared/mac/RemoteLayerBackingStore.mm:
632         (WebKit::RemoteLayerBackingStore::decode):
633         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
634         * UIProcess/API/Cocoa/WKWebView.mm:
635         (-[WKWebView _takeViewSnapshot]):
636         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
637
638 2016-07-07  Anders Carlsson  <andersca@apple.com>
639
640         Memory corruption destroying PaymentCoordinator
641         https://bugs.webkit.org/show_bug.cgi?id=159516
642         rdar://problem/27222517
643
644         Reviewed by Tim Horton.
645
646         Introduce a new MessageReceiverMap::removeMessageReceiver that takes a MessageReceiver
647         and removes all traces of it in the message receiver map. Use it in the WebPaymentCoordinator destructor.
648
649         * Platform/IPC/MessageReceiverMap.cpp:
650         (IPC::MessageReceiverMap::removeMessageReceiver):
651         * Platform/IPC/MessageReceiverMap.h:
652         * Shared/ChildProcess.cpp:
653         (WebKit::ChildProcess::removeMessageReceiver):
654         * Shared/ChildProcess.h:
655         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
656         (WebKit::WebPaymentCoordinator::~WebPaymentCoordinator):
657
658 2016-07-07  Csaba Osztrogonác  <ossy@webkit.org>
659
660         [Mac][cmake] Unreviewed buildfix after r202889. Just for fun.
661
662         * PlatformMac.cmake:
663
664 2016-07-06  Tim Horton  <timothy_horton@apple.com>
665
666         Some API tests started failing after r202889
667         https://bugs.webkit.org/show_bug.cgi?id=159498
668
669         * UIProcess/WebPageProxy.cpp:
670         (WebKit::WebPageProxy::loadHTMLString):
671         Fix a typo; this is a MIME type, not an encoding :|
672
673 2016-07-06  Tim Horton  <timothy_horton@apple.com>
674
675         Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be
676         https://bugs.webkit.org/show_bug.cgi?id=159498
677         <rdar://problem/26719903>
678
679         Reviewed by Sam Weinig.
680
681         * Shared/Cocoa/LoadParametersCocoa.mm: Added.
682         (WebKit::LoadParameters::platformEncode):
683         (WebKit::LoadParameters::platformDecode):
684         * Shared/LoadParameters.cpp: Added.
685         (WebKit::LoadParameters::encode):
686         (WebKit::LoadParameters::decode):
687         * Shared/LoadParameters.h: Added.
688         Add a struct that knows how to encode all of the different parameters
689         to all of the Load* messages, including the platform-specific DataDetectors parameters.
690
691         * Shared/mac/ArgumentCodersMac.h:
692         * Shared/mac/ArgumentCodersMac.mm:
693         (IPC::typeFromObject):
694         (IPC::encode):
695         (IPC::decode):
696         Add NSURL coders that defer to the CFURL coders.
697
698         * UIProcess/API/APIUIClient.h:
699         (API::UIClient::dataDetectionContext):
700         * UIProcess/Cocoa/UIDelegate.h:
701         * UIProcess/Cocoa/UIDelegate.mm:
702         (WebKit::UIDelegate::setDelegate):
703         (WebKit::UIDelegate::UIClient::dataDetectionContext):
704         Add APIUIClient methods to retrieve the DataDetectors context dictionary.
705
706         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
707         (WebKit::WebPageProxy::addPlatformLoadParameters):
708         Add the DataDetectors context dictionary to the given LoadParameters.
709
710         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
711         (WebKit::WebFrameLoaderClient::dataDetectionContext):
712         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
713         * WebProcess/WebPage/WebPage.h:
714         (WebKit::WebPage::dataDetectionContext):
715         Store the dataDetectionContext on WebPage, and make it accessible to WebCore
716         via the FrameLoaderClient (it is used in FrameLoader when the load completes).
717
718         * UIProcess/WebPageProxy.cpp:
719         (WebKit::WebPageProxy::loadRequest):
720         (WebKit::WebPageProxy::loadFile):
721         (WebKit::WebPageProxy::loadData):
722         (WebKit::WebPageProxy::loadHTMLString):
723         (WebKit::WebPageProxy::loadAlternateHTMLString):
724         (WebKit::WebPageProxy::loadPlainTextString):
725         (WebKit::WebPageProxy::loadWebArchiveData):
726         * UIProcess/WebPageProxy.h:
727         * WebKit2.xcodeproj/project.pbxproj:
728         * WebProcess/WebPage/WebPage.cpp:
729         (WebKit::WebPage::loadRequest):
730         (WebKit::WebPage::loadStringImpl):
731         (WebKit::WebPage::loadData):
732         (WebKit::WebPage::loadString):
733         (WebKit::WebPage::loadAlternateHTMLString):
734         (WebKit::WebPage::loadHTMLString): Deleted.
735         (WebKit::WebPage::loadPlainTextString): Deleted.
736         (WebKit::WebPage::loadWebArchiveData): Deleted.
737         * WebProcess/WebPage/WebPage.messages.in:
738         Adopt LoadParameters, taking this opportunity to reduce the number of very similar messages.
739         We can take this further (we should be able to get it down to just LoadRequest
740         and LoadData) in the future. When any load occurs, grab the client's DataDetectorse
741         context dictionary and send it along with the load request, storing it in WebPage.
742
743 2016-07-06  Chris Dumez  <cdumez@apple.com>
744
745         [WK2][Cocoa] Disable ResourceResponse lazy initialization
746         https://bugs.webkit.org/show_bug.cgi?id=159497
747         <rdar://problem/27209066>
748
749         Reviewed by Alex Christensen.
750
751         Disable ResourceResponse lazy initialization for WebKit2 as
752         we always end up initializing all the fields anyway when
753         sending the response to the WebContent process via IPC.
754
755         Even worse, we always do a partial lazy initialization (common
756         fields only) before the IPC so we always do the initialization
757         in 2 steps. This normally would not be an issue but the 2 steps
758         actually have some overlap because both call
759         CFHTTPMessageCopyAllHeaderFields(), which is expensive (See
760         <rdar://problem/26796059>) to first get the common HTTP headers,
761         then ALL the HTTP headers.
762
763         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
764         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
765
766 2016-07-06  Chelsea Pugh  <cpugh@apple.com>
767
768         [iOS] Text suggestions should be cleared when form input session is invalidated        
769         https://bugs.webkit.org/show_bug.cgi?id=159477
770
771         Reviewed by Dan Bernstein.
772
773         * UIProcess/ios/WKContentViewInteraction.mm:
774         (-[WKFormInputSession invalidate]): Set input delegate's suggestions to nil when a form input session is
775         invalidated. This will set the keyboard QuickType suggestions back to their default values.
776
777 2016-07-06  Alex Christensen  <achristensen@webkit.org>
778
779         Call continueCanAuthenticateAgainstProtectionSpace when cancelling loads waiting for the callback
780         https://bugs.webkit.org/show_bug.cgi?id=159492
781         <rdar://problem/26921670>
782
783         Reviewed by Brady Eidson.
784
785         * NetworkProcess/NetworkLoad.cpp:
786         (WebKit::NetworkLoad::~NetworkLoad):
787         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
788         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
789         * NetworkProcess/NetworkLoad.h:
790
791 2016-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
792
793         [RTL Scrollbars] RTL Scrollbars broken with clients creating Web Views via [WKView initWithFrame:contextRef:pageGroupRef:]
794         https://bugs.webkit.org/show_bug.cgi?id=159383
795         <rdar://problem/26921117>
796
797         Reviewed by Anders Carlsson.
798
799         The code which consults with the userInterfaceLayoutDirection of the view is
800         inside [WKWebView _initializeWithConfiguration:]. However, some clients create
801         Web Views via [WKView initWithFrame:contextRef:pageGroupRef:] which doesn't
802         call this code. Therefore, this codepath should do the same kind of direction
803         consulting.
804
805         * UIProcess/API/mac/WKView.mm:
806         (toUserInterfaceLayoutDirection):
807         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
808
809 2016-07-06  Commit Queue  <commit-queue@webkit.org>
810
811         Unreviewed, rolling out r202867.
812         https://bugs.webkit.org/show_bug.cgi?id=159491
813
814         This change caused an existing LayoutTest to crash on ios-
815         simulator (Requested by ryanhaddad on #webkit).
816
817         Reverted changeset:
818
819         "<img> with a wide gamut PDF does not display using a wide
820         gamut color space"
821         https://bugs.webkit.org/show_bug.cgi?id=158983
822         http://trac.webkit.org/changeset/202867
823
824 2016-07-06  Enrica Casucci  <enrica@apple.com>
825
826         Limit touch distance for two finger tap.
827         https://bugs.webkit.org/show_bug.cgi?id=159476
828         rdar://problem/26439052
829
830         Reviewed by Beth Dakin.
831
832         * UIProcess/ios/WKContentViewInteraction.mm:
833         (-[WKContentView setupInteraction]):
834         * Platform/spi/ios/UIKitSPI.h
835
836 2016-07-06  Antoine Quint  <graouts@apple.com>
837
838         <img> with a wide gamut PDF does not display using a wide gamut color space
839         https://bugs.webkit.org/show_bug.cgi?id=158983
840         <rdar://problem/25720247>
841
842         Reviewed by Tim Horton.
843
844         ColorSpace parameters have been replaced with CGColorSpaceRef parameters for IOSurface.
845
846         * Shared/mac/RemoteLayerBackingStore.mm:
847         (WebKit::RemoteLayerBackingStore::decode):
848         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
849         * UIProcess/API/Cocoa/WKWebView.mm:
850         (-[WKWebView _takeViewSnapshot]):
851         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
852
853 2016-07-06  Commit Queue  <commit-queue@webkit.org>
854
855         Unreviewed, rolling out r202725.
856         https://bugs.webkit.org/show_bug.cgi?id=159473
857
858         didn't reduce coreui memory usage (Requested by kling on
859         #webkit).
860
861         Reverted changeset:
862
863         "[Mac] Get rid of the old timey rubber-banding linen pattern."
864         https://bugs.webkit.org/show_bug.cgi?id=159329
865         http://trac.webkit.org/changeset/202725
866
867 2016-07-06  Carlos Garcia Campos  <cgarcia@igalia.com>
868
869         Duplicated code in DrawingAreaImpl and CoordinatedDrawingArea
870         https://bugs.webkit.org/show_bug.cgi?id=159259
871
872         Reviewed by Žan Doberšek.
873
874         It seems that CoordinatedDrawingArea is just a copy paste of DrawingAreaImpl with non-accelerated code path
875         removed. There's actually nothing (or very little) specific to coordinated graphics in the
876         CoordinatedDrawingArea implementation. This patch renames CoordinatedDrawingArea as AcceleratedDrawingArea and
877         makes DrawingAreaImpl inherit from it, so that in case of accelerated compositing the parent class is used, and
878         DrawingAreaImpl only adds the non accelerated code path.
879
880         * PlatformEfl.cmake:
881         * PlatformGTK.cmake:
882         * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp.
883         (WebKit::AcceleratedDrawingArea::~AcceleratedDrawingArea):
884         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
885         (WebKit::AcceleratedDrawingArea::setNeedsDisplay):
886         (WebKit::AcceleratedDrawingArea::setNeedsDisplayInRect):
887         (WebKit::AcceleratedDrawingArea::scroll):
888         (WebKit::AcceleratedDrawingArea::pageBackgroundTransparencyChanged):
889         (WebKit::AcceleratedDrawingArea::setLayerTreeStateIsFrozen):
890         (WebKit::AcceleratedDrawingArea::forceRepaint):
891         (WebKit::AcceleratedDrawingArea::forceRepaintAsync):
892         (WebKit::AcceleratedDrawingArea::setPaintingEnabled):
893         (WebKit::AcceleratedDrawingArea::updatePreferences):
894         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
895         (WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
896         (WebKit::AcceleratedDrawingArea::graphicsLayerFactory):
897         (WebKit::AcceleratedDrawingArea::setRootCompositingLayer):
898         (WebKit::AcceleratedDrawingArea::scheduleCompositingLayerFlush):
899         (WebKit::AcceleratedDrawingArea::scheduleCompositingLayerFlushImmediately):
900         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
901         (WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
902         (WebKit::AcceleratedDrawingArea::suspendPainting):
903         (WebKit::AcceleratedDrawingArea::resumePainting):
904         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
905         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon):
906         (WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage):
907         (WebKit::AcceleratedDrawingArea::viewStateDidChange):
908         (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
909         * WebProcess/WebPage/AcceleratedDrawingArea.h: Renamed from Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h.
910         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModePending):
911         (WebKit::AcceleratedDrawingArea::didUpdateBackingStoreState):
912         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingMode):
913         * WebProcess/WebPage/DrawingArea.cpp:
914         (WebKit::DrawingArea::create):
915         * WebProcess/WebPage/DrawingAreaImpl.cpp:
916         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
917         (WebKit::DrawingAreaImpl::setNeedsDisplay):
918         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
919         (WebKit::DrawingAreaImpl::scroll):
920         (WebKit::DrawingAreaImpl::forceRepaint):
921         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
922         (WebKit::DrawingAreaImpl::updateBackingStoreState):
923         (WebKit::DrawingAreaImpl::didUpdateBackingStoreState):
924         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
925         (WebKit::DrawingAreaImpl::suspendPainting):
926         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
927         (WebKit::DrawingAreaImpl::~DrawingAreaImpl): Deleted.
928         (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Deleted.
929         (WebKit::DrawingAreaImpl::updatePreferences): Deleted.
930         (WebKit::DrawingAreaImpl::didUpdate): Deleted.
931         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Deleted.
932         (WebKit::DrawingAreaImpl::scheduleDisplay): Deleted.
933         (WebKit::DrawingAreaImpl::displayTimerFired): Deleted.
934         (WebKit::DrawingAreaImpl::display): Deleted.
935         (WebKit::shouldPaintBoundsRect): Deleted.
936         (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing): Deleted.
937         * WebProcess/WebPage/DrawingAreaImpl.h:
938
939 2016-07-06  Youenn Fablet  <youenn@apple.com>
940
941         Refactor NetworkResourceLoadParameters
942         https://bugs.webkit.org/show_bug.cgi?id=159402
943
944         Reviewed by Alex Christensen.
945
946         Making NetworkResourceLoadParameters derive from NetworkLoadParameters.
947
948         * CMakeLists.txt: Removed NetworkLoadParameters.cpp
949         * NetworkProcess/NetworkLoadParameters.cpp: Deleted.
950         * NetworkProcess/NetworkLoadParameters.h:
951         * NetworkProcess/NetworkResourceLoadParameters.cpp:
952         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): Deleted.
953         * NetworkProcess/NetworkResourceLoadParameters.h: Making it derive from NetworkLoadParameters.
954         * WebKit2.xcodeproj/project.pbxproj:
955
956 2016-07-05  Alex Christensen  <achristensen@webkit.org>
957
958         Actually persist changes to cookie accept policy.
959         https://bugs.webkit.org/show_bug.cgi?id=159377
960         <rdar://problem/22774152>
961
962         Reviewed by Alexey Proskuryakov.
963
964         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
965         (WebKit::NetworkSession::NetworkSession):
966         Added logging.
967         * UIProcess/mac/WebCookieManagerProxyMac.mm:
968         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
969         When we persist the cookie accept policy, we want to call _saveCookies to actually write the
970         change to disk so that when we create a new process which reads from disk to determine its
971         cookie accept policy, it will read the new cookie accept policy.  Before this patch it was
972         reading the old one in some cases where the changes had not yet been persisted to disk.
973
974 2016-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>
975
976         [Coordinated Graphics] Modernize and cleanup CompositingCoordinator
977         https://bugs.webkit.org/show_bug.cgi?id=159212
978
979         Reviewed by Žan Doberšek.
980
981         Changes done:
982
983           - Use references instead of pointers when possible.
984           - Add missing final/override keywords.
985           - Reduce the use of PassRefPtr
986           - Move member initializations to the declaration.
987           - Use nullptr instead of 0.
988           - Use HashMap::ensure() instead of complicated code with iterators.
989           - Avoid heap allocation when possible.
990
991         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
992         (WebKit::WebCoordinatedSurface::paintToSurface):
993         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
994         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
995         (WebKit::ThreadSafeCoordinatedSurface::paintToSurface):
996         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:
997         * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp:
998         (WebKit::GeneralAreaAllocator::expand):
999         (WebKit::GeneralAreaAllocator::splitNode):
1000         (WebKit::GeneralAreaAllocator::release):
1001         (WebKit::GeneralAreaAllocator::GeneralAreaAllocator): Deleted.
1002         * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h:
1003         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1004         (WebKit::CompositingCoordinator::CompositingCoordinator):
1005         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1006         (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
1007         (WebKit::CompositingCoordinator::updateImageBacking):
1008         (WebKit::CompositingCoordinator::notifyFlushRequired):
1009         (WebKit::CompositingCoordinator::paintContents):
1010         (WebKit::CompositingCoordinator::createUpdateAtlas):
1011         (WebKit::CompositingCoordinator::commitScrollOffset):
1012         (WebKit::CompositingCoordinator::paintToSurface):
1013         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1014         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1015         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
1016         (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
1017         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
1018         (WebKit::CoordinatedLayerTreeHost::invalidate):
1019         (WebKit::CoordinatedLayerTreeHost::forceRepaint):
1020         (WebKit::CoordinatedLayerTreeHost::sizeDidChange):
1021         (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
1022         (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
1023         (WebKit::CoordinatedLayerTreeHost::purgeBackingStores):
1024         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
1025         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
1026         (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory):
1027         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
1028         (WebKit::CoordinatedLayerTreeHost::commitScrollOffset):
1029         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1030         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1031         (WebKit::UpdateAtlas::UpdateAtlas):
1032         (WebKit::UpdateAtlas::~UpdateAtlas):
1033         (WebKit::UpdateAtlas::buildLayoutIfNeeded):
1034         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
1035         (WebKit::UpdateAtlasSurfaceClient::UpdateAtlasSurfaceClient): Deleted.
1036         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1037
1038 2016-07-04  Brady Eidson  <beidson@apple.com>
1039
1040         WebProcesses don't handle DatabaseProcess going away uncleanly..
1041         https://bugs.webkit.org/show_bug.cgi?id=159371
1042
1043         Reviewed by Alex Christensen.
1044
1045         * UIProcess/WebProcessPool.cpp:
1046         (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
1047
1048         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1049         (WebKit::WebIDBConnectionToServer::connectionToServerLost):
1050         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1051
1052         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
1053         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
1054         (WebKit::WebToDatabaseProcessConnection::didClose): Notify each connection
1055           that the database server connection dropped.
1056
1057 2016-07-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1058
1059         [GTK] Null WebCore::Range dereference in WebEditorClient::updateGlobalSelection
1060         https://bugs.webkit.org/show_bug.cgi?id=159341
1061
1062         Reviewed by Carlos Garcia Campos.
1063
1064         FrameSelection::toNormalizedRange() can return null. Null check is
1065         needed.
1066
1067         Tests:
1068             editing/input/set-value-on-input-and-delete.html
1069             editing/selection/selection-in-iframe-removed-crash.html
1070             imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
1071             imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-after-content-change.html
1072             imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea.html
1073             imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application.html
1074
1075         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1076         (WebKit::WebEditorClient::updateGlobalSelection): Do not update
1077         global selection if FrameSelection::toNormalizedRange() returns
1078         null.
1079
1080 2016-07-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1081
1082         [GTK] ASSERTION_FAILED: m_key != PTHREAD_KEYS_MAX when defining WEBKIT2_PAUSE_WEB_PROCESS_ON_LAUNCH
1083         https://bugs.webkit.org/show_bug.cgi?id=158149
1084
1085         Reviewed by Carlos Garcia Campos.
1086
1087         WTF::sleep can not be used at the beginning of web process because
1088         WTF is not initialized at the moment yet.
1089
1090         * WebProcess/gtk/WebProcessMainGtk.cpp: Use g_usleep instead of WTF::sleep.
1091
1092 2016-07-03  Dan Bernstein  <mitz@apple.com>
1093
1094         Follow-up to r202789.
1095
1096         Reviewed by Sam Weinig.
1097
1098         Ensure that API that isn’t available at all on a platform is declared under an appropriate
1099         TARGET_OS_* conditional.
1100
1101         * Shared/API/Cocoa/_WKHitTestResult.h:
1102         * Shared/API/Cocoa/_WKHitTestResult.mm:
1103         * Shared/API/Cocoa/_WKHitTestResultInternal.h:
1104         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
1105         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
1106         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
1107         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h:
1108         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm:
1109         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1110
1111 2016-07-03  Dan Bernstein  <mitz@apple.com>
1112
1113         [Cocoa] Adopt modern API availability macros
1114         https://bugs.webkit.org/show_bug.cgi?id=159378
1115
1116         Reviewed by Sam Weinig.
1117
1118         iOS 10 and macOS Sierra introduce new macros for declaring API availability, defined in
1119         CFAvailability.h, including API_AVAILABLE, API_DEPRECATED, and
1120         API_DEPRECATED_WITH_REPLACEMENT. Rather than having positional parameters for macOS and iOS
1121         versions, the new macros take a variable number of function-like parameters, where the
1122         function specifies the platform to which it applies.
1123
1124         To have WebKit2’s postprocessed headers use the new macros, we make the following changes:
1125
1126         - Replace instances of WK_AVAILABLE(_mac, _ios) with WK_API_AVAILABLE(macosx(_mac), ios(_ios)),
1127           eliding a platform if its current availability is NA.
1128         - Change instances of WK_CLASS_AVAILABLE(_mac, _ios) to
1129           WK_CLASS_AVAILABLE(macosx(_mac), ios(_ios)), eliding a platform if its current
1130           availability is NA.
1131         - Replace instances of WK_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) with
1132           WK_API_DEPRECATED_WITH_REPLACEMENT(_replacement, macosx(_macIntro, _macDep), ios(_iosIntro, _iosDep))
1133           when there is a one-for-one replacement, and with
1134           WK_API_DEPRECATED(_message, macosx(_macIntro, _macDep), ios(_iosIntro, _iosDep)) when the
1135           replacement isn’t one-for-one. Again, if the API doesn’t apply to a platform, then it’s
1136           elided.
1137         - Replace instances of WK_CLASS_DEPRECATED with WK_CLASS_DEPRECATED_WITH_REPLACEMENT,
1138           following the same rules.
1139         - Replace instances of the WK_ENUM_* macros with corresponding WK_API_* macros, now that
1140           all supported compilers support availability attributes on enum values.
1141
1142         * Configurations/WebKit.xcconfig: Disable header postprocessing when building for iOS 9.x,
1143           which doesn’t have the new macros.
1144
1145         * mac/postprocess-framework-headers.sh: Handle the new WK_* macros: WK_API_AVAILABLE becomes
1146           API_AVAILABLE; WK_API_DEPRECATED(_WITH_REPLACEMENT) become API_DEPRECATED(_WITH_REPLACEMENT);
1147           WK_CLASS_AVAILABLE and WK_CLASS_DEPRECATED(_WITH_REPLACEMENT) change to the corresponding
1148           API_ macros, prefixed with WK_EXTERN.
1149         * Shared/API/Cocoa/WKFoundation.h: When header postprocessing is disabled, provide
1150           definitions of the new WK_* macros we use.
1151
1152         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: In addition to the above, changed one
1153           instance of (iOS) 10_0 to WK_IOS_TBA.
1154
1155         Made the above changes in the following headers:
1156
1157         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
1158         * Shared/API/Cocoa/_WKFrameHandle.h:
1159         * Shared/API/Cocoa/_WKHitTestResult.h:
1160         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
1161         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
1162         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
1163         * Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
1164         * UIProcess/API/Cocoa/WKBackForwardList.h:
1165         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1166         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
1167         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
1168         * UIProcess/API/Cocoa/WKConnection.h:
1169         * UIProcess/API/Cocoa/WKError.h:
1170         * UIProcess/API/Cocoa/WKErrorPrivate.h:
1171         * UIProcess/API/Cocoa/WKFrameInfo.h:
1172         * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
1173         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
1174         * UIProcess/API/Cocoa/WKNavigation.h:
1175         * UIProcess/API/Cocoa/WKNavigationAction.h:
1176         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1177         * UIProcess/API/Cocoa/WKNavigationData.h:
1178         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1179         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1180         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1181         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
1182         * UIProcess/API/Cocoa/WKPreferences.h:
1183         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1184         * UIProcess/API/Cocoa/WKPreviewActionItem.h:
1185         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h:
1186         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
1187         * UIProcess/API/Cocoa/WKProcessGroup.h:
1188         * UIProcess/API/Cocoa/WKProcessPool.h:
1189         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1190         * UIProcess/API/Cocoa/WKScriptMessage.h:
1191         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
1192         * UIProcess/API/Cocoa/WKTypeRefWrapper.h:
1193         * UIProcess/API/Cocoa/WKUIDelegate.h:
1194         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1195         * UIProcess/API/Cocoa/WKUserContentController.h:
1196         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
1197         * UIProcess/API/Cocoa/WKUserScript.h:
1198         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
1199         * UIProcess/API/Cocoa/WKViewPrivate.h:
1200         * UIProcess/API/Cocoa/WKWebView.h:
1201         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1202         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1203         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1204         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
1205         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1206         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1207         * UIProcess/API/Cocoa/WKWindowFeatures.h:
1208         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
1209         * UIProcess/API/Cocoa/_WKAutomationSession.h:
1210         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
1211         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
1212         * UIProcess/API/Cocoa/_WKDownload.h:
1213         * UIProcess/API/Cocoa/_WKElementAction.h:
1214         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
1215         * UIProcess/API/Cocoa/_WKFindOptions.h:
1216         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1217         * UIProcess/API/Cocoa/_WKInputDelegate.h:
1218         * UIProcess/API/Cocoa/_WKLayoutMode.h:
1219         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
1220         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1221         * UIProcess/API/Cocoa/_WKSessionState.h:
1222         * UIProcess/API/Cocoa/_WKThumbnailView.h:
1223         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
1224         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
1225         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
1226         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
1227         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
1228         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
1229         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
1230         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
1231         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1232         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h:
1233         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1234         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
1235         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
1236         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
1237         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
1238         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
1239         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
1240         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
1241         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
1242         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
1243         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
1244         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
1245         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
1246
1247 2016-07-01  Hunseop Jeong  <hs85.jeong@samsung.com>
1248
1249         [EFL] Many layout tests are timeout after r202532.
1250         https://bugs.webkit.org/show_bug.cgi?id=159337
1251
1252         Reviewed by Gyuyoung Kim.
1253
1254         WebPageProxy::forceRepaint() wait for the next commit from the web process
1255         after r202532, but WebPageProxy::callAfterNextPresentationUpdate() is not 
1256         implemented in CoordinatedDrawingAreaProxy.
1257
1258         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
1259         (WebKit::CoordinatedDrawingAreaProxy::contentsRect):
1260         (WebKit::CoordinatedDrawingAreaProxy::dispatchAfterEnsuringDrawing):
1261         (WebKit::CoordinatedDrawingAreaProxy::sizeDidChange):
1262         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h:
1263         (WebKit::CoordinatedDrawingAreaProxy::page):
1264
1265 2016-07-01  Myles C. Maxfield  <mmaxfield@apple.com>
1266
1267         REGRESSION(r189668): Notification tests are flakey
1268         https://bugs.webkit.org/show_bug.cgi?id=159375
1269         <rdar://problem/22760990>
1270
1271         Reviewed by Alexey Proskuryakov.
1272
1273         Implement WKNotificationManagerGetLocalID(). For more information, see the entry in Tools/ChangeLog.
1274
1275         * UIProcess/API/C/WKNotificationManager.cpp:
1276         (WKNotificationManagerGetLocalID):
1277         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
1278         (WebKit::WebNotificationManagerProxy::notificationLocalIDForTesting):
1279         * UIProcess/Notifications/WebNotificationManagerProxy.h:
1280         * WebKit2.xcodeproj/project.pbxproj:
1281
1282 2016-07-01  Jer Noble  <jer.noble@apple.com>
1283
1284         REGRESSION(r201405): Fullscreen video no longer enters low-power mode
1285         https://bugs.webkit.org/show_bug.cgi?id=159220
1286         <rdar://problem/26701056>
1287
1288         Reviewed by Beth Dakin.
1289
1290         In r201405, we removed the call to setTopContentInset(0) to avoid a flash
1291         during repainting where the WebProcess still thought it had an inset and
1292         the UIProcess did not, but the >0 inset breaks low power video playback 
1293         in fullscreen. So, instead, fix the repaint issue by setting a CALayer
1294         fence which makes sure both the UIProcess and WebProcess paint simultaneously
1295         after resizing and changing the top content inset.
1296
1297         This requires a new message from WebPageProxy -> WebPage: setTopContentInsetFenced().
1298
1299         * UIProcess/WebPageProxy.cpp:
1300         (WebKit::WebPageProxy::setTopContentInset):
1301         * UIProcess/mac/WKFullScreenWindowController.h:
1302         * UIProcess/mac/WKFullScreenWindowController.mm:
1303         (-[WKFullScreenWindowController enterFullScreen:]):
1304         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
1305         * WebProcess/WebPage/WebPage.cpp:
1306         (WebKit::WebPage::setTopContentInsetFenced):
1307         * WebProcess/WebPage/WebPage.h:
1308         * WebProcess/WebPage/WebPage.messages.in:
1309
1310 2016-07-01  Dan Bernstein  <mitz@apple.com>
1311
1312         [Mac] Get rid of support for old SDKs
1313         https://bugs.webkit.org/show_bug.cgi?id=159369
1314
1315         Reviewed by Anders Carlsson.
1316
1317         * Shared/API/Cocoa/WKFoundation.h: Removed the WK_ARRAY, WK_DICTIONARY, and WK_SET macros,
1318           which were only needed for pre-10.11 SDKs.
1319
1320         * Shared/mac/WebEventFactory.mm:
1321         (WebKit::mouseButtonForEvent): Removed checking for pre-10.10.3 SDKs.
1322         (WebKit::globalPointForEvent): Ditto.
1323         (WebKit::pointForEvent): Ditto.
1324         (WebKit::WebEventFactory::createWebMouseEvent): Ditto.
1325
1326         * UIProcess/API/Cocoa/WKBackForwardList.h: Replaced WK_ARRAY(...) with NSArray<...>.
1327
1328         * UIProcess/API/Cocoa/WKPreferences.mm: Ditto.
1329         (-[WKPreferences _setFixedPitchFontFamily:]):
1330         (+[WKPreferences _experimentalFeatures]):
1331         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Ditto.
1332
1333         * UIProcess/API/Cocoa/WKUIDelegate.h: Ditto.
1334         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Ditto.
1335
1336         * UIProcess/API/Cocoa/WKUserContentController.h: Ditto.
1337         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Ditto.
1338
1339         * UIProcess/API/Cocoa/WKUserScriptPrivate.h: Ditto.
1340
1341         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Replaced WK_SET(...) with NSSet<...>.
1342         * UIProcess/API/Cocoa/WKWebsiteDataStore.h: Ditto.
1343         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: Ditto.
1344         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
1345         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
1346
1347         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Ditto.
1348
1349         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Replaced WK_ARRAY(...) with NSArray<...>.
1350
1351         * UIProcess/API/Cocoa/_WKUserStyleSheet.h: Ditto.
1352         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: Ditto.
1353         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:]):
1354         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
1355         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
1356
1357         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h: Replaced WK_SET(...) with NSSet<...>.
1358
1359         * UIProcess/Cocoa/WebViewImpl.mm:
1360         (WebKit::WebViewImpl::pressureChangeWithEvent): Removed checking for pre-10.10.3 SDKs.
1361
1362         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: Replaced WK_ARRAY(...) with
1363           NSArray<...>.
1364
1365         * mac/postprocess-framework-headers.sh: Removed sed rules for WK_ARRAY, WK_DICTIONARY and
1366           WK_SET.
1367
1368 2016-07-01  Chris Dumez  <cdumez@apple.com>
1369
1370         [iOS] Possible null Range dereference under computeAutocorrectionContext()
1371         https://bugs.webkit.org/show_bug.cgi?id=159328
1372         <rdar://problem/26766720>
1373
1374         Reviewed by Benjamin Poulain.
1375
1376         The code in computeAutocorrectionContext() was checking Editor::hasComposition()
1377         before dereferencing Editor::compositionRange(). However, compositionRange()
1378         can also return null in other cases (e.g. compositionStart == compositionEnd).
1379
1380         Drop the check for hasComposition() and do a null check on the value returned
1381         by compositionRange() instead.
1382
1383         * WebProcess/WebPage/ios/WebPageIOS.mm:
1384         (WebKit::computeAutocorrectionContext):
1385
1386 2016-07-01  Brent Fulgham  <bfulgham@apple.com>
1387
1388         Prevent crash when attempting to copy an image
1389         https://bugs.webkit.org/show_bug.cgi?id=159288
1390         <rdar://problem/23507828>
1391
1392         Reviewed by Brady Eidson.
1393         
1394         WebKit could crash if the HTMLImageElement had a null cachedImage member.
1395         A little investigation showed that the URL we retrieve from the cachedImage
1396         is never used, so rather than adding a null check, let's just pass a
1397         default argument. The actual URL gets read from elsewhere in the pasteboard
1398         processing code.
1399
1400         * WebProcess/WebPage/ios/WebPageIOS.mm:
1401         (WebKit::WebPage::performActionOnElement): Don't bother passing the
1402         unused URL argument to the pasteboard method.
1403
1404 2016-07-01  Brady Eidson  <beidson@apple.com>
1405
1406         Blob content type not preserved when retrieving blobs from IndexedDB.
1407         <rdar://problem/27057357> and https://bugs.webkit.org/show_bug.cgi?id=159360
1408
1409         Reviewed by Alex Christensen.
1410
1411         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1412         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
1413         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1414
1415         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1416         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
1417         * NetworkProcess/NetworkConnectionToWebProcess.h:
1418         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1419
1420         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1421         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
1422         * WebProcess/FileAPI/BlobRegistryProxy.h:
1423
1424 2016-07-01  Dan Bernstein  <mitz@apple.com>
1425
1426         [Cocoa] Get rid of WK_NULLABLE_SPECIFIER now that all supported compilers understand _Nullable
1427         https://bugs.webkit.org/show_bug.cgi?id=159361
1428
1429         Reviewed by Anders Carlsson.
1430
1431         * Shared/API/Cocoa/WKFoundation.h:
1432         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1433         * UIProcess/API/Cocoa/WKUIDelegate.h:
1434         * UIProcess/API/Cocoa/WKWebView.h:
1435         * mac/postprocess-framework-headers.sh:
1436
1437 2016-07-01  Youenn Fablet  <youennf@gmail.com>
1438
1439         Add a runtime flag for DOM iterators
1440         https://bugs.webkit.org/show_bug.cgi?id=159300
1441
1442         Reviewed by Alex Christensen.
1443
1444         * Shared/WebPreferencesDefinitions.h:
1445         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1446         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1447         * WebProcess/WebPage/WebPage.cpp:
1448         (WebKit::WebPage::updatePreferences):
1449
1450 2016-07-01  Andreas Kling  <akling@apple.com>
1451
1452         [Mac] Get rid of the old timey rubber-banding linen pattern.
1453         <https://webkit.org/b/159329>
1454
1455         Reviewed by Benjamin Poulain.
1456
1457         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1458         (WebKit::updateCustomAppearance):
1459
1460 2016-06-30  Tina Liu  <iting_liu@apple.com>
1461
1462         Add SPI to allow restoring session state without navigation in WKPage
1463         https://bugs.webkit.org/show_bug.cgi?id=159326
1464
1465         Reviewed by Brady Eidson.
1466
1467         * UIProcess/API/C/WKPage.cpp:
1468         (restoreFromSessionState):
1469         Added a helper function that takes a bool parameter to specify whether
1470         to navigate or not when restoring from the session state.
1471         (WKPageRestoreFromSessionState):
1472         Calling restoreFromSessionState, passing navigate = true.
1473         (WKPageRestoreFromSessionStateWithoutNavigation):
1474         Ditto but passing navigate = false.
1475         * UIProcess/API/C/WKPagePrivate.h:
1476
1477 2016-06-30  Chris Dumez  <cdumez@apple.com>
1478
1479         [iOS] WebContent processes do not exit promptly
1480         https://bugs.webkit.org/show_bug.cgi?id=159301
1481         <rdar://problem/26965488>
1482
1483         Reviewed by Anders Carlsson.
1484
1485         WebContent processes do not exit promptly, they hang around for 10 seconds
1486         until the watchdog forcefully calls exit().
1487
1488         This patch addresses the issue by asking XPC to exit when clean. It also
1489         fixes 2 XPC transactions that were leaking so that XPC can become clean.
1490
1491         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
1492         (DatabaseServiceInitializer):
1493         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1494         (NetworkServiceInitializer):
1495         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
1496         (PluginServiceInitializer):
1497         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
1498         (WebContentServiceInitializer):
1499         Add extra priorityBoostMessage parameter which is then passed along to
1500         ChildProcess via initialization parameters. ChildProcess is now in
1501         charge of retaining the message for as long as it needs the priority
1502         boost. In particular, ChildProcess now takes care of releasing the
1503         boost message before existing to avoid leaking an XPC transaction.
1504
1505         * Shared/ChildProcess.cpp:
1506         (WebKit::ChildProcess::initialize):
1507         Retain priorityBoostMessage as a data member.
1508
1509         (WebKit::ChildProcess::stopRunLoop):
1510         (WebKit::ChildProcess::platformStopRunLoop):
1511         * Shared/ios/ChildProcessIOS.mm:
1512         (WebKit::ChildProcess::platformStopRunLoop):
1513         On iOS, call XPCServiceExit() to exit instead of RunLoop::main().stop()
1514         which did not work.
1515
1516         * Shared/ChildProcess.h:
1517         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1518         (WebKit::XPCServiceInitializer):
1519         Set priorityBoostMessage on ChildProcessInitializationParameters.
1520
1521         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1522         (WebKit::XPCServiceExit):
1523         Add XPCServiceExit() function which destroys the priority boost
1524         message, calls xpc_transaction_end() to balance the
1525         xpc_transaction_begin() in XPCServiceInitializer() and then call
1526         xpc_transaction_exit_clean() to ask XPC to exit when clean.
1527
1528         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1529         (WebKit::XPCServiceEventHandler):
1530         Leaking the "pre-bootstrap" event for priority boosting would cause us to
1531         leak an XPC transaction, which would prevent XPC from becoming clean and
1532         exiting. Instead, we now pass it along to the initialization function.
1533         We then pass it to ChildProcess which manages the lifetime of this message
1534         instead of leaking it.
1535
1536 2016-06-30  Brian Burg  <bburg@apple.com>
1537
1538         REGRESSION(r202329): WebInspectorProxy's WKPagePolicyClient callbacks are not being called
1539         https://bugs.webkit.org/show_bug.cgi?id=159308
1540         <rdar://problem/27111764>
1541
1542         Reviewed by Tim Horton.
1543
1544         Adopt WKPageNavigationClient and ditch WKPolicyClient and WKPageLoaderClient.
1545         After r202329, it's not possible to set a WKPolicyClient for a WKPage/WebPageProxy that backs a WKWebView.
1546
1547         * UIProcess/WebInspectorProxy.cpp:
1548         (WebKit::isMainOrTestInspectorPage): Take a WebCore::ResourceRequest.
1549         (WebKit::processDidCrash): Deleted.
1550         (WebKit::webProcessDidCrash): Rename to match new client callback name.
1551         (WebKit::decidePolicyForNavigationAction): Rework this to take new argument types.
1552         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
1553         Install a WKPageNavigationClient. 
1554
1555 2016-06-30  Chris Dumez  <cdumez@apple.com>
1556
1557         [iOS] Process suspension is prevented for 30 seconds after closing a tab
1558         https://bugs.webkit.org/show_bug.cgi?id=159280
1559         <rdar://problem/27014867>
1560
1561         Reviewed by Gavin Barraclough.
1562
1563         When closing a tab, ConnectionTerminationWatchdog takes a background
1564         assertion on behalf of the WebContent process and only releases it
1565         after 30 seconds, allowing for the WebContent process to exit cleanly
1566         without worrying about getting suspended too early.
1567
1568         However, the child process normally exits much sooner than this and
1569         we end up holding a process assertion for no reason for a full 30
1570         seconds anyway. This patch addresses the issue by registering an
1571         invalidation handler with the BKSProcessAssertion and releasing our
1572         our assertion in such case. The invalidation handler gets called
1573         as soon as the child process exits.
1574
1575         * Platform/spi/ios/AssertionServicesSPI.h:
1576         * UIProcess/ProcessAssertion.cpp:
1577         (WebKit::ProcessAssertion::ProcessAssertion):
1578         * UIProcess/ProcessAssertion.h:
1579         (WebKit::ProcessAssertion::ProcessAssertion):
1580         (WebKit::ProcessAssertion::validity):
1581         * UIProcess/ios/ProcessAssertionIOS.mm:
1582         (WebKit::ProcessAssertion::ProcessAssertion):
1583         (WebKit::ProcessAssertion::~ProcessAssertion):
1584         (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
1585         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
1586         (WebKit::ProcessAssertion::setState): Deleted.
1587
1588 2016-06-30  Tim Horton  <timothy_horton@apple.com>
1589
1590         Keep track of when a WKWebView is blank before the initial non-empty layout
1591         https://bugs.webkit.org/show_bug.cgi?id=159217
1592         <rdar://problem/26071766>
1593
1594         Reviewed by Beth Dakin.
1595
1596         * UIProcess/API/Cocoa/WKWebView.mm:
1597         (-[WKWebView _initializeWithConfiguration:]):
1598         (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]):
1599         (-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]):
1600         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1601         * UIProcess/ios/PageClientImplIOS.mm:
1602         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
1603
1604 2016-06-29  Gavin Barraclough  <barraclough@apple.com>
1605
1606         Cleanup ProcessAssertion RunInBackground management
1607         https://bugs.webkit.org/show_bug.cgi?id=159284
1608
1609         Reviewed by Chris Dumez.
1610
1611         Factor out code that handles taking a background assertion on the UI app into
1612         ProcessAndUIAssertion::updateRunInBackgroundCount helper.
1613
1614         This patch just cleanup to enable a futher fix.
1615
1616         * UIProcess/ProcessAssertion.h:
1617         (WebKit::ProcessAssertion::state):
1618             - Added ProcessAndUIAssertion::updateRunInBackgroundCount
1619             - Added ProcessAndUIAssertion::m_isHoldingBackgroundAssertionOnApp
1620         * UIProcess/ios/ProcessAssertionIOS.mm:
1621         (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
1622             - helper to manage calls to incrementNeedsToRunInBackgroundCount/decrementNeedsToRunInBackgroundCount
1623         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
1624             - call updateRunInBackgroundCount
1625         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
1626             changed to use m_isHoldingBackgroundAssertionOnApp
1627         (WebKit::ProcessAndUIAssertion::setState):
1628             - call updateRunInBackgroundCount
1629
1630 2016-06-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1631
1632         [Coordinated Graphics] Move CompositingCoordinator from platform to WebKit2 layer
1633         https://bugs.webkit.org/show_bug.cgi?id=159209
1634
1635         Reviewed by Žan Doberšek.
1636
1637         Move CompositingCoordinator and its helper classes to the WebKit2 layer.
1638
1639         * PlatformEfl.cmake:
1640         * PlatformGTK.cmake:
1641         * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.cpp.
1642         (WebKit::AreaAllocator::AreaAllocator):
1643         (WebKit::AreaAllocator::~AreaAllocator):
1644         (WebKit::AreaAllocator::expand):
1645         (WebKit::AreaAllocator::expandBy):
1646         (WebKit::AreaAllocator::release):
1647         (WebKit::AreaAllocator::overhead):
1648         (WebKit::AreaAllocator::roundAllocation):
1649         (WebKit::GeneralAreaAllocator::GeneralAreaAllocator):
1650         (WebKit::GeneralAreaAllocator::~GeneralAreaAllocator):
1651         (WebKit::GeneralAreaAllocator::freeNode):
1652         (WebKit::GeneralAreaAllocator::expand):
1653         (WebKit::fitsWithin):
1654         (WebKit::GeneralAreaAllocator::allocate):
1655         (WebKit::GeneralAreaAllocator::allocateFromNode):
1656         (WebKit::GeneralAreaAllocator::splitNode):
1657         (WebKit::GeneralAreaAllocator::updateLargestFree):
1658         (WebKit::GeneralAreaAllocator::release):
1659         (WebKit::GeneralAreaAllocator::overhead):
1660         * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.h.
1661         (WebKit::nextPowerOfTwo):
1662         (WebKit::AreaAllocator::size):
1663         (WebKit::AreaAllocator::minimumAllocation):
1664         (WebKit::AreaAllocator::setMinimumAllocation):
1665         (WebKit::AreaAllocator::margin):
1666         (WebKit::AreaAllocator::setMargin):
1667         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp.
1668         (WebKit::CompositingCoordinator::CompositingCoordinator):
1669         (WebKit::CompositingCoordinator::~CompositingCoordinator):
1670         (WebKit::CompositingCoordinator::setRootCompositingLayer):
1671         (WebKit::CompositingCoordinator::setViewOverlayRootLayer):
1672         (WebKit::CompositingCoordinator::sizeDidChange):
1673         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1674         (WebKit::CompositingCoordinator::timestamp):
1675         (WebKit::CompositingCoordinator::syncDisplayState):
1676         (WebKit::CompositingCoordinator::nextAnimationServiceTime):
1677         (WebKit::CompositingCoordinator::clearPendingStateChanges):
1678         (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
1679         (WebKit::CompositingCoordinator::createRootLayer):
1680         (WebKit::CompositingCoordinator::syncLayerState):
1681         (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
1682         (WebKit::CompositingCoordinator::createImageBacking):
1683         (WebKit::CompositingCoordinator::updateImageBacking):
1684         (WebKit::CompositingCoordinator::clearImageBackingContents):
1685         (WebKit::CompositingCoordinator::removeImageBacking):
1686         (WebKit::CompositingCoordinator::flushPendingImageBackingChanges):
1687         (WebKit::CompositingCoordinator::notifyAnimationStarted):
1688         (WebKit::CompositingCoordinator::notifyFlushRequired):
1689         (WebKit::CompositingCoordinator::paintContents):
1690         (WebKit::CompositingCoordinator::createGraphicsLayer):
1691         (WebKit::CompositingCoordinator::deviceScaleFactor):
1692         (WebKit::CompositingCoordinator::pageScaleFactor):
1693         (WebKit::CompositingCoordinator::createUpdateAtlas):
1694         (WebKit::CompositingCoordinator::removeUpdateAtlas):
1695         (WebKit::CompositingCoordinator::visibleContentsRect):
1696         (WebKit::CompositingCoordinator::mainContentsLayer):
1697         (WebKit::CompositingCoordinator::setVisibleContentsRect):
1698         (WebKit::CompositingCoordinator::deviceOrPageScaleFactorChanged):
1699         (WebKit::CompositingCoordinator::detachLayer):
1700         (WebKit::CompositingCoordinator::commitScrollOffset):
1701         (WebKit::CompositingCoordinator::renderNextFrame):
1702         (WebKit::CompositingCoordinator::purgeBackingStores):
1703         (WebKit::CompositingCoordinator::paintToSurface):
1704         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases):
1705         (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired):
1706         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h.
1707         (WebKit::CompositingCoordinator::clearRootLayer):
1708         (WebKit::CompositingCoordinator::rootLayer):
1709         (WebKit::CompositingCoordinator::state):
1710         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1711         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.cpp.
1712         (WebKit::UpdateAtlasSurfaceClient::UpdateAtlasSurfaceClient):
1713         (WebKit::UpdateAtlas::UpdateAtlas):
1714         (WebKit::UpdateAtlas::~UpdateAtlas):
1715         (WebKit::UpdateAtlas::buildLayoutIfNeeded):
1716         (WebKit::UpdateAtlas::didSwapBuffers):
1717         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
1718         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.h.
1719         (WebKit::UpdateAtlas::size):
1720         (WebKit::UpdateAtlas::supportsAlpha):
1721         (WebKit::UpdateAtlas::addTimeInactive):
1722         (WebKit::UpdateAtlas::isInactive):
1723         (WebKit::UpdateAtlas::isInUse):
1724
1725 2016-06-29  Hunseop Jeong  <hs85.jeong@samsung.com>
1726
1727         Unreviewed, CMake build fix.
1728
1729         * PlatformMac.cmake:
1730
1731 2016-06-29  Beth Dakin  <bdakin@apple.com>
1732
1733         Add media_icon to WebKit2
1734         https://bugs.webkit.org/show_bug.cgi?id=159273
1735         -and corresponding-
1736         rdar://problem/27087714
1737
1738         Reviewed by Dean Jackson.
1739
1740         * Resources/mediaIcon.pdf: Added.
1741         * WebKit2.xcodeproj/project.pbxproj:
1742
1743 2016-06-29  Anders Carlsson  <andersca@apple.com>
1744
1745         Rename addressFields to contactFields
1746         https://bugs.webkit.org/show_bug.cgi?id=159271
1747         rdar://problem/27086955
1748
1749         Reviewed by Beth Dakin.
1750
1751         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1752         (IPC::ArgumentCoder<PaymentRequest>::encode):
1753         (IPC::ArgumentCoder<PaymentRequest>::decode):
1754         (IPC::ArgumentCoder<PaymentRequest::ContactFields>::encode):
1755         (IPC::ArgumentCoder<PaymentRequest::ContactFields>::decode):
1756         (IPC::ArgumentCoder<PaymentRequest::AddressFields>::encode): Deleted.
1757         (IPC::ArgumentCoder<PaymentRequest::AddressFields>::decode): Deleted.
1758         * Shared/WebCoreArgumentCoders.h:
1759         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1760         (WebKit::toPKAddressField):
1761         (WebKit::toPKPaymentRequest):
1762
1763 2016-06-29  Jer Noble  <jer.noble@apple.com>
1764
1765         Adopt MediaRemote.
1766         https://bugs.webkit.org/show_bug.cgi?id=159250
1767
1768         Reviewed by Eric Carlson.
1769
1770         Add a sandbox exception allowing access to the mediaremoted XPC service.
1771
1772         * WebProcess/com.apple.WebProcess.sb.in:
1773
1774 2016-06-29  Alex Christensen  <achristensen@webkit.org>
1775
1776         WKWebView should ask WKNavigationDelegate about bad ssl certificates
1777         https://bugs.webkit.org/show_bug.cgi?id=159176
1778         rdar://problem/26864882
1779
1780         Reviewed by Sam Weinig.
1781
1782         This can be tested manually by visiting a site in MiniBrowser that has invalid ssl certificates, but we don't have proper ssl testing yet.
1783         Before this change, we would just open the site as if nothing were invalid, now we call the WKNavigationDelegate's didReceiveAuthenticationChallenge
1784         like we did before using NSURLSession, and we do not open the page, also like we did before using NSURLSession.
1785
1786         * NetworkProcess/NetworkLoad.cpp:
1787         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1788         When using NSURLConnection and responding to canAuthenticateAgainstProtectionSpace with YES,
1789         we get an NSURLAuthenticationChallenge when a bad ssl certificate is encountered in the handshake.
1790         When using NSURLSession, we want to call webView:didReceiveAuthenticationChallenge:completionHandler: in this case.
1791         The default implementation of NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace returns true
1792         if there is an implementation of webView:didReceiveAuthenticationChallenge:completionHandler: in its WKNavigationDelegate.
1793         Internal clients can implement _webView:canAuthenticateAgainstProtectionSpace: 
1794         and Safari uses canHandleHTTPSServerTrustEvaluation, so it will be unaffected.
1795
1796 2016-06-29  Beth Dakin  <bdakin@apple.com>
1797
1798         Delete WKElementInfo since it's not used
1799         https://bugs.webkit.org/show_bug.cgi?id=159265
1800
1801         Reviewed by Sam Weinig.
1802
1803         * Shared/API/Cocoa/WebKit.h:
1804         * UIProcess/API/Cocoa/WKElementInfo.h: Removed.
1805         * UIProcess/API/Cocoa/WKElementInfo.mm: Removed.
1806         * UIProcess/API/Cocoa/WKElementInfoInternal.h: Removed.
1807         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
1808         * UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
1809         (-[WKPreviewElementInfo _initWithLinkURL:]):
1810         (-[WKPreviewElementInfo copyWithZone:]):
1811         (-[WKPreviewElementInfo linkURL]):
1812         * UIProcess/API/Cocoa/WKPreviewElementInfoInternal.h:
1813         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
1814         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm:
1815         (-[_WKContextMenuElementInfo copyWithZone:]):
1816         * WebKit2.xcodeproj/project.pbxproj:
1817
1818 2016-06-29  Jeremy Jones  <jeremyj@apple.com>
1819
1820         Replace MPAudioVideoRoutingActionSheet with MPAVRoutingSheet.
1821         https://bugs.webkit.org/show_bug.cgi?id=159161
1822         <rdar://problem/26017691>
1823
1824         Reviewed by Sam Weinig.
1825
1826         MPAudioVideoRoutingActionSheet is being replaced by MPAVRoutingSheet,
1827         with only minor changes to the interface.
1828
1829         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1830         (-[WKAirPlayRoutePicker dealloc]):
1831         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]):
1832
1833 2016-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1834
1835         Too much duplicated code in LayerTreeHosts implementations
1836         https://bugs.webkit.org/show_bug.cgi?id=159144
1837
1838         Reviewed by Žan Doberšek.
1839
1840         There's some code common and duplicated in all current LayerTreeHosts implementations (Gtk, Coordinated, and
1841         ThreadedCoordinated). The thing is even worse in the case of ThreadedCoordinated and Coordinated, where the
1842         former is actually a special case of the later, and it seems like code was copy pasted and then modified to add
1843         ThreadedCoordinated specific code. The problem of that approach, apart from the code duplication, is that common
1844         parts end up diverging too. This patch moves the common parts to the base class LayerTreeHost and makes
1845         ThreadedCoordinatedLayerTreeHost inherit from CoordinatedLayerTreeHost, to share the common code and simply add
1846         the specific one.
1847
1848         * PlatformGTK.cmake:
1849         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
1850         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1851         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
1852         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
1853         (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
1854         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
1855         (WebKit::CoordinatedLayerTreeHost::invalidate):
1856         (WebKit::CoordinatedLayerTreeHost::sizeDidChange):
1857         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
1858         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
1859         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
1860         (WebKit::CoordinatedLayerTreeHost::cancelPendingLayerFlush): Deleted.
1861         (WebKit::CoordinatedLayerTreeHost::forceRepaint): Deleted.
1862         (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): Deleted.
1863         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): Deleted.
1864         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Deleted.
1865         (WebKit::CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Deleted.
1866         (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory): Deleted.
1867         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1868         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1869         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
1870         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
1871         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
1872         (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect):
1873         (WebKit::ThreadedCoordinatedLayerTreeHost::commitSceneState):
1874         (WebKit::ThreadedCoordinatedLayerTreeHost::create): Deleted.
1875         (WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): Deleted.
1876         (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Deleted.
1877         (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted.
1878         (WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged): Deleted.
1879         (WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
1880         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1881         * WebProcess/WebPage/DrawingArea.h:
1882         (WebKit::DrawingArea::layerHostDidFlushLayers):
1883         * WebProcess/WebPage/DrawingAreaImpl.h:
1884         * WebProcess/WebPage/LayerTreeHost.cpp:
1885         (WebKit::LayerTreeHost::~LayerTreeHost):
1886         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
1887         (WebKit::LayerTreeHost::pauseRendering):
1888         (WebKit::LayerTreeHost::resumeRendering):
1889         (WebKit::LayerTreeHost::invalidate):
1890         * WebProcess/WebPage/LayerTreeHost.h:
1891         (WebKit::LayerTreeHost::layerTreeContext):
1892         (WebKit::LayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush):
1893         (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplay):
1894         (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplayInRect):
1895         (WebKit::LayerTreeHost::scrollNonCompositedContents):
1896         (WebKit::LayerTreeHost::graphicsLayerFactory):
1897         (WebKit::LayerTreeHost::contentsSizeChanged):
1898         (WebKit::LayerTreeHost::didChangeViewportProperties):
1899         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
1900         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
1901         (WebKit::LayerTreeHost::forceRepaintAsync): Deleted.
1902         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1903         (WebKit::LayerTreeHostGtk::invalidate):
1904         (WebKit::LayerTreeHostGtk::setViewOverlayRootLayer):
1905         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Deleted.
1906         (WebKit::LayerTreeHostGtk::setRootCompositingLayer): Deleted.
1907         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay): Deleted.
1908         (WebKit::LayerTreeHostGtk::scrollNonCompositedContents): Deleted.
1909         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing): Deleted.
1910         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
1911
1912 2016-06-28  Commit Queue  <commit-queue@webkit.org>
1913
1914         Unreviewed, rolling out r202586 and r202595.
1915         https://bugs.webkit.org/show_bug.cgi?id=159247
1916
1917         These changes broke the iOS build (Requested by ryanhaddad on
1918         #webkit).
1919
1920         Reverted changesets:
1921
1922         "Keep track of when a WKWebView is blank before the initial
1923         non-empty layout"
1924         https://bugs.webkit.org/show_bug.cgi?id=159217
1925         http://trac.webkit.org/changeset/202586
1926
1927         "Try to fix the build."
1928         http://trac.webkit.org/changeset/202595
1929
1930 2016-06-28  Commit Queue  <commit-queue@webkit.org>
1931
1932         Unreviewed, rolling out r202580.
1933         https://bugs.webkit.org/show_bug.cgi?id=159245
1934
1935         Caused all WKTR tests to fail on GuardMalloc and Production
1936         only for unknown reasons, investigating offline. (Requested by
1937         brrian on #webkit).
1938
1939         Reverted changeset:
1940
1941         "RunLoop::Timer should use constructor templates instead of
1942         class templates"
1943         https://bugs.webkit.org/show_bug.cgi?id=159153
1944         http://trac.webkit.org/changeset/202580
1945
1946 2016-06-28  Commit Queue  <commit-queue@webkit.org>
1947
1948         Unreviewed, rolling out r202598.
1949         https://bugs.webkit.org/show_bug.cgi?id=159244
1950
1951         broke the build. (Requested by keith_miller on #webkit).
1952
1953         Reverted changeset:
1954
1955         "Try to fix the build."
1956         http://trac.webkit.org/changeset/202598
1957
1958 2016-06-28  Tim Horton  <timothy_horton@apple.com>
1959
1960         Try to fix the build.
1961
1962         * UIProcess/API/Cocoa/WKWebView.mm:
1963         (convertSystemLayoutDirection):
1964         (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]):
1965         (-[WKWebView _initializeWithConfiguration:]):
1966         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1967
1968 2016-06-28  Tim Horton  <timothy_horton@apple.com>
1969
1970         Try to fix the build.
1971
1972         * UIProcess/API/Cocoa/WKWebView.mm:
1973         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1974
1975 2016-06-28  Tim Horton  <timothy_horton@apple.com>
1976
1977         Keep track of when a WKWebView is blank before the initial non-empty layout
1978         https://bugs.webkit.org/show_bug.cgi?id=159217
1979         <rdar://problem/26071766>
1980
1981         Reviewed by Beth Dakin.
1982
1983         * UIProcess/API/Cocoa/WKWebView.mm:
1984         (-[WKWebView _initializeWithConfiguration:]):
1985         (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]):
1986         (-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]):
1987         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1988         * UIProcess/ios/PageClientImplIOS.mm:
1989         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
1990
1991 2016-06-28  Anders Carlsson  <andersca@apple.com>
1992
1993         PaymentMerchantSession should wrap a PKPaymentMerchantSession
1994         https://bugs.webkit.org/show_bug.cgi?id=159218
1995         rdar://problem/26872118
1996
1997         Reviewed by Tim Horton.
1998
1999         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2000         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
2001         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode):
2002         Use NSCoder.
2003
2004         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2005         PaymentMerchantSession is now a class.
2006
2007         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2008         PaymentMerchantSession is now a class.
2009
2010         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2011         (WebKit::WebPaymentCoordinatorProxy::platformCompleteMerchantValidation):
2012         Just get the underlying PKPaymentMerchantSession from the PaymentMerchantSession object.
2013         (WebKit::toPKPaymentMerchantSession): Deleted.
2014
2015 2016-06-28  Brian Burg  <bburg@apple.com>
2016
2017         RunLoop::Timer should use constructor templates instead of class templates
2018         https://bugs.webkit.org/show_bug.cgi?id=159153
2019
2020         Reviewed by Alex Christensen.
2021
2022         Remove the RunLoop::Timer class template argument, and pass its constructor
2023         a reference to `this` instead of a pointer to `this`.
2024
2025         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
2026         * Platform/IPC/mac/ConnectionMac.mm:
2027         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
2028         * PluginProcess/PluginControllerProxy.cpp:
2029         (WebKit::PluginControllerProxy::PluginControllerProxy):
2030         * PluginProcess/PluginControllerProxy.h:
2031         * PluginProcess/PluginProcess.cpp:
2032         (WebKit::PluginProcess::PluginProcess):
2033         * PluginProcess/PluginProcess.h:
2034         * Shared/ChildProcess.cpp:
2035         (WebKit::ChildProcess::ChildProcess):
2036         * Shared/ChildProcess.h:
2037         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2038         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
2039         (API::SharedJSContext::SharedJSContext):
2040         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2041         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
2042         * UIProcess/DrawingAreaProxy.cpp:
2043         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2044         * UIProcess/DrawingAreaProxy.h:
2045         * UIProcess/DrawingAreaProxyImpl.cpp:
2046         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
2047         * UIProcess/DrawingAreaProxyImpl.h:
2048         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
2049         (WebKit::PluginInfoCache::PluginInfoCache):
2050         * UIProcess/Plugins/gtk/PluginInfoCache.h:
2051         * UIProcess/ProcessThrottler.cpp:
2052         (WebKit::ProcessThrottler::ProcessThrottler):
2053         * UIProcess/ProcessThrottler.h:
2054         * UIProcess/ResponsivenessTimer.cpp:
2055         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
2056         * UIProcess/ResponsivenessTimer.h:
2057         * UIProcess/ViewGestureController.cpp:
2058         (WebKit::ViewGestureController::ViewGestureController):
2059         (WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
2060         * UIProcess/VisitedLinkStore.cpp:
2061         (WebKit::VisitedLinkStore::VisitedLinkStore):
2062         * UIProcess/VisitedLinkStore.h:
2063         * UIProcess/WebInspectorProxy.cpp:
2064         (WebKit::WebInspectorProxy::WebInspectorProxy):
2065         * UIProcess/WebInspectorProxy.h:
2066         * UIProcess/WebProcessPool.cpp:
2067         (WebKit::m_hiddenPageThrottlingTimer):
2068         * UIProcess/WebProcessPool.h:
2069         * UIProcess/gtk/GestureController.cpp:
2070         (WebKit::GestureController::DragGesture::DragGesture):
2071         (WebKit::GestureController::ZoomGesture::ZoomGesture):
2072         * UIProcess/gtk/GestureController.h:
2073         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2074         (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
2075         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
2076         * UIProcess/mac/ViewGestureController.h:
2077         * WebProcess/Network/WebLoaderStrategy.cpp:
2078         (WebKit::WebLoaderStrategy::WebLoaderStrategy):
2079         * WebProcess/Network/WebLoaderStrategy.h:
2080         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2081         (WebKit::NPRuntimeObjectMap::NPRuntimeObjectMap):
2082         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
2083         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2084         (WebKit::NetscapePlugin::NetscapePlugin):
2085         (WebKit::NetscapePlugin::Timer::Timer):
2086         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2087         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2088         (WebKit::NetscapePluginStream::NetscapePluginStream):
2089         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2090         * WebProcess/Plugins/PluginView.cpp:
2091         (WebKit::PluginView::PluginView):
2092         * WebProcess/Plugins/PluginView.h:
2093         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2094         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
2095         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
2096         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2097         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
2098         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2099         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2100         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
2101         * WebProcess/WebPage/DrawingAreaImpl.h:
2102         * WebProcess/WebPage/WebPage.cpp:
2103         (WebKit::WebPage::WebPage):
2104         * WebProcess/WebPage/WebPage.h:
2105         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2106         (WebKit::LayerTreeHostGtk::RenderFrameScheduler::RenderFrameScheduler):
2107         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
2108         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2109         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2110         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2111
2112 2016-06-28  Chris Dumez  <cdumez@apple.com>
2113
2114         [WK2] Add some logging related to NetworkProcess suspension
2115         https://bugs.webkit.org/show_bug.cgi?id=159178
2116
2117         Reviewed by Andreas Kling.
2118
2119         Add some logging related to NetworkProcess suspension to help debug
2120         suspension issues.
2121
2122         * NetworkProcess/NetworkProcess.cpp:
2123         (WebKit::NetworkProcess::prepareToSuspend):
2124         (WebKit::NetworkProcess::cancelPrepareToSuspend):
2125         (WebKit::NetworkProcess::processDidResume):
2126
2127 2016-06-28  Chris Dumez  <cdumez@apple.com>
2128
2129         Add some more UIProcess-side logging related to process assertions
2130         https://bugs.webkit.org/show_bug.cgi?id=159188
2131
2132         Reviewed by Andreas Kling.
2133
2134         Add some more UIProcess-side logging related to process assertions
2135         to help debug process suspension issues.
2136
2137         * UIProcess/Network/NetworkProcessProxy.cpp:
2138         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2139         (WebKit::NetworkProcessProxy::deleteWebsiteData):
2140         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2141         * UIProcess/ProcessThrottler.cpp:
2142         (WebKit::ProcessThrottler::updateAssertionNow):
2143         (WebKit::ProcessThrottler::updateAssertion):
2144         * UIProcess/WebPageProxy.cpp:
2145         (WebKit::WebPageProxy::updateActivityToken):
2146         * UIProcess/WebProcessProxy.cpp:
2147         (WebKit::WebProcessProxy::fetchWebsiteData):
2148         (WebKit::WebProcessProxy::deleteWebsiteData):
2149         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
2150         (WebKit::WebProcessProxy::didSetAssertionState):
2151
2152 2016-06-28  Chris Dumez  <cdumez@apple.com>
2153
2154         [WK2] Do not suppress navigation snapshotting on session restore if we are not navigating right away
2155         https://bugs.webkit.org/show_bug.cgi?id=159216
2156         <rdar://problem/27058360>
2157
2158         Reviewed by Andreas Kling.
2159
2160         Do not suppress navigation snapshotting on session restore if we are not navigating
2161         right away. The snapshot we already have may be outdated by the time we actually
2162         navigate (e.g. Because the user scrolled) so we don't want to suppress snapshotting
2163         in this case.
2164
2165         * UIProcess/WebPageProxy.cpp:
2166         (WebKit::WebPageProxy::restoreFromSessionState):
2167
2168 2016-06-27  Anders Carlsson  <andersca@apple.com>
2169
2170         WebKit::WebPaymentCoordinator leak
2171         https://bugs.webkit.org/show_bug.cgi?id=159168
2172         rdar://problem/26929772
2173
2174         Reviewed by Beth Dakin.
2175
2176         Update for WebCore changes.
2177
2178         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2179         (WebKit::WebPaymentCoordinator::paymentCoordinatorDestroyed):
2180         (WebKit::WebPaymentCoordinator::mainFrameDestroyed): Deleted.
2181         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2182
2183 2016-06-27  Simon Fraser  <simon.fraser@apple.com>
2184
2185         Fix TestWebKitAPI crash introduced in r202532.
2186
2187         WebPageProxy::forceRepaint() could trigger a call to the didForceRepaintCallback()
2188         after the WebPageProxy had been invalidated, causing a null de-ref of m_drawingArea.
2189         Fix by checking for error and isValid().
2190
2191         * UIProcess/WebPageProxy.cpp:
2192         (WebKit::WebPageProxy::forceRepaint):
2193
2194 2016-06-27  Simon Fraser  <simon.fraser@apple.com>
2195
2196         [iOS] Make DumpRenderTree and WebKitTestRunner in the simulator use render server snapshotting
2197         https://bugs.webkit.org/show_bug.cgi?id=159077
2198
2199         Reviewed by Tim Horton.
2200
2201         Fix WebPageProxy::forceRepaint() to correctly wait for the next commit from the web process,
2202         which is necessary for UI-side compositing.
2203
2204         * UIProcess/WebPageProxy.cpp:
2205         (WebKit::WebPageProxy::forceRepaint):
2206
2207 2016-06-27  Joseph Pecoraro  <pecoraro@apple.com>
2208
2209         Web Inspector: When modifying sessionStorage, localStorage gets updated
2210         https://bugs.webkit.org/show_bug.cgi?id=159181
2211         <rdar://problem/27043447>
2212
2213         Reviewed by Timothy Hatcher.
2214
2215         * WebProcess/Storage/StorageAreaMap.cpp:
2216         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2217         This should be dispatching storage events.
2218
2219 2016-06-27  Alex Christensen  <achristensen@webkit.org>
2220
2221         Fix flakiness on Sierra after r202511
2222         https://bugs.webkit.org/show_bug.cgi?id=159071
2223
2224         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2225         (WebKit::NetworkSession::clearCredentials):
2226         Replacing the NSURLSessions immediately caused assertions because the tasks are not always all stopped immediately when tearing down a test.
2227         Stopping an NSURLSession needs to be done asynchronously.  I'll try a different testing technique for r202511.
2228
2229 2016-06-27  Alex Christensen  <achristensen@webkit.org>
2230
2231         Send canAuthenticateAgainstProtectionSpace calls from NetworkProcess directly to UIProcess
2232         https://bugs.webkit.org/show_bug.cgi?id=159071
2233
2234         Reviewed by Brady Eidson.
2235
2236         When CFNetwork asks the NetworkProcess if we can authenticate against this protection space, we used to ask
2237         the WebProcess, which would call ResourceLoader::canAuthenticateAgainstProtectionSpace which would ask the FrameLoaderClient,
2238         which would synchronously ask the UIProcess.  Going directly from the NetworkProcess to the UIProcess gives us many advantages:
2239         1. It reduces IPC because we ask fewer loads.
2240         2. It reduces synchronous IPC because we are not using the same code path as WebKit1 any more.
2241         3. It allows us to check if the NetworkProcess is still valid in sendToNetworkingProcess, possibly fixing rdar://problem/26825408
2242         4. It allows us to ask the UIProcess when we get authentication challenges for synchronous xhr.
2243
2244         I added a new test http/tests/xmlhttprequest/sync-delegate-callbacks.html to verify the change in behavior of synchronous xhr.
2245         In order to make this test not flaky on platforms using NSURLSession, we clear the NSURLSessions used by WebKitTestRunner
2246         to make sure that the TLS session cache is cleared so we get NSURLAuthenticationChallenges corresponding to the NSURLConnection
2247         canAuthenticateAgainstProtectionSpace callback when we initiate the first HTTPS connection to 127.0.0.1 with this session. 
2248
2249         * NetworkProcess/NetworkLoad.cpp:
2250         (WebKit::NetworkLoad::didReceiveChallenge):
2251         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2252         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2253         * NetworkProcess/NetworkProcess.cpp:
2254         (WebKit::NetworkProcess::clearCachedCredentials):
2255         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
2256         (WebKit::NetworkProcess::cancelDownload):
2257         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
2258         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
2259         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload):
2260         * NetworkProcess/NetworkProcess.h:
2261         * NetworkProcess/NetworkProcess.messages.in:
2262         * NetworkProcess/NetworkResourceLoader.cpp:
2263         (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
2264         * NetworkProcess/NetworkResourceLoader.h:
2265         * NetworkProcess/NetworkResourceLoader.messages.in:
2266         * NetworkProcess/NetworkSession.h:
2267         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2268         (WebKit::NetworkSession::networkStorageSession):
2269         (WebKit::NetworkSession::clearCredentials):
2270         (WebKit::NetworkSession::dataTaskForIdentifier):
2271         * UIProcess/Downloads/DownloadProxy.cpp:
2272         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
2273         (WebKit::DownloadProxy::willSendRequest):
2274         * UIProcess/Network/NetworkProcessProxy.cpp:
2275         (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithValue):
2276         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
2277         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
2278         * UIProcess/Network/NetworkProcessProxy.h:
2279         * UIProcess/Network/NetworkProcessProxy.messages.in:
2280         * UIProcess/WebPageProxy.cpp:
2281         (WebKit::WebPageProxy::backForwardClear):
2282         (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpace):
2283         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge):
2284         (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame): Deleted.
2285         * UIProcess/WebPageProxy.h:
2286         * UIProcess/WebPageProxy.messages.in:
2287         * WebProcess/Network/WebResourceLoader.cpp:
2288         (WebKit::WebResourceLoader::didReceiveResource):
2289         (WebKit::WebResourceLoader::isAlwaysOnLoggingAllowed):
2290         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace): Deleted.
2291         * WebProcess/Network/WebResourceLoader.h:
2292         * WebProcess/Network/WebResourceLoader.messages.in:
2293         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2294         (WebKit::WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace):
2295         * WebProcess/WebProcess.cpp:
2296         (WebKit::WebProcess::clearCachedCredentials):
2297         (WebKit::WebProcess::focusedWebPage):
2298
2299 2016-06-27  Anders Carlsson  <andersca@apple.com>
2300
2301         Discounted items are displayed with positive values
2302         https://bugs.webkit.org/show_bug.cgi?id=159160
2303         rdar://problem/26980772
2304
2305         Reviewed by Dean Jackson.
2306
2307         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2308         (WebKit::toDecimalNumber):
2309         Add new helper function. Correctly compute the mantissa.
2310
2311         (WebKit::toPKPaymentSummaryItem):
2312         (WebKit::toPKShippingMethod):
2313         Use toDecimalNumber.
2314
2315 2016-06-27  Miguel Gomez  <magomez@igalia.com>
2316
2317         [GTK][EFL] Build with threaded compositor enabled is broken
2318         https://bugs.webkit.org/show_bug.cgi?id=159138
2319
2320         Reviewed by Carlos Garcia Campos.
2321
2322         Replace the usage of NoncopyableFunction with Function, to follow the changes in r202439.
2323
2324         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2325         (WebKit::CompositingRunLoop::performTask):
2326         (WebKit::CompositingRunLoop::performTaskSync):
2327         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2328
2329 2016-06-24  Brian Burg  <bburg@apple.com>
2330
2331         REGRESSION(r201171): CRASH at WebKit::WebInspectorProxy::open() + 31 when running inspector layout tests
2332         https://bugs.webkit.org/show_bug.cgi?id=159070
2333         <rdar://problem/26768628>
2334
2335         Reviewed by Joseph Pecoraro.
2336
2337         We have been seeing a few crashes underneath WebInspectorProxy::bringToFront() on the bots.
2338         Previously, this code didn't use m_inspectorPage so there was nothing to null-dereference.
2339
2340         However, it doesn't make sense that we would hit the null dereference here:
2341
2342          - The only caller of bringToFront() on the WebProcess side is InspectorController::show().
2343            It only tries to bring to front if there is already a local frontend connection, which
2344            shouldn't be the case if m_inspectorPage is null.
2345
2346          - It's guarded by m_underTest, which should have been set to true in createInspectorPage().
2347
2348         These clues lead me to believe that we may be improperly tearing down the inspector between tests.
2349         For example, it seems possible that a local frontend connection is not being torn down, so
2350         InspectorController never asks to create a inspector page when the next test calls showWebInspector.
2351
2352         Since this crash is not easy to reproduce, we don't have much to go on. For now, this patch
2353         adds an early return in the case where m_inspectorPage is null when calling open().
2354
2355         * UIProcess/WebInspectorProxy.cpp:
2356         (WebKit::WebInspectorProxy::open):
2357
2358 2016-06-24  Jer Noble  <jer.noble@apple.com>
2359
2360         Vimeo.com videos do not get playback controls
2361         https://bugs.webkit.org/show_bug.cgi?id=159082
2362         <rdar://problem/26586630>
2363
2364         Reviewed by Eric Carlson.
2365
2366         When the HasAudioOrVideo media state changes, let the video controls recalculate
2367         by calling videoControlsManagerDidChange().
2368
2369         * UIProcess/WebPageProxy.cpp:
2370         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2371
2372 2016-06-24  Beth Dakin  <bdakin@apple.com>
2373
2374         Include enclosingListType in EditorState
2375         https://bugs.webkit.org/show_bug.cgi?id=159102
2376         -and corresponding-
2377         rdar://problem/26932490
2378
2379         Reviewed by Enrica Casucci.
2380
2381         * Shared/EditorState.cpp:
2382         (WebKit::EditorState::PostLayoutData::encode):
2383         (WebKit::EditorState::PostLayoutData::decode):
2384         * Shared/EditorState.h:
2385         * WebProcess/WebPage/WebPage.cpp:
2386         (WebKit::WebPage::editorState):
2387
2388 2016-06-24  Anders Carlsson  <andersca@apple.com>
2389
2390         Inline more of the Apple Pay source code
2391         https://bugs.webkit.org/show_bug.cgi?id=159099
2392
2393         Reviewed by Andreas Kling.
2394
2395         * Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Removed.
2396         * Shared/WebCoreArgumentCoders.h:
2397         * Shared/WebPreferencesDefinitions.h:
2398         * UIProcess/API/Cocoa/WKPreferences.mm:
2399         (-[WKPreferences _applePayCapabilityDisclosureAllowed]):
2400         (-[WKPreferences _setApplePayCapabilityDisclosureAllowed:]):
2401         * UIProcess/API/Cocoa/WKWebView.mm:
2402         (-[WKWebView _initializeWithConfiguration:]):
2403         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2404         (-[WKWebViewConfiguration copyWithZone:]):
2405         (-[WKWebViewConfiguration _applePayEnabled]):
2406         (-[WKWebViewConfiguration _setApplePayEnabled:]):
2407         (-[WKWebViewConfiguration _paymentsEnabled]):
2408         (-[WKWebViewConfiguration _setPaymentsEnabled:]):
2409         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2410         * UIProcess/WebPageProxy.cpp:
2411         (WebKit::WebPageProxy::WebPageProxy):
2412         (WebKit::WebPageProxy::reattachToWebProcess):
2413         (WebKit::WebPageProxy::resetState):
2414         * UIProcess/WebPageProxy.h:
2415         * WebKit2.xcodeproj/project.pbxproj:
2416         * WebProcess/WebPage/WebPage.cpp:
2417         (WebKit::m_userInterfaceLayoutDirection):
2418         (WebKit::WebPage::updatePreferences):
2419
2420 2016-06-21  Anders Carlsson  <andersca@apple.com>
2421
2422         Rename NoncopyableFunction to Function
2423         https://bugs.webkit.org/show_bug.cgi?id=158354
2424
2425         Reviewed by Chris Dumez.
2426
2427         * NetworkProcess/NetworkProcess.cpp:
2428         (WebKit::fetchDiskCacheEntries):
2429         (WebKit::NetworkProcess::fetchWebsiteData):
2430         (WebKit::clearDiskCacheEntries):
2431         * NetworkProcess/NetworkProcess.h:
2432         * NetworkProcess/cache/NetworkCache.cpp:
2433         (WebKit::NetworkCache::Cache::traverse):
2434         * NetworkProcess/cache/NetworkCache.h:
2435         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2436         (WebKit::NetworkCache::runTaskInQueue):
2437         * NetworkProcess/cache/NetworkCacheStorage.h:
2438
2439 2016-06-22  Anders Carlsson  <andersca@apple.com>
2440
2441         Move WebKit2 Apple Pay code to the open source repository
2442         https://bugs.webkit.org/show_bug.cgi?id=159041
2443
2444         Reviewed by Sam Weinig.
2445
2446         * DerivedSources.make:
2447         * Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Added.
2448         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Added.
2449         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: Added.
2450         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added.
2451         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Added.
2452         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Added.
2453         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Added.
2454         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Added.
2455         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Added.
2456         * UIProcess/WebPageProxy.cpp:
2457         * UIProcess/WebPageProxy.h:
2458         * WebKit2.xcodeproj/project.pbxproj:
2459         * WebProcess/ApplePay/WebPaymentCoordinator.cpp: Added.
2460         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added.
2461         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: Added.
2462
2463 2016-06-24  Chris Dumez  <cdumez@apple.com>
2464
2465         [WK2] PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed
2466         https://bugs.webkit.org/show_bug.cgi?id=159080
2467         <rdar://problem/26982642>
2468
2469         Reviewed by Anders Carlsson.
2470
2471         PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed.
2472         This leads to WebPageProxy object leaks when the client keeps chaining related views.
2473
2474         In this patch, we null our the PageConfiguration's relatedPage in WebPageProxy::close()
2475         to break the chain and make sure we only keep alive 1 relatedPage rather than a chain of
2476         them.
2477
2478         * UIProcess/WebPageProxy.cpp:
2479         (WebKit::WebPageProxy::close):
2480
2481 2016-06-24  Jer Noble  <jer.noble@apple.com>
2482
2483         Playback controls refer to wrong element when playing multiple items in a page.
2484         https://bugs.webkit.org/show_bug.cgi?id=159076
2485         <rdar://problem/26953532>
2486
2487         Reviewed by Beth Dakin.
2488
2489         clearPlaybackControlsManager() no longer takes a parameter.
2490
2491         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2492         (WebKit::WebChromeClient::clearPlaybackControlsManager):
2493         * WebProcess/WebCoreSupport/WebChromeClient.h:
2494         * WebProcess/cocoa/WebPlaybackSessionManager.h:
2495         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2496         (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager): Make sure to removeClientForContext()
2497             if the old context refers to a live media element.
2498         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
2499
2500 2016-06-24  Brady Eidson  <beidson@apple.com>
2501
2502         IDB tests crashing attempting to register sandbox extensions for blob files.
2503         https://bugs.webkit.org/show_bug.cgi?id=159094.
2504
2505         Reviewed by Sam Weinig.
2506         
2507         Already tested by storage/indexeddb/modern/handle-user-delete.html
2508
2509         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2510         (WebKit::preregisterSandboxExtensionsIfNecessary): Check whether the IDBResultData actually contains
2511           a getResult before trying to access it.
2512
2513 2016-06-23  Brady Eidson  <beidson@apple.com>
2514
2515         Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing)
2516         https://bugs.webkit.org/show_bug.cgi?id=158991
2517
2518         Reviewed by Alex Christensen.
2519
2520         * CMakeLists.txt:
2521         * WebKit2.xcodeproj/project.pbxproj:
2522
2523         * DatabaseProcess/DatabaseProcess.cpp:
2524         (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles):
2525         (WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles):
2526         * DatabaseProcess/DatabaseProcess.h:
2527         
2528         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2529         (WebKit::WebIDBConnectionToClient::handleGetResult): Handle creation of sandbox extensions
2530           for any result that might contain blob values.
2531         (WebKit::WebIDBConnectionToClient::didGetRecord):
2532         (WebKit::WebIDBConnectionToClient::didOpenCursor):
2533         (WebKit::WebIDBConnectionToClient::didIterateCursor):
2534         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2535         
2536         * Shared/Databases/IndexedDB/WebIDBResult.cpp: Added.
2537         (WebKit::WebIDBResult::encode):
2538         (WebKit::WebIDBResult::decode):
2539         * Shared/Databases/IndexedDB/WebIDBResult.h: Added.
2540         (WebKit::WebIDBResult::WebIDBResult):
2541         (WebKit::WebIDBResult::resultData):
2542         (WebKit::WebIDBResult::handles):
2543         
2544         * Shared/SandboxExtension.h: Make SandboxExtension handles moveable.
2545                 
2546         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2547         (WebKit::preregisterSandboxExtensionsIfNecessary): Register sandbox extensions with the
2548           Networking process for any result that might contain blob values.
2549         (WebKit::WebIDBConnectionToServer::didGetRecord):
2550         (WebKit::WebIDBConnectionToServer::didOpenCursor):
2551         (WebKit::WebIDBConnectionToServer::didIterateCursor):
2552         (WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): Deleted.
2553         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2554         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2555
2556 2016-06-23  Alex Christensen  <achristensen@webkit.org>
2557
2558         Remove unused didCancelAuthenticationChallenge
2559         https://bugs.webkit.org/show_bug.cgi?id=158819
2560
2561         Reviewed by David Kilzer.
2562
2563         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2564         (-[WKDownloadAsDelegate download:didCancelAuthenticationChallenge:]): Deleted.
2565         * NetworkProcess/NetworkLoad.cpp:
2566         (WebKit::NetworkLoad::didCancelAuthenticationChallenge): Deleted.
2567         * NetworkProcess/NetworkLoad.h:
2568         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2569         (WebKit::WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): Deleted.
2570         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2571
2572 2016-06-23  Benjamin Poulain  <benjamin@webkit.org>
2573
2574         Specialize synchronous event tracking per event type
2575         https://bugs.webkit.org/show_bug.cgi?id=158826
2576
2577         Reviewed by Simon Fraser.
2578
2579         * Shared/WebCoreArgumentCoders.cpp:
2580         (IPC::ArgumentCoder<EventTrackingRegions>::encode):
2581         (IPC::ArgumentCoder<EventTrackingRegions>::decode):
2582         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2583         (WebKit::RemoteScrollingCoordinatorProxy::eventTrackingTypeForPoint):
2584         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2585         * UIProcess/WebPageProxy.cpp:
2586         (WebKit::mergeTrackingTypes):
2587         (WebKit::WebPageProxy::updateTouchEventTracking):
2588         (WebKit::WebPageProxy::touchEventTrackingType):
2589         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2590         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
2591         (WebKit::WebPageProxy::handleTouchEvent):
2592         (WebKit::WebPageProxy::resetState):
2593         * UIProcess/WebPageProxy.h:
2594         (WebKit::WebPageProxy::TouchEventTracking::isTrackingAnything):
2595         (WebKit::WebPageProxy::TouchEventTracking::reset):
2596
2597 2016-06-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
2598
2599         requestFrameAnimation() callback timestamp should be very close to Performance.now() 
2600         https://bugs.webkit.org/show_bug.cgi?id=159038
2601
2602         Reviewed by Simon Fraser.
2603
2604         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm:
2605         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::didUpdateLayers):
2606
2607 2016-06-23  Chris Dumez  <cdumez@apple.com>
2608
2609         [iOS] A WebPageProxy in closed state should not be allowed to hold a process assertion
2610         https://bugs.webkit.org/show_bug.cgi?id=159068
2611         <rdar://problem/17665473>
2612
2613         Reviewed by Tim Horton.
2614
2615         A WebPageProxy in closed state should not be allowed to hold a process assertion. It
2616         currently happens that WebPageProxy::close() gets called but that the WebPageProxy is
2617         kept alive by Safari (e.g. In case of top-hit preloading). In such cases, we fail to
2618         release the foreground process assertion that the WebPageProxy holds.
2619
2620         We should clear the foreground process assertion that the WebPageProxy holds as soon
2621         as WebPageProxy::close() is called.
2622
2623         * UIProcess/WebPageProxy.cpp:
2624         (WebKit::WebPageProxy::close):
2625
2626 2016-06-23  Brent Fulgham  <bfulgham@apple.com>
2627
2628         [OS X][WK2] Expand sandbox for new mach endpoints
2629         https://bugs.webkit.org/show_bug.cgi?id=159040
2630         <rdar://problem/25238336>
2631
2632         Reviewed by Alexey Proskuryakov.
2633
2634         Grant the WebContent and Networking processes the mach lookup capability for
2635         various Security-related mach endpoints..
2636
2637         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2638         * WebProcess/com.apple.WebProcess.sb.in:
2639
2640 2016-06-23  Commit Queue  <commit-queue@webkit.org>
2641
2642         Unreviewed, rolling out r201194.
2643         https://bugs.webkit.org/show_bug.cgi?id=159059
2644
2645         Not needed for iOS (Requested by bfulgham on #webkit).
2646
2647         Reverted changeset:
2648
2649         "[OS X][WK2] Expand sandbox for new mach endpoints"
2650         https://bugs.webkit.org/show_bug.cgi?id=157919
2651         http://trac.webkit.org/changeset/201194
2652
2653 2016-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2654
2655         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.2 release.
2656
2657         * gtk/NEWS: Add release notes for 2.13.2.
2658
2659 2016-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2660
2661         REGRESSION(r201880): WebSockets based remote inspector is broken since r201880
2662         https://bugs.webkit.org/show_bug.cgi?id=158613
2663
2664         Reviewed by Michael Catanzaro.
2665
2666         In r201880 SocketStreamHandleClient was modified to receive references instead of
2667         pointers. WebSocketServerConnection also implements SocketStreamHandleClient but since it's doesn't use
2668         override, it was unnoticed and not updated, so we ended up using the default empty implementation instead of
2669         the WebSocketServerConnection one.
2670
2671         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
2672         (WebKit::WebSocketServerConnection::WebSocketServerConnection):
2673         (WebKit::WebSocketServerConnection::setSocketHandle):
2674         (WebKit::WebSocketServerConnection::shutdownNow):
2675         (WebKit::WebSocketServerConnection::didCloseSocketStream):
2676         (WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
2677         (WebKit::WebSocketServerConnection::didUpdateBufferedAmount):
2678         (WebKit::WebSocketServerConnection::didFailSocketStream): Deleted.
2679         * UIProcess/InspectorServer/WebSocketServerConnection.h:
2680
2681 2016-06-22  Brent Fulgham  <bfulgham@apple.com>
2682
2683         [iOS][WK2] Expand sandbox to read voice services preferences
2684         https://bugs.webkit.org/show_bug.cgi?id=159046
2685         <rdar://problem/26926722>
2686
2687         Reviewed by Alexey Proskuryakov.
2688
2689         Expand the sandbox to permit read-only access to voice services preferences.
2690
2691         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2692
2693 2016-06-22  Sam Weinig  <sam@webkit.org>
2694
2695         Add SPI to allow creating a WKCertificateInfoRef from a SecTrustRef
2696         https://bugs.webkit.org/show_bug.cgi?id=159025
2697
2698         Reviewed by Tim Horton.
2699
2700         * Shared/API/c/mac/WKCertificateInfoMac.h:
2701         * Shared/API/c/mac/WKCertificateInfoMac.mm:
2702         (WKCertificateInfoCreateWithServerTrust):
2703
2704 2016-06-22  Brady Eidson  <beidson@apple.com>
2705
2706         DatabaseProcess doesn't handle WebProcesses going away uncleanly.
2707         https://bugs.webkit.org/show_bug.cgi?id=158894
2708
2709         Reviewed by Alex Christensen.
2710
2711         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
2712         (WebKit::DatabaseToWebProcessConnection::didClose):
2713         
2714         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2715         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): Actually unregister this connection
2716           from the IDBServer so it can clean up.
2717         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
2718         
2719 2016-06-22  Chris Dumez  <cdumez@apple.com>
2720
2721         Stop using PassRefPtr in ShareableResource
2722         https://bugs.webkit.org/show_bug.cgi?id=159043
2723
2724         Reviewed by Alex Christensen.
2725
2726         Stop using PassRefPtr in ShareableResource.
2727
2728         * NetworkProcess/cache/NetworkCache.cpp:
2729         (WebKit::NetworkCache::Cache::store):
2730         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2731         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
2732         * Shared/ShareableResource.cpp:
2733         (WebKit::shareableResourceDeallocate):
2734         (WebKit::ShareableResource::wrapInSharedBuffer):
2735         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer):
2736         (WebKit::ShareableResource::create):
2737         (WebKit::ShareableResource::map):
2738         (WebKit::ShareableResource::ShareableResource):
2739         * Shared/ShareableResource.h:
2740
2741 2016-06-17  Dean Jackson  <dino@apple.com>
2742
2743         REGRESSION: Double tap to zoom does not work on yahoo finance
2744         https://bugs.webkit.org/show_bug.cgi?id=158886
2745         <rdar://problem/24917760>
2746
2747         Reviewed by Simon Fraser.
2748
2749         We shouldn't enable fast click on pages that have
2750         had to shrink to fit. In other words, we should enable
2751         double-tap-to-zoom if the page has already zoomed.
2752
2753         Test: fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html
2754
2755         * UIProcess/API/Cocoa/WKWebView.mm:
2756         (-[WKWebView _allowsDoubleTapGestures]):
2757
2758 2016-06-22  Brian Burg  <bburg@apple.com>
2759
2760         Web Automation: Automation.inspectBrowsingContext should have an option to enable timeline auto-capturing
2761         https://bugs.webkit.org/show_bug.cgi?id=159004
2762         <rdar://problem/26931269>
2763
2764         Reviewed by Joseph Pecoraro.
2765
2766         Automation.inspectBrowsingContext was added to make it easier to hit breakpoints inside of
2767         code evaluated using Automation.evaluateJavaScriptFunction. I recently changed the behavior
2768         of this command to automatically start profiling the page as soon as the inspector attached
2769         so that a full timeline recording could be obtained. However, starting a timeline recording
2770         turns off the debugger, so this command is not so useful for debugging right now.
2771
2772         Add a new option, enableAutoCapturing, to the inspectBrowsingContext command. Don't toggle
2773         profiling automatically unless this optional flag is present and set to true.
2774
2775         * UIProcess/Automation/Automation.json:
2776         * UIProcess/Automation/WebAutomationSession.cpp:
2777         (WebKit::WebAutomationSession::inspectBrowsingContext):
2778         (WebKit::WebAutomationSession::inspectorFrontendLoaded): Deleted.
2779         * UIProcess/Automation/WebAutomationSession.h:
2780
2781 2016-06-22  Tim Horton  <timothy_horton@apple.com>
2782
2783         Mail snapshot has black webview in multitasking switcher
2784         https://bugs.webkit.org/show_bug.cgi?id=159036
2785         <rdar://problem/25972938>
2786
2787         Reviewed by Simon Fraser.
2788
2789         There is a window of time between an application going into the background
2790         and SpringBoard's snapshotting mechanism completing where it is possible
2791         (though difficult, timing-wise) for RemoteLayerBackingStoreCollection to
2792         make still-needed surfaces volatile (and, even worse, for them to get emptied).
2793
2794         UIKit suggested instead waiting for the window context teardown notification,
2795         which does indeed seem to fire after the snapshotting is complete.
2796         This may have the convenient side effect of making the volatility timer
2797         repeat fewer times in general, because it is now started closer to the
2798         last time that the surfaces will be in-use.
2799
2800         * UIProcess/ApplicationStateTracker.h:
2801         * UIProcess/ApplicationStateTracker.mm:
2802         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
2803         (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
2804         (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground):
2805         * UIProcess/WebPageProxy.h:
2806         * UIProcess/ios/WKContentView.mm:
2807         (-[WKContentView didMoveToWindow]):
2808         (-[WKContentView _applicationDidFinishSnapshottingAfterEnteringBackground]):
2809         * UIProcess/ios/WKPDFView.mm:
2810         (-[WKPDFView didMoveToWindow]):
2811         (-[WKPDFView _applicationDidFinishSnapshottingAfterEnteringBackground]):
2812         * UIProcess/ios/WebPageProxyIOS.mm:
2813         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
2814         * WebProcess/WebPage/WebPage.h:
2815         * WebProcess/WebPage/WebPage.messages.in:
2816         * WebProcess/WebPage/ios/WebPageIOS.mm:
2817         (WebKit::WebPage::applicationDidEnterBackground):
2818         (WebKit::WebPage::applicationDidFinishSnapshottingAfterEnteringBackground):
2819
2820 2016-06-22  Chris Dumez  <cdumez@apple.com>
2821
2822         Add logging related to process assertions to help debug process suspension issues
2823         https://bugs.webkit.org/show_bug.cgi?id=159001
2824
2825         Reviewed by Antti Koivisto.
2826
2827         Add logging related to process assertions to help debug process suspension issues.
2828
2829         * UIProcess/Cocoa/NavigationState.mm:
2830         (WebKit::NavigationState::didChangeIsLoading):
2831         * UIProcess/Network/NetworkProcessProxy.cpp:
2832         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2833         (WebKit::NetworkProcessProxy::deleteWebsiteData):
2834         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2835         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
2836         * UIProcess/WebPageProxy.cpp:
2837         (WebKit::WebPageProxy::updateActivityToken):
2838         * UIProcess/WebProcessProxy.cpp:
2839         (WebKit::WebProcessProxy::setIsHoldingLockedFiles):
2840
2841 2016-06-21  Sam Weinig  <sam@webkit.org>
2842
2843         WKWebView with no WKNavigationDelegate does not follow universal links
2844         <rdar://problem/24374110>
2845         https://bugs.webkit.org/show_bug.cgi?id=158997
2846
2847         Reviewed by Dan Bernstein.
2848
2849         API Test:
2850              WKWebView.DefaultNavigationDelegate
2851
2852         * UIProcess/API/Cocoa/WKWebView.mm:
2853         (-[WKWebView _initializeWithConfiguration:]):
2854         When initializing the WKWebView, set a default navigation client.
2855
2856 2016-06-21  Chris Dumez  <cdumez@apple.com>
2857
2858         Unreviewed, rolling out r202296.
2859
2860         Broke basic browsing in Safari
2861
2862         Reverted changeset:
2863
2864         "WKWebView with no WKNavigationDelegate does not follow
2865         universal links"
2866         https://bugs.webkit.org/show_bug.cgi?id=158997
2867         http://trac.webkit.org/changeset/202296
2868
2869 2016-06-21  Anders Carlsson  <andersca@apple.com>
2870
2871         Fix build.
2872
2873         * Configurations/FeatureDefines.xcconfig:
2874
2875 2016-06-21  Anders Carlsson  <andersca@apple.com>
2876
2877         Begin moving the Apple Pay code to the open source repository
2878         https://bugs.webkit.org/show_bug.cgi?id=158998
2879
2880         Reviewed by Tim Horton.
2881
2882         * Configurations/FeatureDefines.xcconfig:
2883         Add ENABLE_APPLE_PAY.
2884
2885 2016-06-21  Said Abou-Hallawa  <sabouhallawa@apple,com>
2886
2887         Add system tracing points for requestAnimationFrame() workflow
2888         https://bugs.webkit.org/show_bug.cgi?id=158723
2889
2890         Reviewed by Simon Fraser.
2891
2892         Add trace points for requestAnimationFrame().
2893
2894         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2895         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2896         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2897         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2898         (WebKit::RemoteLayerTreeContext::buildTransaction):
2899         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2900         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
2901         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
2902
2903 2016-06-21  Sam Weinig  <sam@webkit.org>
2904
2905         WKWebView with no WKNavigationDelegate does not follow universal links
2906         <rdar://problem/24374110>
2907         https://bugs.webkit.org/show_bug.cgi?id=158997
2908
2909         Reviewed by Dan Bernstein.
2910
2911         API Test:
2912              WKWebView.DefaultNavigationDelegate
2913
2914         * UIProcess/API/Cocoa/WKWebView.mm:
2915         (-[WKWebView _initializeWithConfiguration:]):
2916         When initializing the WKWebView, set a default navigation client.
2917
2918         * UIProcess/WebPageProxy.cpp:
2919         (WebKit::WebPageProxy::setLoaderClient):
2920         Be sure to clear out a navigation client, if present, when setting a loader client,
2921         as they are mutually exclusive.
2922
2923 2016-06-20  Simon Fraser  <simon.fraser@apple.com>
2924
2925         Focus event dispatched in iframe causes parent document to scroll incorrectly
2926         https://bugs.webkit.org/show_bug.cgi?id=158629
2927         rdar://problem/26521616
2928
2929         Reviewed by Tim Horton.
2930
2931         Pass SelectionRevealMode::Reveal in existing code.
2932
2933         * WebProcess/WebPage/WebPage.cpp:
2934         (WebKit::WebPage::centerSelectionInVisibleArea):
2935
2936 2016-06-21  Said Abou-Hallawa  <sabouhallawa@apple,com>
2937
2938         [iOS][WK2] When an animation frame is missed, the UI process should immediately notify the Web process once a frame is committed
2939         https://bugs.webkit.org/show_bug.cgi?id=158933
2940
2941         Reviewed by Simon Fraser.
2942
2943         When a frame is committed, the UI process schedules a CADisplayLink and waits until
2944         the next didRefreshDisplay event is fired. This causes more delay in the scenario
2945         where there are frames are dropped. didRefreshDisplay() should be called immediately
2946         when commitLayerTree message is received and the last frame was dropped.
2947
2948         The fix is to have the CADisplayLink active all the times. It should be paused
2949         only when we detect at least one frame is dropped. In this case we should not
2950         send a message to the UI process since it has not sent the last requested LayerTree.
2951         Also we should not waste the CPU time by scheduling a new CADisplayLink since we
2952         have not processed the last event. We should resume CADisplayLink timer once a
2953         commitLayerTree message is received.
2954
2955         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2956         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2957         (-[WKOneShotDisplayLinkHandler pause]):
2958         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2959         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2960         (-[WKOneShotDisplayLinkHandler displayLinkFired:]):
2961
2962 2016-06-21  Amir Alavi  <aalavi@apple.com>
2963
2964         Upstream WKHTTPCookiesForURL from WebKitSystemInterface to OpenSource
2965         https://bugs.webkit.org/show_bug.cgi?id=158967
2966
2967         Reviewed by Brent Fulgham.
2968
2969         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2970         (InitWebCoreSystemInterface): Deleted.
2971
2972 2016-06-21  Dan Bernstein  <mitz@apple.com>
2973
2974         Inlined some picture-in-picture code.
2975         https://bugs.webkit.org/show_bug.cgi?id=158977
2976
2977         Reviewed by Eric Carlsson.
2978
2979         This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
2980         Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
2981         Jon Lee, Remy Demarest, and Zach Li.
2982
2983         * Shared/WebPreferencesStoreDefaultsAdditions.cpp:
2984           Define and use DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK.
2985
2986         * Shared/WebPreferencesStore.cpp:
2987         (WebKit::defaults): Removed include of WebPreferencesStoreDefaultsAdditions.cpp now that the
2988           default is defined correctly in WebPreferencesStoreDefaultsAdditions.cpp.
2989
2990         * UIProcess/API/C/WKPreferences.cpp: Inlined WKPreferencesAdditions.cpp.
2991         * UIProcess/API/C/WKPreferencesRefPrivate.h: Ditto.
2992
2993         * WebProcess/cocoa/WebVideoFullscreenManager.mm: Inlined WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm.
2994
2995 2016-06-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2996
2997         [GTK] Web view is not redrawn when reparented in force compositing mode
2998         https://bugs.webkit.org/show_bug.cgi?id=158689
2999
3000         Reviewed by Žan Doberšek.
3001
3002         When the web view is reparented in accelerated compositing mode, the UI process always exits the accelerated
3003         mode when the view is unrealized, because the native surface handle for compositing is destroyed, but it doesn't
3004         enter again when the view is realized and a new native surface handle for compositing is used. This happens
3005         because the UI and Web processes are not in sync regarding whether the page is in accelerated compositing or
3006         not. The Web process never exits accelerated mode when compositing mode is forced, but the UI process doesn't
3007         check that setting at all.
3008
3009         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3010         (webkitWebViewBaseResizeRedirectedWindow): Helper function to ensure the redirected window size is properly updated.
3011         (webkitWebViewBaseRealize): Resize the redirected window if the view is already in AC mode when realized.
3012         (webkitWebViewRenderAcceleratedCompositingResults): Use webkitWebViewBaseResizeRedirectedWindow().
3013         (webkitWebViewBaseSizeAllocate): Ditto.
3014         (webkitWebViewBaseWillEnterAcceleratedCompositingMode): Ditto.
3015         * UIProcess/DrawingAreaProxyImpl.cpp:
3016         (WebKit::DrawingAreaProxyImpl::alwaysUseCompositing): Return true in force compositing mode.
3017         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode): Update assert.
3018         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode): Do not exit AC mode compositing mode is always enabled.
3019         * UIProcess/DrawingAreaProxyImpl.h:
3020         (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode): Return true also in force compositing mode.
3021         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
3022         (WebKit::RedirectedXCompositeWindow::surface): Ensure we never return an uninitialized surface to prevent
3023         rendering artifacts in in force compositing mode when waiting for the first update on the redirected window.
3024
3025 2016-06-20  Commit Queue  <commit-queue@webkit.org>
3026
3027         Unreviewed, rolling out r202243.
3028         https://bugs.webkit.org/show_bug.cgi?id=158972
3029
3030         Broke Windows build and iOS tests (Requested by ap on
3031         #webkit).
3032
3033         Reverted changeset:
3034
3035         "Focus event dispatched in iframe causes parent document to
3036         scroll incorrectly"
3037         https://bugs.webkit.org/show_bug.cgi?id=158629
3038         http://trac.webkit.org/changeset/202243
3039
3040 2016-06-20  Brent Fulgham  <bfulgham@apple.com>
3041
3042         Allow Spotlight suggestions to be read by any process
3043         https://bugs.webkit.org/show_bug.cgi?id=158950
3044         <rdar://problem/26865374>
3045
3046         Reviewed by Alexey Proskuryakov.
3047
3048         Extend sandbox to allow all web processes to read Spotlight results.
3049
3050         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
3051         * WebProcess/com.apple.WebProcess.sb.in:
3052
3053 2016-06-20  Simon Fraser  <simon.fraser@apple.com>
3054
3055         Focus event dispatched in iframe causes parent document to scroll incorrectly
3056         https://bugs.webkit.org/show_bug.cgi?id=158629
3057         rdar://problem/26521616
3058
3059         Reviewed by Tim Horton.
3060
3061         Pass SelectionRevealMode::Reveal in existing code.
3062
3063         * WebProcess/WebPage/WebPage.cpp:
3064         (WebKit::WebPage::centerSelectionInVisibleArea):
3065
3066 2016-06-20  Keith Rollin  <krollin@apple.com>
3067
3068         Remove RefPtr::release() and change calls sites to use WTFMove()
3069         https://bugs.webkit.org/show_bug.cgi?id=158369
3070
3071         Reviewed by Chris Dumez.
3072
3073         RefPtr::release() releases its managed pointer awkwardly. It's more
3074         direct and clearer to use WTFMove to transfer ownership of the managed
3075         pointer.
3076
3077         As part of this cleanup, also change a lot of explicit data types to
3078         'auto'.
3079
3080         * DatabaseProcess/DatabaseProcess.cpp:
3081         (WebKit::DatabaseProcess::createDatabaseToWebProcessConnection):
3082         * NetworkProcess/NetworkProcess.cpp:
3083         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
3084         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3085         (WebKit::NetworkResourceLoadParameters::decode):
3086         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3087         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
3088         * Platform/mac/SharedMemoryMac.cpp:
3089         (WebKit::SharedMemory::allocate):
3090         (WebKit::SharedMemory::create):
3091         (WebKit::SharedMemory::map):
3092         * PluginProcess/PluginProcess.cpp:
3093         (WebKit::PluginProcess::createWebProcessConnection):
3094         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3095         (encodeToObjectStream):
3096         * Shared/API/c/WKImage.cpp:
3097         (WKImageCreate):
3098         * Shared/API/c/WKNumber.cpp:
3099         (WKBooleanCreate):
3100         (WKDoubleCreate):
3101         (WKUInt64Create):
3102         * Shared/API/c/WKSecurityOriginRef.cpp:
3103         (WKSecurityOriginCreate):
3104         * Shared/API/c/WKSerializedScriptValue.cpp:
3105         (WKSerializedScriptValueCreate):
3106         (WKSerializedScriptValueCreateWithInternalRepresentation):
3107         * Shared/API/c/cairo/WKImageCairo.cpp:
3108         (WKImageCreateFromCairoSurface):
3109         * Shared/API/c/cg/WKImageCG.cpp:
3110         (WKImageCreateFromCGImage):
3111         * Shared/API/c/mac/WKCertificateInfoMac.mm:
3112         (WKCertificateInfoCreateWithCertficateChain):
3113         * Shared/API/c/mac/WKObjCTypeWrapperRef.mm:
3114         (WKObjCTypeWrapperCreate):
3115         * Shared/API/c/mac/WKWebArchive.cpp:
3116         (WKWebArchiveCreate):
3117         (WKWebArchiveCreateWithData):
3118         (WKWebArchiveCreateFromRange):
3119         (WKWebArchiveCopyMainResource):
3120         (WKWebArchiveCopySubresources):
3121         (WKWebArchiveCopySubframeArchives):
3122         * Shared/API/c/mac/WKWebArchiveResource.cpp:
3123         (WKWebArchiveResourceCreate):
3124         * Shared/APIWebArchive.mm:
3125         (API::WebArchive::WebArchive):
3126         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
3127         (WebKit::NetscapePluginModule::getOrCreate):
3128         * Shared/ShareableBitmap.cpp:
3129         (WebKit::ShareableBitmap::create):
3130         * Shared/ShareableResource.cpp:
3131         (WebKit::ShareableResource::map):
3132         * Shared/gtk/ArgumentCodersGtk.cpp:
3133         (IPC::ArgumentCoder<DragData>::decode):
3134         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
3135         (WKViewCreate):
3136         * UIProcess/API/C/WKBatteryStatus.cpp:
3137         (WKBatteryStatusCreate):
3138         * UIProcess/API/C/WKGeolocationPosition.cpp:
3139         (WKGeolocationPositionCreate_b):
3140         * UIProcess/API/C/WKGrammarDetail.cpp:
3141         (WKGrammarDetailCreate):
3142         * UIProcess/API/C/WKPage.cpp:
3143         (WKPageCopySessionState):
3144         * UIProcess/API/C/WKPageGroup.cpp:
3145         (WKPageGroupCreateWithIdentifier):
3146         * UIProcess/API/C/WKPreferences.cpp:
3147         (WKPreferencesCreate):
3148         (WKPreferencesCreateWithIdentifier):
3149         (WKPreferencesCreateCopy):
3150         * UIProcess/API/C/WKSessionRef.cpp:
3151         (WKSessionCreate):
3152         * UIProcess/API/C/WKSessionStateRef.cpp:
3153         (WKSessionStateCopyData):
3154         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3155         (WKContextCopyPlugInInfoForBundleIdentifier):
3156         * UIProcess/API/Cocoa/WKWebView.mm:
3157         (-[WKWebView loadRequest:]):
3158         (-[WKWebView loadFileURL:allowingReadAccessToURL:]):
3159         (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
3160         (-[WKWebView goToBackForwardListItem:]):
3161         (-[WKWebView goBack]):
3162         (-[WKWebView goForward]):
3163         (-[WKWebView reload]):
3164         (-[WKWebView reloadFromOrigin]):
3165         (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
3166         (-[WKWebView _reloadWithoutContentBlockers]):
3167         (-[WKWebView _sessionStateData]):
3168         (-[WKWebView _restoreSessionState:andNavigate:]):
3169         * UIProcess/API/efl/ewk_database_manager.cpp:
3170         (EwkDatabaseManager::createOriginList):
3171         * UIProcess/API/efl/ewk_storage_manager.cpp:
3172         (EwkStorageManager::createOriginList):
3173         * UIProcess/API/gtk/WebKitWebView.cpp:
3174         (webkitWebViewCreateNewPage):
3175         (webkitWebViewPrintFrame):
3176         (getContentsAsMHTMLDataCallback):
3177         * UIProcess/Cocoa/SessionStateCoding.mm:
3178         (WebKit::encodeSessionState):
3179         * UIProcess/GenericCallback.h:
3180         (WebKit::CallbackMap::take):
3181         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
3182         (WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
3183         * UIProcess/Network/NetworkProcessProxy.cpp:
3184         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
3185         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
3186         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
3187         * UIProcess/Plugins/PluginProcessManager.cpp:
3188         (WebKit::PluginProcessManager::getOrCreatePluginProcess):
3189         * UIProcess/Storage/StorageManager.cpp:
3190         (WebKit::StorageManager::StorageArea::setItem):
3191         (WebKit::StorageManager::StorageArea::removeItem):
3192         (WebKit::StorageManager::createLocalStorageMap):
3193         * UIProcess/WebBackForwardList.cpp:
3194         (WebKit::WebBackForwardList::addItem):
3195         (WebKit::WebBackForwardList::clear):
3196         * UIProcess/WebCookieManagerProxy.cpp:
3197         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
3198         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
3199         * UIProcess/WebPageProxy.cpp:
3200         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler):
3201         * UIProcess/WebPreferences.cpp:
3202         (WebKit::WebPreferences::createWithLegacyDefaults):
3203         (WebKit::WebPreferences::copy):
3204         * UIProcess/WebProcessPool.cpp:
3205         (WebKit::WebProcessPool::~WebProcessPool):
3206         * UIProcess/mac/ViewSnapshotStore.mm:
3207         (WebKit::ViewSnapshotStore::recordSnapshot):
3208         * UIProcess/mac/WKImmediateActionController.mm:
3209         (-[WKImmediateActionController _webHitTestResult]):
3210         * UIProcess/mac/WKPrintingView.mm:
3211         (-[WKPrintingView _askPageToComputePageRects]):
3212         * UIProcess/mac/WebPageProxyMac.mm:
3213         (WebKit::WebPageProxy::setDragImage):
3214         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
3215         (-[WKWebProcessPlugInFrame hitTest:]):
3216         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
3217         (-[WKWebProcessPlugInHitTestResult nodeHandle]):
3218         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
3219         (+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]):
3220         (-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]):
3221         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
3222         (+[WKWebProcessPlugInScriptWorld world]):
3223         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3224         (WKBundlePostSynchronousMessage):
3225         * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
3226         (WKBundleDOMWindowExtensionCreate):
3227         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
3228         (WKBundleHitTestResultCopyNodeHandle):
3229         (WKBundleHitTestResultCopyURLElementHandle):
3230         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
3231         (WKBundleNavigationActionCopyHitTestResult):
3232         (WKBundleNavigationActionCopyFormElement):
3233         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
3234         (WKBundleNodeHandleCreate):
3235         (WKBundleNodeHandleCopyDocument):
3236         (WKBundleNodeHandleCopySnapshotWithOptions):
3237         (WKBundleNodeHandleCopyVisibleRange):
3238         (WKBundleNodeHandleCopyHTMLTableCellElementCellAbove):
3239         (WKBundleNodeHandleCopyDocumentFrame):
3240         (WKBundleNodeHandleCopyHTMLFrameElementContentFrame):
3241         (WKBundleNodeHandleCopyHTMLIFrameElementContentFrame):
3242         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3243         (WKBundlePageCreateSnapshotWithOptions):
3244         (WKBundlePageCreateSnapshotInViewCoordinates):
3245         (WKBundlePageCreateSnapshotInDocumentCoordinates):
3246         (WKBundlePageCreateScaledSnapshotInDocumentCoordinates):
3247         (WKBundlePagePostSynchronousMessageForTesting):
3248         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
3249         (WKBundleRangeHandleCreate):
3250         (WKBundleRangeHandleCopySnapshotWithOptions):
3251         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
3252         (WKBundleScriptWorldCreateWorld):
3253         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
3254         (-[WKDOMNode _copyBundleNodeHandleRef]):
3255         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
3256         (-[WKDOMRange _copyBundleRangeHandleRef]):
3257         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
3258         (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
3259         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3260         (WebKit::imageForRect):
3261         (WebKit::InjectedBundleNodeHandle::renderedImage):
3262         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3263         (WebKit::InjectedBundleRangeHandle::getOrCreate):
3264         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3265         (WebKit::InjectedBundle::create):
3266         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3267         (WebKit::NetscapePlugin::loadURL):
3268         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
3269         (WebKit::PDFPlugin::createScrollbar):
3270         * WebProcess/Storage/StorageAreaMap.cpp:
3271         (WebKit::StorageAreaMap::applyChange):
3272         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3273         (WebKit::toFormData):
3274         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3275         (WebKit::WebFrameLoaderClient::createPlugin):
3276         (WebKit::WebFrameLoaderClient::recreatePlugin):
3277         (WebKit::WebFrameLoaderClient::createJavaAppletWidget):
3278         (WebKit::WebFrameLoaderClient::createNetworkingContext):
3279         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3280         (WebKit::WebInspectorClient::highlight):
3281         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3282         (WebKit::convertImageToBitmap):
3283         * WebProcess/WebPage/FindController.cpp:
3284         (WebKit::FindController::updateFindUIAfterPageScroll):
3285         * WebProcess/WebPage/VisitedLinkTableController.cpp:
3286         (WebKit::VisitedLinkTableController::getOrCreate):
3287         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
3288         * WebProcess/WebPage/WebFrame.cpp:
3289         (WebKit::WebFrame::createWithCoreMainFrame):
3290         (WebKit::WebFrame::createSubframe):
3291         (WebKit::WebFrame::create):
3292         (WebKit::WebFrame::createSelectionSnapshot):
3293         * WebProcess/WebPage/WebPage.cpp:
3294         (WebKit::WebPage::createPlugin):
3295         (WebKit::WebPage::snapshotAtSize):
3296         (WebKit::WebPage::snapshotNode):
3297         (WebKit::WebPage::willPerformLoadDragDestinationAction):
3298         (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad):
3299         (WebKit::WebPage::SandboxExtensionTracker::didCommitProvisionalLoad):
3300         (WebKit::WebPage::drawRectToImage):
3301         * WebProcess/WebPage/WebPageGroupProxy.cpp:
3302         (WebKit::WebPageGroupProxy::create):
3303         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3304         (WebKit::PlatformCAAnimationRemote::Properties::decode):
3305         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3306         (WebKit::PlatformCALayerRemote::create):
3307         (WebKit::PlatformCALayerRemote::clone):
3308         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
3309         (WebKit::PlatformCALayerRemoteCustom::create):
3310         (WebKit::PlatformCALayerRemoteCustom::clone):
3311         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3312         (WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor):
3313
3314 2016-06-20  Commit Queue  <commit-queue@webkit.org>
3315
3316         Unreviewed, rolling out r202179.
3317         https://bugs.webkit.org/show_bug.cgi?id=158946
3318
3319         The test either fails or times out 100% of the time (Requested
3320         by ap on #webkit).
3321
3322         Reverted changeset:
3323
3324         "REGRESSION: Double tap to zoom does not work on yahoo
3325         finance"
3326         https://bugs.webkit.org/show_bug.cgi?id=158886
3327         http://trac.webkit.org/changeset/202179
3328
3329 2016-06-20  Tim Horton  <timothy_horton@apple.com>
3330
3331         REGRESSION (r191499): Tab content "jumps" down when focusing tabs that load in the background
3332         https://bugs.webkit.org/show_bug.cgi?id=158904
3333         <rdar://problem/26025831>
3334
3335         Reviewed by Sam Weinig.
3336
3337         * UIProcess/Cocoa/WebViewImpl.h:
3338         * UIProcess/Cocoa/WebViewImpl.mm:
3339         (WebKit::WebViewImpl::viewDidMoveToWindow):
3340         During the large refactor that was r191499, we somehow ended up with two
3341         different members for the same thing - one that got written, and one that
3342         got read. We should only have one.
3343
3344 2016-06-20  Tim Horton  <timothy_horton@apple.com>
3345
3346         Try to fix the iOS build after r202142 and r202224.
3347
3348         * Shared/mac/RemoteLayerBackingStore.mm:
3349         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
3350
3351 2016-06-19  Simon Fraser  <simon.fraser@apple.com>
3352
3353         Fix erroneously commented line added in r202142.
3354
3355         * Shared/mac/RemoteLayerBackingStore.mm:
3356         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
3357
3358 2016-06-16  Enrica Casucci  <enrica@apple.com>
3359
3360         Support configurable autocapitalization.
3361         https://bugs.webkit.org/show_bug.cgi?id=158860
3362         rdar://problem/26231403
3363
3364         Reviewed by Tim Horton.
3365
3366         The behavior of spellchecker should be configurable to avoid
3367         unwanted autocapitalization.
3368
3369         * UIProcess/API/APIPageConfiguration.cpp:
3370         (API::PageConfiguration::copy):
3371         * UIProcess/API/APIPageConfiguration.h:
3372         (API::PageConfiguration::initialCapitalizationEnabled):
3373         (API::PageConfiguration::setInitialCapitalizationEnabled):
3374         * UIProcess/API/C/WKPageConfigurationRef.cpp:
3375         (WKPageConfigurationSetIntialCapitalizationEnabled):
3376         * UIProcess/API/C/WKPageConfigurationRef.h:
3377         * UIProcess/API/Cocoa/WKWebView.mm:
3378         (-[WKWebView _initializeWithConfiguration:]):
3379         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3380         (-[WKWebViewConfiguration copyWithZone:]):
3381         (-[WKWebViewConfiguration _initialCapitalizationEnabled]):
3382         (-[WKWebViewConfiguration _setInitialCapitalizationEnabled:]):
3383         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3384         * UIProcess/TextChecker.h:
3385         * UIProcess/WebPageProxy.cpp:
3386         (WebKit::WebPageProxy::WebPageProxy):
3387         (WebKit::WebPageProxy::checkTextOfParagraph):
3388         (WebKit::WebPageProxy::getGuessesForWord):
3389         * UIProcess/WebPageProxy.h:
3390         * UIProcess/efl/TextCheckerEfl.cpp:
3391         (WebKit::TextChecker::checkTextOfParagraph):
3392         (WebKit::TextChecker::getGuessesForWord):
3393         * UIProcess/gtk/TextCheckerGtk.cpp:
3394         (WebKit::TextChecker::getGuessesForWord):
3395         (WebKit::TextChecker::checkTextOfParagraph):
3396         * UIProcess/ios/TextCheckerIOS.mm:
3397         (WebKit::TextChecker::checkTextOfParagraph):
3398         (WebKit::TextChecker::getGuessesForWord):
3399         * UIProcess/mac/TextCheckerMac.mm:
3400         (WebKit::TextChecker::checkTextOfParagraph):
3401         (WebKit::TextChecker::getGuessesForWord):
3402
3403 2016-06-17  Chris Dumez  <cdumez@apple.com>
3404
3405         Use WTF::NoncopyableFunction in NetworkDataTaskClient
3406         https://bugs.webkit.org/show_bug.cgi?id=158887
3407
3408         Reviewed by Alex Christensen.
3409
3410         Use WTF::NoncopyableFunction in NetworkDataTaskClient instead of std::function
3411         and consistently move it around. This avoids some unnecessary copying.
3412
3413         * NetworkProcess/Downloads/DownloadManager.cpp:
3414         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
3415         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3416         * NetworkProcess/Downloads/DownloadManager.h:
3417         * NetworkProcess/NetworkDataTask.h:
3418         * NetworkProcess/NetworkLoad.cpp:
3419         (WebKit::NetworkLoad::willPerformHTTPRedirection):
3420         (WebKit::NetworkLoad::didReceiveChallenge):
3421         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
3422         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
3423         * NetworkProcess/NetworkLoad.h:
3424         * NetworkProcess/NetworkProcess.cpp:
3425         (WebKit::NetworkProcess::findPendingDownloadLocation):
3426         * NetworkProcess/NetworkProcess.h:
3427         * NetworkProcess/PingLoad.h:
3428         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3429         (WebKit::NetworkDataTask::didReceiveChallenge):
3430         (WebKit::NetworkDataTask::didReceiveResponse):
3431         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
3432         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
3433         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3434         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3435         * Shared/Authentication/AuthenticationManager.cpp:
3436         (WebKit::AuthenticationManager::addChallengeToChallengeMap):
3437         (WebKit::AuthenticationManager::coalesceChallengesMatching):
3438         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
3439         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
3440         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
3441         * Shared/Authentication/AuthenticationManager.h:
3442         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
3443         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
3444
3445 2016-06-17  Antoine Quint  <graouts@apple.com>
3446
3447         Web video playback controls should have RTL volume slider
3448         https://bugs.webkit.org/show_bug.cgi?id=158856
3449         <rdar://problem/25971769>
3450
3451         Reviewed by Tim Horton.
3452
3453         We now call setUserInterfaceLayoutDirection() on WebCore::Page to propagate
3454         the user interface layout direction down to the Web content. To facilitate this,
3455         the UserInterfaceLayoutDirection enum is now defined in WebCore.
3456
3457         * Shared/WebPageCreationParameters.h:
3458         * UIProcess/API/Cocoa/WKWebView.mm:
3459         (convertSystemLayoutDirection):
3460         (toUserInterfaceLayoutDirection):
3461         * UIProcess/API/gtk/PageClientImpl.h:
3462         * UIProcess/Cocoa/WebViewImpl.h:
3463         * UIProcess/Cocoa/WebViewImpl.mm:
3464         (WebKit::toUserInterfaceLayoutDirection):
3465         (WebKit::WebViewImpl::userInterfaceLayoutDirection):
3466         * UIProcess/PageClient.h:
3467         * UIProcess/WebPageProxy.cpp:
3468         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
3469         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
3470         * UIProcess/WebPageProxy.h:
3471         * UIProcess/efl/WebView.h:
3472         * UIProcess/ios/PageClientImplIOS.h:
3473         * UIProcess/ios/PageClientImplIOS.mm:
3474         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
3475         * UIProcess/mac/PageClientImpl.h:
3476         * UIProcess/mac/PageClientImpl.mm:
3477         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
3478         * UIProcess/mac/ViewGestureControllerMac.mm:
3479         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
3480         (WebKit::ViewGestureController::isPhysicallySwipingLeft):
3481         * WebProcess/WebPage/WebPage.cpp:
3482         (WebKit::m_userInterfaceLayoutDirection):
3483         (WebKit::WebPage::setUserInterfaceLayoutDirection):
3484         * WebProcess/WebPage/WebPage.h:
3485         * WebProcess/WebPage/mac/WebPageMac.mm:
3486         (WebKit::WebPage::performNonEditingBehaviorForSelector):
3487
3488 2016-06-17  Dean Jackson  <dino@apple.com>
3489
3490         REGRESSION: Double tap to zoom does not work on yahoo finance
3491         https://bugs.webkit.org/show_bug.cgi?id=158886
3492         <rdar://problem/24917760>
3493
3494         Reviewed by Simon Fraser.
3495
3496         We shouldn't enable fast click on pages that have
3497         had to shrink to fit. In other words, we should enable
3498         double-tap-to-zoom if the page has already zoomed.
3499
3500         Test: fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html
3501
3502         * UIProcess/API/Cocoa/WKWebView.mm:
3503         (-[WKWebView _allowsDoubleTapGestures]):
3504
3505 2016-06-16  Chris Dumez  <cdumez@apple.com>
3506
3507         No need to ref connection in lambda inside NetworkResourceLoader::tryStoreAsCacheEntry()
3508         https://bugs.webkit.org/show_bug.cgi?id=158862
3509
3510         Reviewed by Darin Adler.
3511
3512         No need to ref connection in lambda inside NetworkResourceLoader::tryStoreAsCacheEntry().
3513         We already ref the NetworkResourceLoader which hold a ref to the connection. Also update
3514         the lambda capture to use Ref<> for the NetworkResourceLoader instead of RefPtr<>.
3515         Switch callback type from std::function to WTF::NoncopyableFunction so we can capture a
3516         Ref<>.
3517
3518         * NetworkProcess/NetworkResourceLoader.cpp:
3519         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
3520         * NetworkProcess/cache/NetworkCache.cpp:
3521         (WebKit::NetworkCache::Cache::store):
3522         * NetworkProcess/cache/NetworkCache.h:
3523         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3524         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
3525         * NetworkProcess/cache/NetworkCacheStorage.h:
3526
3527 2016-06-16  Chris Dumez  <cdumez@apple.com>
3528
3529         [WK2] Improve serialization of SubresourcesEntry to network disk cache
3530         https://bugs.webkit.org/show_bug.cgi?id=158851
3531
3532         Reviewed by Antti Koivisto.
3533
3534         Improve serialization of SubresourcesEntry to network disk cache:
3535         - Do not bother serializing SubresourceInfo's first party for cookies
3536           and HTTP headers data members if the resource is transient. This is
3537           because those are never used for transient resources. This patch also
3538           makes it so that we do not even bother initializing those data members
3539           if the transient flag is set.
3540         - Update SubresourceInfo::encode() / decode() to encode and decode
3541           the HTTPHeaderMap data member with the right NetworkCache::Coder
3542           template specialization instead of using directly HTTPHeaderMap::decode()
3543           and HTTPHeaderMap::encode(). HTTPHeaderMap::decode() / encode() is
3544           unsafe in the disk cache case (see r200394).
3545
3546         Also update entry types as so:
3547         - "resource" -> "Resource"
3548         - "subresources" -> "SubResources"
3549
3550         These entry types are used a folder names in the disk cache and other
3551         folder names were capitalized. Antti suggested this was a good time
3552         to harmonize since we're bumping the cache version.
3553
3554         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3555         (WebKit::NetworkCache::constructRevalidationRequest):
3556         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
3557         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
3558         * NetworkProcess/cache/NetworkCacheStorage.h:
3559         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
3560         (WebKit::NetworkCache::SubresourceInfo::encode):
3561         (WebKit::NetworkCache::SubresourceInfo::decode):
3562         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
3563         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
3564         (WebKit::NetworkCache::SubresourceInfo::isTransient):
3565         (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies):
3566         (WebKit::NetworkCache::SubresourceInfo::requestHeaders):
3567
3568 2016-06-16  Anders Carlsson  <andersca@apple.com>
3569
3570         Fix macOS Sierra build
3571         https://bugs.webkit.org/show_bug.cgi?id=158849
3572
3573         Reviewed by Tim Horton.
3574
3575         Add WebCore:: qualifiers for IOSurface, to avoid conflicts with the IOSurface Objective-C class
3576         and adopt IOSurface::asLayerContents().
3577
3578         * Shared/mac/RemoteLayerBackingStore.mm:
3579         (WebKit::RemoteLayerBackingStore::decode):
3580         (WebKit::RemoteLayerBackingStore::bytesPerPixel):
3581         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
3582         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
3583         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
3584         (WebKit::RemoteLayerBackingStore::Buffer::discard):
3585         * UIProcess/mac/ViewSnapshotStore.mm:
3586         (WebKit::ViewSnapshot::create):
3587         (WebKit::ViewSnapshot::ViewSnapshot):
3588         (WebKit::ViewSnapshot::asLayerContents):
3589
3590 2016-06-16  Brady Eidson  <beidson@apple.com>
3591
3592         When a WebsiteDataStore finds no ProcessPools and creates one from scratch, it should represent the data store's config.
3593         rdar://problem/26586991 and https://bugs.webkit.org/show_bug.cgi?id=158844
3594
3595         Reviewed by Anders Carlsson.
3596
3597         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3598         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
3599         * UIProcess/API/APIProcessPoolConfiguration.h:
3600
3601         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3602         (WebKit::WebsiteDataStore::WebsiteDataStore):
3603         (WebKit::WebsiteDataStore::fetchData):
3604         (WebKit::WebsiteDataStore::removeData):
3605         (WebKit::WebsiteDataStore::processPools):
3606         * UIProcess/WebsiteData/WebsiteDataStore.h:
3607
3608 2016-06-15  Simon Fraser  <simon.fraser@apple.com>
3609
3610         [iOS WK2] On iPad, indirect focussing of a text field doesn't always scroll to the correct location
3611         https://bugs.webkit.org/show_bug.cgi?id=158828
3612
3613         Reviewed by Enrica Casucci.
3614         
3615         WebPage::getAssistedNodeInformation() unconditionally set information.selectionRect()
3616         to a 1x1 rect at the last interaction location. This caused -[WKWebView _zoomToFocusRect:...]
3617         to early return under the !forceScroll clause if the last interaction rect was visible, but
3618         the elementRect was not. This would happen, for example, if a click in a <button> focussed
3619         an input on some other portion of the page. This behavior is iPad-only, because forceScroll
3620         is only NO there.
3621         
3622         Fix by making getAssistedNodeInformation() only set the selectionRect to the last interaction
3623         location if that is inside of the elementRect (this caters to the case where a tap is inside
3624         an input which is larger than the screen). Otherwise, set it to the empty rect.
3625         
3626         Make this testable by allowing a test to opt into the iPad-style scrolling/zooming behavior
3627         in this code path (essentially, making forceScroll NO for testing), via testing SPI on WKWebView,
3628         plumbed through to WKContentView.
3629
3630         * UIProcess/API/Cocoa/WKWebView.mm:
3631         (-[WKWebView forceIPadStyleZoomOnInputFocus]):
3632         (-[WKWebView setForceIPadStyleZoomOnInputFocus:]):
3633         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3634         * UIProcess/ios/WKContentViewInteraction.h:
3635         * UIProcess/ios/WKContentViewInteraction.mm:
3636         (-[WKContentView _displayFormNodeInputView]):
3637         (-[WKContentView requiresAccessoryView:]):
3638         (-[WKContentView inputAccessoryView]):
3639         (-[WKContentView forceIPadStyleZoomOnInputFocus]):
3640         (-[WKContentView setForceIPadStyleZoomOnInputFocus:]):
3641         (-[WKContentView requiresAccessoryView]): Remove redundant returns, and allow testing to
3642         override the "isIPad" condition.
3643         * WebProcess/WebPage/ios/WebPageIOS.mm:
3644         (WebKit::WebPage::getAssistedNodeInformation):
3645
3646 2016-06-15  Sam Weinig  <sam@webkit.org>
3647
3648         Forward/Back keyboard shortcuts need to flip for RTL
3649         https://bugs.webkit.org/show_bug.cgi?id=158823
3650         <rdar://problem/25975359>
3651
3652         Reviewed by Darin Adler.
3653
3654         Pipe the UserInterfaceLayoutDirection down to the WebContentProcess on initialization
3655         and when it changes, and use it to flip the behavior of command-left and command-right
3656         when in RTL mode.
3657
3658         Tests:
3659             WebKit2_CommandBackForwardTestWKView.LTR
3660             WebKit2_CommandBackForwardTestWKView.RTL
3661             WebKit2_CommandBackForwardTestWKWebView.LTR
3662             WebKit2_CommandBackForwardTestWKWebView.RTL
3663
3664         * Shared/WebPageCreationParameters.cpp:
3665         (WebKit::WebPageCreationParameters::encode):
3666         (WebKit::WebPageCreationParameters::decode):
3667         * Shared/WebPageCreationParameters.h:
3668         * UIProcess/API/Cocoa/WKWebView.mm:
3669         (-[WKWebView _webViewPrintFormatter]):
3670         (-[WKWebView setSemanticContentAttribute:]):
3671         (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
3672         (-[WKWebView setUserInterfaceLayoutDirection:]):
3673         * UIProcess/API/mac/WKView.mm:
3674         (-[WKView setUserInterfaceLayoutDirection:]):
3675         * UIProcess/Cocoa/WebViewImpl.h:
3676         * UIProcess/Cocoa/WebViewImpl.mm:
3677         (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse):
3678         (WebKit::toUserInterfaceLayoutDirection):
3679         (WebKit::WebViewImpl::userInterfaceLayoutDirection):
3680         (WebKit::WebViewImpl::setUserInterfaceLayoutDirection):
3681         * UIProcess/WebPageProxy.cpp:
3682         (WebKit::WebPageProxy::creationParameters):
3683         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
3684         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
3685         * UIProcess/WebPageProxy.h:
3686         (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction):
3687         * UIProcess/ios/WKContentView.mm:
3688         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
3689         * WebProcess/WebPage/WebPage.cpp:
3690         (WebKit::m_userInterfaceLayoutDirection):
3691         (WebKit::WebPage::setResourceCachingDisabled):
3692         (WebKit::WebPage::setUserInterfaceLayoutDirection):
3693         (WebKit::m_shouldDispatchFakeMouseMoveEvents): Deleted.
3694         * WebProcess/WebPage/WebPage.h:
3695         * WebProcess/WebPage/WebPage.messages.in:
3696         * WebProcess/WebPage/mac/WebPageMac.mm:
3697         (WebKit::WebPage::performNonEditingBehaviorForSelector):
3698
3699 2016-06-15  Tim Horton  <timothy_horton@apple.com>
3700
3701         Expose _shouldExpandContentToViewHeightForAutoLayout SPI on WKWebView
3702         https://bugs.webkit.org/show_bug.cgi?id=158824
3703         <rdar://problem/23713857>
3704
3705         Reviewed by Simon Fraser.
3706
3707         Test: TestWebKitAPI/WebKit2.AutoLayoutIntegration
3708
3709         * UIProcess/API/Cocoa/WKWebView.mm:
3710         (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]):
3711         (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]):
3712         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3713         This property exists on WKView; expose it on WKWebView.
3714
3715 2016-06-15  Alex Christensen  <achristensen@webkit.org>
3716
3717         Revert part of r196034
3718         https://bugs.webkit.org/show_bug.cgi?id=158805
3719         rdar://problem/26788138
3720
3721         Reviewed by Dan Bernstein.
3722
3723         * NetworkProcess/NetworkLoad.cpp:
3724         (WebKit::NetworkLoad::~NetworkLoad):
3725         If the WebResourceLoader was destroyed and received a canAuthenticateAgainstProtectionSpace
3726         but did not send a continueCanAuthenticateAgainstProtectionSpace answer because there's no
3727         core loader, then the NetworkLoad will be destroyed.  When this happens, we still need to call
3728         the callback for the challenge.
3729         * WebProcess/Network/WebResourceLoader.cpp:
3730         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace):
3731         If there's no core loader, we can't send IPC.
3732
3733 2016-06-13  Simon Fraser  <simon.fraser@apple.com>
3734
3735         [iOS WK2] Make it possible to test the Next/Previous buttons in the keyboard accessory bar
3736         https://bugs.webkit.org/show_bug.cgi?id=158714
3737
3738         Reviewed by Enrica Casucci.
3739
3740         Add UIScriptController.keyboardAccessoryBar{Next,Previous} and hook it up to the WKContentView
3741         method that gets called from UIKit.
3742
3743         Add a test that exercises it.
3744
3745         * UIProcess/API/Cocoa/WKWebView.mm:
3746         (-[WKWebView keyboardAssistantBarNext]):
3747         (-[WKWebView keyboardAssistantBarPrevious]):
3748         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3749
3750 2016-06-15  Dean Jackson  <dino@apple.com>
3751
3752         RTL <select> forms are misplaced
3753         https://bugs.webkit.org/show_bug.cgi?id=158810
3754         <rdar://problem/24847541>
3755
3756         Reviewed by Eric Carlson.
3757
3758         AppKit made a change in Sierra that causes popup menus
3759         to snap to a different point when the system language is RTL.
3760         We need to be more explicit about what directionality
3761         we want, and override the location of the popup based
3762         on the text direction.
3763
3764         I also made a small tweak to the fudge offsets we use
3765         in order to make button text and menu text to be
3766         more consistent.
3767
3768         Unfortunately since this is just about the location
3769         of the popup menu, it's unable to be tested in our
3770         current infrastructure.
3771
3772         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3773         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
3774
3775 2016-06-15  Chris Dumez  <cdumez@apple.com>
3776
3777         Drop some unnecessary header includes
3778         https://bugs.webkit.org/show_bug.cgi?id=158788
3779
3780         Reviewed by Alexey Proskuryakov.
3781
3782         Drop some unnecessary header includes in headers to speed up build time.
3783
3784         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
3785         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
3786         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
3787         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
3788         * WebProcess/Plugins/PluginView.cpp:
3789         * WebProcess/WebPage/WebPage.cpp:
3790
3791 2016-06-15  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3792
3793         Enabling Shadow DOM for all platforms
3794         https://bugs.webkit.org/show_bug.cgi?id=158738
3795
3796         Reviewed by Ryosuke Niwa.
3797
3798         Removed Shadow DOM from options (enabled by default)
3799         (comprises removal of corresponding preprocessor directives)
3800
3801         * Configurations/FeatureDefines.xcconfig:
3802         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3803         * WebProcess/WebPage/WebPage.cpp:
3804
3805 2016-06-15  Antti Koivisto  <antti@apple.com>
3806
3807         Vary:Cookie validation doesn't work in private browsing
3808         https://bugs.webkit.org/show_bug.cgi?id=158616
3809         <rdar://problem/26755067>
3810
3811         Reviewed by Andreas Kling.
3812
3813         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3814         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
3815
3816             Implement SessionID version of the function.
3817
3818         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3819
3820 2016-06-14  Chris Dumez  <cdumez@apple.com>
3821
3822         Avoid constructing a AuthenticationChallenge unnecessarily in the NetworkLoad constructor
3823         https://bugs.webkit.org/show_bug.cgi?id=158746
3824
3825         Reviewed by Darin Adler.
3826
3827         Avoid constructing a AuthenticationChallenge unnecessarily in the
3828         NetworkLoad constructor by using WTF::Optional<> for this data
3829         member.
3830
3831         * NetworkProcess/NetworkLoad.cpp:
3832         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
3833         * NetworkProcess/NetworkLoad.h:
3834
3835 2016-06-14  Chris Dumez  <cdumez@apple.com>
3836
3837         Add missing WTFMove() in NetworkResourceLoader::didReceiveResponse()
3838         https://bugs.webkit.org/show_bug.cgi?id=158745
3839
3840         Reviewed by Darin Adler.
3841
3842         Add missing WTFMove() in NetworkResourceLoader::didReceiveResponse()
3843         to avoid copying the ResourceResponse.
3844
3845         * NetworkProcess/NetworkResourceLoader.cpp:
3846
3847 2016-06-14  Chris Dumez  <cdumez@apple.com>
3848
3849         Reduce copying of NetworkLoadParameters
3850         https://bugs.webkit.org/show_bug.cgi?id=158744
3851
3852         Reviewed by Alex Christensen.
3853
3854         Reduce copying of NetworkLoadParameters by moving it around instead.
3855
3856         * NetworkProcess/Downloads/DownloadManager.cpp:
3857         (WebKit::DownloadManager::startDownload):
3858         * NetworkProcess/Downloads/PendingDownload.cpp:
3859         (WebKit::PendingDownload::PendingDownload):
3860         * NetworkProcess/Downloads/PendingDownload.h:
3861         * NetworkProcess/NetworkLoad.cpp:
3862         (WebKit::NetworkLoad::NetworkLoad):
3863         * NetworkProcess/NetworkLoad.h:
3864         * NetworkProcess/NetworkResourceLoader.cpp:
3865         (WebKit::NetworkResourceLoader::startNetworkLoad):
3866         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3867         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3868
3869 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3870
3871         [ThreadedCompositor] Opening the inspector in a window causes a crash.
3872         https://bugs.webkit.org/show_bug.cgi?id=154444
3873
3874         Reviewed by Žan Doberšek.
3875
3876         The threaded compositor doesn't handle the case of changing or removing the native surface handle. When the web
3877         view is reparented, the current native surface handle is destroyed when the view is removed from the parent, and
3878         a new one is created when added to the new parent. We need to handle this case in the threaded compositor.
3879
3880         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
3881         (WebKit::CompositingRunLoop::stopUpdateTimer): Allow users to stop the update timer.
3882         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
3883         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3884         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Use performTaskSync because this is called
3885         from a synchronous IPC message and right after it returns, the current native surface is destroyed by the UI
3886         process. So we need to ensure we finish all pending operations for the current native surface in the compositing
3887         thread before it's destroyed. Then we enable or disable the scene depending on whether the native surface has
3888         been created or destroyed and destroy the current context in case the new handle is 0.
3889         (WebKit::ThreadedCompositor::tryEnsureGLContext): Just renamed to make it clear that it can fail.
3890         (WebKit::ThreadedCompositor::glContext):
3891         (WebKit::ThreadedCompositor::renderLayerTree): Return early if scene is not active.
3892         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3893         (WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Schedule a new layer flush
3894         after the native surface handle changed.
3895
3896 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3897
3898         [Threaded Compositor] Modernize and simplify threaded compositor code
3899         https://bugs.webkit.org/show_bug.cgi?id=158615
3900
3901         Reviewed by Žan Doberšek.
3902
3903         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
3904         (WebKit::CompositingRunLoop::performTask): Use NoncopyableFunction.
3905         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
3906         (WebKit::CompositingRunLoop::startUpdateTimer): Just renamed to start instead of set.
3907         (WebKit::CompositingRunLoop::run): Expose run/stop methods instead of the internal RunLoop object.
3908         (WebKit::CompositingRunLoop::stop): Also stop the update timer instead of relying on the caller to do it.
3909         (WebKit::CompositingRunLoop::setUpdateTimer): Deleted.
3910         (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
3911         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
3912         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3913         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Protects this directly in lambda capture.
3914         (WebKit::ThreadedCompositor::setDeviceScaleFactor): Ditto.
3915         (WebKit::ThreadedCompositor::didChangeViewportSize): Ditto.
3916         (WebKit::ThreadedCompositor::didChangeViewportAttribute): Ditto.
3917         (WebKit::ThreadedCompositor::didChangeContentsSize): Ditto.
3918         (WebKit::ThreadedCompositor::scrollTo): Ditto.
3919         (WebKit::ThreadedCompositor::scrollBy): Ditto.
3920         (WebKit::ThreadedCompositor::updateViewport): Use startUpdateTimer().
3921         (WebKit::ThreadedCompositor::scheduleDisplayImmediately): Ditto.
3922         (WebKit::ThreadedCompositor::didChangeVisibleRect): Improve lambda captures.
3923         (WebKit::ThreadedCompositor::renderLayerTree): Use m_viewportController directly.
3924         (WebKit::ThreadedCompositor::createCompositingThread): Use createThread() version that receives a function.
3925         (WebKit::ThreadedCompositor::runCompositingThread): Use run method and don't stop the update timer when the run
3926         loop finishes.
3927         (WebKit::ThreadedCompositor::terminateCompositingThread): Use stop method.
3928         (WebKit::ThreadedCompositor::ThreadedCompositor): Deleted.
3929         (WebKit::ThreadedCompositor::compositingThreadEntry): Deleted.
3930         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3931         (WebKit::ThreadedCompositor::viewportController): Deleted.
3932
3933 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3934
3935         [Threaded Compositor] Flickering and rendering artifacts when resizing the web view
3936         https://bugs.webkit.org/show_bug.cgi?id=154070
3937
3938         Reviewed by Žan Doberšek.
3939
3940         Resizing the web view is expected to be a sync operation, the UI process creates a new backing store state ID,
3941         sends UpdateBackingStoreState message with the flag RespondImmediately to the web process and waits up to 500ms
3942         for the reply (DidUpdateBackingStoreState message). When using the threaded compositor, we schedule a task in
3943         the compositing thread to update the viewport size, and return immediately, so that we reply to the UI process
3944         before the compositing thread has actually updated its size. There's a moment in which sizes are out of sync
3945         causing the flickering and rendering artifacts, the UI process continues rendering at the new size, while the
3946         web process is still rendering at the previous size. We can prevent this from happening just by making the
3947         resize task synchronous in the threaded compositor.
3948
3949         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
3950         (WebKit::CompositingRunLoop::performTaskSync): Add sync version of performTask().
3951         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
3952         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3953         (WebKit::ThreadedCompositor::didChangeViewportSize): Use performTaskSync().
3954
3955 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3956
3957         Unreviewed. Fix Soup downloads after r201943.
3958
3959         This is a follow up of r201943. The DownloadClient used in DownloadSoup was not updated to the new API of the
3960         ResourceHandleClient because it was not using override on the virtual methods, so it was unnoticed. That broke
3961         the downloads soup implementation, because didReceiveResponse is no longer used in the DownloadClient. This
3962         patch updates the DownloadClient to the new ResourceHandleClient API adding also override to all the virtual
3963         methods to prevent this from happening in the future.
3964
3965         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
3966         (WebKit::Download::start):
3967         (WebKit::Download::startWithHandle):
3968         (WebKit::DownloadClient::DownloadClient):
3969         (WebKit::DownloadClient::downloadFailed):
3970         (WebKit::DownloadClient::didReceiveResponse):
3971         (WebKit::DownloadClient::didReceiveData):
3972         (WebKit::DownloadClient::didFinishLoading):
3973         (WebKit::DownloadClient::didFail):
3974         (WebKit::DownloadClient::wasBlocked): Deleted.
3975         (WebKit::DownloadClient::cannotShowURL): Deleted.
3976         (WebKit::DownloadClient::cancel):
3977         (WebKit::DownloadClient::handleResponse):
3978
3979 2016-06-13  Dan Bernstein  <mitz@apple.com>
3980
3981         [Mac] Web Content service with a restricted entitlement may load arbitrary dylibs
3982         https://bugs.webkit.org/show_bug.cgi?id=156668
3983         <rdar://problem/26714558>
3984
3985         Reviewed by Anders Carlsson.
3986
3987         * Configurations/WebContentService.xcconfig: Enable library validation when the Web Content
3988           service is given the XPC domain extension entitlement when targeting macOS Sierra or later.
3989
3990 2016-06-13  Alex Christensen  <achristensen@webkit.org>
3991
3992         Add WebSocketProvider stub
3993         https://bugs.webkit.org/show_bug.cgi?id=158702
3994
3995         Reviewed by Brady Eidson.
3996
3997         * WebKit2.xcodeproj/project.pbxproj:
3998         * WebProcess/Network/WebSocketProvider.h: Added.
3999         * WebProcess/WebPage/WebPage.cpp:
4000         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
4001
4002 2016-06-10  Ada Chan  <adachan@apple.com>
4003
4004         Use the video element's video box when getting the inline video rect in WebVideoFullscreenManager
4005         https://bugs.webkit.org/show_bug.cgi?id=158351
4006         <rdar://problem/26567938>
4007
4008         Reviewed by Darin Adler.
4009
4010         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
4011         (WebKit::inlineVideoFrame):
4012         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
4013         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
4014         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
4015         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
4016         (WebKit::clientRectForElement): Deleted.
4017
4018 2016-06-10  Benjamin Poulain  <bpoulain@apple.com>
4019
4020         Add support for passive event listeners on touch events
4021         https://bugs.webkit.org/show_bug.cgi?id=158601
4022
4023         Reviewed by Simon Fraser.
4024
4025