IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-11-11  Brady Eidson  <beidson@apple.com>
2
3         IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
4         https://bugs.webkit.org/show_bug.cgi?id=164641
5
6         Reviewed by Alex Christensen.
7
8         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
9         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
10         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
11         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
12
13         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
14         (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
15         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
16
17 2016-11-11  Eric Carlson  <eric.carlson@apple.com>
18
19         [MediaStream] defer resolution of getUserMedia promise made in a background tab
20         https://bugs.webkit.org/show_bug.cgi?id=164643
21         <rdar://problem/29048317>
22
23         Reviewed by Brady Eidson.
24
25         Do not ask for user for access to capture devices when the document does not
26         allow media to play, wait until playback is allowed.
27
28         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
29         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
30         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
31         (WebKit::UserMediaPermissionRequestManager::mediaCanStart):
32         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension):
33         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
34         * WebProcess/Plugins/PluginView.cpp:
35         (WebKit::PluginView::mediaCanStart):
36         * WebProcess/Plugins/PluginView.h:
37
38 2016-11-11  Darin Adler  <darin@apple.com>
39
40         Move Node from ExceptionCode to ExceptionOr
41         https://bugs.webkit.org/show_bug.cgi?id=164515
42
43         Reviewed by Sam Weinig.
44
45         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
46         (webkit_dom_html_select_element_remove): Updated exception handling.
47         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
48         (webkit_dom_node_insert_before): Ditto.
49         (webkit_dom_node_replace_child): Ditto.
50         (webkit_dom_node_remove_child): Ditto.
51         (webkit_dom_node_append_child): Ditto.
52         (webkit_dom_node_clone_node_with_error): Ditto.
53         (webkit_dom_node_set_node_value): Ditto.
54         (webkit_dom_node_set_text_content): Ditto.
55         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
56         (-[WKDOMNode insertNode:before:]): Ditto.
57         (-[WKDOMNode appendChild:]): Ditto.
58         (-[WKDOMNode removeChild:]): Ditto.
59
60         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
61         (WebKit::PDFPlugin::PDFPlugin): Removed unneeded ASSERT_NO_EXCEPTION.
62         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
63         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Ditto.
64
65 2016-11-11  Megan Gardner  <megan_gardner@apple.com>
66
67         [Cocoa] Support wide gamut for Drag Image UI
68         https://bugs.webkit.org/show_bug.cgi?id=164490
69
70         Reviewed by Tim Horton.
71
72         Fixed an error in the gating for the new wide gamut support in ShareableBitmap.
73         We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage.
74         Added support for wide gamut in createCGImage.
75
76         * Shared/cg/ShareableBitmapCG.cpp:
77         (WebKit::bitmapInfo):
78         (WebKit::colorSpace):
79         (WebKit::ShareableBitmap::createGraphicsContext):
80         (WebKit::ShareableBitmap::createCGImage):
81         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
82         (WebKit::convertImageToBitmap):
83         (WebKit::WebDragClient::startDrag):
84
85 2016-11-11  Beth Dakin  <bdakin@apple.com>
86
87         Get touch bar code building for open source builds
88         https://bugs.webkit.org/show_bug.cgi?id=164610
89
90         Reviewed by Wenson Hsieh.
91
92         * config.h:
93
94 2016-11-10  Brent Fulgham  <bfulgham@apple.com>
95
96         Remove unused FontService from sandbox profile
97         https://bugs.webkit.org/show_bug.cgi?id=164625
98         <rdar://problem/26899976>
99
100         Reviewed by Alex Christensen.
101
102         Part of some general sandbox profile gardening.
103
104         Convert the Plugin process sandbox into 
105
106         * Configurations/WebKit.xcconfig: Add exclude for com.apple.WebKit.plugin-common.sb.in.
107         * DerivedSources.make: Update to generate com.apple.WebKit.plugin-common.sb from .in file
108         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Copied from Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb.
109         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Removed.
110         * WebKit2.xcodeproj/project.pbxproj: Update for new .in file.
111         * WebProcess/com.apple.WebProcess.sb.in: Remove com.apple.FontServer
112         from macOS Sierra and newer.
113
114 2016-11-10  Eric Carlson  <eric.carlson@apple.com>
115
116         [MediaStream] apply constraints passed to getUserMedia()
117         https://bugs.webkit.org/show_bug.cgi?id=164561
118
119         Reviewed by Youenn Fablet.
120         <rdar://problem/29191384>
121
122         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
123         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
124
125 2016-11-10  Alex Christensen  <achristensen@webkit.org>
126
127         Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
128         https://bugs.webkit.org/show_bug.cgi?id=164573
129
130         Reviewed by Brady Eidson.
131
132         * Shared/API/c/WKSecurityOriginRef.cpp:
133         (WKSecurityOriginCopyDatabaseIdentifier):
134         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
135         (WebKit::LocalStorageDatabaseTracker::databasePath):
136         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
137         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
138         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
139         (WebKit::WebsiteDataStore::removeMediaKeys):
140         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
141         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
142         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
143         (WKBundlePageCopyOriginsWithApplicationCache):
144         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
145         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin):
146         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
147         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
148         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
149         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
150         (WebKit::WebChromeClient::exceededDatabaseQuota):
151         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
152
153 2016-11-10  Alex Christensen  <achristensen@webkit.org>
154
155         Remove unused CFURLCACHE code
156         https://bugs.webkit.org/show_bug.cgi?id=164551
157
158         Reviewed by Antti Koivisto.
159
160         WebKit2 doesn't use CFURLCache, but we still have some unused code that seems to use it.
161
162         * NetworkProcess/NetworkProcess.cpp:
163         (WebKit::fetchDiskCacheEntries):
164         (WebKit::clearDiskCacheEntries):
165         * NetworkProcess/NetworkProcess.h:
166         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
167         (WebKit::partitionName): Deleted.
168         (WebKit::NetworkProcess::cfURLCacheOrigins): Deleted.
169         (WebKit::NetworkProcess::clearCFURLCacheForOrigins): Deleted.
170
171 2016-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
172
173         [Linux] Memory process values shown by the WebMemorySampler in linux are wrong
174         https://bugs.webkit.org/show_bug.cgi?id=164591
175
176         Reviewed by Michael Catanzaro.
177
178         It's parsing /proc/self/statm, and returning the values as if they were bytes, but they are number of pages, so
179         to get the bytes we need to take the page size into account. In r208534 I added a method to get /proc/self/statm
180         values in bytes to Platform layer, so we can simply use that instead.
181
182         * Shared/linux/WebMemorySamplerLinux.cpp:
183         (WebKit::WebMemorySampler::sampleWebKit): Use currentProcessMemoryStatus() and update the descriptions to
184         clarify that values are in bytes.
185
186 2016-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>
187
188         MemoryPressureHandler shouldn't know how to release WebCore memory
189         https://bugs.webkit.org/show_bug.cgi?id=160497
190
191         Reviewed by Michael Catanzaro.
192
193         Set the low memory handler before installing the memory pressure handler.
194
195         * WebProcess/WebProcess.cpp:
196         (WebKit::WebProcess::initializeWebProcess):
197         * WebProcess/cocoa/WebProcessCocoa.mm:
198         (WebKit::WebProcess::platformInitializeWebProcess):
199
200 2016-10-27  Sergio Villar Senin  <svillar@igalia.com>
201
202         [GTK] New API to notify about dynamically added forms
203         https://bugs.webkit.org/show_bug.cgi?id=164050
204
205         Reviewed by Carlos Garcia Campos.
206
207         This new API exports the WebCore event didAssociateFormControls through the web extension
208         mechanism. This will help clients (mainly web browsers) to implement robust auto filling
209         mechanisms. It deals nicely with dynamically created forms (and form controls) as many JS
210         frameworks do nowadays.
211
212         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added a FormClient implementation of
213         API::InjectedBundle::FormClient.
214         (webkitWebPageFormControlsAssociated): Emit the new signal.
215         (webkit_web_page_class_init): Added the new signal "forms-controls-associated".
216         (webkitWebPageCreate): Set the WebPage as a FormClient.
217
218 2016-11-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
219
220         [GTK] Allow to use WebMemorySampler feature.
221         https://bugs.webkit.org/show_bug.cgi?id=164517
222
223         Reviewed by Carlos Garcia Campos.
224
225         Enable the WebMemorySampler with the environment variable WEBKIT_SAMPLE_MEMORY.
226
227         When enabled, it will dump the stats to /tmp each second.
228
229         * UIProcess/API/gtk/WebKitWebContext.cpp:
230         (webkitWebContextConstructed):
231
232 2016-11-10  Philippe Normand  <pnormand@igalia.com>
233
234         [WK2][GTK][GStreamer] Build fails when -plugins-base and -core headers are not installed in the same directory
235         https://bugs.webkit.org/show_bug.cgi?id=148894
236
237         Reviewed by Carlos Garcia Campos.
238
239         The pbutils (gst-plugins-base-utils) headers are needed in
240         WebKit2/GTK for the permission request API related with the
241         GStreamer codec installer. It builds fine in most cases without
242         explicitely requiring the pbutils include directory path because
243         usually all the GStreamer headers are installed in the same path,
244         excepted for some distributions, like NixOS.
245
246         * PlatformGTK.cmake: The GStreamer pbutils include directory was
247         missing in the header search path.
248
249 2016-11-09  Chris Dumez  <cdumez@apple.com>
250
251         [WK2][!NETWORK_SESSION] Add support for downloading file backed blobs
252         https://bugs.webkit.org/show_bug.cgi?id=164522
253
254         Reviewed by Alex Christensen.
255
256         Add support for downloading file backed blobs for the non-NETWORK_SESSION
257         code path of WebKit2, which is still use on pre-Sierra macOS.
258
259         * NetworkProcess/Downloads/Download.cpp:
260         (WebKit::Download::~Download):
261         * NetworkProcess/Downloads/Download.h:
262         (WebKit::Download::setBlobFileReferences):
263         * NetworkProcess/Downloads/DownloadManager.cpp:
264         (WebKit::DownloadManager::startDownload):
265         (WebKit::DownloadManager::convertNetworkLoadToDownload):
266         * NetworkProcess/Downloads/DownloadManager.h:
267         * NetworkProcess/NetworkResourceLoader.cpp:
268         (WebKit::NetworkResourceLoader::convertToDownload):
269
270 2016-11-09  Chris Dumez  <cdumez@apple.com>
271
272         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
273         https://bugs.webkit.org/show_bug.cgi?id=164458
274         <rdar://problem/28905514>
275
276         Reviewed by Darin Adler.
277
278         Add support for downloading file backed blobs on WebKit2.
279         It previously wasn't working because we weren't calling
280         BlobDataFileReference::prepareForFileAccess() for each blob file before
281         starting the download, similarly to what is done in NetworkResourceLoader's
282         consumeSandboxExtensions().
283
284         * NetworkProcess/Downloads/DownloadManager.cpp:
285         (WebKit::DownloadManager::startDownload):
286         * NetworkProcess/Downloads/DownloadManager.h:
287         (WebKit::DownloadManager::startDownload):
288         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
289         (WebKit::NetworkConnectionToWebProcess::startDownload):
290         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
291         * NetworkProcess/NetworkDataTask.cpp:
292         (WebKit::NetworkDataTask::create):
293         * NetworkProcess/NetworkDataTask.h:
294         * NetworkProcess/NetworkDataTaskBlob.cpp:
295         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
296         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
297         (WebKit::NetworkDataTaskBlob::download):
298         * NetworkProcess/NetworkDataTaskBlob.h:
299         * NetworkProcess/NetworkLoad.cpp:
300         (WebKit::NetworkLoad::NetworkLoad):
301         * NetworkProcess/NetworkLoadParameters.h:
302         * NetworkProcess/NetworkProcess.cpp:
303         (WebKit::NetworkProcess::downloadRequest):
304         * NetworkProcess/NetworkResourceLoader.cpp:
305         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
306         (WebKit::NetworkResourceLoader::startNetworkLoad):
307         * NetworkProcess/PingLoad.h:
308
309 2016-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
310
311         NetworkSession: Network process crash when converting main resource to download
312         https://bugs.webkit.org/show_bug.cgi?id=164220
313
314         Reviewed by Alex Christensen.
315
316         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
317         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
318         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
319         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
320         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
321         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
322         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
323         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
324         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
325         created yet. That's not expected to happen and when the response completion handler is called in the
326         NetworkDataTask it tries to use either the client or the download and it crashes.
327         We need to cleanup and destroy the ResourceLoader as soon as it becomes a download, because that's the expected
328         behavior, but at the same time we need to keep the NetworkLoad alive until the NetworkDataTask finishes to become
329         a download. This patch creates a PendingDownload to take the ownership of the NetworkLoad, so that
330         ResourceLoader can be cleaned up and destroyed. The DownloadManager now will handle the PendingDownload as if it
331         was created by startDownload(), but ensuring it's deleted right before the final Download object is added to the
332         downloads map. That way NetworkDataTask will always have a valid client until the final Download is created,
333         first the ResourceLoader and then the PendingDownload. Since the DownloadManager is the owner of the
334         PendingDownload we no longer need the didBecomeDownload() callback to delete the NetworkLoad, because the
335         NetworkLoad will always be owned by the PendingDownload now that will be deleted by the DownloadManager.
336
337         * NetworkProcess/Downloads/DownloadManager.cpp:
338         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Change the ASSERT because at this point we should always
339         have a PendingDownload, and then remove it from the map here before adding the final Download to the map.
340         (WebKit::DownloadManager::convertNetworkLoadToDownload): This replaces convertHandleToDownload, but it also now
341         used for the NetworkSession. It creates a PendingDownload for the given NetworkLoad.
342         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Do not take the PendingDownload from the
343         map here, just check it's present, because it will be removed from dataTaskBecameDownloadTask().
344         (WebKit::DownloadManager::convertHandleToDownload): Deleted.
345         * NetworkProcess/Downloads/DownloadManager.h:
346         * NetworkProcess/Downloads/PendingDownload.cpp:
347         (WebKit::PendingDownload::PendingDownload): Add a constructor that receives a NetworkLoad.
348         * NetworkProcess/Downloads/PendingDownload.h:
349         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
350         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Just ask the ResourceLoader to be
351         converted to a download.
352         * NetworkProcess/NetworkDataTask.h:
353         * NetworkProcess/NetworkDataTaskBlob.cpp:
354         (WebKit::NetworkDataTaskBlob::download): Do not call didBecomeDownload() and add an assert to ensure the client
355         has already been removed right after the final Download object is created.
356         * NetworkProcess/NetworkLoad.cpp:
357         (WebKit::NetworkLoad::NetworkLoad): Use a pointer for the client instead of a reference because now we need to
358         change the client when the load is converted to a download. We don't need to null check the client in any case
359         because the member is only updated internally and always from a passed reference.
360         (WebKit::NetworkLoad::sharedDidReceiveResponse):
361         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
362         (WebKit::NetworkLoad::convertTaskToDownload): This now receives a PendingDownload. It updates the client and no
363         longer sends DidStart, because the PendingDownload sends it now.
364         (WebKit::NetworkLoad::didReceiveChallenge):
365         (WebKit::NetworkLoad::didReceiveData):
366         (WebKit::NetworkLoad::didCompleteWithError):
367         (WebKit::NetworkLoad::didSendData):
368         (WebKit::NetworkLoad::wasBlocked):
369         (WebKit::NetworkLoad::cannotShowURL):
370         (WebKit::NetworkLoad::didReceiveBuffer):
371         (WebKit::NetworkLoad::didFinishLoading):
372         (WebKit::NetworkLoad::didFail):
373         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
374         (WebKit::NetworkLoad::didBecomeDownload): Deleted.
375         * NetworkProcess/NetworkLoad.h:
376         * NetworkProcess/NetworkLoadClient.h: Remove didBecomeDownload().
377         * NetworkProcess/NetworkResourceLoader.cpp:
378         (WebKit::NetworkResourceLoader::convertToDownload): This replaces didBecomeDownload() and
379         didConvertToDownload(). It transfers the NetworkLoad to the DownloadManager.
380         (WebKit::NetworkResourceLoader::abort): We don't need to check if the load was converted to a download here,
381         because m_networkLoad will always be null here in such case.
382         (WebKit::NetworkResourceLoader::didBecomeDownload): Deleted
383         (WebKit::NetworkResourceLoader::didConvertToDownload): Deleted
384         * NetworkProcess/NetworkResourceLoader.h:
385         * NetworkProcess/PingLoad.h: Remove didBecomeDownload().
386         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
387         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Ditto.
388         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Ditto.
389         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
390         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Do not call didBecomeDownload().
391         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
392         (WebKit::NetworkDataTaskSoup::download): Do not call didBecomeDownload() and add an assert to ensure the client
393         has already been removed right after the final Download object is created.
394
395 2016-11-09  Alex Christensen  <achristensen@webkit.org>
396
397         Unreviewed, rolling out r208438.
398
399         crashes
400
401         Reverted changeset:
402
403         "[WK2][NETWORK_SESSION] Add support for downloading file
404         backed blobs"
405         https://bugs.webkit.org/show_bug.cgi?id=164458
406         http://trac.webkit.org/changeset/208438
407
408 2016-11-04  Brent Fulgham  <bfulgham@apple.com>
409
410         Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
411         https://bugs.webkit.org/show_bug.cgi?id=155185
412         <rdar://problem/11101440>
413
414         Reviewed by Brady Eidson.
415
416         Provide SPI to access the new quirk for localStorage. The quirk defaults to 'on'. When active, this
417         quirk says that localStorage access should be granted, without needing to grant universal file access.
418
419         If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
420         grants universal file access.
421         
422         Tested by existing TestWebKitAPI tests and WebKit2.LocalStorageQuirkTest
423
424         * Shared/WebPreferencesDefinitions.h:
425         * UIProcess/API/C/WKPreferences.cpp:
426         (WKPreferencesSetNeedsLocalStorageQuirk): Added.
427         (WKPreferencesGetNeedsLocalStorageQuirk): Added.
428         * UIProcess/API/C/WKPreferencesRefPrivate.h:
429         * UIProcess/API/Cocoa/WKWebView.mm:
430         (-[WKWebView _initializeWithConfiguration:]): Honor the new localStorage quirk.
431         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
432         (-[WKWebViewConfiguration init]): Honor the new localStorage quirk flag.
433         (-[WKWebViewConfiguration copyWithZone:]): Ditto.
434         (-[WKWebViewConfiguration _needsLocalStorageQuirk]): Added.
435         (-[WKWebViewConfiguration _setNeedsLocalStorageQuirk:]): Added.
436         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
437         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
438         (WKBundleSetNeedsLocalStorageQuirk): Added.
439         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
440         * WebProcess/InjectedBundle/InjectedBundle.cpp:
441         (WebKit::InjectedBundle::setNeedsLocalStorageQuirk): Added.
442         * WebProcess/InjectedBundle/InjectedBundle.h:
443         * WebProcess/WebPage/WebPage.cpp:
444         (WebKit::WebPage::updatePreferences): Honor the new localStorage quirk flag.
445
446 2016-11-09  Simon Fraser  <simon.fraser@apple.com>
447
448         Implement visual-viewport based position:fixed handling for Mac async scrolling
449         https://bugs.webkit.org/show_bug.cgi?id=164495
450
451         Reviewed by Tim Horton.
452
453         Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
454         so we push the enable flag to via the root state node, then push the layout viewport,
455         and the min/max scroll position that contstrain it, through frame state nodes.
456
457         When a scroll happens, we compute a new layout viewport when the visual viewport hits
458         an edge, and push that down through setScrollLayerPosition() since it's used to position
459         fixed and sticky layers.
460
461         The iOS code is made to compile, but not work yet.
462
463         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
464         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
465         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
466         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
467         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
468         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
469         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
470         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
471         * UIProcess/Scrolling/RemoteScrollingTree.h:
472         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
473         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
474         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
475         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
476         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
477
478 2016-11-09  Beth Dakin  <bdakin@apple.com>
479
480         More attempted build fix.
481
482         * UIProcess/Cocoa/WebViewImpl.mm:
483
484 2016-11-09  Alex Christensen  <achristensen@webkit.org>
485
486         Clean up Storage code
487         https://bugs.webkit.org/show_bug.cgi?id=164562
488
489         Reviewed by Brady Eidson.
490
491         Use more Refs!
492
493         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
494         * Platform/IPC/Connection.cpp:
495         (IPC::Connection::addWorkQueueMessageReceiver):
496         * Platform/IPC/Connection.h:
497         * UIProcess/Storage/LocalStorageDatabase.cpp:
498         (WebKit::LocalStorageDatabase::create):
499         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
500         * UIProcess/Storage/LocalStorageDatabase.h:
501         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
502         (WebKit::LocalStorageDatabaseTracker::create):
503         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
504         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
505         * UIProcess/Storage/StorageManager.cpp:
506         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
507         (WebKit::StorageManager::StorageManager):
508         * UIProcess/Storage/StorageManager.h:
509         * UIProcess/WebResourceLoadStatisticsStore.cpp:
510         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
511         * UIProcess/mac/SecItemShimProxy.cpp:
512         (WebKit::SecItemShimProxy::initializeConnection):
513         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
514         (WebKit::PluginProcessConnectionManager::initializeConnection):
515         * WebProcess/WebPage/EventDispatcher.cpp:
516         (WebKit::EventDispatcher::initializeConnection):
517         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
518         (WebKit::ViewUpdateDispatcher::initializeConnection):
519
520 2016-11-09  Beth Dakin  <bdakin@apple.com>
521
522         Another attempted build fix.
523
524         * UIProcess/Cocoa/WebViewImpl.mm:
525
526 2016-11-09  Michael Catanzaro  <mcatanzaro@igalia.com>
527
528         Experimental features should not be enabled by default
529         https://bugs.webkit.org/show_bug.cgi?id=164367
530
531         Reviewed by Darin Adler.
532
533         We have two classes of experimental features:
534
535         (1) Features that are unstable and should be off by default, except for the developers
536             currently working on them. This is straightforward to handle; the default value should
537             be false.
538         (2) Features that are still not ready for end users, but are stable enough for testing. We
539             want these features to be enabled in testing environments like the bots, MiniBrowser,
540             Safari Tech Preview, and so forth, but not in stable release builds.
541
542         Implement this. It is better than having all experimental features on unconditionally, and
543         expecting them to be disabled manually on release branches, which is not something we are
544         keen to do. An exception is Cocoa ports, which to my knowledge do not currently have any
545         concept of development builds. These ports seem happy to continue disabling features
546         manually in release branches, and should continue to do so at least for now.
547
548         We also have features that we wish to enumerate at runtime, yet have enabled by default
549         unconditionally. We do not currently have any infrastructure to support this and should not
550         abuse the experimental status for this purpose; it requires future work. All settings can
551         still be toggled at runtime by clients that know about them using the existing runtime
552         features API.
553
554         Lastly, the custom elements feature is ready to be enabled by default, so it's no longer
555         experimental and can graduate to the list of normal boolean features.
556
557         * Shared/WebPreferencesDefinitions.h:
558
559 2016-11-09  Beth Dakin  <bdakin@apple.com>
560
561         Build fix.
562
563         * UIProcess/Cocoa/WebViewImpl.mm:
564
565 2016-11-09  Brady Eidson  <beidson@apple.com>
566
567         IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
568         https://bugs.webkit.org/show_bug.cgi?id=164504
569
570         Reviewed by Darin Adler.
571
572         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
573         (WebKit::WebIDBConnectionToClient::iterateCursor):
574         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
575         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
576
577         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
578         (WebKit::WebIDBConnectionToServer::iterateCursor):
579         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
580
581 2016-11-09  Darin Adler  <darin@apple.com>
582
583         Move Range from ExceptionCode to ExceptionOr
584         https://bugs.webkit.org/show_bug.cgi?id=164457
585
586         Reviewed by Alex Christensen.
587
588         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
589         (webkit_dom_range_set_start): Updated exception handling.
590         (webkit_dom_range_set_end): Ditto.
591         (webkit_dom_range_set_start_before): Ditto.
592         (webkit_dom_range_set_start_after): Ditto.
593         (webkit_dom_range_set_end_before): Ditto.
594         (webkit_dom_range_set_end_after): Ditto.
595         (webkit_dom_range_select_node): Ditto.
596         (webkit_dom_range_select_node_contents): Ditto.
597         (webkit_dom_range_compare_boundary_points): Ditto.
598         (webkit_dom_range_delete_contents): Ditto.
599         (webkit_dom_range_extract_contents): Ditto.
600         (webkit_dom_range_clone_contents): Ditto.
601         (webkit_dom_range_insert_node): Ditto.
602         (webkit_dom_range_surround_contents): Ditto.
603         (webkit_dom_range_create_contextual_fragment): Ditto.
604         (webkit_dom_range_compare_node): Ditto.
605         (webkit_dom_range_intersects_node): Ditto.
606         (webkit_dom_range_compare_point): Ditto.
607         (webkit_dom_range_is_point_in_range): Ditto.
608         (webkit_dom_range_expand): Ditto.
609         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
610         (-[WKDOMRange setStart:offset:]): Ditto.
611         (-[WKDOMRange setEnd:offset:]): Ditto.
612         (-[WKDOMRange selectNode:]): Ditto.
613         (-[WKDOMRange selectNodeContents:]): Ditto.
614         * WebProcess/WebPage/WebFrame.cpp:
615         (WebKit::WebFrame::contentsAsString): Ditto.
616         * WebProcess/WebPage/ios/WebPageIOS.mm:
617         (WebKit::WebPage::rangeForWebSelectionAtPosition): Ditto.
618         (WebKit::WebPage::rangeForBlockAtPoint): Ditto.
619         (WebKit::WebPage::selectWithGesture): Ditto.
620         (WebKit::containsRange): Ditto.
621         (WebKit::unionDOMRanges): Ditto.
622         (WebKit::WebPage::switchToBlockSelectionAtPoint): Ditto.
623         (WebKit::WebPage::getPositionInformation): Ditto.
624
625
626 2016-11-09  Darin Adler  <darin@apple.com>
627
628         Move EventTarget from ExceptionCode to ExceptionOr
629         https://bugs.webkit.org/show_bug.cgi?id=164465
630
631         Reviewed by Youenn Fablet.
632
633         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
634         (webkit_dom_attr_dispatch_event): Updated exception handling.
635         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
636         (webkit_dom_cdata_section_dispatch_event): Ditto.
637         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
638         (webkit_dom_character_data_dispatch_event): Ditto.
639         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
640         (webkit_dom_comment_dispatch_event): Ditto.
641         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
642         (webkit_dom_dom_window_dispatch_event): Ditto.
643         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
644         (webkit_dom_document_dispatch_event): Ditto.
645         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
646         (webkit_dom_document_fragment_dispatch_event): Ditto.
647         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
648         (webkit_dom_document_type_dispatch_event): Ditto.
649         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
650         (webkit_dom_element_dispatch_event): Ditto.
651         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
652         (webkit_dom_html_anchor_element_dispatch_event): Ditto.
653         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
654         (webkit_dom_html_applet_element_dispatch_event): Ditto.
655         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
656         (webkit_dom_html_area_element_dispatch_event): Ditto.
657         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
658         (webkit_dom_html_br_element_dispatch_event): Ditto.
659         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
660         (webkit_dom_html_base_element_dispatch_event): Ditto.
661         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
662         (webkit_dom_html_body_element_dispatch_event): Ditto.
663         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
664         (webkit_dom_html_button_element_dispatch_event): Ditto.
665         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
666         (webkit_dom_html_canvas_element_dispatch_event): Ditto.
667         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
668         (webkit_dom_html_d_list_element_dispatch_event): Ditto.
669         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
670         (webkit_dom_html_directory_element_dispatch_event): Ditto.
671         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
672         (webkit_dom_html_div_element_dispatch_event): Ditto.
673         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
674         (webkit_dom_html_document_dispatch_event): Ditto.
675         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
676         (webkit_dom_html_element_dispatch_event): Ditto.
677         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
678         (webkit_dom_html_embed_element_dispatch_event): Ditto.
679         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
680         (webkit_dom_html_field_set_element_dispatch_event): Ditto.
681         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
682         (webkit_dom_html_font_element_dispatch_event): Ditto.
683         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
684         (webkit_dom_html_form_element_dispatch_event): Ditto.
685         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
686         (webkit_dom_html_frame_element_dispatch_event): Ditto.
687         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
688         (webkit_dom_html_frame_set_element_dispatch_event): Ditto.
689         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
690         (webkit_dom_html_hr_element_dispatch_event): Ditto.
691         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
692         (webkit_dom_html_heading_element_dispatch_event): Ditto.
693         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
694         (webkit_dom_html_head_element_dispatch_event): Ditto.
695         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
696         (webkit_dom_html_html_element_dispatch_event): Ditto.
697         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
698         (webkit_dom_html_iframe_element_dispatch_event): Ditto.
699         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
700         (webkit_dom_html_image_element_dispatch_event): Ditto.
701         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
702         (webkit_dom_html_input_element_dispatch_event): Ditto.
703         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
704         (webkit_dom_html_li_element_dispatch_event): Ditto.
705         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
706         (webkit_dom_html_label_element_dispatch_event): Ditto.
707         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
708         (webkit_dom_html_legend_element_dispatch_event): Ditto.
709         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
710         (webkit_dom_html_link_element_dispatch_event): Ditto.
711         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
712         (webkit_dom_html_map_element_dispatch_event): Ditto.
713         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
714         (webkit_dom_html_marquee_element_dispatch_event): Ditto.
715         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
716         (webkit_dom_html_menu_element_dispatch_event): Ditto.
717         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
718         (webkit_dom_html_meta_element_dispatch_event): Ditto.
719         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
720         (webkit_dom_html_mod_element_dispatch_event): Ditto.
721         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
722         (webkit_dom_html_o_list_element_dispatch_event): Ditto.
723         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
724         (webkit_dom_html_object_element_dispatch_event): Ditto.
725         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
726         (webkit_dom_html_opt_group_element_dispatch_event): Ditto.
727         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
728         (webkit_dom_html_option_element_dispatch_event): Ditto.
729         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
730         (webkit_dom_html_paragraph_element_dispatch_event): Ditto.
731         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
732         (webkit_dom_html_param_element_dispatch_event): Ditto.
733         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
734         (webkit_dom_html_pre_element_dispatch_event): Ditto.
735         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
736         (webkit_dom_html_quote_element_dispatch_event): Ditto.
737         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
738         (webkit_dom_html_script_element_dispatch_event): Ditto.
739         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
740         (webkit_dom_html_select_element_dispatch_event): Ditto.
741         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
742         (webkit_dom_html_style_element_dispatch_event): Ditto.
743         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
744         (webkit_dom_html_table_caption_element_dispatch_event): Ditto.
745         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
746         (webkit_dom_html_table_cell_element_dispatch_event): Ditto.
747         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
748         (webkit_dom_html_table_col_element_dispatch_event): Ditto.
749         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
750         (webkit_dom_html_table_element_dispatch_event): Ditto.
751         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
752         (webkit_dom_html_table_row_element_dispatch_event): Ditto.
753         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
754         (webkit_dom_html_table_section_element_dispatch_event): Ditto.
755         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
756         (webkit_dom_html_text_area_element_dispatch_event): Ditto.
757         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
758         (webkit_dom_html_title_element_dispatch_event): Ditto.
759         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
760         (webkit_dom_html_u_list_element_dispatch_event): Ditto.
761         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
762         (webkit_dom_node_dispatch_event): Ditto.
763         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
764         (webkit_dom_processing_instruction_dispatch_event): Ditto.
765         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
766         (webkit_dom_text_dispatch_event): Ditto.
767
768 2016-11-08  Dean Jackson  <dino@apple.com>
769
770         Rendering support for ExtendedColors
771         https://bugs.webkit.org/show_bug.cgi?id=164443
772         <rdar://problems/29123243>
773
774         Reviewed by Simon Fraser and Darin Adler.
775
776         Implement argument coders for Color.
777
778         * Shared/WebCoreArgumentCoders.cpp:
779         (IPC::ArgumentCoder<Color>::encode):
780         (IPC::ArgumentCoder<Color>::decode):
781         * Shared/WebCoreArgumentCoders.h:
782         * UIProcess/API/Cocoa/WKWebView.mm:
783         (-[WKWebView _updateScrollViewBackground]):
784
785 2016-11-09  Beth Dakin  <bdakin@apple.com>
786
787         Build fix.
788
789         * UIProcess/Cocoa/WebViewImpl.mm:
790         (WebKit::WebViewImpl::~WebViewImpl):
791
792 2016-11-09  Chris Dumez  <cdumez@apple.com>
793
794         [Mac] Stop using deprecated AppKit enumeration values
795         https://bugs.webkit.org/show_bug.cgi?id=164494
796
797         Reviewed by Darin Adler.
798
799         Stop using deprecated AppKit enumeration values.
800
801         * Shared/mac/ChildProcessMac.mm:
802         (WebKit::ChildProcess::stopNSAppRunLoop):
803         * Shared/mac/WebEventFactory.mm:
804         (WebKit::mouseButtonForEvent):
805         (WebKit::mouseEventTypeForEvent):
806         (WebKit::clickCountForEvent):
807         (WebKit::globalPointForEvent):
808         (WebKit::pointForEvent):
809         (WebKit::textFromEvent):
810         (WebKit::unmodifiedTextFromEvent):
811         (WebKit::isKeypadEvent):
812         (WebKit::isKeyUpEvent):
813         (WebKit::WebEventFactory::createWebKeyboardEvent):
814         * UIProcess/Cocoa/WebViewImpl.mm:
815         (WebKit::WebViewImpl::becomeFirstResponder):
816         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
817         (WebKit::WebViewImpl::viewDidMoveToWindow):
818         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
819         (WebKit::WebViewImpl::createFullScreenWindow):
820         (WebKit::WebViewImpl::sendToolTipMouseExited):
821         (WebKit::WebViewImpl::sendToolTipMouseEntered):
822         (WebKit::applicationFlagsForDrag):
823         (WebKit::WebViewImpl::setLastMouseDownEvent):
824         (WebKit::WebViewImpl::doneWithKeyEvent):
825         (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
826         (WebKit::WebViewImpl::performKeyEquivalent):
827         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
828         (WebKit::PluginProcessProxy::beginModal):
829         * UIProcess/mac/WebContextMenuProxyMac.mm:
830         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
831         * UIProcess/mac/WebInspectorProxyMac.mm:
832         * UIProcess/mac/WebPopupMenuProxyMac.mm:
833         (WebKit::WebPopupMenuProxyMac::populate):
834         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
835         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
836         (WebKit::modifierFlagsFromWebEvent):
837         (WebKit::getEventTypeFromWebEvent):
838         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
839         (WebKit::cssAlignmentValueForNSTextAlignment):
840         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
841         (WebKit::convertImageToBitmap):
842
843 2016-11-09  Beth Dakin  <bdakin@apple.com>
844
845         Support TouchBar in WebKit
846         https://bugs.webkit.org/show_bug.cgi?id=164437
847         -and corresponding-
848         rdar://problem/28876524
849
850         Reviewed by Darin Adler.
851
852         * UIProcess/API/Cocoa/WKViewPrivate.h:
853         * UIProcess/API/Cocoa/WKWebView.mm:
854         (-[WKWebView makeTouchBar]):
855         (-[WKWebView candidateListTouchBarItem]):
856         (-[WKWebView _web_didAddMediaControlsManager:]):
857         (-[WKWebView _web_didRemoveMediaControlsManager]):
858         (-[WKWebView _interactWithMediaControlsForTesting]):
859         (-[WKWebView _wantsMediaPlaybackControlsView]):
860         (-[WKWebView _setWantsMediaPlaybackControlsView:]):
861         (-[WKWebView _mediaPlaybackControlsView]):
862         (-[WKWebView _addMediaPlaybackControlsView:]):
863         (-[WKWebView _removeMediaPlaybackControlsView]):
864         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
865         * UIProcess/API/mac/WKView.mm:
866         (-[WKView makeTouchBar]):
867         (-[WKView candidateListTouchBarItem]):
868         (-[WKView _web_didAddMediaControlsManager:]):
869         (-[WKView _web_didRemoveMediaControlsManager]):
870         (-[WKView _wantsMediaPlaybackControlsView]):
871         (-[WKView _setWantsMediaPlaybackControlsView:]):
872         (-[WKView _mediaPlaybackControlsView]):
873         (-[WKView _addMediaPlaybackControlsView:]):
874         (-[WKView _removeMediaPlaybackControlsView]):
875         * UIProcess/Cocoa/WebViewImpl.h:
876         (WebKit::WebViewImpl::currentTouchBar):
877         (WebKit::WebViewImpl::clientWantsMediaPlaybackControlsView):
878         (WebKit::WebViewImpl::setClientWantsMediaPlaybackControlsView):
879         (WebKit::WebViewImpl::setIsCustomizingTouchBar):
880         * UIProcess/Cocoa/WebViewImpl.mm:
881         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
882         (-[WKTextListTouchBarViewController didDestroyView]):
883         (-[WKTextListTouchBarViewController _selectList:]):
884         (-[WKTextListTouchBarViewController setCurrentListType:]):
885         (-[WKTextTouchBarItemController initWithWebViewImpl:]):
886         (-[WKTextTouchBarItemController didDestroyView]):
887         (-[WKTextTouchBarItemController touchBar:makeItemForIdentifier:]):
888         (-[WKTextTouchBarItemController itemForIdentifier:]):
889         (-[WKTextTouchBarItemController candidateListTouchBarItem:endSelectingCandidateAtIndex:]):
890         (-[WKTextTouchBarItemController candidateListTouchBarItem:changedCandidateListVisibility:]):
891         (-[WKTextTouchBarItemController textListTouchBarViewController]):
892         (-[WKTextTouchBarItemController setTextIsBold:]):
893         (-[WKTextTouchBarItemController setTextIsItalic:]):
894         (-[WKTextTouchBarItemController setTextIsUnderlined:]):
895         (-[WKTextTouchBarItemController _wkChangeTextStyle:]):
896         (-[WKTextTouchBarItemController setCurrentTextAlignment:]):
897         (-[WKTextTouchBarItemController _wkChangeTextAlignment:]):
898         (-[WKTextTouchBarItemController textColor]):
899         (-[WKTextTouchBarItemController setTextColor:]):
900         (-[WKTextTouchBarItemController _wkChangeColor:]):
901         (-[WKTextTouchBarItemController textListViewController]):
902         (WebKit::WebViewImpl::makeTouchBar):
903         (WebKit::WebViewImpl::candidateListTouchBarItem):
904         (WebKit::WebViewImpl::mediaPlaybackControlsView):
905         (WebKit::WebViewImpl::useMediaPlaybackControlsView):
906         (WebKit::WebViewImpl::dismissTextTouchBarPopoverItemWithIdentifier):
907         (WebKit::textTouchBarCustomizationAllowedIdentifiers):
908         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers):
909         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers):
910         (WebKit::touchBarDidExitCustomization):
911         (WebKit::touchBarWillEnterCustomization):
912         (WebKit::didChangeAutomaticTextCompletion):
913         (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
914         (WebKit::WebViewImpl::setUpTextTouchBar):
915         (WebKit::WebViewImpl::isRichlyEditable):
916         (WebKit::WebViewImpl::textTouchBar):
917         (WebKit::WebViewImpl::updateTextTouchBar):
918         (WebKit::WebViewImpl::updateMediaTouchBar):
919         (WebKit::WebViewImpl::forceRequestCandidatesForTesting):
920         (WebKit::WebViewImpl::updateTouchBar):
921         (WebKit::WebViewImpl::shouldRequestCandidates):
922         (WebKit::WebViewImpl::showCandidates):
923         (WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
924         (WebKit::WebViewImpl::setEditableElementIsFocused):
925         (WebKit::WebViewImpl::becomeFirstResponder):
926         (WebKit::WebViewImpl::selectionDidChange):
927         (WebKit::WebViewImpl::videoControlsManagerDidChange):
928         (WebKit::WebViewImpl::updateWebViewImplAdditions): Deleted.
929
930 2016-11-09  Chris Dumez  <cdumez@apple.com>
931
932         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
933         https://bugs.webkit.org/show_bug.cgi?id=164458
934         <rdar://problem/28905514>
935
936         Reviewed by Darin Adler.
937
938         Add support for downloading file backed blobs on WebKit2.
939         It previously wasn't working because we weren't calling
940         BlobDataFileReference::prepareForFileAccess() for each blob file before
941         starting the download, similarly to what is done in NetworkResourceLoader's
942         consumeSandboxExtensions().
943
944         * NetworkProcess/Downloads/DownloadManager.cpp:
945         (WebKit::DownloadManager::startDownload):
946         * NetworkProcess/Downloads/DownloadManager.h:
947         (WebKit::DownloadManager::startDownload):
948         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
949         (WebKit::NetworkConnectionToWebProcess::startDownload):
950         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
951         * NetworkProcess/NetworkDataTask.cpp:
952         (WebKit::NetworkDataTask::create):
953         * NetworkProcess/NetworkDataTask.h:
954         * NetworkProcess/NetworkDataTaskBlob.cpp:
955         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
956         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
957         (WebKit::NetworkDataTaskBlob::download):
958         * NetworkProcess/NetworkDataTaskBlob.h:
959         * NetworkProcess/NetworkLoad.cpp:
960         (WebKit::NetworkLoad::NetworkLoad):
961         * NetworkProcess/NetworkLoadParameters.h:
962         * NetworkProcess/NetworkProcess.cpp:
963         (WebKit::NetworkProcess::downloadRequest):
964         * NetworkProcess/NetworkResourceLoader.cpp:
965         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
966         (WebKit::NetworkResourceLoader::startNetworkLoad):
967         * NetworkProcess/PingLoad.h:
968
969 2016-11-09  Chris Dumez  <cdumez@apple.com>
970
971         [WK2] Network cache speculative revalidation can cause loads to hang
972         https://bugs.webkit.org/show_bug.cgi?id=164532
973         <rdar://problem/28519331>
974
975         Reviewed by Alex Christensen.
976
977         Network cache speculative revalidation could cause loads to hang when HTTP
978         authentication was involved because NetworkCacheSpeculativeLoad failed to
979         call NetworkLoad::continueCanAuthenticateAgainstProtectionSpace() in its
980         canAuthenticateAgainstProtectionSpaceAsync() callback.
981
982         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
983         (WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync):
984         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
985
986 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
987
988         URTBF after r208361.
989
990         * PlatformMac.cmake:
991
992 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
993
994         Unreviewed typo fix after r160616 to fix the build on case sensitive file systems.
995
996         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
997
998 2016-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
999
1000         [SOUP] Layout test http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials.html fails
1001         https://bugs.webkit.org/show_bug.cgi?id=139358
1002
1003         Reviewed by Michael Catanzaro.
1004
1005         Stop putting the credentials in the URL unconditionally and ensure we only do that when provided by the URL
1006         itself. Libsoup has its own cache of SoupAuth, so we don't need to pass user/pass in the URL for every single
1007         request, libsoup will authenticate those automatically.
1008
1009         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1010         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
1011
1012 2016-11-04  Filip Pizlo  <fpizlo@apple.com>
1013
1014         WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
1015         https://bugs.webkit.org/show_bug.cgi?id=152045
1016
1017         Reviewed by Andy Estes.
1018
1019         * Platform/IPC/Connection.cpp:
1020         (IPC::Connection::SyncMessageState::wait):
1021         (IPC::Connection::sendMessage):
1022         (IPC::Connection::timeoutRespectingIgnoreTimeoutsForTesting):
1023         (IPC::Connection::waitForMessage):
1024         (IPC::Connection::sendSyncMessage):
1025         (IPC::Connection::waitForSyncReply):
1026         * Platform/IPC/Connection.h:
1027         (IPC::Connection::sendSync):
1028         (IPC::Connection::waitForAndDispatchImmediately):
1029         * Platform/IPC/MessageSender.h:
1030         (IPC::MessageSender::sendSync):
1031         * UIProcess/ChildProcessProxy.h:
1032         (WebKit::ChildProcessProxy::sendSync):
1033         * UIProcess/Network/NetworkProcessProxy.cpp:
1034         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
1035         * UIProcess/Storage/StorageManager.cpp:
1036         (WebKit::StorageManager::applicationWillTerminate):
1037         * UIProcess/WebProcessProxy.cpp:
1038         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
1039         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1040         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
1041         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1042         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1043         (-[WKOneShotDisplayLinkHandler displayLinkFired:]):
1044         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1045         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1046         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
1047         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1048         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
1049         * UIProcess/mac/WKImmediateActionController.mm:
1050         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1051         * UIProcess/mac/WebPageProxyMac.mm:
1052         (WebKit::WebPageProxy::stringSelectionForPasteboard):
1053         (WebKit::WebPageProxy::dataSelectionForPasteboard):
1054         (WebKit::WebPageProxy::readSelectionFromPasteboard):
1055         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
1056         (WebKit::WebPageProxy::acceptsFirstMouse):
1057         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1058         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
1059         (WebKit::WebChromeClient::runJavaScriptAlert):
1060         (WebKit::WebChromeClient::runJavaScriptConfirm):
1061         (WebKit::WebChromeClient::runJavaScriptPrompt):
1062         (WebKit::WebChromeClient::print):
1063         (WebKit::WebChromeClient::exceededDatabaseQuota):
1064         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1065         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1066         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1067         * WebProcess/WebPage/WebPage.cpp:
1068         (WebKit::WebPage::postSynchronousMessageForTesting):
1069
1070 2016-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1071
1072         Safari does not emit composition end if blurred for dead key / Japanese IME
1073         https://bugs.webkit.org/show_bug.cgi?id=164369
1074         <rdar://problem/29050439>
1075
1076         Reviewed by Ryosuke Niwa.
1077
1078         Split WebPage::discardedComposition into two steps, where we first discard marked text and then update the
1079         editor state. This allows the codepath where we cancel the composition early (before setting the selection) to
1080         discard marked text without also forcing an editor state update at the same time. The editor state is later
1081         updated in WebPage::didChangeSelection.
1082
1083         * UIProcess/WebPageProxy.cpp:
1084         (WebKit::WebPageProxy::compositionWasCanceled):
1085         * UIProcess/WebPageProxy.h:
1086         * UIProcess/WebPageProxy.messages.in:
1087         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1088         (WebKit::WebEditorClient::canceledComposition):
1089         * WebProcess/WebCoreSupport/WebEditorClient.h:
1090         * WebProcess/WebPage/WebPage.cpp:
1091         (WebKit::WebPage::didChangeSelection):
1092         (WebKit::WebPage::discardedComposition):
1093         (WebKit::WebPage::canceledComposition):
1094         * WebProcess/WebPage/WebPage.h:
1095
1096 2016-11-04  Alex Christensen  <achristensen@webkit.org>
1097
1098         Unreviewed, rolling out r208293.
1099
1100         asserts in API tests.
1101
1102         Reverted changeset:
1103
1104         "NetworkSession: Network process crash when converting main
1105         resource to download"
1106         https://bugs.webkit.org/show_bug.cgi?id=164220
1107         http://trac.webkit.org/changeset/208293
1108
1109 2016-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1110
1111         Add a setting and preferences to enable/disable async image decoding
1112         https://bugs.webkit.org/show_bug.cgi?id=164417
1113
1114         Reviewed by Simon Fraser.
1115
1116         Hook up the asyncImageDecodingEnabled setting for WebKit2.
1117
1118         * Shared/WebPreferencesDefinitions.h:
1119         * UIProcess/API/Cocoa/WKPreferences.mm:
1120         (-[WKPreferences _asyncImageDecodingEnabled]):
1121         (-[WKPreferences _setAsyncImageDecodingEnabled:]):
1122         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1123         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1124         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1125         * WebProcess/WebPage/WebPage.cpp:
1126         (WebKit::WebPage::updatePreferences):
1127
1128 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
1129
1130         Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
1131         https://bugs.webkit.org/show_bug.cgi?id=164420
1132
1133         Reviewed by Tim Horton.
1134
1135         Rename:
1136             commitNewTreeState -> commitTreeState ("new" was redundant)
1137             updateBeforeChildren -> commitStateBeforeChildren
1138             updateAfterChildren -> commitStateAfterChildren
1139
1140
1141         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1142         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
1143         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Deleted.
1144         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1145         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1146         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1147         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
1148         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
1149         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): Deleted.
1150         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): Deleted.
1151         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1152         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1153
1154 2016-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1155
1156         NetworkSession: Add NetworkDataTask implementation for blobs
1157         https://bugs.webkit.org/show_bug.cgi?id=163939
1158
1159         Reviewed by Alex Christensen.
1160
1161         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
1162         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
1163         is enabled.
1164
1165         * CMakeLists.txt: Add new files to compilation.
1166         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1167         * NetworkProcess/Downloads/BlobDownloadClient.h:
1168         * NetworkProcess/Downloads/Download.cpp:
1169         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
1170         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
1171         reveices a NetworkDataTask and is used by Soup backend and blobs.
1172         (WebKit::Download::~Download):
1173         (WebKit::Download::start):
1174         (WebKit::Download::startWithHandle):
1175         (WebKit::Download::cancel):
1176         (WebKit::Download::didReceiveAuthenticationChallenge):
1177         (WebKit::Download::didReceiveData):
1178         (WebKit::Download::didFinish):
1179         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
1180         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
1181         * NetworkProcess/Downloads/Download.h:
1182         (WebKit::Download::Download):
1183         (WebKit::Download::suggestedName):
1184         (WebKit::Download::request):
1185         * NetworkProcess/Downloads/DownloadManager.cpp:
1186         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
1187         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
1188         * NetworkProcess/Downloads/DownloadManager.h:
1189         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1190         (WebKit::Download::platformCancelNetworkLoad):
1191         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
1192         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1193         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
1194         using NetworkSession.
1195         * NetworkProcess/NetworkDataTask.cpp:
1196         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
1197         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
1198         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
1199         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1200         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
1201         (WebKit::NetworkDataTaskBlob::clearStream):
1202         (WebKit::NetworkDataTaskBlob::resume):
1203         (WebKit::NetworkDataTaskBlob::suspend):
1204         (WebKit::NetworkDataTaskBlob::cancel):
1205         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
1206         (WebKit::NetworkDataTaskBlob::getSizeForNext):
1207         (WebKit::NetworkDataTaskBlob::didGetSize):
1208         (WebKit::NetworkDataTaskBlob::seek):
1209         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
1210         (WebKit::NetworkDataTaskBlob::read):
1211         (WebKit::NetworkDataTaskBlob::readData):
1212         (WebKit::NetworkDataTaskBlob::readFile):
1213         (WebKit::NetworkDataTaskBlob::didOpen):
1214         (WebKit::NetworkDataTaskBlob::didRead):
1215         (WebKit::NetworkDataTaskBlob::consumeData):
1216         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
1217         (WebKit::NetworkDataTaskBlob::suggestedFilename):
1218         (WebKit::NetworkDataTaskBlob::download):
1219         (WebKit::NetworkDataTaskBlob::writeDownload):
1220         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
1221         (WebKit::NetworkDataTaskBlob::didFailDownload):
1222         (WebKit::NetworkDataTaskBlob::didFinishDownload):
1223         (WebKit::NetworkDataTaskBlob::didFail):
1224         (WebKit::NetworkDataTaskBlob::didFinish):
1225         * NetworkProcess/NetworkDataTaskBlob.h: Added.
1226         * NetworkProcess/NetworkLoad.cpp:
1227         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
1228         (WebKit::NetworkLoad::~NetworkLoad):
1229         (WebKit::NetworkLoad::setDefersLoading):
1230         (WebKit::NetworkLoad::cancel):
1231         (WebKit::NetworkLoad::continueWillSendRequest):
1232         (WebKit::NetworkLoad::continueDidReceiveResponse):
1233         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1234         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
1235         * NetworkProcess/NetworkLoad.h:
1236         * NetworkProcess/NetworkSession.cpp:
1237         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
1238         * NetworkProcess/NetworkSession.h:
1239         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
1240         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
1241         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
1242         because in Cocoa all tasks are invalidated and canceled by the network session.
1243         * NetworkProcess/mac/NetworkLoadMac.mm:
1244         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1245         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1246         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
1247         (WebKit::NetworkDataTaskSoup::download):
1248         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1249         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1250         * NetworkProcess/soup/NetworkSessionSoup.h:
1251         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
1252         * PlatformGTK.cmake: Ditto.
1253         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
1254
1255 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
1256
1257         Give all the geometry classes a single-argument scale() function for consistency
1258         https://bugs.webkit.org/show_bug.cgi?id=164400
1259
1260         Reviewed by Zalan Bujtas.
1261         
1262         Use single-argument scale() functions.
1263
1264         * PluginProcess/PluginControllerProxy.cpp:
1265         (WebKit::PluginControllerProxy::paint):
1266         * Shared/mac/RemoteLayerBackingStore.mm:
1267         (WebKit::RemoteLayerBackingStore::drawInContext):
1268         * UIProcess/API/Cocoa/WKWebView.mm:
1269         (-[WKWebView _didCommitLayerTree:]):
1270         (-[WKWebView _takeViewSnapshot]):
1271         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
1272         (-[WKWebView _scrollByContentOffset:]):
1273         (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
1274         * UIProcess/ios/WKContentView.mm:
1275         (-[WKContentView _didCommitLayerTree:]):
1276         * UIProcess/ios/WKContentViewInteraction.mm:
1277         (-[WKContentView _updateTapHighlight]):
1278         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1279         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
1280         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
1281         * UIProcess/mac/ViewGestureControllerMac.mm:
1282         (WebKit::ViewGestureController::scaledMagnificationOrigin):
1283         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1284         (WebKit::InjectedBundleRangeHandle::renderedImage):
1285         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1286         (WebKit::NetscapePlugin::snapshot):
1287         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1288         (WebKit::PDFPlugin::scrollToPoint):
1289         * WebProcess/WebPage/WebFrame.cpp:
1290         (WebKit::WebFrame::createSelectionSnapshot):
1291         * WebProcess/WebPage/WebPage.cpp:
1292         (WebKit::WebPage::scalePageInViewCoordinates):
1293         (WebKit::WebPage::scaleView):
1294         (WebKit::WebPage::snapshotAtSize):
1295         (WebKit::WebPage::snapshotNode):
1296         (WebKit::WebPage::drawRectToImage):
1297         * WebProcess/WebPage/ios/WebPageIOS.mm:
1298         (WebKit::WebPage::restorePageState):
1299
1300 2016-11-03  Chris Dumez  <cdumez@apple.com>
1301
1302         [WK2][Cocoa] Implement user interface for HTML form validation
1303         https://bugs.webkit.org/show_bug.cgi?id=164143
1304         <rdar://problem/28944652>
1305
1306         Reviewed by Simon Fraser.
1307
1308         Implement the ValidationMessageClient in WebKit2 and have it display
1309         a ValidationBubble on Cocoa. ValidationBubble is implemented using
1310         native popovers on both Mac and iOS. As a result, Mac and iOS WK2
1311         now use native popover for HTML form validation instead of the old
1312         Shadow DOM based UI in WebCore.
1313
1314         The native popover shows at the bottom (or top) of the input and it
1315         disapears as soon as the user starts typing or interacts with the
1316         view (e.g. tap / scroll / zoom).
1317
1318         The feature is still disabled at runtime.
1319
1320         * UIProcess/API/Cocoa/WKWebView.mm:
1321         (-[WKWebView _initializeWithConfiguration:]):
1322         (-[WKWebView _keyboardWillShow:]):
1323         (-[WKWebView _keyboardDidShow:]):
1324         (-[WKWebView _contentsOfUserInterfaceItem:]):
1325         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1326         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1327         * UIProcess/PageClient.h:
1328         * UIProcess/WebPageProxy.cpp:
1329         (WebKit::WebPageProxy::handleWheelEvent):
1330         (WebKit::WebPageProxy::setPageZoomFactor):
1331         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
1332         (WebKit::WebPageProxy::pageDidScroll):
1333         (WebKit::WebPageProxy::resetState):
1334         (WebKit::WebPageProxy::hideValidationMessage):
1335         * UIProcess/WebPageProxy.h:
1336         (WebKit::WebPageProxy::validationBubble):
1337         (WebKit::WebPageProxy::setIsKeyboardAnimatingIn):
1338         * UIProcess/WebPageProxy.messages.in:
1339         * UIProcess/ios/PageClientImplIOS.h:
1340         * UIProcess/ios/PageClientImplIOS.mm:
1341         (WebKit::PageClientImpl::createValidationBubble):
1342         * UIProcess/ios/WKContentViewInteraction.mm:
1343         (-[WKContentView _willStartScrollingOrZooming]):
1344         (-[WKContentView scrollViewWillStartPanOrPinchGesture]):
1345         (-[WKContentView _didEndScrollingOrZooming]):
1346         * UIProcess/ios/WebPageProxyIOS.mm:
1347         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
1348         (WebKit::WebPageProxy::potentialTapAtPosition):
1349         (WebKit::WebPageProxy::showValidationMessage):
1350         (WebKit::WebPageProxy::setIsScrollingOrZooming):
1351         * UIProcess/mac/PageClientImpl.h:
1352         * UIProcess/mac/PageClientImpl.mm:
1353         (WebKit::PageClientImpl::createValidationBubble):
1354         * UIProcess/mac/WebPageProxyMac.mm:
1355         (WebKit::WebPageProxy::showValidationMessage):
1356         * WebKit2.xcodeproj/project.pbxproj:
1357         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
1358         (WebKit::WebValidationMessageClient::WebValidationMessageClient):
1359         (WebKit::WebValidationMessageClient::~WebValidationMessageClient):
1360         (WebKit::WebValidationMessageClient::showValidationMessage):
1361         (WebKit::WebValidationMessageClient::hideValidationMessage):
1362         (WebKit::WebValidationMessageClient::isValidationMessageVisible):
1363         * WebProcess/WebCoreSupport/WebValidationMessageClient.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
1364         * WebProcess/WebPage/WebPage.cpp:
1365         (WebKit::m_userInterfaceLayoutDirection):
1366
1367 2016-11-03  Tim Horton  <timothy_horton@apple.com>
1368
1369         Printing to PDF should produce internal links when HTML has internal links
1370         https://bugs.webkit.org/show_bug.cgi?id=112081
1371         <rdar://problem/5955705>
1372
1373         Reviewed by Simon Fraser.
1374
1375         * UIProcess/mac/WKPrintingView.h:
1376         * UIProcess/mac/WKPrintingView.mm:
1377         (linkDestinationName):
1378         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
1379         Propagate link-to-destination annotations (and each page's destinations)
1380         into the printed PDF.
1381         Generate a unique destination name based on the page and position, because
1382         we have lost the fragment name information.
1383
1384         (-[WKPrintingView drawRect:]):
1385         Compute all of the destinations for every page, so that we can add them
1386         to the context as we paint the pages (we need the page CTM in order to add them).
1387
1388 2016-11-03  Alex Christensen  <achristensen@webkit.org>
1389
1390         Unreviewed, rolling out r208298.
1391         https://bugs.webkit.org/show_bug.cgi?id=163939
1392
1393         caused asan crashes
1394
1395         Reverted changeset:
1396
1397         "NetworkSession: Add NetworkDataTask implementation for blobs"
1398         https://bugs.webkit.org/show_bug.cgi?id=163939
1399         http://trac.webkit.org/changeset/208298
1400
1401 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
1402
1403         Unreviewed, rolling out r208330.
1404
1405         This change appears to have caused two editing tests to fail
1406         on macOS.
1407
1408         Reverted changeset:
1409
1410         "Reduce PassRefPtr use in WebKit2"
1411         https://bugs.webkit.org/show_bug.cgi?id=164360
1412         http://trac.webkit.org/changeset/208330
1413
1414 2016-11-03  Dan Bernstein  <mitz@apple.com>
1415
1416         WKWebView’s _observedRenderingProgressEvents not restored after web process crash
1417         https://bugs.webkit.org/show_bug.cgi?id=164368
1418         <rdar://problem/29091954>
1419
1420         Reviewed by Anders Carlsson.
1421
1422         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
1423
1424         * Shared/WebPageCreationParameters.cpp:
1425         (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
1426         (WebKit::WebPageCreationParameters::decode): Decode it.
1427         * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
1428
1429         * UIProcess/WebPageProxy.cpp:
1430         (WebKit::WebPageProxy::WebPageProxy): Removed initializer for
1431           m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
1432         (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
1433           member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
1434         (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
1435           creation parameters.
1436
1437         * UIProcess/WebPageProxy.h: Declared new member variable, deleted
1438           m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
1439
1440         * UIProcess/ios/WebPageProxyIOS.mm:
1441         (WebKit::WebPageProxy::didCommitLayerTree): Rather than using
1442           m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
1443
1444         * WebProcess/WebPage/WebPage.cpp:
1445         (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
1446
1447 2016-11-02  Alex Christensen  <achristensen@webkit.org>
1448
1449         Reduce PassRefPtr use in WebKit2
1450         https://bugs.webkit.org/show_bug.cgi?id=164360
1451
1452         Reviewed by Tim Horton.
1453
1454         * Shared/API/APISecurityOrigin.h:
1455         (API::SecurityOrigin::SecurityOrigin):
1456         * Shared/API/APISerializedScriptValue.h:
1457         (API::SerializedScriptValue::create):
1458         (API::SerializedScriptValue::SerializedScriptValue):
1459         * Shared/API/c/WKSharedAPICast.h:
1460         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
1461         (WebKit::toAPI):
1462         * Shared/APIWebArchive.h:
1463         * Shared/APIWebArchive.mm:
1464         (API::WebArchive::create):
1465         (API::WebArchive::WebArchive):
1466         * UIProcess/API/APIHitTestResult.cpp:
1467         (API::HitTestResult::create):
1468         * UIProcess/API/APIHitTestResult.h:
1469         * UIProcess/API/APIUIClient.h:
1470         (API::UIClient::createNewPage):
1471         * UIProcess/API/C/WKPage.cpp:
1472         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
1473         (WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
1474         (WebKit::RunJavaScriptAlertResultListener::create):
1475         (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
1476         (WebKit::RunJavaScriptConfirmResultListener::create):
1477         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
1478         (WebKit::RunJavaScriptPromptResultListener::create):
1479         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
1480         (WKPageSetPageUIClient):
1481         * UIProcess/API/Cocoa/WKWebView.mm:
1482         (-[WKWebView _takeViewSnapshot]):
1483         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1484         * UIProcess/Cocoa/UIDelegate.h:
1485         * UIProcess/Cocoa/UIDelegate.mm:
1486         (WebKit::UIDelegate::UIClient::createNewPage):
1487         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1488         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
1489         * UIProcess/mac/WKImmediateActionController.mm:
1490         (-[WKImmediateActionController _webHitTestResult]):
1491         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1492         (contextMenuItems):
1493         (WKBundlePageCopyContextMenuItems):
1494         (WKBundlePageCopyContextMenuAtPointInWindow):
1495         * WebProcess/UserContent/WebUserContentController.cpp:
1496         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
1497         * WebProcess/WebPage/WebUndoStep.cpp:
1498         (WebKit::WebUndoStep::create):
1499         * WebProcess/WebPage/WebUndoStep.h:
1500         (WebKit::WebUndoStep::WebUndoStep):
1501
1502 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
1503
1504         Remove PageThrottler & all related code
1505         https://bugs.webkit.org/show_bug.cgi?id=164302
1506
1507         Reviewed by Ryosuke Niwa.
1508
1509         All relevant information now available from the ActivityState.
1510
1511         * PluginProcess/PluginProcess.cpp:
1512         (WebKit::PluginProcess::PluginProcess):
1513         (WebKit::PluginProcess::createWebProcessConnection):
1514         (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
1515         (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
1516         * PluginProcess/PluginProcess.h:
1517         (): Deleted.
1518         * PluginProcess/WebProcessConnection.cpp:
1519         (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
1520         (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
1521         * PluginProcess/WebProcessConnection.h:
1522         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1523         (WebKit::NPRuntimeObjectMap::evaluate):
1524         * WebProcess/Plugins/Plugin.h:
1525         (WebKit::Plugin::audioHardwareActivity): Deleted.
1526         * WebProcess/Plugins/PluginProcessConnection.cpp:
1527         (WebKit::PluginProcessConnection::PluginProcessConnection):
1528         (WebKit::PluginProcessConnection::didReceiveMessage):
1529         (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
1530         (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
1531         * WebProcess/Plugins/PluginProcessConnection.h:
1532         (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
1533         (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
1534         * WebProcess/Plugins/PluginProcessConnection.messages.in:
1535         * WebProcess/Plugins/PluginProxy.cpp:
1536         (WebKit::PluginProxy::audioHardwareActivity): Deleted.
1537         * WebProcess/Plugins/PluginProxy.h:
1538         * WebProcess/Plugins/PluginView.cpp:
1539         (WebKit::PluginView::audioHardwareActivity): Deleted.
1540         * WebProcess/Plugins/PluginView.h:
1541         * WebProcess/WebPage/WebPage.cpp:
1542
1543 2016-11-03  Dan Bernstein  <mitz@apple.com>
1544
1545         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
1546         https://bugs.webkit.org/show_bug.cgi?id=164340
1547         <rdar://problem/29074344>
1548
1549         Reviewed by Tim Horton.
1550
1551         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
1552         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1553         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
1554           function that sends the message to the UI process and resets
1555           m_pendingNewlyReachedLayoutMilestones.
1556         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
1557           pending milestones and send them to the UI process. This way we don’t miss milestones that
1558           fire during the commit.
1559
1560 2016-11-02  David Kilzer  <ddkilzer@apple.com>
1561
1562         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
1563         <https://webkit.org/b/164333>
1564         <rdar://problem/29072727>
1565
1566         Reviewed by Alex Christensen.
1567
1568         * WebProcess/WebProcess.cpp:
1569         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
1570         Add private method to log diagnostic message.
1571         (WebKit::WebProcess::networkProcessConnectionClosed):
1572         Call logDiagnosticMessageForNetworkProcessCrash().
1573         * WebProcess/WebProcess.h:
1574         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
1575         Declare new method.
1576
1577 2016-11-02  Alex Christensen  <achristensen@webkit.org>
1578
1579         Remove Battery Status API from the tree
1580         https://bugs.webkit.org/show_bug.cgi?id=164213
1581
1582         Reviewed by Sam Weinig.
1583
1584         * CMakeLists.txt:
1585         * PlatformEfl.cmake:
1586         * Shared/API/APIObject.h:
1587         * Shared/API/c/WKBase.h:
1588         * Shared/WebBatteryStatus.cpp: Removed.
1589         * Shared/WebBatteryStatus.h: Removed.
1590         * UIProcess/API/C/WKAPICast.h:
1591         * UIProcess/API/C/WKBatteryManager.cpp: Removed.
1592         * UIProcess/API/C/WKBatteryManager.h: Removed.
1593         * UIProcess/API/C/WKBatteryStatus.cpp: Removed.
1594         * UIProcess/API/C/WKBatteryStatus.h: Removed.
1595         * UIProcess/API/C/WKContext.cpp:
1596         (WKContextGetBatteryManager): Deleted.
1597         * UIProcess/API/C/WKContext.h:
1598         * UIProcess/API/efl/ewk_context.cpp:
1599         (EwkContext::EwkContext):
1600         * UIProcess/API/efl/ewk_context_private.h:
1601         * UIProcess/API/efl/ewk_main.cpp:
1602         (WebKit::EwkMain::initialize):
1603         (WebKit::EwkMain::finalize):
1604         (WebKit::EwkMain::shutdownInitializedEFLModules):
1605         * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed.
1606         * UIProcess/API/gtk/WebKitBatteryProvider.h: Removed.
1607         * UIProcess/API/gtk/WebKitWebContext.cpp:
1608         (webkitWebContextConstructed):
1609         * UIProcess/WebBatteryManagerProxy.cpp: Removed.
1610         * UIProcess/WebBatteryManagerProxy.h: Removed.
1611         * UIProcess/WebBatteryManagerProxy.messages.in: Removed.
1612         * UIProcess/WebBatteryProvider.cpp: Removed.
1613         * UIProcess/WebBatteryProvider.h: Removed.
1614         * UIProcess/WebProcessPool.cpp:
1615         (WebKit::m_hiddenPageThrottlingTimer):
1616         * UIProcess/efl/BatteryProvider.cpp: Removed.
1617         * UIProcess/efl/BatteryProvider.h: Removed.
1618         * WebProcess/Battery: Removed.
1619         * WebProcess/Battery/WebBatteryManager.cpp: Removed.
1620         * WebProcess/Battery/WebBatteryManager.h: Removed.
1621         * WebProcess/Battery/WebBatteryManager.messages.in: Removed.
1622         * WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed.
1623         * WebProcess/WebCoreSupport/WebBatteryClient.h: Removed.
1624         * WebProcess/WebPage/WebPage.cpp:
1625         (WebKit::m_userInterfaceLayoutDirection):
1626         * WebProcess/WebProcess.cpp:
1627         (WebKit::m_resourceLoadStatisticsStorage):
1628
1629 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1630
1631         NetworkSession: Add NetworkDataTask implementation for blobs
1632         https://bugs.webkit.org/show_bug.cgi?id=163939
1633
1634         Reviewed by Alex Christensen.
1635
1636         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
1637         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
1638         is enabled.
1639
1640         * CMakeLists.txt: Add new files to compilation.
1641         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1642         * NetworkProcess/Downloads/BlobDownloadClient.h:
1643         * NetworkProcess/Downloads/Download.cpp:
1644         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
1645         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
1646         reveices a NetworkDataTask and is used by Soup backend and blobs.
1647         (WebKit::Download::~Download):
1648         (WebKit::Download::start):
1649         (WebKit::Download::startWithHandle):
1650         (WebKit::Download::cancel):
1651         (WebKit::Download::didReceiveAuthenticationChallenge):
1652         (WebKit::Download::didReceiveData):
1653         (WebKit::Download::didFinish):
1654         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
1655         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
1656         * NetworkProcess/Downloads/Download.h:
1657         (WebKit::Download::Download):
1658         (WebKit::Download::suggestedName):
1659         (WebKit::Download::request):
1660         * NetworkProcess/Downloads/DownloadManager.cpp:
1661         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
1662         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
1663         * NetworkProcess/Downloads/DownloadManager.h:
1664         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1665         (WebKit::Download::platformCancelNetworkLoad):
1666         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
1667         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1668         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
1669         using NetworkSession.
1670         * NetworkProcess/NetworkDataTask.cpp:
1671         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
1672         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
1673         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
1674         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1675         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
1676         (WebKit::NetworkDataTaskBlob::clearStream):
1677         (WebKit::NetworkDataTaskBlob::resume):
1678         (WebKit::NetworkDataTaskBlob::suspend):
1679         (WebKit::NetworkDataTaskBlob::cancel):
1680         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
1681         (WebKit::NetworkDataTaskBlob::getSizeForNext):
1682         (WebKit::NetworkDataTaskBlob::didGetSize):
1683         (WebKit::NetworkDataTaskBlob::seek):
1684         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
1685         (WebKit::NetworkDataTaskBlob::read):
1686         (WebKit::NetworkDataTaskBlob::readData):
1687         (WebKit::NetworkDataTaskBlob::readFile):
1688         (WebKit::NetworkDataTaskBlob::didOpen):
1689         (WebKit::NetworkDataTaskBlob::didRead):
1690         (WebKit::NetworkDataTaskBlob::consumeData):
1691         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
1692         (WebKit::NetworkDataTaskBlob::suggestedFilename):
1693         (WebKit::NetworkDataTaskBlob::download):
1694         (WebKit::NetworkDataTaskBlob::writeDownload):
1695         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
1696         (WebKit::NetworkDataTaskBlob::didFailDownload):
1697         (WebKit::NetworkDataTaskBlob::didFinishDownload):
1698         (WebKit::NetworkDataTaskBlob::didFail):
1699         (WebKit::NetworkDataTaskBlob::didFinish):
1700         * NetworkProcess/NetworkDataTaskBlob.h: Added.
1701         * NetworkProcess/NetworkLoad.cpp:
1702         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
1703         (WebKit::NetworkLoad::~NetworkLoad):
1704         (WebKit::NetworkLoad::setDefersLoading):
1705         (WebKit::NetworkLoad::cancel):
1706         (WebKit::NetworkLoad::continueWillSendRequest):
1707         (WebKit::NetworkLoad::continueDidReceiveResponse):
1708         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1709         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
1710         * NetworkProcess/NetworkLoad.h:
1711         * NetworkProcess/NetworkSession.cpp:
1712         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
1713         * NetworkProcess/NetworkSession.h:
1714         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
1715         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
1716         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
1717         because in Cocoa all tasks are invalidated and canceled by the network session.
1718         * NetworkProcess/mac/NetworkLoadMac.mm:
1719         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1720         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1721         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
1722         (WebKit::NetworkDataTaskSoup::download):
1723         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1724         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1725         * NetworkProcess/soup/NetworkSessionSoup.h:
1726         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
1727         * PlatformGTK.cmake: Ditto.
1728         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
1729
1730 2016-11-02  Andy Estes  <aestes@apple.com>
1731
1732         REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
1733         https://bugs.webkit.org/show_bug.cgi?id=164311
1734         <rdar://problem/26995374>
1735
1736         Reviewed by Tim Horton.
1737
1738         -[NSURL fileSystemRepresentation] returns a char* in file system representation, which on
1739         iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is
1740         Latin-1 encoded.
1741
1742         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1743         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to
1744         convert fileURL.fileSystemRepresentation to a String.
1745
1746 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1747
1748         NetworkSession: Network process crash when converting main resource to download
1749         https://bugs.webkit.org/show_bug.cgi?id=164220
1750
1751         Reviewed by Alex Christensen.
1752
1753         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
1754         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
1755         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
1756         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
1757         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
1758         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
1759         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
1760         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
1761         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
1762         created yet. That's not expected to happen and when the response completion handler is called in the
1763         NetworkDataTask it tries to use either the client or the download and it crashes.
1764
1765         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1766         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the
1767         resource loader in case it's becoming a download.
1768         * NetworkProcess/NetworkResourceLoader.cpp:
1769         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
1770         (WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a
1771         download, but didBecomeDownload() hasn't been called yet.
1772         (WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup()
1773         because it will be called by didBecomeDownload() later.
1774         * NetworkProcess/NetworkResourceLoader.h:
1775
1776 2016-11-02  David Kilzer  <ddkilzer@apple.com>
1777
1778         Add logging for "WebKit encountered an internal error" messages
1779         <https://webkit.org/b/164272>
1780         <rdar://problem/28546064>
1781
1782         Reviewed by Alex Christensen.
1783
1784         * NetworkProcess/NetworkResourceLoader.cpp:
1785         (WebKit::NetworkResourceLoader::startNetworkLoad):
1786         * WebProcess/Network/WebLoaderStrategy.cpp:
1787         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1788         * WebProcess/Network/WebResourceLoader.cpp:
1789         (WebKit::WebResourceLoader::didReceiveResource):
1790         - Add logging for various internalError() events.
1791
1792 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1793
1794         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
1795         https://bugs.webkit.org/show_bug.cgi?id=164303
1796
1797         Reviewed by Michael Catanzaro.
1798
1799         This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
1800         BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
1801
1802         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
1803         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
1804         (WebKit::AcceleratedBackingStoreX11::update):
1805
1806 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1807
1808         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
1809         https://bugs.webkit.org/show_bug.cgi?id=164315
1810
1811         Reviewed by Michael Catanzaro.
1812
1813         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1814         (WebKit::getExecutablePath):
1815         (WebKit::findWebKitProcess):
1816         * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
1817         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
1818         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
1819         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
1820         * UIProcess/API/gtk/WebKitWebContext.cpp:
1821         (webkitWebContextConstructed):
1822         (webkit_web_context_set_favicon_database_directory):
1823         (webkit_web_context_set_additional_plugins_directory):
1824         (webkit_web_context_set_disk_cache_directory):
1825         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
1826         (webkitWebsiteDataManagerGetDataStore):
1827         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1828         (WebKit::PluginInfoCache::PluginInfoCache):
1829         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1830         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
1831         * WebProcess/gtk/WebGtkExtensionManager.cpp:
1832         (WebKit::parseUserData):
1833
1834 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1835
1836         [Readable Streams API] Enable creation of ReadableByteStreamController
1837         https://bugs.webkit.org/show_bug.cgi?id=164014
1838
1839         Reviewed by Youenn Fablet.
1840
1841         Added flag for the byte stream part of Readable Streams API.
1842
1843         * Configurations/FeatureDefines.xcconfig:
1844
1845 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1846
1847         PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
1848         https://bugs.webkit.org/show_bug.cgi?id=164103
1849
1850         Reviewed by Michael Catanzaro.
1851
1852         Follow symlinks when scanning plugins to avoid duplicates.
1853
1854         * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
1855         from the cache.
1856         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
1857         (WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.
1858
1859 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1860
1861         [GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin
1862         https://bugs.webkit.org/show_bug.cgi?id=164204
1863
1864         Reviewed by Michael Catanzaro.
1865
1866         Check the platform plugin widget is embedded before trying to get its socket window.
1867
1868         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1869         (WebKit::NetscapePluginX11::geometryDidChange):
1870         (WebKit::NetscapePluginX11::visibilityDidChange):
1871
1872 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1873
1874         Turn the Input Events runtime flag on by default
1875         https://bugs.webkit.org/show_bug.cgi?id=164297
1876
1877         Reviewed by Ryosuke Niwa.
1878
1879         * Shared/WebPreferencesDefinitions.h:
1880
1881 2016-11-01  Jaehun Lim  <ljaehun.lim@samsung.com>
1882
1883         Unreviewed, EFL build fix after r208225
1884
1885         Rename ViewState to ActivityState
1886
1887         * UIProcess/efl/WebView.cpp:
1888         (WebKit::WebView::setActive):
1889         (WebKit::WebView::setFocused):
1890         (WebKit::WebView::setVisible):
1891
1892 2016-11-01  Alex Christensen  <achristensen@webkit.org>
1893
1894         Fix CMake build.
1895
1896         * PlatformMac.cmake:
1897
1898 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
1899
1900         Remove CUSTOM_ELEMENTS build flag
1901         https://bugs.webkit.org/show_bug.cgi?id=164267
1902
1903         Reviewed by Antti Koivisto.
1904
1905         Removed the build flag.
1906
1907         * Configurations/FeatureDefines.xcconfig:
1908         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1909         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1910         * WebProcess/WebPage/WebPage.cpp:
1911         (WebKit::WebPage::updatePreferences):
1912
1913 2016-11-01  Eric Carlson  <eric.carlson@apple.com>
1914
1915         [MediaStream] restrict media capture secure connections
1916         https://bugs.webkit.org/show_bug.cgi?id=164234
1917         <rdar://problem/28944906>
1918
1919         Reviewed by Alex Christensen.
1920
1921         * Shared/WebPreferencesDefinitions.h:
1922    
1923         * UIProcess/API/C/WKPreferences.cpp:
1924         (WKPreferencesSetMediaCaptureRequiresSecureConnection):
1925         (WKPreferencesGetMediaCaptureRequiresSecureConnection):
1926         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1927    
1928         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1929         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Drive by
1930          fix: remove some unused parameters in a lambda call.
1931
1932         * WebProcess/WebPage/WebPage.cpp:
1933         (WebKit::WebPage::updatePreferences):
1934
1935 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
1936
1937         Add IsAudible, IsLoading to ActivityState
1938         https://bugs.webkit.org/show_bug.cgi?id=164286
1939
1940         Reviewed by Geoff Garen.
1941
1942         By computing these values in the UIProcess and passing them to WebContent we can
1943         more closely unify iOS & macOS throttling, and remove the PageThrottler class.
1944
1945         * UIProcess/WebPageProxy.cpp:
1946         (WebKit::WebPageProxy::updateActivityState):
1947             - Added update for IsAudible, IsLoading flags.
1948         (WebKit::WebPageProxy::updateThrottleState):
1949             - Read IsAudible, IsLoading flags from ActivityState.
1950         (WebKit::WebPageProxy::setMuted):
1951             - call activityStateDidChange to trigger update.
1952         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1953             - call activityStateDidChange to trigger update.
1954         * UIProcess/WebPageProxy.h:
1955         (WebKit::WebPageProxy::isLoadingChanged):
1956             - call activityStateDidChange to trigger update.
1957
1958 2016-10-31  Gavin Barraclough  <barraclough@apple.com>
1959
1960         Rename ViewState to ActivityState
1961         https://bugs.webkit.org/show_bug.cgi?id=164254
1962
1963         Reviewed by Andreas Kling.
1964
1965         We plan to add a couple more flags to ViewState that aren't directly related to the view
1966         itself - whether there is an ongoing page load, and whether whether there is audio playback.
1967         This will allow viewState (now activityState) to fully drive throttling decisions.
1968
1969         Renaming this bitfield accordingly.
1970
1971         * Shared/WebPageCreationParameters.cpp:
1972         (WebKit::WebPageCreationParameters::encode):
1973         (WebKit::WebPageCreationParameters::decode):
1974         * Shared/WebPageCreationParameters.h:
1975         * UIProcess/API/Cocoa/WKWebView.mm:
1976         (-[WKWebView didMoveToWindow]):
1977         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1978         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
1979         (_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
1980         (webkitWebViewBaseScheduleUpdateActivityState):
1981         (toplevelWindowFocusInEvent):
1982         (toplevelWindowFocusOutEvent):
1983         (toplevelWindowStateEvent):
1984         (webkitWebViewBaseSetToplevelOnScreenWindow):
1985         (webkitWebViewBaseMap):
1986         (webkitWebViewBaseUnmap):
1987         (webkitWebViewBaseSetFocus):
1988         (webkitWebViewBaseIsInWindowActive):
1989         (webkitWebViewBaseIsFocused):
1990         (webkitWebViewBaseIsVisible):
1991         (webkitWebViewBaseIsInWindow):
1992         (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
1993         (webkitWebViewBaseScheduleUpdateViewState): Deleted.
1994         * UIProcess/Cocoa/WebViewImpl.mm:
1995         (WebKit::WebViewImpl::becomeFirstResponder):
1996         (WebKit::WebViewImpl::resignFirstResponder):
1997         (WebKit::WebViewImpl::windowDidOrderOffScreen):
1998         (WebKit::WebViewImpl::windowDidOrderOnScreen):
1999         (WebKit::WebViewImpl::windowDidBecomeKey):
2000         (WebKit::WebViewImpl::windowDidResignKey):
2001         (WebKit::WebViewImpl::windowDidMiniaturize):
2002         (WebKit::WebViewImpl::windowDidDeminiaturize):
2003         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
2004         (WebKit::WebViewImpl::viewDidMoveToWindow):
2005         (WebKit::WebViewImpl::viewDidHide):
2006         (WebKit::WebViewImpl::viewDidUnhide):
2007         (WebKit::WebViewImpl::activeSpaceDidChange):
2008         (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
2009         (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
2010         (WebKit::WebViewImpl::prepareForMoveToWindow):
2011         * UIProcess/DrawingAreaProxy.h:
2012         (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
2013         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
2014         * UIProcess/WebPageProxy.cpp:
2015         (WebKit::WebPageProxy::WebPageProxy):
2016         (WebKit::WebPageProxy::reattachToWebProcess):
2017         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
2018         (WebKit::WebPageProxy::updateActivityState):
2019         (WebKit::WebPageProxy::activityStateDidChange):
2020         (WebKit::WebPageProxy::dispatchActivityStateChange):
2021         (WebKit::WebPageProxy::updateThrottleState):
2022         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
2023         (WebKit::WebPageProxy::creationParameters):
2024         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
2025         (WebKit::WebPageProxy::updateViewState): Deleted.
2026         (WebKit::WebPageProxy::viewStateDidChange): Deleted.
2027         (WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
2028         (WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
2029         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
2030         * UIProcess/WebPageProxy.h:
2031         (WebKit::WebPageProxy::isInWindow):
2032         (WebKit::WebPageProxy::didUpdateActivityState):
2033         (WebKit::WebPageProxy::isViewVisible):
2034         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
2035         * UIProcess/WebPageProxy.messages.in:
2036         * UIProcess/WebProcessProxy.cpp:
2037         (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
2038         * UIProcess/efl/WebView.cpp:
2039         * UIProcess/ios/WKContentView.mm:
2040         (-[WKContentView _applicationDidEnterBackground]):
2041         (-[WKContentView _applicationWillEnterForeground]):
2042         * UIProcess/ios/WKPDFView.mm:
2043         (-[WKPDFView _applicationDidEnterBackground]):
2044         (-[WKPDFView _applicationWillEnterForeground]):
2045         * UIProcess/ios/WebPageProxyIOS.mm:
2046         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
2047         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2048         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2049         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2050         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2051         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
2052         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2053         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2054         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2055         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
2056         * WebProcess/Plugins/PluginView.cpp:
2057         (WebKit::PluginView::activityStateDidChange):
2058         (WebKit::PluginView::viewStateDidChange): Deleted.
2059         * WebProcess/Plugins/PluginView.h:
2060         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2061         (WebKit::AcceleratedDrawingArea::activityStateDidChange):
2062         (WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
2063         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2064         * WebProcess/WebPage/DrawingArea.h:
2065         (WebKit::DrawingArea::activityStateDidChange):
2066         (WebKit::DrawingArea::viewStateDidChange): Deleted.
2067         * WebProcess/WebPage/WebPage.cpp:
2068         (WebKit::m_userInterfaceLayoutDirection):
2069         (WebKit::WebPage::reinitializeWebPage):
2070         (WebKit::WebPage::updateIsInWindow):
2071         (WebKit::WebPage::setActivityState):
2072         (WebKit::WebPage::setViewState): Deleted.
2073         * WebProcess/WebPage/WebPage.h:
2074         (WebKit::WebPage::isVisible):
2075         (WebKit::WebPage::isVisibleOrOccluded):
2076         * WebProcess/WebPage/WebPage.messages.in:
2077         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2078         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2079         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
2080         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
2081         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2082         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2083         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2084         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
2085         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
2086         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
2087         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.
2088
2089 2016-10-31  Jaehun Lim  <ljaehun.lim@samsung.com>
2090
2091         Unreviewed, CMake build fix
2092
2093         Adds #include <WebCore/IDBGetAllRecordsData.h>
2094
2095         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2096
2097 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
2098
2099         Add basic visual/layout viewport support for fixed position layout
2100         https://bugs.webkit.org/show_bug.cgi?id=164261
2101
2102         Reviewed by Dean Jackson.
2103
2104         Don't make visualViewportEnabled an experimental feature, because I don't want it enabled
2105         by default in WebKitTestRunner (and therefore mismatching DumpRenderTree).
2106
2107         * Shared/WebPreferencesDefinitions.h:
2108
2109 2016-10-29  Filip Pizlo  <fpizlo@apple.com>
2110
2111         JSC should support SharedArrayBuffer
2112         https://bugs.webkit.org/show_bug.cgi?id=163986
2113
2114         Reviewed by Keith Miller.
2115         
2116         Adds some small things we need for SharedArrayBuffer.
2117
2118         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2119         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2120         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2121         (WebKit::InjectedBundle::createWebDataFromUint8Array):
2122
2123 2016-10-31  Brady Eidson  <beidson@apple.com>
2124
2125         IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
2126         <rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
2127
2128         Reviewed by Darin Adler.
2129
2130         - Handle moving "Get All" requests to and from the DatabaseProcess.
2131         - Handle the additional task of creating/passing Sandbox Extensions for
2132           referenced files when necessary. 
2133           
2134         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2135         (WebKit::WebIDBConnectionToClient::handleGetResult):
2136         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
2137         (WebKit::WebIDBConnectionToClient::getAllRecords):
2138         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2139         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2140         
2141         * Shared/WebCoreArgumentCoders.h:
2142         
2143         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2144         (WebKit::WebIDBConnectionToServer::getAllRecords):
2145         (WebKit::preregisterSandboxExtensionsIfNecessary):
2146         (WebKit::WebIDBConnectionToServer::didGetAllRecords):
2147         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2148         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2149
2150 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2151
2152         [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
2153         https://bugs.webkit.org/show_bug.cgi?id=164236
2154         <rdar://problem/28747712>
2155
2156         Reviewed by Beth Dakin.
2157
2158         See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of
2159         keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath.
2160
2161         * WebProcess/WebPage/WebPage.cpp:
2162         (WebKit::WebPage::didChangeSelection):
2163         * WebProcess/WebPage/WebPage.h:
2164         * WebProcess/WebPage/mac/WebPageMac.mm:
2165         (WebKit::WebPage::dictionaryPopupInfoForRange):
2166
2167 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
2168
2169         Implement IntersectionObserver
2170         https://bugs.webkit.org/show_bug.cgi?id=159475
2171
2172         Reviewed by Ryosuke Niwa.
2173
2174         Add ENABLE_INTERSECTION_OBSERVER, enabled by default.
2175
2176         * Configurations/FeatureDefines.xcconfig:
2177
2178 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
2179
2180         Unreviewed, rolling out r208154.
2181
2182         This change caused an assertion failure during API tests on
2183         macOS.
2184
2185         Reverted changeset:
2186
2187         "NetworkSession: Network process crash when converting main
2188         resource to download"
2189         https://bugs.webkit.org/show_bug.cgi?id=164220
2190         http://trac.webkit.org/changeset/208154
2191
2192 2016-10-28  Brent Fulgham  <bfulgham@apple.com>
2193
2194         Do a better job of protecting Frame objects in the context of JavaScript calls
2195         https://bugs.webkit.org/show_bug.cgi?id=164163
2196         <rdar://problem/28955249>
2197
2198         Reviewed by Darin Adler.
2199
2200         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2201         (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame.
2202         * WebProcess/WebPage/WebPage.cpp:
2203         (WebKit::WebPage::insertTextAsync): Ditto.
2204         (WebKit::WebPage::setComposition): Ditto.
2205         * WebProcess/WebPage/mac/WebPageMac.mm:
2206         (WebKit::WebPage::insertDictatedTextAsync): Ditto.
2207
2208 2016-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2209
2210         NetworkSession: Network process crash when converting main resource to download
2211         https://bugs.webkit.org/show_bug.cgi?id=164220
2212
2213         Reviewed by Alex Christensen.
2214
2215         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
2216         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
2217         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
2218         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
2219         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
2220         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
2221         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
2222         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
2223         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
2224         created yet. That's not expected to happen and when the response completion handler is called in the
2225         NetworkDataTask it tries to use either the client or the download and it crashes.
2226
2227         * NetworkProcess/NetworkResourceLoader.cpp:
2228         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
2229         (WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not
2230         call cleanup() because it will be called by didBecomeDownload() later.
2231
2232 2016-10-31  Darin Adler  <darin@apple.com>
2233
2234         Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
2235         https://bugs.webkit.org/show_bug.cgi?id=164214
2236
2237         Reviewed by Alex Christensen.
2238
2239         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2240         (webkit_dom_document_query_selector): Updated exception handling.
2241         (webkit_dom_document_query_selector_all): Ditto.
2242         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
2243         (webkit_dom_document_fragment_query_selector): Ditto.
2244         (webkit_dom_document_fragment_query_selector_all): Ditto.
2245         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2246         (webkit_dom_element_query_selector): Ditto.
2247         (webkit_dom_element_query_selector_all): Ditto.
2248
2249 2016-10-31  Darin Adler  <darin@apple.com>
2250
2251         Convert Document from ExceptionCode to Exception
2252         https://bugs.webkit.org/show_bug.cgi?id=164212
2253
2254         Reviewed by Alex Christensen.
2255
2256         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2257         (webkit_dom_document_create_element): Updated exception handling.
2258         (webkit_dom_document_create_cdata_section): Ditto.
2259         (webkit_dom_document_create_processing_instruction): Ditto.
2260         (webkit_dom_document_create_attribute): Ditto.
2261         (webkit_dom_document_import_node): Ditto.
2262         (webkit_dom_document_create_element_ns): Ditto.
2263         (webkit_dom_document_create_attribute_ns): Ditto.
2264         (webkit_dom_document_adopt_node): Ditto.
2265         (webkit_dom_document_create_event): Ditto.
2266         (webkit_dom_document_set_xml_version): Ditto.
2267         (webkit_dom_document_get_cookie): Ditto.
2268         (webkit_dom_document_set_cookie): Ditto.
2269         (webkit_dom_document_set_body): Ditto.
2270         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
2271         (-[WKDOMDocument createElement:]): Ditto.
2272
2273 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2274
2275         Holding down a key to choose an accented character should fire "insertReplacementText" input events
2276         https://bugs.webkit.org/show_bug.cgi?id=164209
2277         <rdar://problem/29019305>
2278
2279         Reviewed by Darin Adler.
2280
2281         When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to
2282         use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor
2283         changes in order to support testing replacement text insertion.
2284
2285         * UIProcess/API/Cocoa/WKWebView.mm:
2286         (-[WKWebView _insertText:replacementRange:]):
2287         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2288         * WebProcess/WebPage/WebPage.cpp:
2289         (WebKit::WebPage::insertTextAsync):
2290
2291 2016-10-30  Darin Adler  <darin@apple.com>
2292
2293         Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
2294         https://bugs.webkit.org/show_bug.cgi?id=164206
2295
2296         Reviewed by Chris Dumez.
2297
2298         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
2299         (webkit_dom_named_node_map_set_named_item): Updated exception handling.
2300         (webkit_dom_named_node_map_remove_named_item): Ditto.
2301         (webkit_dom_named_node_map_set_named_item_ns): Ditto.
2302         (webkit_dom_named_node_map_remove_named_item_ns): Ditto.
2303         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2304         (webkit_dom_element_set_attribute): Ditto.
2305         (webkit_dom_element_set_attribute_node): Ditto.
2306         (webkit_dom_element_remove_attribute_node): Ditto.
2307         (webkit_dom_element_set_attribute_ns): Ditto.
2308         (webkit_dom_element_set_attribute_node_ns): Ditto.
2309         (webkit_dom_element_matches): Ditto.
2310         (webkit_dom_element_closest): Ditto.
2311         (webkit_dom_element_webkit_matches_selector): Ditto.
2312         (webkit_dom_element_insert_adjacent_element): Ditto.
2313         (webkit_dom_element_insert_adjacent_html): Ditto.
2314         (webkit_dom_element_insert_adjacent_text): Ditto.
2315         (webkit_dom_element_set_inner_html): Ditto.
2316         (webkit_dom_element_set_outer_html): Ditto.
2317         * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
2318         (-[WKDOMElement setAttribute:value:]): Ditto.
2319
2320 2016-10-30  Yusuke Suzuki  <utatane.tea@gmail.com>
2321
2322         [DOM] Introduce WebCore::jsDynamicDowncast
2323         https://bugs.webkit.org/show_bug.cgi?id=164137
2324
2325         Reviewed by Darin Adler.
2326
2327         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2328         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
2329
2330 2016-10-29  Darin Adler  <darin@apple.com>
2331
2332         Convert more of DOM from ExceptionCode to Exception
2333         https://bugs.webkit.org/show_bug.cgi?id=164173
2334
2335         Reviewed by Ryosuke Niwa.
2336
2337         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
2338         (webkit_dom_character_data_substring_data): Updated since this
2339         now uses ExceptionOr.
2340         (webkit_dom_character_data_insert_data): Ditto.
2341         (webkit_dom_character_data_delete_data): Ditto.
2342         (webkit_dom_character_data_replace_data): Ditto.
2343         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
2344         (webkit_dom_text_replace_whole_text): Ditto.
2345         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2346         (webkit_dom_text_split_text): Ditto.
2347
2348 2016-10-28  Darin Adler  <darin@apple.com>
2349
2350         Move all classes in the HTML directory from ExceptionCode to Exception
2351         https://bugs.webkit.org/show_bug.cgi?id=163876
2352
2353         Reviewed by Sam Weinig.
2354
2355         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
2356         (webkit_dom_dom_token_list_add): Updated exception handling.
2357         (webkit_dom_dom_token_list_remove): Ditto.
2358         (webkit_dom_dom_token_list_toggle): Ditto.
2359         (webkit_dom_dom_token_list_replace): Ditto.
2360         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2361         (webkit_dom_element_remove): Ditto.
2362         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
2363         (webkit_dom_html_element_set_inner_text): Ditto.
2364         (webkit_dom_html_element_set_outer_text): Ditto.
2365         (webkit_dom_html_element_set_content_editable): Ditto.
2366         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
2367         (webkit_dom_html_input_element_set_max_length): Ditto.
2368         (webkit_dom_html_input_element_set_size): Ditto.
2369         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2370         (webkit_dom_html_select_element_set_length): Ditto.
2371         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2372         (webkit_dom_html_table_element_insert_row): Ditto.
2373         (webkit_dom_html_table_element_delete_row): Ditto.
2374         (webkit_dom_html_table_element_set_caption): Ditto.
2375         (webkit_dom_html_table_element_set_t_head): Ditto.
2376         (webkit_dom_html_table_element_set_t_foot): Ditto.
2377         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2378         (webkit_dom_html_table_row_element_insert_cell): Ditto.
2379         (webkit_dom_html_table_row_element_delete_cell): Ditto.
2380         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2381         (webkit_dom_html_table_section_element_insert_row): Ditto.
2382         (webkit_dom_html_table_section_element_delete_row): Ditto.
2383
2384         * WebProcess/WebPage/WebPage.cpp:
2385         (WebKit::WebPage::editorState): Removed ASSERT_NO_EXCEPTION.
2386
2387         * WebProcess/WebPage/ios/WebPageIOS.mm:
2388         (WebKit::WebPage::setAssistedNodeValueAsNumber): Removed ASSERT_NO_EXCEPTION.
2389
2390         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2391         (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
2392         Changed the code to use a different interface to TimeRange that does
2393         not involve exceptions.
2394
2395 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2396
2397         iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
2398         https://bugs.webkit.org/show_bug.cgi?id=164077
2399         <rdar://problem/28987810>
2400
2401         Reviewed by Simon Fraser.
2402
2403         Small tweak to mark text insertion when autocorrecting as such, as opposed to regular keyboard input.
2404
2405         * WebProcess/WebPage/ios/WebPageIOS.mm:
2406         (WebKit::WebPage::syncApplyAutocorrection):
2407
2408 2016-10-28  Megan Gardner  <megan_gardner@apple.com>
2409
2410         Rename SharedMemoryMac to SharedMemoryCocoa
2411         https://bugs.webkit.org/show_bug.cgi?id=164156
2412
2413         Reviewed by Alex Christensen.
2414
2415         Renamed SharedMemoryMac to SharedMemoryCocoa, as it runs on all cocoa platforms, not exclusively just mac, and
2416         thus should be named to reflect that reality.
2417
2418         * Platform/cocoa: Added.
2419         * Platform/cocoa/SharedMemoryCocoa.cpp: Copied from Source/WebKit2/Platform/mac/SharedMemoryMac.cpp.
2420         * Platform/mac/SharedMemoryMac.cpp: Removed.
2421         * WebKit2.xcodeproj/project.pbxproj:
2422
2423 2016-10-28  Antti Koivisto  <antti@apple.com>
2424
2425         Enable CFNetwork connection cache fast lane for WebKit2
2426         https://bugs.webkit.org/show_bug.cgi?id=164129
2427
2428         Reviewed by Andreas Kling.
2429
2430         The idea of this feature is keep a connection free for higher priority requests so low-priority
2431         image loads can't take all the available connections.
2432
2433         We have this enabled on WK1 but not on WK2. See what enabling it does for performance in bots.
2434
2435         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2436         (WebKit::initializeNetworkSettings):
2437
2438             Based on code inspection setting kHTTPMinimumFastLanePriority is not sufficient to enable this feature,
2439             kHTTPNumFastLanes needs also be set to a non-zero value. Use the same constants as WK1.
2440             Also enable this on Mac to unify behavior.
2441
2442 2016-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2443
2444         [GTK] New stable DOM API headers should be included from webkitdom.h
2445         https://bugs.webkit.org/show_bug.cgi?id=164069
2446
2447         Reviewed by Carlos Garcia Campos.
2448
2449         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
2450
2451 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
2452
2453         Fix when building against the MacOSX10.12.sdk where "macos" is not recognized
2454         in the availability macros.
2455
2456         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2457
2458 2016-10-27  Megan Gardner  <megan_gardner@apple.com>
2459
2460         Add support for wide gamut for ShareableBitmap for image popovers
2461         https://bugs.webkit.org/show_bug.cgi?id=164001
2462
2463         Reviewed by Simon Fraser.
2464
2465         Added suppport for wide gamut in ShareableBitmap. SharableBitmaps now know the size of their pixels,
2466         and that data is passed back and forth between the processes. The callers of SharedBitmap will determine
2467         if their image should support wide gamut, but ShareableBitmap will override a set flag on a device that
2468         is incapbable of supporting a wide gamut image.
2469         This makes it possible to show wide gamut images in image popovers on iOS.
2470         This is currently untestable, so no tests added.
2471
2472         * Platform/IPC/Decoder.cpp:
2473         (IPC::Decoder::decode):
2474         * Platform/IPC/Decoder.h:
2475         * Platform/IPC/Encoder.cpp:
2476         (IPC::Encoder::encode):
2477         * Platform/IPC/Encoder.h:
2478         * Shared/ShareableBitmap.cpp:
2479         (WebKit::bytesPerPixel):
2480         (WebKit::ShareableBitmap::Handle::encode):
2481         (WebKit::ShareableBitmap::Handle::decode):
2482         (WebKit::ShareableBitmap::Handle::clear):
2483         (WebKit::ShareableBitmap::create):
2484         (WebKit::ShareableBitmap::createShareable):
2485         (WebKit::ShareableBitmap::createHandle):
2486         (WebKit::ShareableBitmap::ShareableBitmap):
2487         * Shared/ShareableBitmap.h:
2488         (WebKit::ShareableBitmap::numBytesForSize):
2489         (WebKit::ShareableBitmap::sizeInBytes):
2490         * Shared/cg/ShareableBitmapCG.cpp:
2491         (WebKit::bitmapInfo):
2492         (WebKit::ShareableBitmap::createGraphicsContext):
2493         (WebKit::ShareableBitmap::createCGImage):
2494         * WebProcess/WebPage/ios/WebPageIOS.mm:
2495         (WebKit::WebPage::getPositionInformation):
2496
2497 2016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2498
2499         Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
2500         https://bugs.webkit.org/show_bug.cgi?id=163948
2501         <rdar://problem/28921433>
2502
2503         Reviewed by Darin Adler.
2504
2505         Add support for new drag and drop-related EditAction enum values.
2506
2507         * UIProcess/WebEditCommandProxy.cpp:
2508         (WebKit::WebEditCommandProxy::nameForEditAction):
2509
2510 2016-10-26  Chris Dumez  <cdumez@apple.com>
2511
2512         Replace IDBKeyPath with a WTF::Variant
2513         https://bugs.webkit.org/show_bug.cgi?id=163909
2514
2515         Reviewed by Darin Adler.
2516
2517         Add coders to encode / decode IDBKeyPath type for IPC.
2518
2519         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
2520         * Shared/WebCoreArgumentCoders.cpp:
2521         (IPC::ArgumentCoder<IDBKeyPath>::encode):
2522         (IPC::ArgumentCoder<IDBKeyPath>::decode):
2523         * Shared/WebCoreArgumentCoders.h:
2524         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2525
2526 2016-10-26  Brian Burg  <bburg@apple.com>
2527
2528         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
2529         https://bugs.webkit.org/show_bug.cgi?id=164046
2530
2531         Reviewed by Joseph Pecoraro.
2532
2533         * WebProcess/WebPage/WebInspector.cpp:
2534         (WebKit::WebInspector::sendMessageToFrontend):
2535         * WebProcess/WebPage/WebInspector.h:
2536
2537 2016-10-26  Eric Carlson  <eric.carlson@apple.com>
2538
2539         [MediaStream] Add "has capture device" bit to media state flags
2540         https://bugs.webkit.org/show_bug.cgi?id=163952
2541
2542         Unreviewed fix after r207839.
2543
2544         * WebProcess/WebPage/WebPage.cpp:
2545         (WebKit::WebPage::setMuted): Take an MutedStateFlags, not a bool.
2546         * WebProcess/WebPage/WebPage.h:
2547
2548 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2549
2550         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.1 release.
2551
2552         * gtk/NEWS: Add release notes for 2.15.1.
2553
2554 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2555
2556         REGRESSION(r206505) [GTK] Build broken with GTK+ 3.14
2557         https://bugs.webkit.org/show_bug.cgi?id=162776
2558
2559         Reviewed by Xabier Rodriguez-Calvar.
2560
2561         Do not use gtk_widget_get_action_group() when GTK+ < 3.16, use g_object_set instead to attach the action group
2562         to the menu widget.
2563
2564         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2565         (WebKit::WebContextMenuProxyGtk::append):
2566         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
2567         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
2568
2569 2016-10-25  Alex Christensen  <achristensen@webkit.org>
2570
2571         CMake build fix.
2572
2573         * PlatformMac.cmake:
2574         * Shared/WebHitTestResultData.cpp:
2575         (WebKit::WebHitTestResultData::WebHitTestResultData):
2576         Explicitly call AtomicString::string to make the String constructor no longer ambiguous.
2577         It couldn't decide whether to use operator const String& or operator NSString*.
2578
2579 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2580
2581         [SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection
2582         https://bugs.webkit.org/show_bug.cgi?id=163941
2583
2584         Reviewed by Michael Catanzaro.
2585
2586         equalLettersIgnoringASCIICase() expects the second argument to be the letters to compare in lowercase, so use
2587         "get" instead of "GET".
2588
2589         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2590         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
2591
2592 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
2593
2594         [MediaStream] Add "has capture device" bit to media state flags
2595         https://bugs.webkit.org/show_bug.cgi?id=163952
2596
2597         Reviewed by Sam Weinig.
2598
2599         * UIProcess/API/C/WKPage.cpp:
2600         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
2601         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
2602
2603 2016-10-25  Commit Queue  <commit-queue@webkit.org>
2604
2605         Unreviewed, rolling out r207827 and r207828.
2606         https://bugs.webkit.org/show_bug.cgi?id=163965
2607
2608         Caused LayoutTest webaudio/web-audio-is-playing.html to time
2609         out on macOS. (Requested by ryanhaddad on #webkit).
2610
2611         Reverted changesets:
2612
2613         "[MediaStream] Add "has capture device" bit to media state
2614         flags"
2615         https://bugs.webkit.org/show_bug.cgi?id=163952
2616         http://trac.webkit.org/changeset/207827
2617
2618         "[MediaStream] Add "has capture device" bit to media state
2619         flags"
2620         https://bugs.webkit.org/show_bug.cgi?id=163952
2621         http://trac.webkit.org/changeset/207828
2622
2623 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
2624
2625         [MediaStream] Add "has capture device" bit to media state flags
2626         https://bugs.webkit.org/show_bug.cgi?id=163952
2627
2628         Reviewed by Sam Weinig.
2629
2630         * UIProcess/API/C/WKPage.cpp:
2631         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
2632         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
2633
2634 2016-10-25  Chris Dumez  <cdumez@apple.com>
2635
2636         Unreviewed, rolling out r207494.
2637
2638         iOS SDK has been updated on the bots now so rollout the
2639         rollout
2640
2641         Reverted changeset:
2642
2643         "Unreviewed, rolling out r207413."
2644         https://bugs.webkit.org/show_bug.cgi?id=163547
2645         http://trac.webkit.org/changeset/207494
2646
2647 2016-10-25  Jonathan Bedard  <jbedard@apple.com>
2648
2649         Unreviewed build fix.
2650
2651         * UIProcess/API/Cocoa/WKWebView.mm:
2652         (-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis.
2653
2654 2016-10-19  Jer Noble  <jer.noble@apple.com>
2655
2656         Add WKWebView fullscreen delegate SPI
2657         https://bugs.webkit.org/show_bug.cgi?id=163674
2658
2659         Reviewed by Anders Carlsson.
2660
2661         Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.
2662
2663         * UIProcess/API/APIFullscreenClient.h: Added.
2664         (API::FullscreenClient::~FullscreenClient):
2665         (API::FullscreenClient::willEnterFullscreen):
2666         (API::FullscreenClient::didEnterFullscreen):
2667         (API::FullscreenClient::willExitFullscreen):
2668         (API::FullscreenClient::didExitFullscreen):
2669         * UIProcess/API/Cocoa/WKWebView.mm:
2670         (-[WKWebView _initializeWithConfiguration:]):
2671         (-[WKWebView _setFullscreenDelegate:]):
2672         (-[WKWebView _fullscreenDelegate]):
2673         (-[WKWebView _isInFullscreen]):
2674         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2675         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
2676         * UIProcess/Cocoa/FullscreenClient.h: Added.
2677         (WebKit::FullscreenClient::~FullscreenClient):
2678         * UIProcess/Cocoa/FullscreenClient.mm: Added.
2679         (WebKit::FullscreenClient::FullscreenClient):
2680         (WebKit::FullscreenClient::delegate):
2681         (WebKit::FullscreenClient::setDelegate):
2682         (WebKit::FullscreenClient::willEnterFullscreen):
2683         (WebKit::FullscreenClient::didEnterFullscreen):
2684         (WebKit::FullscreenClient::willExitFullscreen):
2685         (WebKit::FullscreenClient::didExitFullscreen):
2686         * UIProcess/WebFullScreenManagerProxy.cpp:
2687         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
2688         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
2689         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
2690         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
2691         * UIProcess/WebPageProxy.cpp:
2692         (WebKit::WebPageProxy::WebPageProxy):
2693         (WebKit::WebPageProxy::setFullscreenClient):
2694         (WebKit::WebPageProxy::fullScreenManager): Deleted.
2695         * UIProcess/WebPageProxy.h:
2696         (WebKit::WebPageProxy::fullscreenClient):
2697         * WebKit2.xcodeproj/project.pbxproj:
2698
2699 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2700
2701         Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.
2702
2703         * NetworkProcess/NetworkProcessCreationParameters.h: Initialize loadThrottleLatency.
2704
2705 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2706
2707         Unreviewed. Fix Soup based ports debug build after r207813.
2708
2709         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2710         (WebKit::NetworkDataTaskSoup::authenticateCallback):
2711         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
2712
2713 2016-10-25  Andreas Kling  <akling@apple.com>
2714
2715         More PassRefPtr purging in WebCore.
2716         <https://webkit.org/b/163895>
2717
2718         Reviewed by Antti Koivisto.
2719
2720         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
2721         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2722         (WebKit::PDFPlugin::createScrollbar):
2723
2724 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2725
2726         NetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask implementations
2727         https://bugs.webkit.org/show_bug.cgi?id=163777
2728
2729         Reviewed by Alex Christensen.
2730
2731         The subclass model allows us to choose the implementation at run time, so we could add other implementations
2732         like a mock network class to measure performance, and even one for blobs and finally get rid of ResourceHandle
2733         in WebKit2.
2734
2735         * CMakeLists.txt: Add new files to compilation.
2736         * NetworkProcess/NetworkDataTask.cpp: Added.
2737         (WebKit::NetworkDataTask::create): Create a NetworkDataTaskCocoa or NetworkDataTaskSoup.
2738         (WebKit::NetworkDataTask::NetworkDataTask): Move common code from NetworkDataTaskCocoa and NetworkDataTaskSoup
2739         here to handle the early failures.
2740         (WebKit::NetworkDataTask::~NetworkDataTask):
2741         (WebKit::NetworkDataTask::scheduleFailure):
2742         (WebKit::NetworkDataTask::failureTimerFired):
2743         * NetworkProcess/NetworkDataTask.h: Remove platform specific members.
2744         (WebKit::NetworkDataTask::setPendingDownloadLocation): Make it virtual and set the m_pendingDownloadLocation.
2745         (WebKit::NetworkDataTask::suggestedFilename): Make it virtual and const with a default implementation.
2746         (WebKit::NetworkDataTask::setSuggestedFilename): Ditto.
2747         (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost): Ditto.
2748         * NetworkProcess/NetworkLoad.cpp: Include NetworkDataTaskCocoa.h.
2749         * NetworkProcess/NetworkLoad.h: Include NetworkDataTask.h instead of NetworkSession.h.
2750         * NetworkProcess/NetworkProcess.cpp:
2751         (WebKit::NetworkProcess::NetworkProcess): Use NetworkSessionCocoa.
2752         * NetworkProcess/NetworkSession.cpp:
2753         (WebKit::NetworkSession::create): Create a NetworkSessionCocoa or NetworkSessionSoup.
2754         (WebKit::NetworkSession::defaultSession): In case of cocoa use NetworkSessionCocoa::defaultSession() because of
2755         the custom protocol manager, otherwise simply create a default session.
2756         (WebKit::NetworkSession::networkStorageSession): Move common code from NetworkSessionCocoa and
2757         NetworkSessionSoup here.
2758         (WebKit::NetworkSession::NetworkSession):
2759         (WebKit::NetworkSession::~NetworkSession):
2760         * NetworkProcess/NetworkSession.h: Remove platform specific members.
2761         (WebKit::NetworkSession::invalidateAndCancel): Make it virtual.
2762         (WebKit::NetworkSession::clearCredentials): Ditto.
2763         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: Include NetworkSession.h.
2764         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Added.
2765         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2766         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2767         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
2768         (WebKit::NetworkDataTaskCocoa::didSendData):
2769         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
2770         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
2771         (WebKit::NetworkDataTaskCocoa::didReceiveResponse):
2772         (WebKit::NetworkDataTaskCocoa::didReceiveData):
2773         (WebKit::NetworkDataTaskCocoa::didBecomeDownload):
2774         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2775         (WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation):
2776         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
2777         (WebKit::NetworkDataTaskCocoa::transferSandboxExtensionToDownload):
2778         (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
2779         (WebKit::NetworkDataTaskCocoa::suggestedFilename):
2780         (WebKit::NetworkDataTaskCocoa::cancel):
2781         (WebKit::NetworkDataTaskCocoa::resume):
2782         (WebKit::NetworkDataTaskCocoa::suspend):
2783         (WebKit::NetworkDataTaskCocoa::state):
2784         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2785         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2786         * NetworkProcess/cocoa/NetworkSessionCocoa.h: Added.
2787         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2788         (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
2789         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2790         (WebKit::configurationForSessionID):
2791         (WebKit::NetworkSessionCocoa::setCustomProtocolManager):
2792         (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData):
2793         (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier):
2794         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
2795         (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType):
2796         (WebKit::NetworkSessionCocoa::create):
2797         (WebKit::NetworkSessionCocoa::defaultSession):
2798         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2799         (WebKit::NetworkSessionCocoa::~NetworkSessionCocoa):
2800         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
2801         (WebKit::NetworkSessionCocoa::clearCredentials):
2802         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
2803         (WebKit::NetworkSessionCocoa::addDownloadID):
2804         (WebKit::NetworkSessionCocoa::downloadID):
2805         (WebKit::NetworkSessionCocoa::takeDownloadID):
2806         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2807         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
2808         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2809         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2810         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
2811         (WebKit::NetworkDataTaskSoup::suggestedFilename):
2812         (WebKit::NetworkDataTaskSoup::setPendingDownloadLocation):
2813         (WebKit::NetworkDataTaskSoup::createRequest):
2814         (WebKit::NetworkDataTaskSoup::clearRequest):
2815         (WebKit::NetworkDataTaskSoup::resume):
2816         (WebKit::NetworkDataTaskSoup::suspend):
2817         (WebKit::NetworkDataTaskSoup::cancel):
2818         (WebKit::NetworkDataTaskSoup::invalidateAndCancel):
2819         (WebKit::NetworkDataTaskSoup::state):
2820         (WebKit::NetworkDataTaskSoup::timeoutFired):
2821         (WebKit::NetworkDataTaskSoup::startTimeout):
2822         (WebKit::NetworkDataTaskSoup::stopTimeout):
2823         (WebKit::NetworkDataTaskSoup::sendRequestCallback):
2824         (WebKit::NetworkDataTaskSoup::didSendRequest):
2825         (WebKit::NetworkDataTaskSoup::didReceiveResponse):
2826         (WebKit::NetworkDataTaskSoup::tlsErrorsChangedCallback):
2827         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
2828         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
2829         (WebKit::NetworkDataTaskSoup::authenticateCallback):
2830         (WebKit::NetworkDataTaskSoup::authenticate):
2831         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
2832         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirectionCallback):
2833         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
2834         (WebKit::NetworkDataTaskSoup::didFinishSkipInputStreamForRedirection):
2835         (WebKit::NetworkDataTaskSoup::shouldStartHTTPRedirection):
2836         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
2837         (WebKit::NetworkDataTaskSoup::readCallback):
2838         (WebKit::NetworkDataTaskSoup::read):
2839         (WebKit::NetworkDataTaskSoup::didRead):
2840         (WebKit::NetworkDataTaskSoup::didFinishRead):
2841         (WebKit::NetworkDataTaskSoup::requestNextPartCallback):
2842         (WebKit::NetworkDataTaskSoup::requestNextPart):
2843         (WebKit::NetworkDataTaskSoup::didRequestNextPart):
2844         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
2845         (WebKit::NetworkDataTaskSoup::gotHeadersCallback):
2846         (WebKit::NetworkDataTaskSoup::didGetHeaders):
2847         (WebKit::NetworkDataTaskSoup::wroteBodyDataCallback):
2848         (WebKit::NetworkDataTaskSoup::didWriteBodyData):
2849         (WebKit::NetworkDataTaskSoup::download):
2850         (WebKit::NetworkDataTaskSoup::writeDownloadCallback):
2851         (WebKit::NetworkDataTaskSoup::writeDownload):
2852         (WebKit::NetworkDataTaskSoup::didWriteDownload):
2853         (WebKit::NetworkDataTaskSoup::didFinishDownload):
2854         (WebKit::NetworkDataTaskSoup::didFailDownload):
2855         (WebKit::NetworkDataTaskSoup::cleanDownloadFiles):
2856         (WebKit::NetworkDataTaskSoup::didFail):
2857         (WebKit::NetworkDataTaskSoup::networkEventCallback):
2858         (WebKit::NetworkDataTaskSoup::networkEvent):
2859         (WebKit::NetworkDataTaskSoup::startingCallback):
2860         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
2861         (WebKit::NetworkDataTaskSoup::didStartRequest):
2862         (WebKit::NetworkDataTaskSoup::restartedCallback):
2863         (WebKit::NetworkDataTaskSoup::didRestart):
2864         * NetworkProcess/soup/NetworkDataTaskSoup.h: Added.
2865         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2866         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
2867         (WebKit::NetworkSessionSoup::~NetworkSessionSoup):
2868         (WebKit::NetworkSessionSoup::soupSession):
2869         (WebKit::NetworkSessionSoup::invalidateAndCancel):
2870         * NetworkProcess/soup/NetworkSessionSoup.h: Added.
2871         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
2872         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
2873         * PlatformEfl.cmake: Add new files to compilation.
2874         * PlatformGTK.cmake: Ditto.
2875         * WebKit2.xcodeproj/project.pbxproj: Ditto.
2876         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2877         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
2878         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2879         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Ditto.
2880
2881 2016-10-25  Antti Koivisto  <antti@apple.com>
2882
2883         Add support for introducing simulated latency in network process
2884         https://bugs.webkit.org/show_bug.cgi?id=163902
2885
2886         Reviewed by Alex Christensen.
2887
2888         For testing purposes it is useful to have a mechanism for simulating high latency.
2889         This patch adds a basic mechanism that introduces a delay to each response in network
2890         process. In Safari it can be used with
2891
2892              defaults write com.apple.Safari WebKitNetworkLoadThrottleLatencyMilliseconds 200
2893
2894         Setting the delay to 0 disables the feature.
2895
2896         * NetworkProcess/NetworkLoad.cpp:
2897         (WebKit::NetworkLoad::Throttle::Throttle):
2898         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2899         (WebKit::NetworkLoad::notifyDidReceiveResponse):
2900         (WebKit::NetworkLoad::didReceiveData):
2901         (WebKit::NetworkLoad::didCompleteWithError):
2902         (WebKit::NetworkLoad::throttleDelayCompleted):
2903         * NetworkProcess/NetworkLoad.h:
2904         * NetworkProcess/NetworkProcess.cpp:
2905         (WebKit::NetworkProcess::initializeNetworkProcess):
2906         * NetworkProcess/NetworkProcess.h:
2907         (WebKit::NetworkProcess::loadThrottleLatency):
2908         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2909         (WebKit::NetworkProcessCreationParameters::encode):
2910         (WebKit::NetworkProcessCreationParameters::decode):
2911         * NetworkProcess/NetworkProcessCreationParameters.h:
2912         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2913         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2914
2915 2016-10-24  Dan Bernstein  <mitz@apple.com>
2916
2917         REGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged
2918         https://bugs.webkit.org/show_bug.cgi?id=163879
2919         <rdar://problem/28728735>
2920
2921         Reviewed by Darin Adler.
2922
2923         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2924         (WebKit::WebProcessProxy::platformIsBeingDebugged): Check if the current process, which is
2925           the UI process, is sandboxed before trying to find out if the Web process is being
2926           debugged.
2927
2928 2016-10-21  Alex Christensen  <achristensen@webkit.org>
2929
2930         URL::port should return Optional<uint16_t>
2931         https://bugs.webkit.org/show_bug.cgi?id=163806
2932
2933         Reviewed by Darin Adler.
2934
2935         * NetworkProcess/mac/NetworkProcessMac.mm:
2936         (WebKit::overrideSystemProxies):
2937         * Shared/API/APISecurityOrigin.h:
2938         (API::SecurityOrigin::create):
2939         * Shared/API/APIURL.h:
2940         (API::URL::protocol):
2941         * Shared/API/c/WKSecurityOriginRef.cpp:
2942         (WKSecurityOriginGetPort):
2943         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
2944         (-[WKSecurityOrigin port]):
2945         * WebProcess/WebPage/WebPage.cpp:
2946         (WebKit::WebPage::canHandleRequest):
2947         * WebProcess/cocoa/WebProcessCocoa.mm:
2948         (WebKit::origin):
2949
2950 2016-10-24  Eric Carlson  <eric.carlson@apple.com>
2951
2952         [MediaStream] Separate media capture and audio playback muting
2953         https://bugs.webkit.org/show_bug.cgi?id=163855
2954         <rdar://problem/28827186>
2955
2956         Reviewed by Darin Adler.
2957
2958         * Shared/WebPageCreationParameters.h: Change 'muted' from bool to MutedStateFlags.
2959
2960         * UIProcess/API/C/WKPage.cpp: Change parameter from bool to WKMediaMutedState.
2961         (WKPageSetMuted):
2962         * UIProcess/API/C/WKPagePrivate.h: Define WKMediaMutedState.
2963
2964         * UIProcess/WebPageProxy.cpp:
2965         (WebKit::WebPageProxy::WebPageProxy):
2966         (WebKit::WebPageProxy::setMuted): m_muted -> m_mutedState.
2967         (WebKit::WebPageProxy::creationParameters): Ditto.
2968         * UIProcess/WebPageProxy.h:
2969
2970         * WebProcess/Plugins/PluginView.cpp:
2971         (WebKit::PluginView::isMuted): page.isMuted -> page.mutedState.
2972
2973         * WebProcess/WebPage/WebPage.messages.in: Change SetMuted parameter.
2974
2975 2016-10-24  Youenn Fablet  <youenn@apple.com>
2976
2977         Activate WEB_RTC compilation flags for Mac bots
2978         https://bugs.webkit.org/show_bug.cgi?id=163886
2979
2980         Reviewed by Eric Carlson.
2981
2982         * Configurations/FeatureDefines.xcconfig:
2983
2984 2016-10-24  Brady Eidson  <beidson@apple.com>
2985
2986         IndexedDB 2.0: Support IDBIndex name assignment.
2987         <rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
2988
2989         Reviewed by Alex Christensen.
2990
2991         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2992         (WebKit::WebIDBConnectionToClient::didRenameIndex):
2993         (WebKit::WebIDBConnectionToClient::renameIndex):
2994         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2995         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2996
2997         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2998         (WebKit::WebIDBConnectionToServer::renameIndex):
2999         (WebKit::WebIDBConnectionToServer::didRenameIndex):
3000         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3001         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
3002
3003 2016-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3004
3005         [GTK] Remove DO NOT MODIFY headers from files that are no longer autogenerated
3006         https://bugs.webkit.org/show_bug.cgi?id=163867
3007
3008         Reviewed by Darin Adler.
3009
3010         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
3011         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
3012         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttrPrivate.h:
3013         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
3014         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
3015         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlobPrivate.h:
3016         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
3017         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
3018         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASectionPrivate.h:
3019         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
3020         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
3021         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
3022         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleListPrivate.h:
3023         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRulePrivate.h:
3024         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
3025         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclarationPrivate.h:
3026         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
3027         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheetPrivate.h:
3028         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
3029         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
3030         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
3031         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
3032         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterDataPrivate.h:
3033         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
3034         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
3035         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCommentPrivate.h:
3036         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
3037         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementationPrivate.h:
3038         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
3039         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
3040         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelectionPrivate.h:
3041         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
3042         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
3043         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenListPrivate.h:
3044         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
3045         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
3046         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowPrivate.h:
3047         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowUnstable.h:
3048         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
3049         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
3050         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
3051         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentPrivate.h:
3052         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentUnstable.h:
3053         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h:
3054         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
3055         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
3056         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentTypePrivate.h:
3057         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentUnstable.h:
3058         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3059         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
3060         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h:
3061         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementUnstable.h:
3062         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
3063         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
3064         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventPrivate.h:
3065         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
3066         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
3067         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
3068         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
3069         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileListPrivate.h:
3070         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFilePrivate.h:
3071         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
3072         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
3073         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElementPrivate.h:
3074         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
3075         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
3076         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElementPrivate.h:
3077         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
3078         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
3079         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElementPrivate.h:
3080         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
3081         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
3082         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElementPrivate.h:
3083         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
3084         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
3085         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElementPrivate.h:
3086         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
3087         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
3088         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElementPrivate.h:
3089         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
3090         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
3091         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElementPrivate.h:
3092         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
3093         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
3094         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElementPrivate.h:
3095         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
3096         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
3097         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollectionPrivate.h:
3098         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
3099         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
3100         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElementPrivate.h:
3101         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
3102         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
3103         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElementPrivate.h:
3104         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
3105         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
3106         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElementPrivate.h:
3107         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
3108         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
3109         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocumentPrivate.h:
3110         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
3111         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
3112         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementPrivate.h:
3113         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementUnstable.h:
3114         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
3115         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
3116         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElementPrivate.h:
3117         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
3118         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
3119         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElementPrivate.h:
3120         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
3121         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
3122         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElementPrivate.h:
3123         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
3124         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
3125         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElementPrivate.h:
3126         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
3127         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
3128         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElementPrivate.h:
3129         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
3130         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
3131         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElementPrivate.h:
3132         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
3133         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
3134         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElementPrivate.h:
3135         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
3136         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
3137         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElementPrivate.h:
3138         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
3139         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
3140         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElementPrivate.h:
3141         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
3142         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
3143         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElementPrivate.h:
3144         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
3145         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
3146         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElementPrivate.h:
3147         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
3148         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
3149         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElementPrivate.h:
3150         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
3151         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
3152         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElementPrivate.h:
3153         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
3154         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
3155         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElementPrivate.h:
3156         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
3157         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
3158         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElementPrivate.h:
3159         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
3160         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
3161         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElementPrivate.h:
3162         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
3163         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
3164         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElementPrivate.h:
3165         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
3166         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
3167         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElementPrivate.h:
3168         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
3169         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
3170         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElementPrivate.h:
3171         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
3172         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
3173         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElementPrivate.h:
3174         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
3175         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
3176         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElementPrivate.h:
3177         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
3178         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
3179         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElementPrivate.h:
3180         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
3181         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
3182         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElementPrivate.h:
3183         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
3184         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
3185         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElementPrivate.h:
3186         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
3187         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
3188         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElementPrivate.h:
3189         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
3190         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
3191         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElementPrivate.h:
3192         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
3193         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
3194         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollectionPrivate.h:
3195         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
3196         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
3197         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElementPrivate.h:
3198         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
3199         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
3200         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElementPrivate.h:
3201         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
3202         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
3203         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElementPrivate.h:
3204         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
3205         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
3206         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
3207         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElementPrivate.h:
3208         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
3209         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
3210         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElementPrivate.h:
3211         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
3212         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
3213         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElementPrivate.h:
3214         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
3215         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
3216         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElementPrivate.h:
3217         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
3218         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
3219         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElementPrivate.h:
3220         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
3221         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
3222         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElementPrivate.h:
3223         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
3224         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
3225         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElementPrivate.h:
3226         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
3227         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
3228         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElementPrivate.h:
3229         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
3230         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
3231         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElementPrivate.h:
3232         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
3233         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
3234         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElementPrivate.h:
3235         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
3236         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
3237         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElementPrivate.h:
3238         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
3239         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
3240         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElementPrivate.h:
3241         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
3242         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
3243         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElementPrivate.h:
3244         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
3245         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
3246         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEventPrivate.h:
3247         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
3248         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaListPrivate.h:
3249         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
3250         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
3251         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEventPrivate.h:
3252         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
3253         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
3254         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMapPrivate.h:
3255         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
3256         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
3257         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
3258         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIteratorPrivate.h:
3259         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
3260         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
3261         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeListPrivate.h:
3262         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h:
3263         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
3264         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
3265         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstructionPrivate.h:
3266         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
3267         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
3268         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangePrivate.h:
3269         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangeUnstable.h:
3270         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
3271         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
3272         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
3273         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
3274         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetListPrivate.h:
3275         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetPrivate.h:
3276         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
3277         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
3278         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTextPrivate.h:
3279         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
3280         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
3281         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalkerPrivate.h:
3282         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
3283         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
3284         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEventPrivate.h:
3285         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
3286         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
3287         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEventPrivate.h:
3288         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
3289         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
3290         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpressionPrivate.h:
3291         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolverPrivate.h:
3292         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
3293         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
3294         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResultPrivate.h:
3295         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
3296         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h:
3297         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h:
3298
3299 2016-10-23  Chris Dumez  <cdumez@apple.com>
3300
3301         Another unreviewed attempt to fix the WatchOS / TvOS build after r207585.
3302         <rdar://problem/28902292>
3303
3304         Disable USE_CFURLCONNECTION on newer WatchOS / TvOS.
3305
3306         * config.h:
3307
3308 2016-10-23  Chris Dumez  <cdumez@apple.com>
3309
3310         Unreviewed attempt to fix WatchOS / TvOS build after r207585.
3311         <rdar://problem/28902292>
3312
3313         Enable NETWORK_SESSION on those platforms.
3314
3315         * config.h:
3316
3317 2016-10-22  Dan Bernstein  <mitz@apple.com>
3318
3319         [iOS] _webViewWillEndNavigationGesture:withNavigationToBackForwardListItem: is never called
3320         https://bugs.webkit.org/show_bug.cgi?id=163758
3321
3322         Reviewed by Darin Adler.
3323
3324         * UIProcess/ios/ViewGestureControllerIOS.mm:
3325         (WebKit::ViewGestureController::beginSwipeGesture): Don’t reset the interactive update
3326           handler.
3327
3328 2016-10-21  David Kilzer  <ddkilzer@apple.com>
3329
3330         Bug 163762: IntSize::area() should used checked arithmetic
3331         <https://webkit.org/b/163762>
3332
3333         Reviewed by Darin Adler.
3334
3335         * Shared/ShareableBitmap.cpp:
3336         (WebKit::ShareableBitmap::create): Add overflow check and return
3337         nullptr on overflow.
3338         (WebKit::ShareableBitmap::createShareable): Ditto.
3339         (WebKit::ShareableBitmap::create): Change debug assert for
3340         adequate buffer size check into release check.
3341         * Shared/ShareableBitmap.h:
3342         (WebKit::ShareableBitmap::numBytesForSize): Change to return a
3343         Checked<unsigned, RecordOverflow> value.
3344         (WebKit::ShareableBitmap::sizeInBytes):
3345         * Shared/cairo/ShareableBitmapCairo.cpp:
3346         (WebKit::ShareableBitmap::numBytesForSize): Ditto.
3347         * UIProcess/API/Cocoa/WKWebView.mm:
3348         (-[WKWebView _takeViewSnapshot]): Call unsafeGet().
3349
3350 2016-10-21  Eric Carlson  <eric.carlson@apple.com>
3351
3352         [MediaStream] Dynamically generate media capture sandbox extensions
3353         https://bugs.webkit.org/show_bug.cgi?id=154861
3354         <rdar://problem/24909411>
3355
3356         Reviewed by Tim Horton.
3357
3358         * Shared/SandboxExtension.h:
3359         (WebKit::SandboxExtension::createHandleForGenericExtension):
3360         * Shared/mac/SandboxExtensionMac.mm:
3361         (WebKit::wkSandboxExtensionType): Add case for generic handle.
3362         (WebKit::SandboxExtension::createHandleForGenericExtension): New.
3363
3364         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3365         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Clear the list of extensions granted.
3366         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Extend the web 
3367           process sandbox as necessary.
3368         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3369
3370         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3371         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Revoke all
3372           sandbox extensions.
3373         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Consume
3374           sandbox extensions.
3375         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3376
3377         * WebProcess/WebPage/WebPage.cpp:
3378         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Pass-through to user media manager.
3379         * WebProcess/WebPage/WebPage.h:
3380
3381         * WebProcess/WebPage/WebPage.messages.in: Add GrantUserMediaDevicesSandboxExtension.
3382
3383         * WebProcess/com.apple.WebProcess.sb.in: Add rules, defines, and a macro to allow dynamic extensions
3384           for media capture devices.
3385