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