Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-08-02  Fujii Hironori  <Hironori.Fujii@sony.com>
2
3         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
4         https://bugs.webkit.org/show_bug.cgi?id=175010
5         <rdar://problem/33647818>
6
7         Reviewed by Alex Christensen.
8
9         * UIProcess/API/APIContentRuleListStore.cpp:
10         (API::ContentRuleListStore::compileContentRuleList):
11         Call QualifiedName::init().
12
13 2017-08-01  Chris Dumez  <cdumez@apple.com>
14
15         Add initial support for navigator.sendBeacon
16         https://bugs.webkit.org/show_bug.cgi?id=175007
17         <rdar://problem/33547728>
18
19         Reviewed by Sam Weinig.
20
21         Add experimental feature flag for the Beacon API, disabled by default.
22
23         * Shared/WebPreferencesDefinitions.h:
24         * WebProcess/InjectedBundle/InjectedBundle.cpp:
25         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
26         * WebProcess/WebPage/WebPage.cpp:
27         (WebKit::WebPage::updatePreferences):
28
29 2017-08-01  Filip Pizlo  <fpizlo@apple.com>
30
31         Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
32         https://bugs.webkit.org/show_bug.cgi?id=174727
33
34         Reviewed by Mark Lam.
35         
36         The WebProcess should never disable the Gigacage by allocating typed arrays outside the Gigacage. So,
37         we add a callback that crashes the process.
38
39         * WebProcess/WebProcess.cpp:
40         (WebKit::gigacageDisabled):
41         (WebKit::m_webSQLiteDatabaseTracker):
42
43 2017-08-01  Brian Burg  <bburg@apple.com>
44
45         Web Automation: add event to notify service when a page's main frame window object has cleared
46         https://bugs.webkit.org/show_bug.cgi?id=174987
47         <rdar://problem/36602634>
48
49         Reviewed by Carlos Garcia Campos.
50
51         * UIProcess/Automation/Automation.json: Add new event.
52
53         * UIProcess/Automation/WebAutomationSession.h:
54         * UIProcess/Automation/WebAutomationSession.cpp:
55         (WebKit::WebAutomationSession::navigationOccurredForFrame):
56         (WebKit::WebAutomationSession::willClosePage):
57         When a WebPage navigates or closes, send the browsingContextCleared event.
58         Any element handles for elements in the browsing context are no longer valid.
59
60         * UIProcess/WebPageProxy.cpp:
61         (WebKit::WebPageProxy::close):
62         Add a new hook into the active automation session so it is notified when a page closes.
63
64 2017-08-01  Brady Eidson  <beidson@apple.com>
65
66         API test URLSchemeHandler.Exceptions is Exiting out early on macOS Debug..
67         https://bugs.webkit.org/show_bug.cgi?id=175030
68
69         Reviewed by Andy Estes.
70
71         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
72         (WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Release the API wrapped on the next
73           spin of the runloop.
74
75 2017-08-01  Brady Eidson  <beidson@apple.com>
76
77         Part 2 of: Rename DatabaseProcess to StorageProcess.
78         https://bugs.webkit.org/show_bug.cgi?id=174880
79
80         Reviewed by Andy Estes.
81
82         Rename some more variables, classes, etc. to reflect the change.
83
84         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
85         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
86
87         * NetworkProcess/NetworkProcess.cpp:
88         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs):
89         (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs):
90         (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
91         (WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
92         * NetworkProcess/NetworkProcess.h:
93         * NetworkProcess/NetworkProcess.messages.in:
94
95         * Shared/ProcessExecutablePath.h:
96         * Shared/gtk/ProcessExecutablePathGtk.cpp:
97         (WebKit::executablePathOfStorageProcess):
98         (WebKit::executablePathOfDatabaseProcess): Deleted.
99         * Shared/wpe/ProcessExecutablePathWPE.cpp:
100         (WebKit::executablePathOfStorageProcess):
101         (WebKit::executablePathOfDatabaseProcess): Deleted.
102
103         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp:
104         (WebKit::WebIDBConnectionToClient::putOrAdd):
105
106         * StorageProcess/StorageProcess.cpp:
107         (WebKit::StorageProcess::initializeWebsiteDataStore):
108         (WebKit::StorageProcess::postStorageTask):
109         (WebKit::StorageProcess::performNextStorageTask):
110         (WebKit::StorageProcess::createStorageToWebProcessConnection):
111         (WebKit::StorageProcess::fetchWebsiteData):
112         (WebKit::StorageProcess::postDatabaseTask): Deleted.
113         (WebKit::StorageProcess::performNextDatabaseTask): Deleted.
114         (WebKit::StorageProcess::createDatabaseToWebProcessConnection): Deleted.
115         * StorageProcess/StorageProcess.h:
116         * StorageProcess/StorageProcess.messages.in:
117         * StorageProcess/mac/StorageProcessMac.mm:
118         (WebKit::StorageProcess::initializeProcessName):
119
120         * UIProcess/API/C/WKContext.cpp:
121         (WKContextGetDatabaseProcessIdentifier):
122
123         * UIProcess/API/Cocoa/WKProcessPool.mm:
124         (-[WKProcessPool _terminateStorageProcess]):
125         (-[WKProcessPool _storageProcessIdentifier]):
126         (-[WKProcessPool _terminateDatabaseProcess]): Deleted.
127         (-[WKProcessPool _databaseProcessIdentifier]): Deleted.
128         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
129
130         * UIProcess/ChildProcessProxy.cpp:
131         (WebKit::ChildProcessProxy::getLaunchOptions):
132
133         * UIProcess/Launcher/ProcessLauncher.h:
134         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
135         (WebKit::ProcessLauncher::launchProcess):
136         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
137         (WebKit::serviceName):
138         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
139         (WebKit::ProcessLauncher::launchProcess):
140
141         * UIProcess/Network/NetworkProcessProxy.cpp:
142         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
143         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
144         * UIProcess/Network/NetworkProcessProxy.h:
145         * UIProcess/Network/NetworkProcessProxy.messages.in:
146
147         * UIProcess/Storage/StorageProcessProxy.cpp:
148         (WebKit::StorageProcessProxy::getLaunchOptions):
149         (WebKit::StorageProcessProxy::getStorageProcessConnection):
150         (WebKit::StorageProcessProxy::didClose):
151         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
152         (WebKit::StorageProcessProxy::didFinishLaunching):
153         (WebKit::StorageProcessProxy::getDatabaseProcessConnection): Deleted.
154         (WebKit::StorageProcessProxy::didCreateDatabaseToWebProcessConnection): Deleted.
155         * UIProcess/Storage/StorageProcessProxy.h:
156         * UIProcess/Storage/StorageProcessProxy.messages.in:
157
158         * UIProcess/WebContextClient.cpp:
159         (WebKit::WebContextClient::storageProcessDidCrash):
160         (WebKit::WebContextClient::databaseProcessDidCrash): Deleted.
161         * UIProcess/WebContextClient.h:
162
163         * UIProcess/WebProcessPool.cpp:
164         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
165         (WebKit::WebProcessPool::getStorageProcessConnection):
166         (WebKit::WebProcessPool::storageProcessCrashed):
167         (WebKit::WebProcessPool::pageAddedToProcess):
168         (WebKit::WebProcessPool::storageProcessIdentifier):
169         (WebKit::WebProcessPool::terminateStorageProcess):
170         (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Deleted.
171         (WebKit::WebProcessPool::getDatabaseProcessConnection): Deleted.
172         (WebKit::WebProcessPool::databaseProcessCrashed): Deleted.
173         (WebKit::WebProcessPool::databaseProcessIdentifier): Deleted.
174         (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
175         * UIProcess/WebProcessPool.h:
176         (WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary):
177         (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): Deleted.
178
179         * UIProcess/WebProcessProxy.cpp:
180         (WebKit::WebProcessProxy::getStorageProcessConnection):
181         (WebKit::WebProcessProxy::getDatabaseProcessConnection): Deleted.
182         * UIProcess/WebProcessProxy.h:
183         * UIProcess/WebProcessProxy.messages.in:
184
185         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
186         (WebKit::WebsiteDataStore::fetchDataAndApply):
187         (WebKit::WebsiteDataStore::removeData):
188         (WebKit::WebsiteDataStore::storageProcessParameters):
189         (WebKit::WebsiteDataStore::databaseProcessParameters): Deleted.
190         * UIProcess/WebsiteData/WebsiteDataStore.h:
191
192         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
193         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
194         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
195
196         * WebProcess/Databases/WebDatabaseProvider.cpp:
197         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
198
199         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
200         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
201         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection):
202         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
203         (WebKit::WebToStorageProcessConnection::didClose):
204         (WebKit::WebToStorageProcessConnection::didReceiveInvalidMessage):
205         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
206         (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): Deleted.
207         (WebKit::WebToDatabaseProcessConnection::~WebToDatabaseProcessConnection): Deleted.
208         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
209         (WebKit::WebToDatabaseProcessConnection::didClose): Deleted.
210         (WebKit::WebToDatabaseProcessConnection::didReceiveInvalidMessage): Deleted.
211         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): Deleted.
212         * WebProcess/Storage/WebToStorageProcessConnection.h:
213         (WebKit::WebToStorageProcessConnection::create):
214         (WebKit::WebToDatabaseProcessConnection::create): Deleted.
215         (WebKit::WebToDatabaseProcessConnection::connection): Deleted.
216
217         * WebProcess/WebProcess.cpp:
218         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
219         (WebKit::WebProcess::webToStorageProcessConnection):
220         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
221         (WebKit::WebProcess::webToDatabaseProcessConnectionClosed): Deleted.
222         (WebKit::WebProcess::webToDatabaseProcessConnection): Deleted.
223         (WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Deleted.
224         * WebProcess/WebProcess.h:
225
226 2017-08-01  Brady Eidson  <beidson@apple.com>
227
228         Part 1 of: Rename DatabaseProcess to StorageProcess.
229         https://bugs.webkit.org/show_bug.cgi?id=174879
230
231         Reviewed by Andy Estes.
232
233         This patch is all about renaming source files and renaming the process itself (touching build system files, etc etc).
234
235         Some renaming in actual code did result (Some class/struct names, method names, etc)
236
237         Part 2 (174880) will go through and update all references in code itself from "Database" to "Storage"
238
239         * CMakeLists.txt:
240         * DerivedSources.make:
241         * PlatformGTK.cmake:
242         * PlatformMac.cmake:
243         * PlatformWPE.cmake:
244         * WebKit.xcodeproj/project.pbxproj:
245
246         * Configurations/StorageService.xcconfig: Renamed from Source/WebKit/Configurations/DatabaseService.xcconfig.
247         * StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist.
248         * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Renamed from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.
249
250         * Shared/Storage/StorageProcessCreationParameters.cpp: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.cpp.
251         * Shared/Storage/StorageProcessCreationParameters.h: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.h.
252
253         * StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm.
254         * StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
255
256         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp.
257         * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h.
258         * StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
259
260         * StorageProcess/StorageProcess.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.cpp.
261         * StorageProcess/StorageProcess.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.h.
262         * StorageProcess/StorageProcess.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.messages.in.
263
264         * StorageProcess/StorageToWebProcessConnection.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.cpp.
265         * StorageProcess/StorageToWebProcessConnection.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.h.
266         * StorageProcess/StorageToWebProcessConnection.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.messages.in.
267
268         * StorageProcess/gtk/StorageProcessMainGtk.cpp: Renamed from Source/WebKit/DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp.
269         * StorageProcess/ios/StorageProcessIOS.mm: Renamed from Source/WebKit/DatabaseProcess/ios/DatabaseProcessIOS.mm.
270         * StorageProcess/mac/StorageProcessMac.mm: Renamed from Source/WebKit/DatabaseProcess/mac/DatabaseProcessMac.mm.
271         * StorageProcess/unix/StorageProcessMainUnix.h: Renamed from Source/WebKit/DatabaseProcess/unix/DatabaseProcessMainUnix.h.
272         * UIProcess/Network/NetworkProcessProxy.cpp:
273
274         * UIProcess/Storage/StorageProcessProxy.cpp: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.cpp.
275         * UIProcess/Storage/StorageProcessProxy.h: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.h.
276         * UIProcess/Storage/StorageProcessProxy.messages.in: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.messages.in.
277
278         * UIProcess/WebContextSupplement.h:
279         * UIProcess/WebProcessPool.cpp:
280         * UIProcess/WebProcessPool.h:
281         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
282         * UIProcess/WebsiteData/WebsiteDataStore.h:
283         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
284         * WebProcess/Databases/WebDatabaseProvider.cpp:
285
286         * WebProcess/Storage/WebToStorageProcessConnection.cpp: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.cpp.
287         * WebProcess/Storage/WebToStorageProcessConnection.h: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.h.
288
289         * WebProcess/WebProcess.cpp:
290
291 2017-08-01  Michael Catanzaro  <mcatanzaro@igalia.com>
292
293         [CMake] WebKitFS.cmake depends on options set in Option cmake files that are included later
294         https://bugs.webkit.org/show_bug.cgi?id=174855
295
296         Reviewed by Carlos Garcia Campos.
297
298         Don't create derived sources directory here anymore.
299
300         * PlatformGTK.cmake:
301         * PlatformMac.cmake:
302         * PlatformWPE.cmake:
303
304 2017-07-31  Daniel Bates  <dabates@apple.com>
305
306         WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() may not be able to
307         determine page that initiated navigation
308         https://bugs.webkit.org/show_bug.cgi?id=174531
309
310         Remove a comment from WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
311         about determining the originating page independently from the originating frame. There
312         does not seem to be much value to fixing this. We can always revisit this issue if we
313         discover a strong motivating example. See <https://bugs.webkit.org/show_bug.cgi?id=174531#c1>
314         for more details.
315
316         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
317         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
318
319 2017-07-31  Sam Weinig  <sam@webkit.org>
320
321         Remove unnecessary exceptions from storage code
322         https://bugs.webkit.org/show_bug.cgi?id=174572
323
324         Reviewed by Chris Dumez.
325
326         * WebProcess/Storage/StorageAreaImpl.cpp:
327         (WebKit::StorageAreaImpl::canAccessStorage): Deleted.
328         * WebProcess/Storage/StorageAreaImpl.h:
329         * WebProcess/Storage/StorageNamespaceImpl.cpp:
330         Remove canAccessStorage. It is no longer called.
331
332 2017-07-30  Brady Eidson  <beidson@apple.com>
333
334         Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
335         https://bugs.webkit.org/show_bug.cgi?id=174958
336
337         Reviewed by Darin Adler.
338
339         * UIProcess/API/APIURLSchemeTask.h:
340
341         * UIProcess/API/C/WKTestingSupport.cpp:
342         (WKGetAPIURLSchemeTaskInstanceCount):
343         (WKGetWebURLSchemeTaskInstanceCount):
344         * UIProcess/API/C/WKTestingSupport.h:
345
346         * UIProcess/WebURLSchemeTask.h:
347
348         * WebKit.xcodeproj/project.pbxproj:
349
350 2017-07-29  Yusuke Suzuki  <utatane.tea@gmail.com>
351
352         Unreviewed, build fix for GTK and WPE about StorageProcess renaming
353
354         * CMakeLists.txt:
355         * PlatformGTK.cmake:
356         * PlatformMac.cmake:
357         * PlatformWPE.cmake:
358
359 2017-07-28  Brent Fulgham  <bfulgham@apple.com>
360
361         [Mac][WebKit2] WebKit sandbox errors while streaming Netflix
362         https://bugs.webkit.org/show_bug.cgi?id=174955
363         <rdar://problem/33583994>
364
365         Reviewed by Alex Christensen.
366
367         Wider testing with the stricter sandboxing rules identified three more IOKit properties we need to expose:
368         - CEAModeID
369         - CEAPixelRepetition
370         - IOFBHDMIDongleROM
371
372         * WebProcess/com.apple.WebProcess.sb.in:
373
374 2017-07-28  Commit Queue  <commit-queue@webkit.org>
375
376         Unreviewed, rolling out r219986.
377         https://bugs.webkit.org/show_bug.cgi?id=174962
378
379         "broke PLT on iOS (rdar://problem/33602751)" (Requested by
380         estes on #webkit).
381
382         Reverted changeset:
383
384         "Part 1 of: Rename DatabaseProcess to StorageProcess."
385         https://bugs.webkit.org/show_bug.cgi?id=174879
386         http://trac.webkit.org/changeset/219986
387
388 2017-07-28  Commit Queue  <commit-queue@webkit.org>
389
390         Unreviewed, rolling out r219990.
391         https://bugs.webkit.org/show_bug.cgi?id=174961
392
393         "broke PLT on iOS (rdar://problem/33602751)" (Requested by
394         estes on #webkit).
395
396         Reverted changeset:
397
398         "Part 2 of: Rename DatabaseProcess to StorageProcess."
399         https://bugs.webkit.org/show_bug.cgi?id=174880
400         http://trac.webkit.org/changeset/219990
401
402 2017-07-28  Brady Eidson  <beidson@apple.com>
403
404         API tests that use URLSchemeHandler are failing.
405         https://bugs.webkit.org/show_bug.cgi?id=174950
406
407         Reviewed by Alex Christensen.
408
409         Make sure that in all cases where we remove the last task from the page->task map...
410         ...We also remove the map itself.
411
412         * UIProcess/WebURLSchemeHandler.cpp:
413         (WebKit::WebURLSchemeHandler::stopTask):
414         (WebKit::WebURLSchemeHandler::taskCompleted):
415         (WebKit::WebURLSchemeHandler::removeTaskFromPageMap):
416         * UIProcess/WebURLSchemeHandler.h:
417
418 2017-07-28  Brady Eidson  <beidson@apple.com>
419
420         WKURLSchemeTaskImpl instances are being abandoned (except if the task is stopped).
421         <rdar://problem/33568276> and https://bugs.webkit.org/show_bug.cgi?id=174895
422
423         Reviewed by Alex Christensen.
424
425         There was a lot going on here:
426         - There was an unbroken cycle between URLSchemeHandlers and URLSchemeTasks 
427         - WKURLSchemeTasks were not destroying their API::URLSchemeTask implementation object
428         - When a WKWebView was dealloc'ed, it was not cleaning up the related UIProcess tasks
429         - If the NetworkingProcess crashed, WebProcesses were not cleaning up their tasks
430           (and therefore the UIProcess tasks were also not getting cleaned up)
431         - If a WebProcess crashed, the UIProcess was not cleaning up the related tasks
432         
433         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
434         (-[WKURLSchemeTaskImpl dealloc]): Call API::~URLSchemeTask
435         
436         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
437         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
438         (WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Clear out the API wrapper map
439           so the wrapper and implementation object can both be destroyed.
440         
441         * UIProcess/WebPageProxy.cpp:
442         (WebKit::WebPageProxy::close): Call stopAllURLSchemeTasks.
443         (WebKit::WebPageProxy::processDidTerminate): Call stopAllURLSchemeTasks.
444         (WebKit::WebPageProxy::stopAllURLSchemeTasks):
445         * UIProcess/WebPageProxy.h:
446         
447         * UIProcess/WebURLSchemeHandler.cpp:
448         (WebKit::WebURLSchemeHandler::startTask):
449         (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
450         (WebKit::WebURLSchemeHandler::stopTask):
451         (WebKit::WebURLSchemeHandler::taskCompleted):
452         * UIProcess/WebURLSchemeHandler.h:
453         
454         * UIProcess/WebURLSchemeTask.cpp:
455         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
456         * UIProcess/WebURLSchemeTask.h:
457         (WebKit::WebURLSchemeTask::pageID): Store separate from the WebPage so messaging
458           is possible even after the WebPage* has been cleared.
459         
460         * WebProcess/WebPage/WebPage.cpp:
461         (WebKit::WebPage::stopAllURLSchemeTasks):
462         * WebProcess/WebPage/WebPage.h:
463         
464         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
465         (WebKit::WebURLSchemeHandlerProxy::stopAllTasks):
466         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
467         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
468         (WebKit::WebURLSchemeHandlerProxy::removeTask):
469         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
470         
471         * WebProcess/WebProcess.cpp:
472         (WebKit::WebProcess::networkProcessConnectionClosed): Call stopAllURLSchemeTasks 
473           for each WebPage.
474
475 2017-07-28  Frederic Wang  <fwang@igalia.cpm>
476
477         Fix typo in scrollPositionChangedViaDelegatedScrolling
478         https://bugs.webkit.org/show_bug.cgi?id=174937
479
480         Reviewed by Wenson Hsieh.
481
482         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
483         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
484         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
485
486 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
487
488         Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
489         https://bugs.webkit.org/show_bug.cgi?id=174437
490
491         Reviewed by Darin Adler.
492
493         Remove redundant Web- prefix from classes in WebKit namespace.
494
495         * DerivedSources.make:
496         * UIProcess/API/Cocoa/WKWebView.mm:
497         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h.
498         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in.
499         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: Added.
500         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h.
501         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in.
502         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm.
503         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Removed.
504         * UIProcess/Cocoa/WebViewImpl.mm:
505         (WebKit::WebViewImpl::updateMediaTouchBar):
506         * UIProcess/WebPageProxy.cpp:
507         (WebKit::m_weakPtrFactory):
508         (WebKit::WebPageProxy::reattachToWebProcess):
509         (WebKit::WebPageProxy::playbackSessionManager):
510         (WebKit::WebPageProxy::videoFullscreenManager):
511         * UIProcess/WebPageProxy.h:
512         * UIProcess/ios/WebPageProxyIOS.mm:
513         * WebKit.xcodeproj/project.pbxproj:
514         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
515         * WebProcess/WebPage/WebPage.cpp:
516         (WebKit::WebPage::playbackSessionManager):
517         (WebKit::WebPage::videoFullscreenManager):
518         * WebProcess/WebPage/WebPage.h:
519         * WebProcess/cocoa/PlaybackSessionManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.h.
520         * WebProcess/cocoa/PlaybackSessionManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.messages.in.
521         * WebProcess/cocoa/PlaybackSessionManager.mm: Added.
522         * WebProcess/cocoa/VideoFullscreenManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.h.
523         (WebKit::VideoFullscreenInterfaceContext::create):
524         * WebProcess/cocoa/VideoFullscreenManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.messages.in.
525         * WebProcess/cocoa/VideoFullscreenManager.mm: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.mm.
526         * WebProcess/cocoa/WebPlaybackSessionManager.mm: Removed.
527
528 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
529
530         [CMake] Re-add the StorageProcess executable target
531         https://bugs.webkit.org/show_bug.cgi?id=174929
532
533         Reviewed by Carlos Garcia Campos.
534
535         Re-add the StorageProcess executable target that was removed in r219960.
536         Back then it was still named DatabaseProcess, but the name changed in
537         the following patches.
538
539         * CMakeLists.txt:
540
541 2017-07-27  Brady Eidson  <beidson@apple.com>
542
543         Part 2 of: Rename DatabaseProcess to StorageProcess.
544         https://bugs.webkit.org/show_bug.cgi?id=174880
545
546         Reviewed by Andy Estes.
547
548         Rename some more variables, classes, etc. to reflect the change.
549
550         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
551         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
552
553         * NetworkProcess/NetworkProcess.cpp:
554         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs):
555         (WebKit::NetworkProcess::didgrantSandboxExtensionsToStorageProcessForBlobs):
556         (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
557         (WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
558         * NetworkProcess/NetworkProcess.h:
559         * NetworkProcess/NetworkProcess.messages.in:
560
561         * Shared/ProcessExecutablePath.h:
562         * Shared/gtk/ProcessExecutablePathGtk.cpp:
563         (WebKit::executablePathOfStorageProcess):
564         (WebKit::executablePathOfDatabaseProcess): Deleted.
565         * Shared/wpe/ProcessExecutablePathWPE.cpp:
566         (WebKit::executablePathOfStorageProcess):
567         (WebKit::executablePathOfDatabaseProcess): Deleted.
568
569         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp:
570         (WebKit::WebIDBConnectionToClient::putOrAdd):
571
572         * StorageProcess/StorageProcess.cpp:
573         (WebKit::StorageProcess::initializeWebsiteDataStore):
574         (WebKit::StorageProcess::postStorageTask):
575         (WebKit::StorageProcess::performNextStorageTask):
576         (WebKit::StorageProcess::createStorageToWebProcessConnection):
577         (WebKit::StorageProcess::fetchWebsiteData):
578         (WebKit::StorageProcess::postDatabaseTask): Deleted.
579         (WebKit::StorageProcess::performNextDatabaseTask): Deleted.
580         (WebKit::StorageProcess::createDatabaseToWebProcessConnection): Deleted.
581         * StorageProcess/StorageProcess.h:
582         * StorageProcess/StorageProcess.messages.in:
583         * StorageProcess/mac/StorageProcessMac.mm:
584         (WebKit::StorageProcess::initializeProcessName):
585
586         * UIProcess/API/C/WKContext.cpp:
587         (WKContextGetDatabaseProcessIdentifier):
588
589         * UIProcess/API/Cocoa/WKProcessPool.mm:
590         (-[WKProcessPool _terminateStorageProcess]):
591         (-[WKProcessPool _storageProcessIdentifier]):
592         (-[WKProcessPool _terminateDatabaseProcess]): Deleted.
593         (-[WKProcessPool _databaseProcessIdentifier]): Deleted.
594         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
595
596         * UIProcess/Launcher/ProcessLauncher.h:
597         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
598         (WebKit::ProcessLauncher::launchProcess):
599         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
600         (WebKit::serviceName):
601         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
602         (WebKit::ProcessLauncher::launchProcess):
603
604         * UIProcess/Network/NetworkProcessProxy.cpp:
605         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
606         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
607         * UIProcess/Network/NetworkProcessProxy.h:
608         * UIProcess/Network/NetworkProcessProxy.messages.in:
609
610         * UIProcess/Storage/StorageProcessProxy.cpp:
611         (WebKit::StorageProcessProxy::getLaunchOptions):
612         (WebKit::StorageProcessProxy::getStorageProcessConnection):
613         (WebKit::StorageProcessProxy::didClose):
614         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
615         (WebKit::StorageProcessProxy::didFinishLaunching):
616         (WebKit::StorageProcessProxy::getDatabaseProcessConnection): Deleted.
617         (WebKit::StorageProcessProxy::didCreateDatabaseToWebProcessConnection): Deleted.
618         * UIProcess/Storage/StorageProcessProxy.h:
619         * UIProcess/Storage/StorageProcessProxy.messages.in:
620
621         * UIProcess/WebContextClient.cpp:
622         (WebKit::WebContextClient::storageProcessDidCrash):
623         (WebKit::WebContextClient::databaseProcessDidCrash): Deleted.
624         * UIProcess/WebContextClient.h:
625
626         * UIProcess/WebProcessPool.cpp:
627         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
628         (WebKit::WebProcessPool::getStorageProcessConnection):
629         (WebKit::WebProcessPool::storageProcessCrashed):
630         (WebKit::WebProcessPool::pageAddedToProcess):
631         (WebKit::WebProcessPool::storageProcessIdentifier):
632         (WebKit::WebProcessPool::terminateStorageProcess):
633         (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Deleted.
634         (WebKit::WebProcessPool::getDatabaseProcessConnection): Deleted.
635         (WebKit::WebProcessPool::databaseProcessCrashed): Deleted.
636         (WebKit::WebProcessPool::databaseProcessIdentifier): Deleted.
637         (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
638         * UIProcess/WebProcessPool.h:
639         (WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary):
640         (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): Deleted.
641
642         * UIProcess/WebProcessProxy.cpp:
643         (WebKit::WebProcessProxy::getStorageProcessConnection):
644         (WebKit::WebProcessProxy::getDatabaseProcessConnection): Deleted.
645         * UIProcess/WebProcessProxy.h:
646         * UIProcess/WebProcessProxy.messages.in:
647
648         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
649         (WebKit::WebsiteDataStore::fetchDataAndApply):
650         (WebKit::WebsiteDataStore::removeData):
651         (WebKit::WebsiteDataStore::storageProcessParameters):
652         (WebKit::WebsiteDataStore::databaseProcessParameters): Deleted.
653         * UIProcess/WebsiteData/WebsiteDataStore.h:
654
655         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
656         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
657         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
658
659         * WebProcess/Databases/WebDatabaseProvider.cpp:
660         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
661
662         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
663         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
664         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection):
665         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
666         (WebKit::WebToStorageProcessConnection::didClose):
667         (WebKit::WebToStorageProcessConnection::didReceiveInvalidMessage):
668         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
669         (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): Deleted.
670         (WebKit::WebToDatabaseProcessConnection::~WebToDatabaseProcessConnection): Deleted.
671         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
672         (WebKit::WebToDatabaseProcessConnection::didClose): Deleted.
673         (WebKit::WebToDatabaseProcessConnection::didReceiveInvalidMessage): Deleted.
674         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): Deleted.
675         * WebProcess/Storage/WebToStorageProcessConnection.h:
676         (WebKit::WebToStorageProcessConnection::create):
677         (WebKit::WebToDatabaseProcessConnection::create): Deleted.
678         (WebKit::WebToDatabaseProcessConnection::connection): Deleted.
679
680         * WebProcess/WebProcess.cpp:
681         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
682         (WebKit::WebProcess::webToStorageProcessConnection):
683         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
684         (WebKit::WebProcess::webToDatabaseProcessConnectionClosed): Deleted.
685         (WebKit::WebProcess::webToDatabaseProcessConnection): Deleted.
686         (WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Deleted.
687         * WebProcess/WebProcess.h:
688
689 2017-07-27  Nan Wang  <n_wang@apple.com>
690
691         AX: A11Y: Zoom no longer follows keyboard insertion point in safari
692         https://bugs.webkit.org/show_bug.cgi?id=174869
693
694         Reviewed by David Kilzer.
695
696         There was a recent change by denying XPC services access by default. 
697         In UAZoomChangeFocus we need to send message to HIServices, so let's
698         allow the connection to XPC services for that. 
699
700         * WebProcess/com.apple.WebProcess.sb.in:
701
702 2017-07-27  Brady Eidson  <beidson@apple.com>
703
704         Part 1 of: Rename DatabaseProcess to StorageProcess.
705         https://bugs.webkit.org/show_bug.cgi?id=174879
706
707         Reviewed by Andy Estes.
708
709         This patch is all about renaming source files and renaming the process itself (touching build system files, etc etc).
710
711         Some renaming in actual code did result (Some class/struct names, method names, etc)
712
713         Part 2 (174880) will go through and update all references in code itself from "Database" to "Storage"
714
715         * CMakeLists.txt:
716         * Configurations/Storage-iOS.entitlements: Renamed from Source/WebKit/Configurations/Databases-iOS.entitlements.
717         * Configurations/StorageService.xcconfig: Renamed from Source/WebKit/Configurations/DatabaseService.xcconfig.
718         * Configurations/WebKit.xcconfig:
719         * DerivedSources.make:
720         * Platform/ExtraPrivateSymbolsForTAPI.h:
721         * PlatformGTK.cmake:
722         * PlatformMac.cmake:
723         * PlatformWPE.cmake:
724
725         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Renamed from Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.
726
727         * Shared/Storage/StorageProcessCreationParameters.cpp: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.cpp.
728         (WebKit::StorageProcessCreationParameters::StorageProcessCreationParameters):
729         (WebKit::StorageProcessCreationParameters::encode):
730         (WebKit::StorageProcessCreationParameters::decode):
731         * Shared/Storage/StorageProcessCreationParameters.h: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.h.
732
733         * StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist.
734         * StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm.
735         (StorageServiceInitializer):
736         * StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
737         (main):
738
739         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp.
740         * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h.
741         * StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
742         
743         * StorageProcess/StorageProcess.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.cpp.
744         * StorageProcess/StorageProcess.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.h.
745         * StorageProcess/StorageProcess.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.messages.in.
746
747         * StorageProcess/StorageToWebProcessConnection.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.cpp.
748         * StorageProcess/StorageToWebProcessConnection.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.h.
749         * StorageProcess/StorageToWebProcessConnection.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.messages.in.
750
751         * StorageProcess/gtk/StorageProcessMainGtk.cpp: Renamed from Source/WebKit/DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp.
752         (WebKit::StorageProcessMainUnix):
753         * StorageProcess/ios/StorageProcessIOS.mm: Renamed from Source/WebKit/DatabaseProcess/ios/DatabaseProcessIOS.mm.
754         (WebKit::StorageProcess::initializeProcess):
755         (WebKit::StorageProcess::initializeProcessName):
756         (WebKit::StorageProcess::initializeSandbox):
757         * StorageProcess/mac/StorageProcessMac.mm: Renamed from Source/WebKit/DatabaseProcess/mac/DatabaseProcessMac.mm.
758         (WebKit::StorageProcess::initializeProcess):
759         (WebKit::StorageProcess::initializeProcessName):
760         (WebKit::StorageProcess::initializeSandbox):
761
762         * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Copied from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.
763         * StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Renamed from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.
764
765         * StorageProcess/unix/StorageProcessMainUnix.h: Renamed from Source/WebKit/DatabaseProcess/unix/DatabaseProcessMainUnix.h.
766
767         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
768         (WebKit::serviceName):
769
770         * UIProcess/Network/NetworkProcessProxy.cpp:
771         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
772
773         * UIProcess/Storage/StorageProcessProxy.cpp: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.cpp.
774         * UIProcess/Storage/StorageProcessProxy.h: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.h.
775         * UIProcess/Storage/StorageProcessProxy.messages.in: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.messages.in.
776
777         * UIProcess/WebContextSupplement.h:
778         (WebKit::WebContextSupplement::processDidClose):
779
780         * UIProcess/WebProcessPool.cpp:
781         (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore):
782         (WebKit::WebProcessPool::databaseProcessCrashed):
783         (WebKit::WebProcessPool::pageAddedToProcess):
784         * UIProcess/WebProcessPool.h:
785
786         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
787         (WebKit::WebsiteDataStore::databaseProcessParameters):
788         * UIProcess/WebsiteData/WebsiteDataStore.h:
789
790         * WebKit.xcodeproj/project.pbxproj:
791
792         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
793         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
794         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
795         * WebProcess/Databases/WebDatabaseProvider.cpp:
796
797         * WebProcess/Storage/WebToStorageProcessConnection.cpp: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.cpp.
798         * WebProcess/Storage/WebToStorageProcessConnection.h: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.h.
799
800         * WebProcess/WebProcess.cpp:
801
802 2017-07-27  Tim Horton  <timothy_horton@apple.com>
803
804         PDF page number indicator is very flashy when scrolling
805         https://bugs.webkit.org/show_bug.cgi?id=174882
806         <rdar://problem/23760981>
807
808         Reviewed by Andy Estes.
809
810         * Platform/spi/ios/UIKitSPI.h:
811         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
812         (-[WKPDFPageNumberIndicator initWithFrame:]):
813         Increase the backdrop rendering resolution to reduce flashiness.
814         It's still not perfect, but it's quite visibly better.
815
816 2017-07-26  Brady Eidson  <beidson@apple.com>
817
818         ResourceLoadStatistics API tests fail on El Capitan.
819         https://bugs.webkit.org/show_bug.cgi?id=174877
820
821         Reviewed by Chris Dumez.
822
823         Always install the testing callback.
824
825         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
826         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
827
828 2017-07-26  Tim Horton  <timothy_horton@apple.com>
829
830         REGRESSION (r211160): Can't pinch to zoom unlocked encrypted PDFs in WKWebView
831         https://bugs.webkit.org/show_bug.cgi?id=174881
832         <rdar://problem/33556312>
833
834         Reviewed by Andy Estes.
835
836         * UIProcess/API/Cocoa/WKWebView.mm:
837         (-[WKWebView _hidePasswordView]):
838         WKPasswordView saves and restores a bunch of scroll view properties, including
839         those relating to zoom limits. The restoration happens in -[WKPasswordView hide],
840         which is never called. Instead, the code added in r211160 just calls
841         removeFromSuperview after unlocking, never restoring the old zoom limits,
842         causing the then fully unlocked PDF to not be zoomable. Fix this by calling
843         -hide instead of -removeFromSuperview (which -hide also calls).
844
845 2017-07-26  Brady Eidson  <beidson@apple.com>
846
847         Rename {Web/UI}Process/Storage to {Web/UI}Process/WebStorage.
848         https://bugs.webkit.org/show_bug.cgi?id=174871
849
850         Reviewed by Chris Dumez.
851
852         The standard these directories help implement is the "Web Storage" standard.
853         "Storage" is too general of a word that we have plans to start using in other contexts soon.
854
855         * CMakeLists.txt:
856         * DerivedSources.make:
857         * PlatformGTK.cmake:
858         * PlatformMac.cmake:
859         * PlatformWPE.cmake:
860         * WebKit.xcodeproj/project.pbxproj:
861
862         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: Renamed from Source/WebKit/UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp.
863         * UIProcess/ResourceLoadStatisticsPersistentStorage.h: Renamed from Source/WebKit/UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h.
864         * UIProcess/WebStorage/LocalStorageDatabase.cpp: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabase.cpp.
865         * UIProcess/WebStorage/LocalStorageDatabase.h: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabase.h.
866         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabaseTracker.cpp.
867         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabaseTracker.h.
868         * UIProcess/WebStorage/StorageManager.cpp: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.cpp.
869         * UIProcess/WebStorage/StorageManager.h: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.h.
870         * UIProcess/WebStorage/StorageManager.messages.in: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.messages.in.
871         * UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm: Renamed from Source/WebKit/UIProcess/Storage/ios/LocalStorageDatabaseTrackerIOS.mm.
872         * UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Renamed from Source/WebKit/UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm.
873
874         * WebProcess/WebStorage/StorageAreaImpl.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaImpl.cpp.
875         * WebProcess/WebStorage/StorageAreaImpl.h: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaImpl.h.
876         * WebProcess/WebStorage/StorageAreaMap.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.cpp.
877         * WebProcess/WebStorage/StorageAreaMap.h: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.h.
878         * WebProcess/WebStorage/StorageAreaMap.messages.in: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.messages.in.
879         * WebProcess/WebStorage/StorageNamespaceImpl.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageNamespaceImpl.cpp.
880         * WebProcess/WebStorage/StorageNamespaceImpl.h: Renamed from Source/WebKit/WebProcess/Storage/StorageNamespaceImpl.h.
881         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp: Renamed from Source/WebKit/WebProcess/Storage/WebStorageNamespaceProvider.cpp.
882         * WebProcess/WebStorage/WebStorageNamespaceProvider.h: Renamed from Source/WebKit/WebProcess/Storage/WebStorageNamespaceProvider.h.
883
884 2017-07-26  Brady Eidson  <beidson@apple.com>
885
886         Remove DATABASE_PROCESS build flag.
887         https://bugs.webkit.org/show_bug.cgi?id=174868
888
889         Reviewed by Andy Estes.
890
891         * CMakeLists.txt:
892         * DatabaseProcess/DatabaseProcess.cpp:
893         * DatabaseProcess/DatabaseProcess.h:
894         * DatabaseProcess/DatabaseProcess.messages.in:
895         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
896         * DatabaseProcess/DatabaseToWebProcessConnection.h:
897         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
898         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
899         * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp:
900         * DatabaseProcess/ios/DatabaseProcessIOS.mm:
901         * DatabaseProcess/mac/DatabaseProcessMac.mm:
902         * DatabaseProcess/unix/DatabaseProcessMainUnix.h:
903         * Shared/Databases/DatabaseProcessCreationParameters.cpp:
904         * Shared/Databases/DatabaseProcessCreationParameters.h:
905         * Shared/ProcessExecutablePath.h:
906         * Shared/gtk/ProcessExecutablePathGtk.cpp:
907         (WebKit::executablePathOfDatabaseProcess):
908         * Shared/wpe/ProcessExecutablePathWPE.cpp:
909         (WebKit::executablePathOfDatabaseProcess):
910         * UIProcess/ChildProcessProxy.cpp:
911         (WebKit::ChildProcessProxy::getLaunchOptions):
912         * UIProcess/Databases/DatabaseProcessProxy.cpp:
913         * UIProcess/Databases/DatabaseProcessProxy.h:
914         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
915         * UIProcess/Launcher/ProcessLauncher.h:
916         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
917         (WebKit::ProcessLauncher::launchProcess):
918         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
919         (WebKit::serviceName):
920         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
921         (WebKit::ProcessLauncher::launchProcess):
922         * UIProcess/Network/NetworkProcessProxy.cpp:
923         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
924         * UIProcess/WebProcessPool.cpp:
925         (WebKit::WebProcessPool::databaseProcessCrashed):
926         (WebKit::WebProcessPool::databaseProcessIdentifier):
927         (WebKit::WebProcessPool::terminateDatabaseProcess):
928         * UIProcess/WebProcessPool.h:
929         (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary):
930         * UIProcess/WebProcessProxy.cpp:
931         (WebKit::WebProcessProxy::getDatabaseProcessConnection):
932         * UIProcess/WebProcessProxy.h:
933         * UIProcess/WebProcessProxy.messages.in:
934         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
935         (WebKit::WebsiteDataStore::fetchDataAndApply):
936         (WebKit::WebsiteDataStore::removeData):
937         * WebKit2Prefix.h:
938         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
939         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
940         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
941         * WebProcess/WebProcess.cpp:
942         * WebProcess/WebProcess.h:
943
944 2017-07-26  Brady Eidson  <beidson@apple.com>
945
946         Add test to verify certain child processes are not launched as a side effect of enabling ResourceLoadStatistics.
947         https://bugs.webkit.org/show_bug.cgi?id=174851
948
949         Reviewed by Chris Dumez.
950
951         * UIProcess/API/Cocoa/WKProcessPool.mm:
952         (-[WKProcessPool _databaseProcessIdentifier]):
953         (-[WKProcessPool _pluginProcessCount]):
954         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
955
956         * UIProcess/Plugins/PluginProcessManager.h:
957         (WebKit::PluginProcessManager::pluginProcesses):
958
959 2017-07-26  Brian Burg  <bburg@apple.com>
960
961         Remove WEB_TIMING feature flag
962         https://bugs.webkit.org/show_bug.cgi?id=174795
963
964         Reviewed by Alex Christensen.
965
966         * Configurations/FeatureDefines.xcconfig:
967         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
968         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
969         (WebKit::NetworkDataTaskSoup::createRequest):
970         (WebKit::NetworkDataTaskSoup::didSendRequest):
971         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
972         (WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
973         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
974         (WebKit::NetworkDataTaskSoup::didGetHeaders):
975         (WebKit::NetworkDataTaskSoup::didRestart):
976         * NetworkProcess/soup/NetworkDataTaskSoup.h:
977
978 2017-07-26  Brian Burg  <bburg@apple.com>
979
980         Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process
981         https://bugs.webkit.org/show_bug.cgi?id=174828
982
983         Reviewed by Tim Horton.
984
985         In the previous change I forgot to hoist the HandleArray and message-send out of the
986         loop, so the code wasn't actually sending fewer messages. That's fixed now.
987
988         * UIProcess/WebPageProxy.cpp:
989         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
990         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
991
992 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
993
994         Unreviewed. Fix a compiler warning that springs up when
995         building the WPE port with Clang.
996
997         * UIProcess/API/wpe/ScrollGestureController.h:
998         Let ScrollGestureController be a class, and not a struct.
999         This fits the usual pattern, and also matches the forward
1000         declaration used in WPE's PageClientImpl.h.
1001
1002 2017-07-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1003
1004         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.5 release.
1005
1006         * gtk/NEWS: Add release notes for 2.17.5.
1007
1008 2017-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1009
1010         Icon loader error on startup
1011         https://bugs.webkit.org/show_bug.cgi?id=174787
1012
1013         Reviewed by Brady Eidson.
1014
1015         Ignore non HTTP favicons in glib API.
1016
1017         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
1018
1019 2017-07-25  Brady Eidson  <beidson@apple.com>
1020
1021         ResourceLoadStatistics grandfathering happens much too often.
1022         <rdar://problem/32655834> and https://bugs.webkit.org/show_bug.cgi?id=174825
1023
1024         Reviewed by Chris Dumez.
1025
1026         The ResourceLoadStatistics grandfathering procedure happens too often.
1027         - With an empty memory store, even though an empty memory store is a perfectly valid state.
1028         - On each launch, even if grandfathering happened on the last launch - because grandfathering
1029           data would not automatically be saved to disk.
1030         - After clearing all website data, at which point no grandfathering can possibly be relevant
1031           because there is no data to grandfather.
1032
1033         This patch fixes those cases and adds API tests to verify they remain fixed.
1034
1035         * Shared/WebsiteData/WebsiteDataType.h:
1036
1037         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1038         (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): allWebsiteDataTypes, but even with the private ones.
1039         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): If the types being cleared cover all of 
1040           the types that ResourceLoadStatistics care about, don't grandfather afterwards.
1041         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Ditto.
1042         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
1043         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1044
1045         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
1046         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): Don't grandfather if the store read from 
1047           disk is empty (as being empty is perfectly fine), and also log the event of "populated without grandfathering".
1048         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
1049
1050         * UIProcess/WebProcessProxy.cpp:
1051         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
1052
1053         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1054         (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):
1055         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1056         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
1057         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): 
1058         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Schedule a write right away so we don't re-grandfather
1059           on next launch, and also log the grandfathering event.
1060         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): Takes a ShouldGrandfather flag
1061           to tell whether or not data should be re-grandfathered after the store is cleared.
1062         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent): Log the event to the testing client.
1063         (WebKit::dataTypesToRemove): Deleted.
1064         * UIProcess/WebResourceLoadStatisticsStore.h:
1065
1066         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1067         (WebKit::WebsiteDataStore::removeData):
1068         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
1069         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Handles enabling ResourceLoadStatistics both
1070           with and without a testing callback.
1071         * UIProcess/WebsiteData/WebsiteDataStore.h:
1072
1073 2017-07-25  Andy Estes  <aestes@apple.com>
1074
1075         [Apple Pay] Add "carteBancaire" as a supported payment network
1076         https://bugs.webkit.org/show_bug.cgi?id=174841
1077         <rdar://problem/31935596>
1078
1079         Reviewed by Alex Christensen.
1080
1081         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1082         (WebKit::toSupportedNetwork):
1083
1084 2017-07-25  Brian Burg  <bburg@apple.com>
1085
1086         Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process
1087         https://bugs.webkit.org/show_bug.cgi?id=174828
1088
1089         Reviewed by Tim Horton.
1090
1091         Send all of the sandbox extension handles in a single message, rather than
1092         one message per extension. Update message name and parameter types to match.
1093
1094         * UIProcess/WebPageProxy.cpp:
1095         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
1096         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
1097         * WebProcess/WebPage/WebPage.cpp:
1098         (WebKit::WebPage::extendSandboxForFilesFromOpenPanel):
1099         (WebKit::WebPage::extendSandboxForFileFromOpenPanel): Deleted.
1100         * WebProcess/WebPage/WebPage.h:
1101         * WebProcess/WebPage/WebPage.messages.in:
1102
1103 2017-07-25  Alex Christensen  <achristensen@webkit.org>
1104
1105         Fix API tests after r219871.
1106         https://bugs.webkit.org/show_bug.cgi?id=174807
1107
1108         WebKit2.OpenAndCloseWindowAsync and WebKit2.OpenAsyncWithNil API tests are fixed.
1109
1110         * UIProcess/WebPageProxy.cpp:
1111         (WebKit::WebPageProxy::createNewPage):
1112         createNewPageAsync or createNewPage should be called, not both.
1113
1114 2017-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
1115
1116         Async image decoding for large images should be disabled after the first time a tile is painted
1117         https://bugs.webkit.org/show_bug.cgi?id=174451
1118         <rdar://problem/31246421>
1119
1120         Reviewed by Simon Fraser.
1121
1122         * Shared/mac/RemoteLayerBackingStore.mm:
1123         (WebKit::RemoteLayerBackingStore::drawInContext):
1124         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1125         (WebKit::imageForRect):
1126         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1127         (WebKit::InjectedBundleRangeHandle::renderedImage):
1128         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1129         (WebKit::CompositingCoordinator::paintContents):
1130         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1131
1132 2017-07-25  Brian Burg  <bburg@apple.com>
1133
1134         Web Automation: add support for uploading files
1135         https://bugs.webkit.org/show_bug.cgi?id=174797
1136         <rdar://problem/28485063>
1137
1138         Reviewed by Joseph Pecoraro.
1139
1140         The general strategy is to have automation clients set the list of files they want
1141         to select ahead of time. Then, the client simulates a click on the <input type="file"> element.
1142         When that causes WebPageProxy to ask the UI delegate to runOpenPanel, it instead
1143         gives WebAutomationSession a chance to select files if the page is under control of
1144         automation. WebAutomationSession validates its file list and selects the files if valid.
1145
1146         * CMakeLists.txt: Add frontend dispatcher files.
1147         * DerivedSources.make:
1148         Add frontend dispatcher code generator scripts as dependencies of the generated code.
1149         Add generated frontend dispatcher files to the list of output files.
1150
1151         * UIProcess/Automation/Automation.json:
1152         Add a command to set the canned list of files that should be selected when prompted.
1153         If no files are selected, then the effect is as if the user had clicked "cancel" in
1154         the file chooser dialog.
1155
1156         Add an event to signal to the WebDriver service that the file selection request has
1157         been either fulfilled or cancelled. This event is necessary because otherwise remotes
1158         cannot distinguish whether selecting the files failed for some reason, or if the
1159         UIProcess has not yet selected the files and sent them to the web content process.
1160         In either case, the input element's "files" attribute would return an empty FileList.
1161
1162         * UIProcess/Automation/WebAutomationSession.h:
1163         * UIProcess/Automation/WebAutomationSession.cpp:
1164         (WebKit::WebAutomationSession::WebAutomationSession):
1165         Add the frontend dispatcher for Automation domain. This is named m_domainNotifier since
1166         m_domainDispatcher is already being used for the backend command dispatcher.
1167
1168         (WebKit::WebAutomationSession::handleRunOpenPanel):
1169         Validate that the files-to-select list has valid entries and select the files if so.
1170         If anything goes wrong, pretend to cancel out of the file chooser. Either way, notify the
1171         frontend with an event that the file chooser was dismissed due to selecting files or cancelling.
1172         Automation protocol clients may implement additional strategies to further restrict
1173         the conditions upon which local files can be uploaded.
1174
1175         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload): Added.
1176         Store the list of files as a vector of strings. The file list is always replaced.
1177
1178         * UIProcess/WebPageProxy.cpp:
1179         (WebKit::WebPageProxy::runOpenPanel):
1180         If the page is under automation, delegating the runOpenPanel is likely to hang
1181         because WebDriver cannot interact directly with the file chooser dialog. Instead,
1182         give WebAutomationSession a chance to select files and don't tell the delegate.
1183
1184         * WebKit.xcodeproj/project.pbxproj:
1185         Add frontend dispatcher files to "Derived Sources" group.
1186
1187 2017-07-25  Alex Christensen  <achristensen@webkit.org>
1188
1189         Modernize NavigationAction code
1190         https://bugs.webkit.org/show_bug.cgi?id=174807
1191
1192         Reviewed by Darin Adler.
1193
1194         Mostly just use more move semantics.
1195
1196         * Platform/IPC/HandleMessage.h:
1197         (IPC::callMemberFunctionImpl):
1198         * Shared/API/APIURLRequest.h:
1199         * Shared/NavigationActionData.h:
1200         * UIProcess/API/APINavigation.cpp:
1201         (API::Navigation::Navigation):
1202         * UIProcess/API/APINavigation.h:
1203         (API::Navigation::create):
1204         * UIProcess/API/APINavigationAction.h:
1205         * UIProcess/API/APINavigationClient.h:
1206         (API::NavigationClient::decidePolicyForNavigationAction):
1207         * UIProcess/API/APIPolicyClient.h:
1208         * UIProcess/API/APIUIClient.h:
1209         (API::UIClient::createNewPage):
1210         (API::UIClient::createNewPageAsync):
1211         (API::UIClient::canCreateNewPageAsync):
1212         * UIProcess/API/C/WKPage.cpp:
1213         (WKPageLoadURLRequest):
1214         (WKPageLoadURLRequestWithUserData):
1215         (WKPageSetPageUIClient):
1216         (WKPageSetPageNavigationClient):
1217         * UIProcess/Cocoa/NavigationState.h:
1218         * UIProcess/Cocoa/NavigationState.mm:
1219         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1220         * UIProcess/Cocoa/UIDelegate.h:
1221         * UIProcess/Cocoa/UIDelegate.mm:
1222         (WebKit::UIDelegate::UIClient::createNewPageCommon):
1223         (WebKit::UIDelegate::UIClient::createNewPage):
1224         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync):
1225         (WebKit::UIDelegate::UIClient::createNewPageAsync):
1226         * UIProcess/WebInspectorProxy.cpp:
1227         (WebKit::decidePolicyForNavigationAction):
1228         * UIProcess/WebNavigationState.cpp:
1229         (WebKit::WebNavigationState::createLoadRequestNavigation):
1230         * UIProcess/WebNavigationState.h:
1231         * UIProcess/WebPageProxy.cpp:
1232         (WebKit::WebPageProxy::loadRequest):
1233         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1234         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1235         (WebKit::WebPageProxy::createNewPage):
1236         * UIProcess/WebPageProxy.h:
1237
1238 2017-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1239
1240         REGRESSION(r218629): [GTK] ASSERTION FAILED: m_eglDisplay == EGL_NO_DISPLAY in WebCore::PlatformDisplay::~PlatformDisplay
1241         https://bugs.webkit.org/show_bug.cgi?id=174789
1242
1243         Reviewed by Žan Doberšek.
1244
1245         Before r218629, the wayland nested compositor display was a singleton created on demand by
1246         AcceleratedSurfaceWayland, but now it's created unconditionally on web process creation when a valid display
1247         name is received from the UI process. The side effect of this is that now the shared display is created after
1248         the nested compositor display that is not a singleton anymore. The atexit used by PlatformDisplay to shutdown
1249         egl display assumes that it will be registered by the shared display. Since we switched to on demand AC mode,
1250         the shared display is only used in the web process when entering AC mode, that's why it only crashes when we
1251         have entered AC at least once. We just need to ensure that the shared display is created before the nested
1252         compositor display.
1253
1254         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
1255         (WebKit::WaylandCompositorDisplay::create): Check we are under wayland before creating the WaylandCompositorDisplay.
1256
1257 2017-07-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1258
1259         [GTK] ASSERTION FAILED: client in WebKit::IconDatabase::setClient
1260         https://bugs.webkit.org/show_bug.cgi?id=174788
1261
1262         Reviewed by Carlos Garcia Campos.
1263
1264         IconDatabase ensures that setClient is never called with nullptr, but WebKitFaviconDatabase
1265         does exactly that. First, ensure it's safe to unset the client. Next, we can either remove
1266         the assertions from setClient or else automatically unset the client in IconDatabase::close.
1267         I opted to do both.
1268
1269         * UIProcess/API/glib/IconDatabase.cpp:
1270         (WebKit::IconDatabase::close):
1271         (WebKit::IconDatabase::setIconDataForIconURL):
1272         (WebKit::IconDatabase::setIconURLForPageURL):
1273         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
1274         (_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate): Deleted.
1275         (webkitFaviconDatabaseDispose): Deleted.
1276
1277 2017-07-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1278
1279         [GTK][WPE] Remove useless conditional in IconDatabase::setIconDataForIconURL
1280         https://bugs.webkit.org/show_bug.cgi?id=174792
1281
1282         Reviewed by Carlos Garcia Campos.
1283
1284         We have in IconDatabase::setIconDataForIconURL some code in a conditional to check if it's
1285         not being executed on the icon sync thread. But at the top of the function is an assertion
1286         to ensure the code is never executed on the icon sync thread. The condition is therefore
1287         useless and the code should be executed unconditionally.
1288
1289         * UIProcess/API/glib/IconDatabase.cpp:
1290         (WebKit::IconDatabase::setIconDataForIconURL):
1291
1292 2017-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1293
1294         [GTK] Icon database error and crash
1295         https://bugs.webkit.org/show_bug.cgi?id=174760
1296
1297         Reviewed by Michael Catanzaro.
1298
1299         The crash is a debug ASSERT that happens when the IconRecord image is created in one thread and destroyed in
1300         another one. IconDatabase creates and destroys IconRecord objects in both database and main thread. The
1301         IconRecord is destroyed when the icon is no longer retained, and we only release icons when we fail to get the
1302         image data (including pages that don't have a favicon). We can prevent this crash from happening if we ensure we
1303         never create an Image for an IconRecord when the given image data is nullptr.
1304
1305         * UIProcess/API/glib/IconDatabase.cpp:
1306         (WebKit::IconDatabase::IconRecord::setImageData):
1307
1308 2017-07-24  Chris Dumez  <cdumez@apple.com>
1309
1310         [WK2][Cocoa] Allow overriding the ITP data removal internal using a default
1311         https://bugs.webkit.org/show_bug.cgi?id=174802
1312         <rdar://problem/33497898>
1313
1314         Reviewed by Sam Weinig.
1315
1316         Allow overriding the ITP data removal internal using a default to facilitate testing.
1317         Can be used like so:
1318         defaults write -g ResourceLoadStatisticsMinimumTimeBetweenDataRecordsRemoval 60
1319
1320         Will cause us to write every 60 seconds instead of 3600.
1321
1322         * Shared/WebPreferencesDefinitions.h:
1323         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
1324         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
1325
1326 2017-07-24  Simon Fraser  <simon.fraser@apple.com>
1327
1328         [iOS WK2] Crash under PageOverlayController::uninstallPageOverlay when doing multiple finds
1329         https://bugs.webkit.org/show_bug.cgi?id=174806
1330         rdar://problem/33501664
1331
1332         Reviewed by Tim Horton.
1333         
1334         Calling TextIndicator::createWithSelectionInFrame can trigger layout via VisibleSelection code,
1335         which can re-enter FindController::updateFindIndicator which has by now removed m_findIndicatorOverlay
1336         from pageOverlayController's map, but not deleted it. The second call to uninstallPageOverlay()
1337         thus crashes at m_overlayGraphicsLayers.take(&overlay)->removeFromParent().
1338         
1339         Fix by nulling out m_findIndicatorOverlay as soon as we uninstall it.
1340
1341         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1342         (WebKit::FindController::updateFindIndicator):
1343
1344 2017-07-24  Chris Dumez  <cdumez@apple.com>
1345
1346         Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()
1347         https://bugs.webkit.org/show_bug.cgi?id=174790
1348
1349         Reviewed by Brady Eidson.
1350
1351         Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore().
1352         WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to
1353         |this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can
1354         get executed after the store is gone.
1355
1356         To address the issue, we now use a RunLoop::Timer to schedule the write, instead of a
1357         WorkQueue::dispatchAfter() call. This way, we are guaranteed that the callback will not get called
1358         after the store has been destroyed.
1359
1360         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
1361         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
1362         (WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired):
1363         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
1364         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
1365         (WebKit::ResourceLoadStatisticsPersistentStorage::ref):
1366         (WebKit::ResourceLoadStatisticsPersistentStorage::deref):
1367         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
1368
1369 2017-07-24  Chris Dumez  <cdumez@apple.com>
1370
1371         Unreviewed, rolling out r219828.
1372
1373         Causes debug assertions to be hit on iOS
1374
1375         Reverted changeset:
1376
1377         "Fix lifetime management issue in
1378         ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()"
1379         https://bugs.webkit.org/show_bug.cgi?id=174790
1380         http://trac.webkit.org/changeset/219828
1381
1382 2017-07-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1383
1384         [GTK][WPE] Stop using AutodrainedPool in IconDatabase
1385         https://bugs.webkit.org/show_bug.cgi?id=174791
1386
1387         Reviewed by Alex Christensen.
1388
1389         AutodrainedPool seems to be some NS garbage collection thing that has no implementation on
1390         other platforms. Now that IconDatabase is used only by GTK and WPE, we can stop using it.
1391
1392         * UIProcess/API/glib/IconDatabase.cpp:
1393         (WebKit::IconDatabase::setIconDataForIconURL):
1394         (WebKit::IconDatabase::setIconURLForPageURL):
1395         (WebKit::IconDatabase::iconDatabaseSyncThread):
1396         (WebKit::IconDatabase::performURLImport):
1397         (WebKit::IconDatabase::readFromDatabase):
1398
1399 2017-07-24  Chris Dumez  <cdumez@apple.com>
1400
1401         Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()
1402         https://bugs.webkit.org/show_bug.cgi?id=174790
1403
1404         Reviewed by Brady Eidson.
1405
1406         Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore().
1407         WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to
1408         |this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can
1409         get executed after the store is gone.
1410
1411         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
1412         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
1413         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
1414         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
1415         (WebKit::ResourceLoadStatisticsPersistentStorage::createWeakPtr):
1416
1417 2017-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1418
1419         Unreviewed. REGRESSION(r219713): [GTK][WPE] Fix default favicon database patch.
1420
1421         When nullptr is passed to webkit_web_context_set_favicon_database_directory() the default database directory was
1422         taken from WebProcessPool::platformDefaultIconDatabasePath(), that has been removed in r219713 without properly
1423         replacing it, now it uses an empty string. This causes that the current directory is used to create the favicon
1424         database.
1425
1426         * UIProcess/API/glib/WebKitWebContext.cpp:
1427         (webkit_web_context_set_favicon_database_directory): Use the default icon database directory instead of an empty
1428         string when nullptr is passed.
1429
1430 2017-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1431
1432         [iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values
1433         https://bugs.webkit.org/show_bug.cgi?id=174769
1434         <rdar://problem/33478864>
1435
1436         Reviewed by Tim Horton.
1437
1438         Fixes several API tests in the DataInteractionTests suite. See Source/WebCore/ChangeLog for more details.
1439
1440         * WebProcess/WebPage/WebPage.cpp:
1441         (WebKit::WebPage::performDragControllerAction):
1442
1443 2017-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1444
1445         WebDriver: implement page load timeout
1446         https://bugs.webkit.org/show_bug.cgi?id=174672
1447
1448         Reviewed by Brian Burg.
1449
1450         Always start a timer when waiting for a navigation to complete. When the timer fires, pending callbacks for
1451         navigations are removed and invoked with a timeout error. If navigation completes before the timer is fired,
1452         then the timer is stopped. All navigation commands now receive the page load strategy and timeout as optional
1453         parameters, when not provided the default timeout (300 seconds) is used.
1454
1455         * UIProcess/Automation/Automation.json:
1456         * UIProcess/Automation/WebAutomationSession.cpp:
1457         (WebKit::WebAutomationSession::WebAutomationSession):
1458         (WebKit::WebAutomationSession::waitForNavigationToComplete):
1459         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
1460         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
1461         (WebKit::WebAutomationSession::loadTimerFired):
1462         (WebKit::WebAutomationSession::navigateBrowsingContext):
1463         (WebKit::WebAutomationSession::goBackInBrowsingContext):
1464         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
1465         (WebKit::WebAutomationSession::reloadBrowsingContext):
1466         (WebKit::WebAutomationSession::navigationOccurredForFrame):
1467         * UIProcess/Automation/WebAutomationSession.h:
1468
1469 2017-07-23  Takuro Ashie  <ashie@clear-code.com>
1470
1471         [GTK] Correct a typo in the reference manual of WebKitWebInspector
1472         https://bugs.webkit.org/show_bug.cgi?id=174767
1473
1474         Reviewed by Michael Catanzaro.
1475
1476         * UIProcess/API/gtk/WebKitWebInspector.cpp:
1477
1478 2017-07-23  Chris Dumez  <cdumez@apple.com>
1479
1480         Drop ExceptionCodeDescription class
1481         https://bugs.webkit.org/show_bug.cgi?id=174757
1482
1483         Reviewed by Darin Adler.
1484
1485         Update GTK bindings to use new API on DOMException instead of
1486         ExceptionCodeDescription.
1487
1488         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
1489         (webkit_dom_attr_dispatch_event):
1490         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
1491         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
1492         (webkit_dom_cdata_section_dispatch_event):
1493         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
1494         (webkit_dom_css_rule_set_css_text):
1495         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
1496         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
1497         (webkit_dom_css_style_declaration_set_property):
1498         (webkit_dom_css_style_declaration_set_css_text):
1499         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
1500         (webkit_dom_css_style_sheet_insert_rule):
1501         (webkit_dom_css_style_sheet_delete_rule):
1502         (webkit_dom_css_style_sheet_add_rule):
1503         (webkit_dom_css_style_sheet_remove_rule):
1504         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
1505         (webkit_dom_css_value_set_css_text):
1506         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
1507         (webkit_dom_character_data_dispatch_event):
1508         (webkit_dom_character_data_insert_data):
1509         (webkit_dom_character_data_delete_data):
1510         (webkit_dom_character_data_replace_data):
1511         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
1512         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
1513         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
1514         (webkit_dom_comment_dispatch_event):
1515         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
1516         (webkit_dom_dom_implementation_create_document_type):
1517         (webkit_dom_dom_implementation_create_document):
1518         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
1519         (webkit_dom_dom_selection_collapse_to_end):
1520         (webkit_dom_dom_selection_collapse_to_start):
1521         (webkit_dom_dom_selection_extend):
1522         (webkit_dom_dom_selection_get_range_at):
1523         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
1524         (webkit_dom_dom_token_list_add):
1525         (webkit_dom_dom_token_list_remove):
1526         (webkit_dom_dom_token_list_toggle):
1527         (webkit_dom_dom_token_list_replace):
1528         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
1529         (webkit_dom_dom_window_dispatch_event):
1530         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
1531         (webkit_dom_node_set_prefix):
1532         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1533         (webkit_dom_document_dispatch_event):
1534         (webkit_dom_document_create_element):
1535         (webkit_dom_document_create_cdata_section):
1536         (webkit_dom_document_create_processing_instruction):
1537         (webkit_dom_document_create_attribute):
1538         (webkit_dom_document_import_node):
1539         (webkit_dom_document_create_element_ns):
1540         (webkit_dom_document_create_attribute_ns):
1541         (webkit_dom_document_adopt_node):
1542         (webkit_dom_document_create_event):
1543         (webkit_dom_document_create_expression):
1544         (webkit_dom_document_evaluate):
1545         (webkit_dom_document_query_selector):
1546         (webkit_dom_document_query_selector_all):
1547         (webkit_dom_document_set_xml_version):
1548         (webkit_dom_document_set_cookie):
1549         (webkit_dom_document_set_body):
1550         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
1551         (webkit_dom_document_fragment_dispatch_event):
1552         (webkit_dom_document_fragment_query_selector):
1553         (webkit_dom_document_fragment_query_selector_all):
1554         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
1555         (webkit_dom_document_type_dispatch_event):
1556         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1557         (webkit_dom_element_dispatch_event):
1558         (webkit_dom_element_set_attribute):
1559         (webkit_dom_element_set_attribute_node):
1560         (webkit_dom_element_remove_attribute_node):
1561         (webkit_dom_element_set_attribute_ns):
1562         (webkit_dom_element_set_attribute_node_ns):
1563         (webkit_dom_element_matches):
1564         (webkit_dom_element_closest):
1565         (webkit_dom_element_insert_adjacent_element):
1566         (webkit_dom_element_insert_adjacent_html):
1567         (webkit_dom_element_insert_adjacent_text):
1568         (webkit_dom_element_remove):
1569         (webkit_dom_element_query_selector):
1570         (webkit_dom_element_query_selector_all):
1571         (webkit_dom_element_set_inner_html):
1572         (webkit_dom_element_set_outer_html):
1573         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
1574         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
1575         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
1576         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
1577         (webkit_dom_html_anchor_element_dispatch_event):
1578         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
1579         (webkit_dom_html_applet_element_dispatch_event):
1580         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
1581         (webkit_dom_html_area_element_dispatch_event):
1582         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
1583         (webkit_dom_html_br_element_dispatch_event):
1584         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
1585         (webkit_dom_html_base_element_dispatch_event):
1586         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
1587         (webkit_dom_html_body_element_dispatch_event):
1588         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
1589         (webkit_dom_html_button_element_dispatch_event):
1590         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
1591         (webkit_dom_html_canvas_element_dispatch_event):
1592         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
1593         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
1594         (webkit_dom_html_d_list_element_dispatch_event):
1595         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
1596         (webkit_dom_html_directory_element_dispatch_event):
1597         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
1598         (webkit_dom_html_div_element_dispatch_event):
1599         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
1600         (webkit_dom_html_document_dispatch_event):
1601         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
1602         (webkit_dom_html_element_dispatch_event):
1603         (webkit_dom_html_element_set_inner_text):
1604         (webkit_dom_html_element_set_outer_text):
1605         (webkit_dom_html_element_set_content_editable):
1606         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
1607         (webkit_dom_html_embed_element_dispatch_event):
1608         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
1609         (webkit_dom_html_field_set_element_dispatch_event):
1610         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
1611         (webkit_dom_html_font_element_dispatch_event):
1612         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
1613         (webkit_dom_html_form_element_dispatch_event):
1614         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
1615         (webkit_dom_html_frame_element_dispatch_event):
1616         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
1617         (webkit_dom_html_frame_set_element_dispatch_event):
1618         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
1619         (webkit_dom_html_hr_element_dispatch_event):
1620         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
1621         (webkit_dom_html_head_element_dispatch_event):
1622         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
1623         (webkit_dom_html_heading_element_dispatch_event):
1624         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
1625         (webkit_dom_html_html_element_dispatch_event):
1626         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
1627         (webkit_dom_html_iframe_element_dispatch_event):
1628         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
1629         (webkit_dom_html_image_element_dispatch_event):
1630         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1631         (webkit_dom_html_input_element_dispatch_event):
1632         (webkit_dom_html_input_element_set_max_length):
1633         (webkit_dom_html_input_element_set_size):
1634         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
1635         (webkit_dom_html_li_element_dispatch_event):
1636         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
1637         (webkit_dom_html_label_element_dispatch_event):
1638         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
1639         (webkit_dom_html_legend_element_dispatch_event):
1640         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
1641         (webkit_dom_html_link_element_dispatch_event):
1642         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
1643         (webkit_dom_html_map_element_dispatch_event):
1644         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
1645         (webkit_dom_html_marquee_element_dispatch_event):
1646         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
1647         (webkit_dom_html_menu_element_dispatch_event):
1648         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
1649         (webkit_dom_html_meta_element_dispatch_event):
1650         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
1651         (webkit_dom_html_mod_element_dispatch_event):
1652         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
1653         (webkit_dom_html_o_list_element_dispatch_event):
1654         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
1655         (webkit_dom_html_object_element_dispatch_event):
1656         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
1657         (webkit_dom_html_opt_group_element_dispatch_event):
1658         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
1659         (webkit_dom_html_option_element_dispatch_event):
1660         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
1661         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
1662         (webkit_dom_html_paragraph_element_dispatch_event):
1663         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
1664         (webkit_dom_html_param_element_dispatch_event):
1665         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
1666         (webkit_dom_html_pre_element_dispatch_event):
1667         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
1668         (webkit_dom_html_quote_element_dispatch_event):
1669         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
1670         (webkit_dom_html_script_element_dispatch_event):
1671         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1672         (webkit_dom_html_select_element_dispatch_event):
1673         (webkit_dom_html_select_element_add):
1674         (webkit_dom_html_select_element_set_length):
1675         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
1676         (webkit_dom_html_style_element_dispatch_event):
1677         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
1678         (webkit_dom_html_table_caption_element_dispatch_event):
1679         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
1680         (webkit_dom_html_table_cell_element_dispatch_event):
1681         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
1682         (webkit_dom_html_table_col_element_dispatch_event):
1683         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
1684         (webkit_dom_html_table_element_dispatch_event):
1685         (webkit_dom_html_table_element_insert_row):
1686         (webkit_dom_html_table_element_delete_row):
1687         (webkit_dom_html_table_element_set_caption):
1688         (webkit_dom_html_table_element_set_t_head):
1689         (webkit_dom_html_table_element_set_t_foot):
1690         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
1691         (webkit_dom_html_table_row_element_dispatch_event):
1692         (webkit_dom_html_table_row_element_insert_cell):
1693         (webkit_dom_html_table_row_element_delete_cell):
1694         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
1695         (webkit_dom_html_table_section_element_dispatch_event):
1696         (webkit_dom_html_table_section_element_insert_row):
1697         (webkit_dom_html_table_section_element_delete_row):
1698         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
1699         (webkit_dom_html_text_area_element_dispatch_event):
1700         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
1701         (webkit_dom_html_title_element_dispatch_event):
1702         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
1703         (webkit_dom_html_u_list_element_dispatch_event):
1704         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
1705         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
1706         (webkit_dom_media_list_delete_medium):
1707         (webkit_dom_media_list_append_medium):
1708         (webkit_dom_media_list_set_media_text):
1709         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
1710         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
1711         (webkit_dom_named_node_map_set_named_item):
1712         (webkit_dom_named_node_map_remove_named_item):
1713         (webkit_dom_named_node_map_remove_named_item_ns):
1714         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
1715         (webkit_dom_node_dispatch_event):
1716         (webkit_dom_node_insert_before):
1717         (webkit_dom_node_replace_child):
1718         (webkit_dom_node_remove_child):
1719         (webkit_dom_node_append_child):
1720         (webkit_dom_node_clone_node_with_error):
1721         (webkit_dom_node_set_node_value):
1722         (webkit_dom_node_set_text_content):
1723         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
1724         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
1725         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
1726         (webkit_dom_processing_instruction_dispatch_event):
1727         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
1728         (webkit_dom_range_set_start):
1729         (webkit_dom_range_set_end):
1730         (webkit_dom_range_set_start_before):
1731         (webkit_dom_range_set_start_after):
1732         (webkit_dom_range_set_end_before):
1733         (webkit_dom_range_set_end_after):
1734         (webkit_dom_range_select_node):
1735         (webkit_dom_range_select_node_contents):
1736         (webkit_dom_range_compare_boundary_points):
1737         (webkit_dom_range_delete_contents):
1738         (webkit_dom_range_extract_contents):
1739         (webkit_dom_range_clone_contents):
1740         (webkit_dom_range_insert_node):
1741         (webkit_dom_range_surround_contents):
1742         (webkit_dom_range_create_contextual_fragment):
1743         (webkit_dom_range_compare_node):
1744         (webkit_dom_range_intersects_node):
1745         (webkit_dom_range_compare_point):
1746         (webkit_dom_range_is_point_in_range):
1747         (webkit_dom_range_expand):
1748         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
1749         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
1750         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
1751         (webkit_dom_text_dispatch_event):
1752         (webkit_dom_text_split_text):
1753         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
1754         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
1755         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
1756         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
1757         (webkit_dom_xpath_expression_evaluate):
1758         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
1759         (webkit_dom_xpath_result_iterate_next):
1760         (webkit_dom_xpath_result_snapshot_item):
1761         (webkit_dom_xpath_result_get_number_value):
1762         (webkit_dom_xpath_result_get_boolean_value):
1763         (webkit_dom_xpath_result_get_single_node_value):
1764         (webkit_dom_xpath_result_get_snapshot_length):
1765
1766 2017-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1767
1768         [iOS WK2] Remove _WKDraggableElementInfo and fold PositionInformationTests into WKRequestActivatedElementInfo
1769         https://bugs.webkit.org/show_bug.cgi?id=174758
1770
1771         Reviewed by Dan Bernstein.
1772
1773         _WKDraggableElementInfo is no longer used in WebKit, so it should be removed. However, some of the scenarios
1774         in PositionInformationTests that depend on _WKDraggableElementInfo are still useful to exercise: namely,
1775         performing both synchronous and asynchronous position information updates while an async position information
1776         update is in flight. This patch refactors these unit tests into 2 new unit tests in the existing
1777         WKRequestActivatedElementInfo test suite.
1778
1779         * UIProcess/API/Cocoa/WKWebView.mm:
1780         (-[WKWebView _draggableElementAtPosition:]): Deleted.
1781         (-[WKWebView _requestDraggableElementAtPosition:completionBlock:]): Deleted.
1782         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1783         * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Removed.
1784         * UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Removed.
1785         * UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Removed.
1786         * UIProcess/ios/WKContentViewInteraction.mm:
1787         * WebKit.xcodeproj/project.pbxproj:
1788
1789 2017-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1790
1791         [Mac WK2] Fix null dereference in asynchronous NSTextInputClient methods when deallocating a WKWebView
1792         https://bugs.webkit.org/show_bug.cgi?id=174751
1793         <rdar://problem/33132405>
1794
1795         Reviewed by Darin Adler.
1796
1797         Tweaks -[WKWebView dealloc] to close the WebPageProxy at an earlier time, prior to destroying the WebViewImpl.
1798         This fixes a NSTextInputClient crash in WKWebView when exercising the following scenario:
1799
1800         (1) Suppose that NSTextInputContext invokes an asynchronous text input query on WKWebView immediately before
1801         WKWebView is deallocated, such that WebPageProxy's CallbackMap contains an NSTextInputContext callback at the
1802         time that -[WKWebView dealloc] is called. Additionally, suppose that this callback from NSTextInputContext
1803         invokes additional NSTextInputClient methods on the WKWebView that involve plumbing through to the WebViewImpl
1804         (which is stored as _impl on the WKWebView).
1805
1806         (2) Observe that when calling [super dealloc] in [WKWebView dealloc], we will destroy the WebViewImpl as a
1807         result of setting our unique pointer to _impl to be null. In ~WebViewImpl, we invoke WebPageProxy::close, which
1808         in turn invokes WebPageProxy::resetState.
1809
1810         (3) WebPageProxy::resetState then calls m_callbacks.invalidate(error), which triggers all pending callbacks.
1811         This invokes the block described in (1), which causes us to try and call back into WKWebView, invoking
1812         NSTextInputClient methods. Without the fix in this patch, these methods currently assume that _impl is nonnull,
1813         even though we've already cleared out the pointer in (2), so we segfault with a null dereference.
1814
1815         After this patch, we close the _page at an earlier time, such that the state is reset before the WebViewImpl
1816         (and corresponding _impl unique_ptr in WKWebView) is torn down. This ensures that _impl will not be null for
1817         callbacks invoked after beginning to deallocate the WKWebView.
1818
1819         Forcing this scenario in a custom AppKit root that triggers async NSTextInputClient methods immediately when a
1820         WKWebView is being deallocated produces a crash with the same stack trace as what we observe in the radar, but
1821         there are no known steps to actually reproduce this crash in shipping software.
1822
1823         * UIProcess/API/Cocoa/WKWebView.mm:
1824         (-[WKWebView dealloc]):
1825
1826 2017-07-22  Chris Dumez  <cdumez@apple.com>
1827
1828         REGRESSION(r204565): WKObject is broken
1829         https://bugs.webkit.org/show_bug.cgi?id=174736
1830         <rdar://problem/33246169>
1831
1832         Reviewed by Dan Bernstein.
1833
1834         Revert r204565 as making WKObject a root class caused unexpected crashes.
1835         Instead, we now have WKObject inherit from NSProxy (instead of previously
1836         NSObject) and we forward calls to the target.
1837
1838         We also need to provide an implementation for private methods such as
1839         isNSString__ to address the issue with NSStrings that r204565 was trying
1840         to fix.
1841
1842         * Shared/Cocoa/APIObject.mm:
1843         (API::Object::unwrap):
1844         * Shared/Cocoa/WKObject.h:
1845         * Shared/Cocoa/WKObject.mm:
1846         (-[WKObject dealloc]):
1847         (-[WKObject hash]):
1848         (-[WKObject isKindOfClass:]):
1849         (-[WKObject isMemberOfClass:]):
1850         (-[WKObject respondsToSelector:]):
1851         (-[WKObject conformsToProtocol:]):
1852         (-[WKObject forwardingTargetForSelector:]):
1853         (-[WKObject description]):
1854         (-[WKObject debugDescription]):
1855         (-[WKObject classForCoder]):
1856         (-[WKObject classForKeyedArchiver]):
1857         (-[WKObject _web_createTarget]):
1858         (-[WKObject forwardInvocation:]):
1859         (-[WKObject methodSignatureForSelector:]):
1860         (-[WKObject isNSObject__]):
1861         (-[WKObject isNSArray__]):
1862         (-[WKObject isNSCFConstantString__]):
1863         (-[WKObject isNSData__]):
1864         (-[WKObject isNSDate__]):
1865         (-[WKObject isNSDictionary__]):
1866         (-[WKObject isNSNumber__]):
1867         (-[WKObject isNSOrderedSet__]):
1868         (-[WKObject isNSSet__]):
1869         (-[WKObject isNSString__]):
1870         (-[WKObject isNSTimeZone__]):
1871         (-[WKObject isNSValue__]):
1872
1873 2017-07-21  Chris Dumez  <cdumez@apple.com>
1874
1875         Drop IDBDatabaseException class
1876         https://bugs.webkit.org/show_bug.cgi?id=174743
1877
1878         Reviewed by Darin Adler.
1879
1880         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1881         (WebKit::WebIDBConnectionToServer::connectionToServerLost):
1882
1883 2017-07-21  Brady Eidson  <beidson@apple.com>
1884
1885         Crash in many WebKit apps marking a connection invalid under Messages::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace.
1886         <rdar://problem/28822272> and https://bugs.webkit.org/show_bug.cgi?id=174729
1887
1888         Reviewed by Tim Horton.
1889
1890         Previously, when a NetworkLoad generated a "CanAuthenticateAgainstProtectionSpace" event, the message went from
1891         Network process -> Web process -> UI process.
1892
1893         In that case, MESSAGE_CHECKing the validity of the frame in WebPageProxy made sense.
1894
1895         In r202511 we cut the WebProcess out of this and had Networking go straight to UI process.
1896
1897         As a result, the message check became invalid. The Networking process cannot possible know the validity of 
1898         particular WebPage or WebFrame identifiers.
1899
1900         We simply need to validate the input in NetworkProcessProxy.
1901
1902         * UIProcess/Network/NetworkProcessProxy.cpp:
1903         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Validate both the page and frame ids before
1904           passing the call along to the WebPageProxy. Also, if either of those validations fail, respond to the network process.
1905
1906 2017-07-21  Andy Estes  <aestes@apple.com>
1907
1908         [iOS] Adopt UIImagePickerControllerImageURL for photo uploads
1909         https://bugs.webkit.org/show_bug.cgi?id=174723
1910         <rdar://problem/33223962>
1911
1912         Reviewed by Joseph Pecoraro.
1913
1914         In iOS 11, use the URL provided by UIImagePickerControllerImageURL, if available, as the
1915         file URL for photo uploads. Since we use the UIImagePickerController imageExportPreset of
1916         UIImagePickerControllerImageURLExportPresetCompatible, UIKit will take care of converting
1917         HEIF images to JPEG for us. For other types (GIF, JPEG, and PNG), it will preserve the
1918         original format.
1919
1920         Since UIImagePickerController now provides GIF and PNG representations, we no longer need to
1921         use PHImageManager to access the original assets. This patch removes the
1922         PHAsset/PHImageManager code added in r185241.
1923
1924         * Platform/spi/ios/PhotosSPI.h: Removed.
1925         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1926         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
1927         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]): Deleted.
1928         * WebKit.xcodeproj/project.pbxproj:
1929
1930 2017-07-21  Konstantin Tokarev  <annulen@yandex.ru>
1931
1932         [cmake][Mac] Unreviewed, fix linking WebKitSystemInterface
1933
1934         After r219560 link_directories() in PlatformXXX.cmake files does not
1935         affect corresponding targets.
1936
1937         * PlatformMac.cmake:
1938
1939 2017-07-21  Andreas Kling  <akling@apple.com>
1940
1941         Use more references in event dispatch code
1942         https://bugs.webkit.org/show_bug.cgi?id=174681
1943
1944         Reviewed by Geoffrey Garen.
1945
1946         * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
1947         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
1948         (WebKit::PDFPluginAnnotation::handleEvent):
1949         (WebKit::PDFPluginAnnotation::PDFPluginAnnotationEventListener::handleEvent):
1950         * WebProcess/Plugins/PDF/PDFPluginPasswordField.h:
1951         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
1952         (WebKit::PDFPluginPasswordField::handleEvent):
1953         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
1954         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
1955         (WebKit::PDFPluginTextAnnotation::handleEvent):
1956         * WebProcess/Plugins/PluginView.cpp:
1957         (WebKit::PluginView::createWebEvent):
1958         (WebKit::PluginView::handleEvent):
1959         * WebProcess/Plugins/PluginView.h:
1960
1961 2017-07-21  Chris Dumez  <cdumez@apple.com>
1962
1963         WebResourceLoadStatisticsStore::m_operatingDates is unsafely modified from several threads
1964         https://bugs.webkit.org/show_bug.cgi?id=174721
1965         <rdar://problem/33400343>
1966
1967         Reviewed by Brent Fulgham.
1968
1969         WebResourceLoadStatisticsStore::m_operatingDates is supposed to only be modified on
1970         the background thread. However, WebResourceLoadStatisticsStore::performDailyTasks()
1971         was mistakenly calling includeTodayAsOperatingDateIfNecessary() on the main thread,
1972         which would modify m_operatingDates. This could lead to crashes such as the
1973         one in <rdar://problem/33400343>, as the main thread may modify m_operatingDates
1974         while we are interating over it on the background thread to save it to disk.
1975
1976         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1977         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1978         (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
1979
1980 2017-07-21  Brady Eidson  <beidson@apple.com>
1981
1982         Get rid of WebCore IconDatabase code.
1983         https://bugs.webkit.org/show_bug.cgi?id=174700
1984
1985         Reviewed by Tim Horton.
1986
1987         * UIProcess/API/glib/WebKitWebContext.cpp:
1988         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1989         (WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted.
1990         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1991
1992 2017-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1993
1994         Web Automation: implicit navigations don't cause browsing context switch
1995         https://bugs.webkit.org/show_bug.cgi?id=174633
1996         <rdar://problem/33387797>
1997
1998         Reviewed by Brian Burg.
1999
2000         When a new page load replaces the current frameset, for example when a link in the current browser context has a
2001         _top target, there's no explicit context switch, so the web driver doesn't know that the current browsing
2002         context is no longer valid. Following commands will still be using the previous frame as the current browsing
2003         context, but they don't fail with no such frame because the frame is still alive in the page cache and
2004         referenced in the internal maps used in both UI and web processes. This causes test
2005         testShouldFocusOnTheReplacementWhenAFrameFollowsALinkToA_TopTargetedPage to fail, since it expects a no such
2006         frame exception. When a new page navigation happens we can simply remove references to frames from
2007         m_handleWebFrameMap in WebAutomationSession, because any existing frame reference in the map should be for a
2008         previous page. With this, before the next command is executed, waitForNavigationToComplete will be called and it
2009         will fail with no such frame, condition that is handled to switch to the top level browser context. The test
2010         still fails, because the find element command is called with the top level browsing context, returning no such
2011         element, instead of no such frame. This is consistent with Chrome.
2012
2013         * UIProcess/Automation/WebAutomationSession.cpp:
2014         (WebKit::WebAutomationSession::navigationOccurredForFrame): Clear the m_handleWebFrameMap when a new page load
2015         finished.
2016
2017 2017-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2018
2019         WebDriver: wait until navigation is complete before running new commands and after a click
2020         https://bugs.webkit.org/show_bug.cgi?id=174670
2021
2022         Reviewed by Brian Burg.
2023
2024         Add waitForNavigationToComplete method to Automation to allow WebDriver to wait for pending navigations to
2025         complete. The new method already receives page load strategy and timeout, but they are not implemented yet.
2026
2027         * UIProcess/Automation/Automation.json: Add waitForNavigationToComplete method and PageLoadStrategy new type.
2028         * UIProcess/Automation/WebAutomationSession.cpp:
2029         (WebKit::WebAutomationSession::waitForNavigationToComplete): Call waitForNavigationToCompleteOnPage or
2030         waitForNavigationToCompleteOnFrame depending on whether the current borwsing context is the main frame or not.
2031         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Check if there's an ongoing load for the page,
2032         and wait for it to complete if needed.
2033         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Check if there's an ongoing load for the frame,
2034         and wait for it to complete if needed.
2035         (WebKit::WebAutomationSession::navigateBrowsingContext): Use waitForNavigationToCompleteOnPage() now.
2036         (WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
2037         (WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
2038         (WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
2039         (WebKit::WebAutomationSession::navigationOccurredForFrame): Renamed since it now receives the notification for
2040         all the frames. Complete page operations if it's a main frame, or frame operations otherwise.
2041         * UIProcess/Automation/WebAutomationSession.h:
2042         * UIProcess/WebPageProxy.cpp:
2043         (WebKit::WebPageProxy::didFinishLoadForFrame): Notify about all frames, not only the main one.
2044         (WebKit::WebPageProxy::didFailLoadForFrame): Ditto.
2045         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Ditto.
2046
2047 2017-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2048
2049         Unreviewed. Remove WKIconDatabaseCairo.
2050
2051         * PlatformGTK.cmake:
2052         * PlatformWPE.cmake:
2053         * UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp: Removed.
2054         * UIProcess/API/C/cairo/WKIconDatabaseCairo.h: Removed.
2055
2056 2017-07-20  Brady Eidson  <beidson@apple.com>
2057
2058         Get rid of IconDatabase related code in WebKit.
2059         https://bugs.webkit.org/show_bug.cgi?id=174693
2060
2061         Reviewed by Tim Horton.
2062
2063         This leaves the C-API class but guts it.
2064
2065         No explanations of the other changes are needed.
2066
2067         * CMakeLists.txt:
2068         * DerivedSources.make:
2069         * Shared/WebProcessCreationParameters.cpp:
2070         (WebKit::WebProcessCreationParameters::encode):
2071         (WebKit::WebProcessCreationParameters::decode):
2072         * Shared/WebProcessCreationParameters.h:
2073         * UIProcess/API/C/WKContext.cpp:
2074         (WKContextGetIconDatabase):
2075         (WKContextSetIconDatabasePath):
2076         * UIProcess/API/C/WKIconDatabase.cpp:
2077         (WKIconDatabaseSetIconDatabaseClient):
2078         (WKIconDatabaseRetainIconForURL):
2079         (WKIconDatabaseReleaseIconForURL):
2080         (WKIconDatabaseSetIconDataForIconURL):
2081         (WKIconDatabaseSetIconURLForPageURL):
2082         (WKIconDatabaseCopyIconURLForPageURL):
2083         (WKIconDatabaseCopyIconDataForPageURL):
2084         (WKIconDatabaseEnableDatabaseCleanup):
2085         (WKIconDatabaseRemoveAllIcons):
2086         (WKIconDatabaseCheckIntegrityBeforeOpening):
2087         (WKIconDatabaseClose):
2088         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
2089         (WKIconDatabaseTryGetCGImageForURL):
2090         (WKIconDatabaseTryCopyCGImageArrayForURL):
2091         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2092         (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.
2093         * UIProcess/WebIconDatabase.cpp: Removed.
2094         * UIProcess/WebIconDatabase.h:
2095         (WebKit::WebIconDatabase::clearProcessPool): Deleted.
2096         * UIProcess/WebIconDatabase.messages.in: Removed.
2097         * UIProcess/WebIconDatabaseClient.cpp: Removed.
2098         * UIProcess/WebIconDatabaseClient.h: Removed.
2099         * UIProcess/WebProcessPool.cpp:
2100         (WebKit::m_hiddenPageThrottlingTimer):
2101         (WebKit::WebProcessPool::~WebProcessPool):
2102         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
2103         (WebKit::WebProcessPool::createNewWebProcess):
2104         (WebKit::WebProcessPool::setIconDatabasePath): Deleted.
2105         (WebKit::WebProcessPool::iconDatabasePath): Deleted.
2106         * UIProcess/WebProcessPool.h:
2107         * UIProcess/WebProcessProxy.cpp:
2108         (WebKit::WebProcessProxy::processWillShutDown):
2109         (WebKit::WebProcessProxy::retainIconForPageURL): Deleted.
2110         (WebKit::WebProcessProxy::releaseIconForPageURL): Deleted.
2111         (WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs): Deleted.
2112         * UIProcess/WebProcessProxy.h:
2113         * UIProcess/WebProcessProxy.messages.in:
2114         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2115         (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.
2116         * UIProcess/wpe/WebProcessPoolWPE.cpp:
2117         (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.
2118         * WebKit.xcodeproj/project.pbxproj:
2119         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Removed.
2120         * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Removed.
2121         * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Removed.
2122         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2123         * WebProcess/WebProcess.cpp:
2124         (WebKit::WebProcess::WebProcess):
2125         (WebKit::WebProcess::initializeWebProcess):
2126         (WebKit::WebProcess::getWebCoreStatistics):
2127         * WebProcess/WebProcess.h:
2128
2129 2017-07-20  David Quesada  <david_quesada@apple.com>
2130
2131         Add SPI to notify WKNavigationDelegate about client redirects
2132         https://bugs.webkit.org/show_bug.cgi?id=174680
2133         rdar://problem/33184886
2134
2135         Reviewed by Brady Eidson.
2136
2137         * UIProcess/API/APINavigationClient.h:
2138         (API::NavigationClient::didPerformClientRedirectForNavigation):
2139         Add a new virtual method for navigation clients to implement if they want to be informed
2140         when the page is initiating a navigation that is a client redirect.
2141
2142         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2143         Declare the new WKNavigationDelegate method -_webView:didPerformClientRedirectForNavigation:
2144
2145         * UIProcess/Cocoa/NavigationState.h:
2146         * UIProcess/Cocoa/NavigationState.mm:
2147         (WebKit::NavigationState::setNavigationDelegate):
2148         (WebKit::NavigationState::NavigationClient::didPerformClientRedirectForNavigation):
2149         Add a new method to NavigationState method to tell the WKNavigationDelegate when a
2150         client redirect happens.
2151
2152         * UIProcess/WebPageProxy.cpp:
2153         (WebKit::WebPageProxy::didPerformClientRedirectForLoadForFrame):
2154         * UIProcess/WebPageProxy.h:
2155         * UIProcess/WebPageProxy.messages.in:
2156         Allow the WebPageProxy to receive a message from the web process when a client redirect happens.
2157
2158         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2159         (WebKit::WebFrameLoaderClient::dispatchDidPerformClientRedirect):
2160         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2161         Send this new message to the UI process on client redirects.
2162
2163 2017-07-20  Chris Dumez  <cdumez@apple.com>
2164
2165         Drop legacy XPathException type
2166         https://bugs.webkit.org/show_bug.cgi?id=174679
2167
2168         Reviewed by Sam Weinig.
2169
2170         Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
2171         no longer expose XPathException.
2172
2173         * UIProcess/Automation/atoms/FindNodes.js:
2174         (tryToFindNode):
2175
2176 2017-07-20  Chris Dumez  <cdumez@apple.com>
2177
2178         Unreviewed, rolling out r219706.
2179
2180         Broke iOS build
2181
2182         Reverted changeset:
2183
2184         "Drop legacy XPathException type"
2185         https://bugs.webkit.org/show_bug.cgi?id=174679
2186         http://trac.webkit.org/changeset/219706
2187
2188 2017-07-20  Chris Dumez  <cdumez@apple.com>
2189
2190         Drop legacy XPathException type
2191         https://bugs.webkit.org/show_bug.cgi?id=174679
2192
2193         Reviewed by Sam Weinig.
2194
2195         Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
2196         no longer expose XPathException.
2197
2198         * UIProcess/Automation/atoms/FindNodes.js:
2199         (tryToFindNode):
2200
2201 2017-07-20  Chris Dumez  <cdumez@apple.com>
2202
2203         Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords()
2204         https://bugs.webkit.org/show_bug.cgi?id=174686
2205
2206         Reviewed by Geoffrey Garen.
2207
2208         Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords(). The most common
2209         call site is already on the right thread.
2210
2211         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2212         (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]):
2213         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2214         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
2215         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2216         * UIProcess/WebResourceLoadStatisticsStore.h:
2217
2218 2017-07-20  Chris Dumez  <cdumez@apple.com>
2219
2220         Regression(ITP): May get frequently logged out of wsj.com
2221         https://bugs.webkit.org/show_bug.cgi?id=174661
2222         <rdar://problem/32343256>
2223
2224         Reviewed by Geoffrey Garen.
2225
2226         Bump statistics file version to blow away old statistics on disk since those do not
2227         take into account associated domains.
2228
2229         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2230
2231 2017-07-20  Chris Dumez  <cdumez@apple.com>
2232
2233         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
2234         https://bugs.webkit.org/show_bug.cgi?id=174660
2235
2236         Reviewed by Geoffrey Garen.
2237
2238         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
2239         This essentially replaces a branch to figure out if the new size is less or greater than the
2240         current size by an assertion.
2241
2242         * Platform/IPC/ArgumentCoders.h:
2243         * UIProcess/Gamepad/UIGamepadProvider.cpp:
2244         (WebKit::UIGamepadProvider::platformGamepadConnected):
2245         * UIProcess/WebProcessPool.cpp:
2246         (WebKit::WebProcessPool::setInitialConnectedGamepads):
2247         * WebProcess/Network/WebLoaderStrategy.cpp:
2248         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
2249         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
2250         (WebKit::WebPasteboardOverrides::getDataForOverride):
2251         * WebProcess/WebPage/ios/WebPageIOS.mm:
2252         (WebKit::WebPage::requestAutocorrectionData):
2253
2254 2017-07-20  Chris Dumez  <cdumez@apple.com>
2255
2256         Regression(ITP): Can no longer log in on abc.go.com
2257         https://bugs.webkit.org/show_bug.cgi?id=174533
2258         <rdar://problem/33325881>
2259
2260         Reviewed by Geoffrey Garen.
2261
2262         Bump statistics database version to blow away any existing statistics. Without this, SSO providers
2263         for which we added a quirk may already be in the database and identified as trackers. The quirk
2264         merely prevents the specified SSO providers from being identified as trackers.
2265
2266         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2267
2268 2017-07-19  Simon Fraser  <simon.fraser@apple.com>
2269
2270         getBoundingClientRects not updated for programmatic scrolls
2271         https://bugs.webkit.org/show_bug.cgi?id=174538
2272         rdar://problem/33049012
2273
2274         Reviewed by Tim Horton.
2275         
2276         Feed ViewportRectStability and ScrollingLayerPositionAction into reconcileScrollingState().
2277
2278         * WebProcess/WebPage/ios/WebPageIOS.mm:
2279         (WebKit::WebPage::updateVisibleContentRects):
2280
2281 2017-07-19  Brady Eidson  <beidson@apple.com>
2282
2283         iBooks sometimes crashes when closing a book.
2284         <rdar://problem/31180331> and https://bugs.webkit.org/show_bug.cgi?id=174658
2285
2286         Reviewed by Oliver Hunt.
2287
2288         - LegacyCustomProtocolManagerProxy should not reference a WebProcessPool directly.
2289         - LegacyCustomProtocolManagerProxy should invalidate in its destructor.
2290
2291         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp:
2292         (WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy):
2293         (WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy):
2294         (WebKit::LegacyCustomProtocolManagerProxy::startLoading):
2295         (WebKit::LegacyCustomProtocolManagerProxy::stopLoading):
2296         (WebKit::LegacyCustomProtocolManagerProxy::invalidate):
2297         (WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest):
2298         (WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse):
2299         (WebKit::LegacyCustomProtocolManagerProxy::didLoadData):
2300         (WebKit::LegacyCustomProtocolManagerProxy::didFailWithError):
2301         (WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading):
2302         (WebKit::LegacyCustomProtocolManagerProxy::processDidClose): Deleted.
2303         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h:
2304
2305         * UIProcess/Network/NetworkProcessProxy.cpp:
2306         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
2307         (WebKit::NetworkProcessProxy::didClose):
2308         * UIProcess/Network/NetworkProcessProxy.h:
2309         (WebKit::NetworkProcessProxy::processPool):
2310
2311 2017-07-19  Yusuke Suzuki  <utatane.tea@gmail.com>
2312
2313         [WTF] Implement WTF::ThreadGroup
2314         https://bugs.webkit.org/show_bug.cgi?id=174081
2315
2316         Reviewed by Mark Lam.
2317
2318         * Shared/AsyncRequest.h:
2319
2320 2017-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2321
2322         WebDriver: handle invalid selector errors
2323         https://bugs.webkit.org/show_bug.cgi?id=174619
2324
2325         Reviewed by Brian Burg.
2326
2327         We are currently handling only XPathException and only when it's an invalid expression. In the xpath case, the
2328         spec also says "If any item in result is not an element return an error with error code invalid selector.", so
2329         we should also handle TYPE_ERR (The expression could not be converted to return the specified type.). However,
2330         since the spec says "or other error", I think we can simplify this and simply throw InvalidSelector inside the
2331         catch, without checking any specific error. This is causing 14 failures in selenium tests.
2332
2333         §12. Element Retrieval. Step 6: If a DOMException, SyntaxError, XPathException, or other error occurs during the
2334         execution of the element location strategy, return error invalid selector.
2335         https://www.w3.org/TR/webdriver/#dfn-find
2336
2337         * UIProcess/Automation/Automation.json: Add InvalidSelector error.
2338         * UIProcess/Automation/atoms/FindNodes.js:
2339         (tryToFindNode): Raise InvalidSelector in case of error.
2340         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2341         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidSelector exceptions.
2342
2343 2017-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2344
2345         Web Automation: error details not passed to DidEvaluateJavaScriptFunction message when callback was not called before page unload
2346         https://bugs.webkit.org/show_bug.cgi?id=174624
2347
2348         Reviewed by Brian Burg.
2349
2350         There's a variable errorMessage, but it's unused.
2351
2352         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2353         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): Pass errorMessage instead of String() to DidEvaluateJavaScriptFunction.
2354
2355 2017-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2356
2357         Web Automation: evaluateJavaScriptFunction should always notify the web process before returning early
2358         https://bugs.webkit.org/show_bug.cgi?id=174623
2359
2360         Reviewed by Brian Burg.
2361
2362         It currently returns early if page, frame or scriptObject are nullptr, in which cases the UI process is not
2363         notified. This causes test testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs to hang, because message
2364         DidEvaluateJavaScriptFunction is never sent when the given frame no longer exists. We should send
2365         DidEvaluateJavaScriptFunction with WindowNotFound in case of page is nullptr and FrameNotFound if the frame is
2366         nullptr. The scriptObject early return is actually wrong, because scriptObjectForFrame creates a new script if
2367         there's isn't one for the given frame.
2368
2369         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2370         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
2371
2372 2017-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2373
2374         Web Automation: pending evaluate script callbacks are stored with the wrong frame ID when using the default main frame
2375         https://bugs.webkit.org/show_bug.cgi?id=174622
2376
2377         Reviewed by Brian Burg.
2378
2379         The frameHandle argument is optional in evaluateJavaScriptFunction(), when not provided we pass 0 to the web
2380         process. The proxy gets the web page main frame when received frame ID is 0, but the given frameID is
2381         still used as key of m_webFramePendingEvaluateJavaScriptCallbacksMap and also passed to the javascript function
2382         as argument. I think r203442 was actually a workaround to this bug, making it even more hidden. Both
2383         m_webFrameScriptObjectMap and m_webFramePendingEvaluateJavaScriptCallbacksMap should never have 0 as a
2384         key, since they always use a frame ID, and the frame identifier counter starts at 1. This is causing test
2385         testShouldDetectPageLoadsWhileWaitingOnAnAsyncScriptAndReturnAnError to hang, because when the page is unloaded
2386         and didClearWindowObjectForFrame is called, we try to get the pending callbacks of frame 1, but they were stored
2387         as frame 0 so DidEvaluateJavaScriptFunction message is never sent to the UI process.
2388
2389         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2390         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use always the actual frameID from the WebFrame
2391         we are using.
2392         * WebProcess/Automation/WebAutomationSessionProxy.h: Do not allow 0 as a key of
2393         m_webFramePendingEvaluateJavaScriptCallbacksMap and m_webFrameScriptObjectMap.
2394
2395 2017-07-18  Andy Estes  <aestes@apple.com>
2396
2397         [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
2398         https://bugs.webkit.org/show_bug.cgi?id=174631
2399
2400         Reviewed by Tim Horton.
2401
2402         * Configurations/Base.xcconfig:
2403         * Shared/API/APIArray.cpp:
2404         (API::Array::toStringVector):
2405         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
2406         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray):
2407         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2408         (WebKit::WebUserContentControllerProxy::addProcess):
2409         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
2410         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2411         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2412         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
2413         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2414         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
2415
2416 2017-07-18  Andy Estes  <aestes@apple.com>
2417
2418         [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
2419         https://bugs.webkit.org/show_bug.cgi?id=174631
2420
2421         Reviewed by Sam Weinig.
2422
2423         * Configurations/Base.xcconfig:
2424
2425 2017-07-18  Andy Estes  <aestes@apple.com>
2426
2427         [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
2428         https://bugs.webkit.org/show_bug.cgi?id=174631
2429
2430         Reviewed by Dan Bernstein.
2431
2432         * Configurations/Base.xcconfig:
2433
2434 2017-07-18  Matt Lewis  <jlewis3@apple.com>
2435
2436         Unreviewed, rolling out r219610.
2437
2438         This caused an api failure on all platforms for the test
2439         SnapshotImageLargeAsyncDecoding
2440
2441         Reverted changeset:
2442
2443         "Async image decoding for large images should be disabled
2444         after the first time a tile is painted"
2445         https://bugs.webkit.org/show_bug.cgi?id=174451
2446         http://trac.webkit.org/changeset/219610
2447
2448 2017-07-18  Andy Estes  <aestes@apple.com>
2449
2450         [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
2451         https://bugs.webkit.org/show_bug.cgi?id=174631
2452
2453         Reviewed by Darin Adler.
2454
2455         * Configurations/Base.xcconfig:
2456
2457 2017-07-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
2458
2459         Async image decoding for large images should be disabled after the first time a tile is painted
2460         https://bugs.webkit.org/show_bug.cgi?id=174451
2461
2462         Reviewed by Simon Fraser.
2463
2464         * Shared/mac/RemoteLayerBackingStore.mm:
2465         (WebKit::RemoteLayerBackingStore::drawInContext):
2466         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2467         (WebKit::CompositingCoordinator::paintContents):
2468         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2469
2470 2017-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2471
2472         Web Automation: link and partial link queries don't work if text link contains trailing or leading whitespaces
2473         https://bugs.webkit.org/show_bug.cgi?id=174499
2474
2475         Reviewed by Brian Burg.
2476
2477         This is causing test test_Driver_Can_Get_Link_By_Link_Test_Ignoring_Trailing_Whitespace to fail.
2478
2479         * UIProcess/Automation/atoms/FindNodes.js:
2480         (switch): Use normalize-space() in in the links xpath expressions.
2481
2482 2017-07-17  Darin Adler  <darin@apple.com>
2483
2484         Improve use of NeverDestroyed
2485         https://bugs.webkit.org/show_bug.cgi?id=174348
2486
2487         Reviewed by Sam Weinig.
2488
2489         * DatabaseProcess/DatabaseProcess.h: Removed unneeded include of
2490         NeverDestroyed.h.
2491         * NetworkProcess/cache/NetworkCacheKey.cpp: Ditto.
2492
2493         * NetworkProcess/capture/NetworkCaptureManager.cpp: Moved include of
2494         NeverDestroyed.h here ...
2495         * NetworkProcess/capture/NetworkCaptureManager.h: ... from here.
2496
2497         * PluginProcess/PluginProcess.cpp: Moved include of NeverDestroyed.h
2498         here ...
2499         * PluginProcess/PluginProcess.h: ... from here.
2500
2501         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
2502         (isContainerClass): Removed trivial inefficient use of
2503         LazyNeverDestroyed<HashSet> to check against two classes.
2504         Instead wrote out the boolean expression.
2505
2506         * Shared/mac/SecItemShim.cpp: Removed unneeded include of
2507         NeverDestroyed.h.
2508
2509         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2510         (WebKit::WebProcessPool::platformInitialize): Call
2511         installMemoryPressureHandler instead of WebMemoryPressureHandler::singleton.
2512
2513         * UIProcess/Gamepad/UIGamepadProvider.h: Removed unneeded include
2514         of NeverDestroyed.h.
2515
2516         * UIProcess/Plugins/PluginProcessManager.cpp: Moved include of
2517         NeverDestroyed.h here ...
2518         * UIProcess/Plugins/PluginProcessManager.h: ... from here.
2519
2520         * UIProcess/WebInspectorProxy.cpp: Removed unneeded include
2521         of NeverDestroyed.h.
2522
2523         * UIProcess/WebPageProxy.h: Added now-needed include of
2524         MediaPlaybackTargetContext.h.
2525
2526         * UIProcess/WebPasteboardProxy.cpp: Moved include of
2527         NeverDestroyed.h here ...
2528         * UIProcess/WebPasteboardProxy.h: ... from here.
2529
2530         * UIProcess/ios/WebMemoryPressureHandlerIOS.h: Removed the
2531         WebMemoryPressureHandler class from this header. Callers don't need to
2532         know if there is a class. They simply indicate when it's time to install
2533         the handler. Another way to put it is that this class had no functions
2534         other than the singleton function.
2535
2536         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
2537         (WebKit::installMemoryPressureHandler): Replaced the class with this function.
2538         It creates a dispatch source and then resumes it. To avoid having the source
2539         look like a leak, we keep it in a global variable.
2540
2541         * WebProcess/Gamepad/WebGamepadProvider.h: Include Forward.h instead of
2542         NeverDestroyed.h.
2543
2544         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Moved include of
2545         NeverDestroyed.h here ...
2546         * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: ... from here.
2547
2548         * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Removed unneeded
2549         include of NeverDestroyed.h.
2550
2551 2017-07-17  Timothy Horton  <timothy_horton@apple.com>
2552
2553         Page using safe area constant properties jumps to correct layout after resize
2554         https://bugs.webkit.org/show_bug.cgi?id=174598
2555         <rdar://problem/33364275>
2556
2557         Reviewed by Simon Fraser.
2558
2559         Test: fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html
2560
2561         * UIProcess/API/Cocoa/WKWebView.mm:
2562         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2563         * UIProcess/WebPageProxy.h:
2564         * UIProcess/ios/WebPageProxyIOS.mm:
2565         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2566         * WebProcess/WebPage/WebPage.h:
2567         * WebProcess/WebPage/WebPage.messages.in:
2568         * WebProcess/WebPage/ios/WebPageIOS.mm:
2569         (WebKit::WebPage::dynamicViewportSizeUpdate):
2570         Plumb unobscured safe area insets through in the dynamicViewportSizeUpdate,
2571         like we do in VisibleContentRectUpdate (once again sad that these aren't
2572         more similar), so that it will be correct in the during-rotation snapshot,
2573         instead of only becoming correct in the first visible content rect update
2574         post-rotation.
2575
2576 2017-07-17  Chris Dumez  <cdumez@apple.com>
2577
2578         UserMediaPermissionRequestManagerProxy should not use WebCore::Timer
2579         https://bugs.webkit.org/show_bug.cgi?id=174599
2580         <rdar://problem/33362600>
2581
2582         Reviewed by Tim Horton.
2583
2584         UserMediaPermissionRequestManagerProxy should not use WebCore::Timer since it runs in the
2585         UIProcess. Switch to using RunLoop::Timer instead.
2586
2587         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2588         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
2589         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2590
2591 2017-07-17  Chris Dumez  <cdumez@apple.com>
2592
2593         NETWORK_SESSION does not need didReceiveAuthenticationChallenge(uint64_t, uint64_t, const AuthenticationChallenge&)
2594         https://bugs.webkit.org/show_bug.cgi?id=174595
2595
2596         Reviewed by Alex Christensen.
2597
2598         * Shared/Authentication/AuthenticationManager.cpp:
2599         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2600         * Shared/Authentication/AuthenticationManager.h:
2601
2602 2017-07-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2603
2604         [iOS DnD] Web process uses too much memory when beginning a drag on a very large image
2605         https://bugs.webkit.org/show_bug.cgi?id=174585
2606         <rdar://problem/33302541>
2607
2608         Reviewed by Tim Horton.
2609
2610         Add IPC support for serializing/deserializing the size of an image written to the pasteboard. See WebCore
2611         ChangeLogs for more details.
2612
2613         * Shared/WebCoreArgumentCoders.cpp:
2614         (IPC::ArgumentCoder<PasteboardImage>::encode):
2615         (IPC::ArgumentCoder<PasteboardImage>::decode):
2616
2617 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
2618
2619         Unreviewed attempt to fix Mac cmake build
2620
2621         * PlatformMac.cmake: Remove reference to file which is gone since r219025
2622
2623 2017-07-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2624
2625         [CMake] Include most CMake modules from WebKitCommon.cmake
2626         https://bugs.webkit.org/show_bug.cgi?id=174546
2627
2628         Reviewed by Konstantin Tokarev.
2629
2630         * CMakeLists.txt:
2631
2632 2017-07-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2633
2634         [CMake] Macros in WebKitMacros.cmake should be prefixed with WEBKIT_ namespace
2635         https://bugs.webkit.org/show_bug.cgi?id=174547
2636
2637         Reviewed by Alex Christensen.
2638
2639         * CMakeLists.txt:
2640
2641 2017-07-17  Alex Christensen  <achristensen@webkit.org>
2642
2643         Modernize content extension code
2644         https://bugs.webkit.org/show_bug.cgi?id=174588
2645
2646         Reviewed by Sam Weinig.
2647
2648         * WebProcess/UserContent/WebUserContentController.cpp:
2649         (WebKit::WebUserContentController::addContentRuleLists):
2650
2651 2017-07-17  Jeremy Jones  <jeremyj@apple.com>
2652
2653         Add video fullscreen transition logging.
2654         https://bugs.webkit.org/show_bug.cgi?id=174474
2655
2656         Reviewed by Jer Noble.
2657
2658         No functional change. Just adds logging.
2659
2660         * Platform/Logging.h:
2661         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2662         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
2663         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
2664         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
2665         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
2666         (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
2667         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
2668         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
2669         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
2670
2671 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
2672
2673         [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
2674         https://bugs.webkit.org/show_bug.cgi?id=174557
2675
2676         Reviewed by Michael Catanzaro.
2677
2678         * CMakeLists.txt:
2679
2680 2017-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2681
2682         Web Automation: link and partial link queries don't work if the link contains formatting tags
2683         https://bugs.webkit.org/show_bug.cgi?id=174498
2684
2685         Reviewed by Brian Burg.
2686
2687         So, for example, if we find links with text "Foo" and there's a link like <a href=""><bA>Foo</b></a> we fail
2688         with no such element error. This causes test test_Link_With_Formatting_Tags to fail.
2689
2690         * UIProcess/Automation/atoms/FindNodes.js:
2691         (switch): Use descendant-or-self::text() instead of just text() in the links xpath expressions.
2692
2693 2017-07-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2694
2695         Web Automation: FindNodes should throw an error in case of invalid strategy
2696         https://bugs.webkit.org/show_bug.cgi?id=174497
2697
2698         Reviewed by Brian Burg.
2699
2700         We are currently returning null or empty list. According to the spec in 12.2 Find Element and 12.3 Find
2701         Elements, step 4: "If location strategy is not present as a keyword in the table of location strategies, return
2702         error with error code invalid argument.".
2703         https://www.w3.org/TR/webdriver/#find-element.
2704
2705         This is causing test test_should_throw_an_error_if_user_passes_in_invalid_by_when_find_elements to fail.
2706
2707         * UIProcess/Automation/atoms/FindNodes.js:
2708         (switch): Throw an error in case of unknown strategy.
2709         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2710         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidParameter exceptions.
2711
2712 2017-07-16  Brady Eidson  <beidson@apple.com>
2713
2714         Crash when a WKHTTPCookieStore outlives its owning WKWebsiteDataStore.
2715         <rdar://problem/33341730> and https://bugs.webkit.org/show_bug.cgi?id=174574
2716
2717         Reviewed by Tim Horton.
2718
2719         Instead of holding a weak reference to its owning API::WebsiteDataStore,
2720         API::HTTPCookieStore can hold a strong reference to the owner's implementation
2721         WebKit::WebsiteDataStore.
2722         
2723         * UIProcess/API/APIHTTPCookieStore.cpp:
2724         (API::HTTPCookieStore::HTTPCookieStore):
2725         (API::HTTPCookieStore::cookies):
2726         (API::HTTPCookieStore::setCookie):
2727         (API::HTTPCookieStore::deleteCookie):
2728         (API::HTTPCookieStore::registerObserver):
2729         (API::HTTPCookieStore::unregisterObserver):
2730         (API::HTTPCookieStore::cookieManagerDestroyed):
2731         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
2732         * UIProcess/API/APIHTTPCookieStore.h:
2733
2734 2017-07-15  Brady Eidson  <beidson@apple.com>
2735
2736         Make sure all CFHTTPCookieStorageRefs we create are scheduled.
2737         <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
2738
2739         Reviewed by Tim Horton.
2740
2741         Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
2742         We need to schedule it on the appropriate RunLoop.
2743         
2744         This patch also cleans up the creation of the identifying data itself.
2745         
2746         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2747         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2748
2749         * Shared/cf/CookieStorageUtilsCF.h: Added.
2750         * Shared/cf/CookieStorageUtilsCF.mm: Added.
2751         (WebKit::cookieStorageFromIdentifyingData):
2752         (WebKit::identifyingDataFromCookieStorage):
2753
2754         * Shared/mac/ChildProcessMac.mm:
2755         (WebKit::ChildProcess::setSharedHTTPCookieStorage):
2756
2757         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2758         (WebKit::WebProcessPool::platformInitializeWebProcess):
2759         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2760
2761         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2762         (WebKit::WebsiteDataStore::parameters):
2763
2764         * WebKit.xcodeproj/project.pbxproj:
2765
2766         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2767         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2768
2769 2017-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2770
2771         [iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating
2772         https://bugs.webkit.org/show_bug.cgi?id=174539
2773         <rdar://problem/33307395>
2774
2775         Reviewed by Darin Adler.
2776
2777         Small tweak to avoid presenting at the element rect or text rect if the interaction information failed to
2778         capture valid bounds for the element. We instead fall back to presenting at the touch location. This addresses
2779         problems when presenting the action sheet popover on image maps on iPad, where GetPositionInformation fails to
2780         capture correct data about for the <area>.
2781
2782         * UIProcess/ios/WKActionSheetAssistant.mm:
2783         (presentationStyleForView):
2784
2785 2017-07-14  Jonathan Bedard  <jbedard@apple.com>
2786
2787         Add iOS 11 SPI
2788         https://bugs.webkit.org/show_bug.cgi?id=174430
2789         <rdar://problem/33269288>
2790
2791         Reviewed by Tim Horton.
2792
2793         * Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11.
2794         * UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h.
2795
2796 2017-07-14  Jeff Miller  <jeffm@apple.com>
2797
2798         -[WKWebProcessBundleParameters setParametersForKeyWithDictionary:] passing wrong parameters to -setParameter:forKey
2799         https://bugs.webkit.org/show_bug.cgi?id=174524
2800
2801         Reviewed by Sam Weinig.
2802
2803         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
2804         (-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:]):
2805         Pass the dictionary key and value in the correct order.
2806
2807 2017-07-14  Brent Fulgham  <bfulgham@apple.com>
2808
2809         Monitor directory for new statistics files after a delete operation
2810         https://bugs.webkit.org/show_bug.cgi?id=174521
2811         <rdar://problem/33322189>
2812
2813         Reviewed by Chris Dumez.
2814
2815         Create a FileMonitor to watch the data directory when the statistics file is
2816         deleted by an external process. If it sees the file get created externally, merge
2817         those data into the in-memory store.
2818
2819         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
2820         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): Added.
2821         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
2822         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
2823
2824 2017-07-14  Matt Lewis  <jlewis3@apple.com>
2825
2826         Unreviewed, rolling out r219516.
2827
2828         This caused an API failure on macOS.
2829
2830         Reverted changeset:
2831
2832         "Make sure all CFHTTPCookieStorageRefs we create are
2833         scheduled."
2834         https://bugs.webkit.org/show_bug.cgi?id=174513
2835         http://trac.webkit.org/changeset/219516
2836
2837 2017-07-14  Daniel Bates  <dabates@apple.com>
2838
2839         REGRESSION (r219013): Compute source frame info for frameless document
2840         https://bugs.webkit.org/show_bug.cgi?id=174385
2841         <rdar://problem/33217736>
2842
2843         Reviewed by Brady Eidson.
2844
2845         Fixes an issue where we would crash in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
2846         when computing the frame info for a now-frameless document. One way this can happen is when the frame
2847         that contains the document that initiated the navigation is removed from the page.
2848
2849         * UIProcess/WebPageProxy.cpp:
2850         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check that we have a valid page ID before
2851         looking up the WebPage object corresponding to it.
2852         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2853         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Compute a FrameInfoData
2854         object from the source document directly as opposed to using WebFrame::info() as the latter requires
2855         that we have a valid WebCore frame and the source document may not have a frame.
2856
2857 2017-07-14  Jer Noble  <jer.noble@apple.com>
2858
2859         Allow clients to override their own hardware media requirements where no fallback media exists.
2860         https://bugs.webkit.org/show_bug.cgi?id=174426
2861         <rdar://problem/32537704>
2862
2863         Reviewed by Eric Carlson.
2864
2865         Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both to control
2866         WebCore's new allowMediaContentTypesRequiringHardwareSupportAsFallback setting.
2867
2868         * Shared/WebPreferencesDefinitions.h:
2869         * UIProcess/API/C/WKPreferences.cpp:
2870         (WKPreferencesGetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
2871         (WKPreferencesSetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
2872         * UIProcess/API/C/WKPreferencesRef.h:
2873         * UIProcess/API/Cocoa/WKWebView.mm:
2874         (-[WKWebView _initializeWithConfiguration:]):
2875         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2876         (-[WKWebViewConfiguration init]):
2877         (-[WKWebViewConfiguration copyWithZone:]):
2878         (-[WKWebViewConfiguration _setAllowMediaContentTypesRequiringHardwareSupportAsFallback:]):
2879         (-[WKWebViewConfiguration _allowMediaContentTypesRequiringHardwareSupportAsFallback]):
2880         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2881         * WebProcess/WebPage/WebPage.cpp:
2882         (WebKit::WebPage::updatePreferences):
2883
2884 2017-07-14  Chris Dumez  <cdumez@apple.com>
2885
2886         Possible crash under NetworkSocketStream::didFailSocketStream()
2887         https://bugs.webkit.org/show_bug.cgi?id=174526
2888         <rdar://problem/32831441>
2889
2890         Reviewed by Brent Fulgham.
2891
2892         For robustness, initialize the SocketStreamHandleImpl after the other
2893         data members. We are passing |this| to the SocketStreamHandleImpl when
2894         constructing it so it is unsafe to have uninitialized data members
2895         at this point.
2896
2897         * NetworkProcess/NetworkSocketStream.cpp:
2898         (WebKit::NetworkSocketStream::NetworkSocketStream):
2899         * NetworkProcess/NetworkSocketStream.h:
2900
2901 2017-07-14  Michael Catanzaro  <mcatanzaro@igalia.com>
2902
2903         [CMake] Unclear distinction between WebKitHelpers and WebKitMacros
2904         https://bugs.webkit.org/show_bug.cgi?id=153189
2905
2906         Reviewed by Antonio Gomes.
2907
2908         New location for macros that are exclusively needed here.
2909
2910         * CMakeLists.txt:
2911
2912 2017-07-14  Brady Eidson  <beidson@apple.com>
2913
2914         Make sure all CFHTTPCookieStorageRefs we create are scheduled.
2915         <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
2916
2917         Reviewed by Tim Horton.
2918
2919         Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
2920         We need to schedule it on a RunLoop.
2921         
2922         This patch also cleans up the creation of the identifying data itself.
2923         
2924         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2925         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2926         
2927         * Shared/cf/CookieStorageUtilsCF.cpp: Added.
2928         (WebKit::cookieStorageFromIdentifyingData):
2929         (WebKit::identifyingDataFromCookieStorage):
2930         * Shared/cf/CookieStorageUtilsCF.h: Added.
2931         
2932         * Shared/mac/ChildProcessMac.mm:
2933         (WebKit::ChildProcess::setSharedHTTPCookieStorage):
2934         
2935         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2936         (WebKit::WebProcessPool::platformInitializeWebProcess):
2937         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2938         
2939         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2940         (WebKit::WebsiteDataStore::parameters):
2941         
2942         * WebKit.xcodeproj/project.pbxproj:
2943         
2944         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2945         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2946
2947 2017-07-14  Chris Dumez  <cdumez@apple.com>
2948
2949         Potential null-dereference under NetworkRTCProvider::resolvedName()
2950         https://bugs.webkit.org/show_bug.cgi?id=174507
2951         <rdar://problem/32597868>
2952
2953         Reviewed by Youenn Fablet.
2954
2955         NetworkRTCProvider::resolvedName() could do a null dereference of m_connection
2956         because m_connection is nullified in NetworkRTCProvider::close() but resolvers
2957         were only closed later on in the NetworkRTCProvider destructor.
2958
2959         To address the issue, we now stop DNS resolvers earlier, in NetworkRTCProvider::close().
2960         Also fix unsafe modification of m_resolvers HashMap when iterating over it.
2961
2962         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2963         (WebKit::NetworkRTCProvider::~NetworkRTCProvider):
2964         (WebKit::NetworkRTCProvider::close):
2965         (WebKit::NetworkRTCProvider::Resolver::~Resolver):
2966         (WebKit::NetworkRTCProvider::stopResolver):
2967
2968 2017-07-14  Youenn Fablet  <youenn@apple.com>
2969
2970         Report CoreAudioCaptureSource failure in case shared unit stops working properly
2971         https://bugs.webkit.org/show_bug.cgi?id=174494
2972
2973         Reviewed by Eric Carlson.
2974
2975         In case of capture failure, send a CaptureFailure message so that the
2976         correct behavior happens in the Web process.
2977
2978         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2979         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2980         (WebKit::UserMediaCaptureManager::captureFailed):
2981         * WebProcess/cocoa/UserMediaCaptureManager.h:
2982         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
2983
2984 2017-07-13  Chris Dumez  <cdumez@apple.com>
2985
2986         Better deal with changes to the ResourceLoadStatisticsStore file on disk
2987         https://bugs.webkit.org/show_bug.cgi?id=174487
2988
2989         Reviewed by Brent Fulgham.
2990
2991         Rename WebResourceLoadStatisticsStore's resetDataFromDecoder() to mergeWithDataFromDecoder()
2992         and update it so that it actual merges the data from the disk with the one we have in memory,
2993         instead of replacing it. This avoid data loss.
2994
2995         We leverage the existing WebResourceLoadStatisticsStore::mergeStatistics() to merge the
2996         statistics.
2997
2998         To faciliate merging the operating dates, they are now represented as OperatingDate objects
2999         instead of WallTime objects. OperatingDate only include date precision, no time information.
3000         As a result, the merge 2 vectors of OperatingDate objects, we can:
3001         1. Merge the 2 sorted vectors (using std::merge())
3002         2. Get rid of duplicates (easy because of date-level precision)
3003         3. Drop old dates until the vector has at most 30 items.
3004
3005         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
3006         (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
3007         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
3008         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3009         (WebKit::OperatingDate::fromWallTime):
3010         (WebKit::OperatingDate::today):
3011         (WebKit::OperatingDate::secondsSinceEpoch):
3012         (WebKit::OperatingDate::operator==):
3013         (WebKit::OperatingDate::operator<):
3014         (WebKit::OperatingDate::operator<=):
3015         (WebKit::OperatingDate::OperatingDate):
3016         (WebKit::mergeOperatingDates):
3017         (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData):
3018         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
3019         (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
3020         (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
3021         * UIProcess/WebResourceLoadStatisticsStore.h:
3022
3023 2017-07-13  Dan Bernstein  <mitz@apple.com>
3024
3025         Removed empty project directories left behind after the rename
3026
3027         * WebKit2.xcodeproj: Removed.
3028
3029 2017-07-13  Matthew Hanson  <matthew_hanson@apple.com>
3030
3031         Fix the cMake builds (GTK and WPE.)
3032         https://bugs.webkit.org/show_bug.cgi?id=174164
3033         rdar://problem/33137595
3034
3035         Reviewed by Dan Bernstein.
3036
3037         * Scripts/generate-forwarding-headers.pl:
3038         (collectFrameworkHeaderPaths):
3039         (createForwardingHeadersForFramework):
3040
3041 2017-07-13  Matthew Hanson  <matthew_hanson@apple.com>
3042
3043         Rename WebKit2.xcodeproj to WebKit.xcodeproj.
3044         https://bugs.webkit.org/show_bug.cgi?id=174164
3045         rdar://problem/33137595
3046
3047         Reviewed by Dan Bernstein.
3048
3049         * WebKit.xcodeproj/project.pbxproj: Renamed from Source/WebKit/WebKit2.xcodeproj/project.pbxproj.
3050
3051 2017-07-13  Matthew Hanson  <matthew_hanson@apple.com>
3052
3053         Update tools and configurations after renaming Source/WebKit2 to Source/WebKit.
3054         https://bugs.webkit.org/show_bug.cgi?id=174164
3055         rdar://problem/33137595
3056
3057         Reviewed by Dan Bernstein.
3058
3059         * PlatformGTK.cmake:
3060         * Shared/API/c/wpe/WebKit.h:
3061
3062 2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
3063
3064         Fix compiler warnings when building with GCC 7
3065         https://bugs.webkit.org/show_bug.cgi?id=174463
3066
3067         Reviewed by Darin Adler.
3068
3069         * Platform/IPC/unix/ConnectionUnix.cpp:
3070         (IPC::Connection::sendOutputMessage):
3071
3072 2017-07-13  Chris Dumez  <cdumez@apple.com>
3073
3074         Moved filesystem code out of WebResourceLoadStatisticsStore class
3075         https://bugs.webkit.org/show_bug.cgi?id=174435
3076
3077         Reviewed by Brent Fulgham.
3078
3079         Moved filesystem code out of WebResourceLoadStatisticsStore class and into
3080         a new ResourceLoadStatisticsPersistentStorage class to decrease complexity.
3081
3082         * CMakeLists.txt:
3083         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3084         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added.
3085         (WebKit::hasFileChangedSince):
3086         (WebKit::createDecoderForFile):
3087         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
3088         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
3089         (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath):
3090         (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath):
3091         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
3092         (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk):
3093         (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
3094         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
3095         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
3096         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
3097         (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
3098         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
3099         (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
3100         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added.
3101         * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added.
3102         (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
3103         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3104         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3105         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3106         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
3107         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
3108         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3109         (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder):
3110         * UIProcess/WebResourceLoadStatisticsStore.h:
3111         * WebKit2.xcodeproj/project.pbxproj:
3112
3113 2017-07-13  Chris Dumez  <cdumez@apple.com>
3114
3115         Unreviewed, rolling out r219453.
3116
3117         Seems to cause some crashes on the bots
3118
3119         Reverted changeset:
3120
3121         "Moved filesystem code out of WebResourceLoadStatisticsStore
3122         class"
3123         https://bugs.webkit.org/show_bug.cgi?id=174435
3124         http://trac.webkit.org/changeset/219453
3125
3126 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
3127
3128         Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
3129         https://bugs.webkit.org/show_bug.cgi?id=174448
3130
3131         Reviewed by Eric Carlson.
3132
3133         No behavior change.
3134
3135         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
3136         * WebProcess/cocoa/WebVideoFullscreenManager.h:
3137
3138 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
3139
3140         Style fix. Replace strongThis with protectedThis.
3141         https://bugs.webkit.org/show_bug.cgi?id=174444
3142
3143         Reviewed by Eric Carlson.
3144
3145         Rename, no behavior change.
3146
3147         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
3148         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
3149         (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
3150         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
3151         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
3152
3153 2017-07-13  Chris Dumez  <cdumez@apple.com>
3154
3155         Moved filesystem code out of WebResourceLoadStatisticsStore class
3156         https://bugs.webkit.org/show_bug.cgi?id=174435
3157
3158         Reviewed by Brent Fulgham.
3159
3160         Moved filesystem code out of WebResourceLoadStatisticsStore class and into
3161         a new ResourceLoadStatisticsPersistentStorage class to decrease complexity.
3162
3163         * CMakeLists.txt:
3164         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3165         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added.
3166         (WebKit::hasFileChangedSince):
3167         (WebKit::createDecoderForFile):
3168         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
3169         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
3170         (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath):
3171         (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath):
3172         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
3173         (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk):
3174         (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
3175         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
3176         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
3177         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
3178         (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
3179         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
3180         (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
3181         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added.
3182         * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added.
3183         (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
3184         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3185         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3186         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3187         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
3188         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
3189         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3190         (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder):
3191         * UIProcess/WebResourceLoadStatisticsStore.h:
3192         * WebKit2.xcodeproj/project.pbxproj:
3193
3194 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3195
3196         Web Automation: evaluateJavaScriptFunction should start the callback timeout after the function is applied
3197         https://bugs.webkit.org/show_bug.cgi?id=174421
3198
3199         Reviewed by Brian Burg.
3200
3201         This is causing selenium test testShouldNotTimeoutIfScriptCallsbackInsideAZeroTimeout to fail, because
3202         JavaScriptTimeout error is generated unexpectedly. When no script timeout is specified, 0 is used by default,
3203         which means we do a setTimeout with 0 and then the script does another setTimeout with 0, but ours is dispatched
3204         before and reportTimeoutError is called. We should start our timeout after applying the function, and only if
3205         the result hasn't been reported yet.
3206
3207         * WebProcess/Automation/WebAutomationSessionProxy.js:
3208         (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction):
3209
3210 2017-07-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3211
3212         [iOS DnD] [WK2] Add SPI to enable, disable, or follow default behavior for DnD on a WKWebView
3213         https://bugs.webkit.org/show_bug.cgi?id=174440
3214         <rdar://problem/33272627>
3215
3216         Reviewed by Beth Dakin.
3217
3218         Adds a new _dragInteractionPolicy property to WKWebView, which an internal client may use to always allow
3219         dragging out of the web view (_WKDragInteractionPolicyAlwaysEnable), never allow
3220         (_WKDragInteractionPolicyAlwaysDisable) or just use the default device-dependent behavior
3221         (_WKDragInteractionPolicyDefault).
3222
3223         Also removes an extraneous class from WKContentViewInteraction.mm that is no longer used anywhere.
3224
3225         * UIProcess/API/Cocoa/WKWebView.mm:
3226         (-[WKWebView _initializeWithConfiguration:]):
3227
3228         Set _dragInteractionPolicy to _WKDragInteractionPolicyDefault upon initialization.
3229
3230         (-[WKWebView _dragInteractionPolicy]):
3231         (-[WKWebView _setDragInteractionPolicy:]):
3232         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3233         * UIProcess/ios/WKContentViewInteraction.h:
3234         * UIProcess/ios/WKContentViewInteraction.mm:
3235         (shouldEnableDragInteractionForPolicy):
3236         (-[WKContentView _didChangeDragInteractionPolicy]):
3237
3238         Called by the WKWebView when its _dragInteractionPolicy changes. The content view updates its
3239         UIDragInteraction's -enabled property here in response.
3240
3241         (-[WKContentView setupDataInteractionDelegates]):
3242
3243 2017-07-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
3244
3245         Async image decoding for large images should be disabled by default
3246         https://bugs.webkit.org/show_bug.cgi?id=174432
3247
3248         Reviewed by Simon Fraser.
3249
3250         -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by
3251            GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None
3252            by AllowAsyncImageDecoding.
3253         -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir 
3254            by resetting the bit PaintBehaviorAllowAsyncImageDecoding.
3255
3256         * Shared/mac/RemoteLayerBackingStore.mm:
3257         (WebKit::RemoteLayerBackingStore::drawInContext):
3258         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3259         (WebKit::imageForRect):
3260         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3261         (WebKit::InjectedBundleRangeHandle::renderedImage):
3262
3263 2017-07-12  Eric Carlson  <eric.carlson@apple.com>
3264
3265         [MediaStream] a capture source failure should end the MediaStreamTrack
3266         https://bugs.webkit.org/show_bug.cgi?id=174375
3267
3268         Reviewed by Youenn Fablet.
3269
3270         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3271         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Consolidate start/end.
3272         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): Deleted.
3273         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Deleted.
3274         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3275
3276         * UIProcess/WebPageProxy.cpp:
3277         (WebKit::WebPageProxy::isPlayingMediaDidChange): Call captureStateChanged if the capture 
3278         state changes. Consider interrupted flags.
3279
3280 2017-07-12  Daniel Bates  <dabates@apple.com>
3281
3282         NavigationAction should track whether the navigation was initiated by the main frame
3283         https://bugs.webkit.org/show_bug.cgi?id=174386
3284         <rdar://problem/33245267>
3285
3286         Reviewed by Brady Eidson.
3287
3288         * WebProcess/WebPage/WebInspector.cpp:
3289         (WebKit::WebInspector::openInNewTab): Pass whether the load was initiated by the main frame
3290         when instantiating the NavigationAction.
3291
3292 2017-07-12  Daniel Bates  <dabates@apple.com>
3293
3294         Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame
3295         https://bugs.webkit.org/show_bug.cgi?id=174427
3296
3297         Rubber-stamped by Brady Eidson.
3298
3299         * WebProcess/Plugins/PluginView.cpp:
3300         (WebKit::PluginView::loadURL):
3301         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3302         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
3303         * WebProcess/WebPage/WebInspector.cpp:
3304         (WebKit::WebInspector::openInNewTab):
3305
3306 2017-07-12  Matt Lewis  <jlewis3@apple.com>
3307
3308         Unreviewed, rolling out r219401.
3309
3310         This revision rolled out the previous patch, but after talking
3311         with reviewer, a rebaseline is what was needed.Rolling back in
3312         before rebaseline.
3313
3314         Reverted changeset:
3315
3316         "Unreviewed, rolling out r219379."
3317         https://bugs.webkit.org/show_bug.cgi?id=174400
3318         http://trac.webkit.org/changeset/219401
3319
3320 2017-07-12  Daniel Bates  <dabates@apple.com>
3321
3322         Update description of Secure Contexts experimental flag
3323         https://bugs.webkit.org/show_bug.cgi?id=174401
3324
3325         Reviewed by Simon Fraser.
3326
3327         Change the description of the Secure Contexts experimental flag from "isSecureContext attribute"
3328         to "Secure Contexts API".
3329
3330         * Shared/WebPreferencesDefinitions.h:
3331
3332 2017-07-12  Matt Lewis  <jlewis3@apple.com>
3333
3334         Unreviewed, rolling out r219379.
3335
3336         This revision caused a consistent failure in the test
3337         fast/dom/Window/property-access-on-cached-window-after-frame-
3338         removed.html.
3339
3340         Reverted changeset:
3341
3342         "Remove NAVIGATOR_HWCONCURRENCY"
3343         https://bugs.webkit.org/show_bug.cgi?id=174400
3344         http://trac.webkit.org/changeset/219379
3345
3346 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
3347
3348         [WPE] Use libepoxy
3349         https://bugs.webkit.org/show_bug.cgi?id=172104
3350
3351         Reviewed by Michael Catanzaro.
3352
3353         * PlatformWPE.cmake: Drop the EGL_INCLUDE_DIRS compilation flags.
3354         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3355         Include <epoxy/gl.h> when compiling with libepoxy usage enabled.
3356
3357 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3358
3359         Web Automation: upstream safaridriver's JavaScript atom implementations
3360         https://bugs.webkit.org/show_bug.cgi?id=172060
3361         <rdar://problem/32168187>
3362
3363         Reviewed by Brian Burg.
3364
3365         * UIProcess/Automation/atoms/ElementAttribute.js: Added.
3366         * UIProcess/Automation/atoms/ElementDisplayed.js: Added.
3367         * UIProcess/Automation/atoms/FindNodes.js: Added.
3368         * UIProcess/Automation/atoms/FormElementClear.js: Added.
3369         * UIProcess/Automation/atoms/FormSubmit.js: Added.
3370
3371 2017-07-11  Dean Jackson  <dino@apple.com>
3372
3373         Remove NAVIGATOR_HWCONCURRENCY
3374         https://bugs.webkit.org/show_bug.cgi?id=174400
3375
3376         Reviewed by Sam Weinig.
3377
3378         * Configurations/FeatureDefines.xcconfig:
3379
3380 2017-07-11  Ansh Shukla  <ansh_shukla@apple.com>
3381
3382         WKWindowFeatures needs to expose scrollbar, fullscreen, and dialog configuration properties
3383         https://bugs.webkit.org/show_bug.cgi?id=174239
3384
3385         Reviewed by Brady Eidson.
3386
3387         Add a new private header to expose getters for window feature properties already available
3388         in the TFB APIWindowFeatures class. These properties are necessary for Safari to adopt more
3389         modern API.
3390
3391         * UIProcess/API/Cocoa/WKWindowFeatures.mm:
3392         (-[WKWindowFeatures _locationBarVisibility]):
3393         (-[WKWindowFeatures _scrollbarsVisibility]):
3394         (-[WKWindowFeatures _fullscreenDisplay]):
3395         (-[WKWindowFeatures _dialogDisplay]):
3396         * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: Expose some window features as read-only
3397         properties.
3398         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
3399         * WebKit2.xcodeproj/project.pbxproj:
3400
3401 2017-07-11  Chris Dumez  <cdumez@apple.com>
3402
3403         Avoid duplicating default parameter values in [WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]
3404         https://bugs.webkit.org/show_bug.cgi?id=174402
3405
3406         Reviewed by Brent Fulgham.
3407
3408         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3409         (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
3410         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3411         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3412         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
3413         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3414         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
3415         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
3416         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
3417         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
3418         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
3419         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
3420         (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
3421         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies):
3422         (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
3423         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
3424         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
3425         (WebKit::WebResourceLoadStatisticsStore::pruneStatisticsIfNeeded):
3426         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
3427         * UIProcess/WebResourceLoadStatisticsStore.h:
3428
3429 2017-07-11  Dean Jackson  <dino@apple.com>
3430
3431         Rolling out r219372.
3432