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