Enable SharedArrayBuffer, remove the flag
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-12-08  Filip Pizlo  <fpizlo@apple.com>
2
3         Enable SharedArrayBuffer, remove the flag
4         https://bugs.webkit.org/show_bug.cgi?id=165614
5
6         Rubber stamped by Geoffrey Garen.
7
8         * UIProcess/API/C/WKPreferencesRefPrivate.h:
9         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
10
11 2016-12-08  Alex Christensen  <achristensen@webkit.org>
12
13         Add SPI for sending WebsiteSettings to WebProcess during navigation
14         https://bugs.webkit.org/show_bug.cgi?id=165517
15         <rdar://29341068>
16
17         We add the ability for the navigation client to send settings to the WebProcess 
18         based on the URL of the document being navigated to. This approach adds no new IPC 
19         messages and allows the application to decide what settings to use during navigation 
20         instead of declaratively before navigation. Right now there is only one setting, 
21         whether to disable content blockers, but this infrastructure can be used for more settings.
22
23         Reviewed by Anders Carlsson.
24
25         * CMakeLists.txt:
26         * PlatformMac.cmake:
27         * Shared/API/APIObject.h:
28         * Shared/API/c/WKBase.h:
29         * Shared/WebsitePolicies.h: Added.
30         (WebKit::WebsitePolicies::encode):
31         (WebKit::WebsitePolicies::decode):
32         * UIProcess/API/APINavigationClient.h:
33         (API::NavigationClient::decidePolicyForNavigationAction):
34         (API::NavigationClient::decidePolicyForNavigationResponse):
35         * UIProcess/API/APIPolicyClient.h:
36         (API::PolicyClient::decidePolicyForNavigationAction):
37         (API::PolicyClient::decidePolicyForNewWindowAction):
38         (API::PolicyClient::decidePolicyForResponse):
39         * UIProcess/API/APIWebsitePolicies.cpp: Added.
40         (API::WebsitePolicies::create):
41         * UIProcess/API/APIWebsitePolicies.h: Added.
42         * UIProcess/API/C/WKAPICast.h:
43         * UIProcess/API/C/WKFramePolicyListener.cpp:
44         (WKFramePolicyListenerUse):
45         (WKFramePolicyListenerUseWithPolicies):
46         * UIProcess/API/C/WKFramePolicyListener.h:
47         * UIProcess/API/C/WKPage.cpp:
48         (WKPageSetPagePolicyClient):
49         * UIProcess/API/C/WKWebsitePolicies.cpp: Added.
50         (WKWebsitePoliciesGetTypeID):
51         (WKWebsitePoliciesCreate):
52         (WKWebsitePoliciesSetContentBlockersEnabled):
53         (WKWebsitePoliciesGetContentBlockersEnabled):
54         * UIProcess/API/C/WKWebsitePolicies.h: Added.
55         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
56         * UIProcess/API/Cocoa/_WKWebsitePolicies.h: Added.
57         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: Added.
58         (-[_WKWebsitePolicies dealloc]):
59         (-[_WKWebsitePolicies init]):
60         (-[_WKWebsitePolicies setContentBlockersEnabled:]):
61         (-[_WKWebsitePolicies contentBlockersEnabled]):
62         (-[_WKWebsitePolicies description]):
63         (-[_WKWebsitePolicies _apiObject]):
64         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: Added.
65         (WebKit::wrapper):
66         * UIProcess/Automation/WebAutomationSession.cpp:
67         (WebKit::WebAutomationSession::reloadBrowsingContext):
68         * UIProcess/Cocoa/NavigationState.h:
69         * UIProcess/Cocoa/NavigationState.mm:
70         (WebKit::NavigationState::setNavigationDelegate):
71         (WebKit::tryAppLink):
72         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
73         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
74         * UIProcess/WebFormSubmissionListenerProxy.cpp:
75         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
76         * UIProcess/WebFrameListenerProxy.cpp:
77         (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
78         * UIProcess/WebFrameListenerProxy.h:
79         * UIProcess/WebFramePolicyListenerProxy.cpp:
80         (WebKit::WebFramePolicyListenerProxy::use):
81         (WebKit::WebFramePolicyListenerProxy::download):
82         (WebKit::WebFramePolicyListenerProxy::ignore):
83         * UIProcess/WebFramePolicyListenerProxy.h:
84         (WebKit::WebFramePolicyListenerProxy::create):
85         * UIProcess/WebFrameProxy.cpp:
86         (WebKit::WebFrameProxy::receivedPolicyDecision):
87         * UIProcess/WebFrameProxy.h:
88         * UIProcess/WebInspectorProxy.cpp:
89         (WebKit::decidePolicyForNavigationAction):
90         * UIProcess/WebPageProxy.cpp:
91         (WebKit::WebPageProxy::receivedPolicyDecision):
92         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
93         * UIProcess/WebPageProxy.h:
94         * UIProcess/WebPageProxy.messages.in:
95         * WebKit2.xcodeproj/project.pbxproj:
96         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
97         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
98
99 2016-12-08  Antti Koivisto  <antti@apple.com>
100
101         Salt network cache hashes
102         https://bugs.webkit.org/show_bug.cgi?id=164924
103
104         Reviewed by Alex Christensen.
105
106         To enhance privacy make cache content unidentifiable from file names alone.
107         This is done by generating a unique persistent salt for each cache instance.
108         It is used when computing hashes used in file names.
109
110         The patch also replaces plain text partition directory names with salted hashes.
111
112         * NetworkProcess/cache/NetworkCache.cpp:
113         (WebKit::NetworkCache::Cache::makeCacheKey):
114         (WebKit::NetworkCache::makeCacheKey): Deleted.
115         * NetworkProcess/cache/NetworkCache.h:
116
117             Increment cache version.
118
119         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
120         (WebKit::NetworkCache::BlobStorage::BlobStorage):
121         (WebKit::NetworkCache::BlobStorage::add):
122         (WebKit::NetworkCache::BlobStorage::get):
123
124             Use salt for blob content hash.
125
126         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
127         * NetworkProcess/cache/NetworkCacheData.cpp:
128         (WebKit::NetworkCache::computeSHA1):
129
130             For simplicity all SHA1s are now salted.
131
132         (WebKit::NetworkCache::makeSalt):
133         (WebKit::NetworkCache::readOrMakeSalt):
134
135             Read salt if it exists, generate and persist it otherwise.
136
137         * NetworkProcess/cache/NetworkCacheData.h:
138         * NetworkProcess/cache/NetworkCacheKey.cpp:
139         (WebKit::NetworkCache::Key::Key):
140
141             Remove the "No partition" string and just empty.
142             That was only needed to have a directory name of some sort.
143
144         (WebKit::NetworkCache::Key::computeHash):
145
146             Use salt for key hash.
147
148         (WebKit::NetworkCache::Key::computePartitionHash):
149
150             Separate hash for partition.
151
152         * NetworkProcess/cache/NetworkCacheKey.h:
153         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
154         (WebKit::NetworkCache::makeSubresourcesKey):
155         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
156         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
157         * NetworkProcess/cache/NetworkCacheStorage.cpp:
158         (WebKit::NetworkCache::makeSaltFilePath):
159         (WebKit::NetworkCache::Storage::open):
160
161             Cache can't be opened if we can't read or persist a salt.
162
163         (WebKit::NetworkCache::traverseRecordsFiles):
164         (WebKit::NetworkCache::Storage::Storage):
165         (WebKit::NetworkCache::Storage::synchronize):
166         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
167
168             Use the partition hash in the directory name instead of a plain text name.
169
170         (WebKit::NetworkCache::decodeRecordHeader):
171         (WebKit::NetworkCache::Storage::readRecord):
172         (WebKit::NetworkCache::Storage::encodeRecord):
173         (WebKit::NetworkCache::Storage::traverse):
174         (WebKit::NetworkCache::Storage::clear):
175         * NetworkProcess/cache/NetworkCacheStorage.h:
176         (WebKit::NetworkCache::Storage::salt):
177
178 2016-12-08  Eric Carlson  <eric.carlson@apple.com>
179
180         Fix the EFL build.
181
182         * UIProcess/WebPageProxy.cpp:
183         (WebKit::WebPageProxy::isPlayingMediaDidChange): Add another ENABLE(MEDIA_STREAM) guard.
184
185 2016-12-08  Tomas Popela  <tpopela@redhat.com>
186
187         [GTK] Process accelerated compositing env variables only if they are really enabled
188         https://bugs.webkit.org/show_bug.cgi?id=165300
189
190         Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
191         WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
192         (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
193
194         Reviewed by Michael Catanzaro.
195
196         * UIProcess/gtk/WebPreferencesGtk.cpp:
197         (WebKit::WebPreferences::platformInitializeStore):
198
199 2016-12-08  Alex Christensen  <achristensen@webkit.org>
200
201         Fix CMake build.
202
203         * CMakeLists.txt:
204         Add the new NetworkProcess/capture include directory to find new headers from r209498.
205         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
206         (WebKit::NetworkCapture::Response::Response):
207         (WebKit::NetworkCapture::Error::Error):
208         The String constructor was ambiguous after r209498 because URL has an operator NSString* and String has an NSString constructor.
209         We should get rid of operator NSString* and operator String on URL.
210         * UIProcess/WebPageProxy.cpp:
211         * UIProcess/WebPageProxy.h:
212         Add some ENABLE(MEDIA_STREAM) macros to fix the build without it enabled after r209512.
213
214 2016-12-08  Alex Christensen  <achristensen@webkit.org>
215
216         Fix iOS debug build after r209498
217         https://bugs.webkit.org/show_bug.cgi?id=164527
218
219         * NetworkProcess/capture/NetworkCaptureLogging.h:
220         Logs were causing compile warnings/errors.  Disable logs for now.
221
222 2016-12-07  Dean Jackson  <dino@apple.com>
223
224         Remove runtime toggle for pointer-lock
225         https://bugs.webkit.org/show_bug.cgi?id=165577
226         <rdar://problems/29566996>
227
228         Reviewed by Jon Lee.
229
230         Remove any runtime calls to check if pointer-lock is enabled. It's
231         either compiled in or out.
232
233         * Shared/WebPreferencesDefinitions.h:
234         * UIProcess/API/C/WKPreferences.cpp:
235         (WKPreferencesSetPointerLockEnabled): Deleted.
236         (WKPreferencesGetPointerLockEnabled): Deleted.
237         * UIProcess/API/C/WKPreferencesRefPrivate.h:
238         * WebProcess/WebPage/WebPage.cpp:
239         (WebKit::WebPage::updatePreferences):
240
241 2016-12-07  Eric Carlson  <eric.carlson@apple.com>
242
243         [MediaStream][Mac] Revoke sandbox extensions when capture ends
244         https://bugs.webkit.org/show_bug.cgi?id=165476
245
246         Reviewed by Brady Eidson.
247
248         Track media capture by process so it is possible to revoke the sandbox extensions issued to
249         a web process when capture stops. Allocate WK2 user media permission manager lazily rather
250         than every time a page is created as most pages won't need one.
251
252         * CMakeLists.txt: Add new files.
253
254         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
255         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
256           with process manager.
257         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
258         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox 
259           extension code to the process manager.
260         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
261         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
262           change to the process manager.
263         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
264         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
265
266         * UIProcess/UserMediaProcessManager.cpp: Added.
267         (WebKit::ProcessState::ProcessState):
268         (WebKit::ProcessState::managers):
269         (WebKit::ProcessState::sandboxExtensionsGranted):
270         (WebKit::ProcessState::setSandboxExtensionsGranted):
271         (WebKit::stateMap):
272         (WebKit::processState):
273         (WebKit::ProcessState::addRequestManager):
274         (WebKit::ProcessState::removeRequestManager):
275         (WebKit::UserMediaProcessManager::singleton):
276         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
277         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
278         (WebKit::UserMediaProcessManager::willCreateMediaStream):
279         (WebKit::UserMediaProcessManager::startedCaptureSession):
280         (WebKit::UserMediaProcessManager::endedCaptureSession):
281         * UIProcess/UserMediaProcessManager.h: Added.
282
283         * UIProcess/WebPageProxy.cpp:
284         (WebKit::WebPageProxy::WebPageProxy): Don't allocate m_userMediaPermissionRequestManager.
285         (WebKit::WebPageProxy::resetState): Set m_userMediaPermissionRequestManager to null.
286         (WebKit::WebPageProxy::userMediaPermissionRequestManager): Allocate m_userMediaPermissionRequestManager
287           lazily as most pages don't need it.
288         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Call userMediaPermissionRequestManager().
289         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): Ditto.
290         (WebKit::WebPageProxy::clearUserMediaState): Ditto.
291         (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
292           manager proxy.
293         * UIProcess/WebPageProxy.h:
294
295         * WebKit2.xcodeproj/project.pbxproj: Add new files.
296
297         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
298         (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
299         (WebKit::MediaDeviceSandboxExtensions::encode):
300         (WebKit::MediaDeviceSandboxExtensions::decode):
301         (WebKit::MediaDeviceSandboxExtensions::operator[]):
302         (WebKit::MediaDeviceSandboxExtensions::size):
303         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
304
305         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
306         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
307           is now in a HashMap, not a Vector.
308         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
309           IDs with extensions so they can be revoked later.
310         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
311         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
312         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
313
314         * WebProcess/WebPage/WebPage.cpp:
315         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
316         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
317         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
318         * WebProcess/WebPage/WebPage.h:
319         * WebProcess/WebPage/WebPage.messages.in:
320
321 2016-12-07  Jeremy Jones  <jeremyj@apple.com>
322
323         One esc to exit fullscreen and pointer lock
324         https://bugs.webkit.org/show_bug.cgi?id=165416
325         rdar://problem/29430711
326
327         Reviewed by Jer Noble.
328
329         Fix a crash when didLosePointerLock is not specified.
330
331         * UIProcess/API/C/WKPage.cpp:
332         (WKPageSetPageUIClient):
333
334 2016-12-07  Keith Rollin  <krollin@apple.com>
335
336         Network event record/replay
337         https://bugs.webkit.org/show_bug.cgi?id=164527
338         <rdar://problem/29168157>
339
340         Reviewed by Alex Christensen.
341
342         Add WebKit2/NetworkProcess/capture/* for recording the network events
343         that occur when loading a page and for replaying them later. Update
344         NetworkLoad to invoke capture facilities. Add preferences for enabling
345         record or replay.
346
347         * CMakeLists.txt:
348         * NetworkProcess/NetworkLoad.cpp:
349         (WebKit::NetworkLoad::NetworkLoad):
350         (WebKit::NetworkLoad::initializeForRecord):
351         (WebKit::NetworkLoad::initializeForReplay):
352         (WebKit::NetworkLoad::initialize):
353         (WebKit::NetworkLoad::setDefersLoading):
354         (WebKit::NetworkLoad::continueWillSendRequest):
355         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
356         (WebKit::NetworkLoad::notifyDidReceiveResponse):
357         (WebKit::NetworkLoad::didReceiveData):
358         (WebKit::NetworkLoad::didCompleteWithError):
359         * NetworkProcess/NetworkLoad.h:
360         * NetworkProcess/NetworkProcess.cpp:
361         (WebKit::NetworkProcess::initializeNetworkProcess):
362         (WebKit::NetworkProcess::terminate):
363         * NetworkProcess/NetworkProcessCreationParameters.cpp:
364         (WebKit::NetworkProcessCreationParameters::encode):
365         (WebKit::NetworkProcessCreationParameters::decode):
366         * NetworkProcess/NetworkProcessCreationParameters.h:
367         * NetworkProcess/capture/NetworkCaptureEvent.cpp: Added.
368         (WebKit::NetworkCapture::copyHeaders):
369         (WebKit::NetworkCapture::KeyValuePair::KeyValuePair):
370         (WebKit::NetworkCapture::ResourceRequest::ResourceRequest):
371         (WebKit::NetworkCapture::ResourceRequest::operator WebCore::ResourceRequest):
372         (WebKit::NetworkCapture::ResourceResponse::ResourceResponse):
373         (WebKit::NetworkCapture::ResourceResponse::operator WebCore::ResourceResponse):
374         (WebKit::NetworkCapture::ResourceError::ResourceError):
375         (WebKit::NetworkCapture::ResourceError::operator WebCore::ResourceError):
376         (WebKit::NetworkCapture::JSONCoder::encode):
377         (WebKit::NetworkCapture::JSONCoder::decode):
378         (WebKit::NetworkCapture::JSONCoder<String>::encode):
379         (WebKit::NetworkCapture::JSONCoder<String>::decode):
380         (WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::encode):
381         (WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::decode):
382         (WebKit::NetworkCapture::JSONCoder<KeyValuePair>::encode):
383         (WebKit::NetworkCapture::JSONCoder<KeyValuePair>::decode):
384         (WebKit::NetworkCapture::JSONCoder<Vector<T>>::encode):
385         (WebKit::NetworkCapture::JSONCoder<Vector<T>>::decode):
386         (WebKit::NetworkCapture::JSONCoder<ResourceRequest>::encode):
387         (WebKit::NetworkCapture::JSONCoder<ResourceRequest>::decode):
388         (WebKit::NetworkCapture::JSONCoder<ResourceResponse>::encode):
389         (WebKit::NetworkCapture::JSONCoder<ResourceResponse>::decode):
390         (WebKit::NetworkCapture::JSONCoder<ResourceError>::encode):
391         (WebKit::NetworkCapture::JSONCoder<ResourceError>::decode):
392         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::encode):
393         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
394         (WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::encode):
395         (WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::decode):
396         (WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::encode):
397         (WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::decode):
398         (WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::encode):
399         (WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::decode):
400         (WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::encode):
401         (WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::decode):
402         (WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::encode):
403         (WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::decode):
404         (WebKit::NetworkCapture::JSONCoder<FinishedEvent>::encode):
405         (WebKit::NetworkCapture::JSONCoder<FinishedEvent>::decode):
406         (WebKit::NetworkCapture::eventToString):
407         (WebKit::NetworkCapture::stringToEvent):
408         * NetworkProcess/capture/NetworkCaptureEvent.h: Added.
409         (WebKit::NetworkCapture::TimedEvent::TimedEvent):
410         * NetworkProcess/capture/NetworkCaptureLogging.h: Added.
411         * NetworkProcess/capture/NetworkCaptureManager.cpp: Added.
412         (WebKit::NetworkCapture::Manager::singleton):
413         (WebKit::NetworkCapture::Manager::initialize):
414         (WebKit::NetworkCapture::Manager::terminate):
415         (WebKit::NetworkCapture::Manager::findMatch):
416         (WebKit::NetworkCapture::Manager::findExactMatch):
417         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
418         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
419         (WebKit::NetworkCapture::Manager::loadResources):
420         (WebKit::NetworkCapture::Manager::reportLoadPath):
421         (WebKit::NetworkCapture::Manager::reportRecordPath):
422         (WebKit::NetworkCapture::Manager::reportReplayPath):
423         (WebKit::NetworkCapture::Manager::requestToPath):
424         (WebKit::NetworkCapture::Manager::stringToHash):
425         (WebKit::NetworkCapture::Manager::hashToPath):
426         (WebKit::NetworkCapture::Manager::logRecordedResource):
427         (WebKit::NetworkCapture::Manager::logLoadedResource):
428         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
429         (WebKit::NetworkCapture::Manager::ensureFileHandle):
430         (WebKit::NetworkCapture::Manager::openCacheFile):
431         (WebKit::NetworkCapture::Manager::readFile):
432         (WebKit::NetworkCapture::Manager::getLine):
433         (WebKit::NetworkCapture::Manager::getWord):
434         (WebKit::NetworkCapture::Manager::printToFile):
435         * NetworkProcess/capture/NetworkCaptureManager.h: Added.
436         (WebKit::NetworkCapture::Manager::isRecording):
437         (WebKit::NetworkCapture::Manager::isReplaying):
438         (WebKit::NetworkCapture::Manager::mode):
439         * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Added.
440         (WebKit::NetworkCapture::Recorder::recordRequestSent):
441         (WebKit::NetworkCapture::Recorder::recordResponseReceived):
442         (WebKit::NetworkCapture::Recorder::recordRedirectReceived):
443         (WebKit::NetworkCapture::Recorder::recordRedirectSent):
444         (WebKit::NetworkCapture::Recorder::recordDataReceived):
445         (WebKit::NetworkCapture::Recorder::recordFinish):
446         (WebKit::NetworkCapture::Recorder::writeEvents):
447         * NetworkProcess/capture/NetworkCaptureRecorder.h: Added.
448         (WebKit::NetworkCapture::Recorder::recordEvent):
449         * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Added.
450         (WebKit::NetworkCapture::Replayer::replayResource):
451         * NetworkProcess/capture/NetworkCaptureReplayer.h: Added.
452         * NetworkProcess/capture/NetworkCaptureResource.cpp: Added.
453         (WebKit::NetworkCapture::Resource::Resource):
454         (WebKit::NetworkCapture::Resource::url):
455         (WebKit::NetworkCapture::Resource::baseURL):
456         (WebKit::NetworkCapture::Resource::queryParameters):
457         (WebKit::NetworkCapture::Resource::eventStream):
458         (WebKit::NetworkCapture::Resource::EventStream::EventStream):
459         (WebKit::NetworkCapture::Resource::EventStream::nextEvent):
460         * NetworkProcess/capture/NetworkCaptureResource.h: Added.
461         * NetworkProcess/capture/NetworkCaptureTypes.h: Added.
462         (WebKit::NetworkCapture::TypeHolder::forEachTypeImpl):
463         (WebKit::NetworkCapture::TypeHolder::forEachType):
464         * NetworkProcess/capture/NetworkDataTaskReplay.cpp: Added.
465         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
466         (WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay):
467         (WebKit::NetworkCapture::NetworkDataTaskReplay::resume):
468         (WebKit::NetworkCapture::NetworkDataTaskReplay::suspend):
469         (WebKit::NetworkCapture::NetworkDataTaskReplay::cancel):
470         (WebKit::NetworkCapture::NetworkDataTaskReplay::complete):
471         (WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel):
472         (WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler):
473         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent):
474         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived):
475         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived):
476         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent):
477         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived):
478         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished):
479         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
480         (WebKit::NetworkCapture::NetworkDataTaskReplay::didFinish):
481         * NetworkProcess/capture/NetworkDataTaskReplay.h: Added.
482         (WebKit::NetworkCapture::NetworkDataTaskReplay::create):
483         * NetworkProcess/capture/json.hpp: Added.
484         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
485         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
486         * WebKit2.xcodeproj/project.pbxproj:
487         * config.h:
488
489 2016-12-07  Anders Carlsson  <andersca@apple.com>
490
491         Fix build.
492
493         * Platform/IPC/mac/ConnectionMac.mm:
494         (IPC::Connection::open):
495
496 2016-12-07  Anders Carlsson  <andersca@apple.com>
497
498         Rename the connection sources to better indicate what data direction they are used for
499         https://bugs.webkit.org/show_bug.cgi?id=165548
500
501         Reviewed by Tim Horton.
502
503         * Platform/IPC/Connection.h:
504         * Platform/IPC/mac/ConnectionMac.mm:
505         (IPC::Connection::platformInvalidate):
506         (IPC::Connection::platformInitialize):
507         (IPC::createReceiveSource):
508         (IPC::Connection::initializeSendSource):
509         (IPC::Connection::receiveSourceEventHandler):
510         (IPC::createDataAvailableSource): Deleted.
511         (IPC::Connection::initializeDeadNameSource): Deleted.
512         Rename m_deadNameSource to m_sendSource, and m_receivePortDataAvailableSource to m_receiveSource.
513
514         (IPC::Connection::open):
515         Initialize the send source before we attempt to send a first message.
516
517 2016-12-07  Simon Fraser  <simon.fraser@apple.com>
518
519         Fix use of enum in a WK2 C SPI header.
520         rdar://problem/28725583
521
522         Followup to correctly prefix the enum values.
523
524         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
525         (WKBundlePageSetEventThrottlingBehaviorOverride):
526         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
527
528 2016-12-07  Simon Fraser  <simon.fraser@apple.com>
529
530         Fix use of enum in a WK2 C SPI header.
531         rdar://problem/28725583
532
533         Reviewed by Dan Bernstein.
534
535         Use correct enum style for a C SPI header and fix the callers.
536
537         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
538         (WKBundlePageSetEventThrottlingBehaviorOverride):
539         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
540
541 2016-12-07  Beth Dakin  <bdakin@apple.com>
542
543         Remove iCloud Pages and Keynote site-specific hacks
544         https://bugs.webkit.org/show_bug.cgi?id=165544
545         -and corresponding-
546         rdar://problem/29082536
547
548         Reviewed by Wenson Hsieh.
549
550         * WebProcess/WebPage/WebPage.cpp:
551         (WebKit::needsHiddenContentEditableQuirk):
552         (WebKit::needsPlainTextQuirk):
553
554 2016-12-05  Ada Chan  <adachan@apple.com>
555
556         Add a getter for serverTrust in _WKObservablePageState
557         https://bugs.webkit.org/show_bug.cgi?id=165433
558
559         Reviewed by Anders Carlsson.
560
561         * UIProcess/API/C/mac/WKPagePrivateMac.h:
562         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
563         (-[WKObservablePageState serverTrust]):
564
565 2016-12-07  Jer Noble  <jer.noble@apple.com>
566
567         Exiting Element Fullscreen mode loses focus on WKWebView.
568         https://bugs.webkit.org/show_bug.cgi?id=165512
569
570         Reviewed by Eric Carlson.
571
572         Setting 'window.contentView.hidden = YES' will reset the first-responder (whereas
573         previously setting 'window.contentView.layer.hidden = YES' did not). Grab the first-
574         responder before doing so, so that it can be reset correctly when moving the WKWebView
575         back to it's original window.
576
577         * UIProcess/mac/WKFullScreenWindowController.mm:
578         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
579
580 2016-12-07  Alex Christensen  <achristensen@webkit.org>
581
582         Fix CMake build after r209418.
583         https://bugs.webkit.org/show_bug.cgi?id=165484
584
585         * PlatformMac.cmake:
586
587 2016-12-07  Philippe Normand  <pnormand@igalia.com>
588
589         Unreviewed, GTK build fix after r209407.
590
591         * Platform/IPC/unix/ConnectionUnix.cpp:
592         (IPC::Connection::processMessage):
593         * UIProcess/LegacySessionStateCodingNone.cpp:
594         (WebKit::decodeLegacySessionState):
595
596 2016-12-06  Ryan Haddad  <ryanhaddad@apple.com>
597
598         Unreviewed, rolling out r209422.
599
600         This change caused assertion failures during API tests.
601
602         Reverted changeset:
603
604         "[MediaStream][Mac] Revoke sandbox extensions when capture
605         ends"
606         https://bugs.webkit.org/show_bug.cgi?id=165476
607         http://trac.webkit.org/changeset/209422
608
609 2016-12-06  Dean Jackson  <dino@apple.com>
610
611         Include default value in Experimental Feature information
612         https://bugs.webkit.org/show_bug.cgi?id=165509
613         <rdar://problems/29547177>
614
615         Reviewed by Tim Horton.
616
617         Add a defaultValue member variable to experimental
618         features, both the C++ and ObjC interfaces.
619
620         * UIProcess/API/APIExperimentalFeature.cpp:
621         (API::ExperimentalFeature::create):
622         (API::ExperimentalFeature::ExperimentalFeature):
623         * UIProcess/API/APIExperimentalFeature.h:
624         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
625         * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
626         (-[_WKExperimentalFeature description]):
627         (-[_WKExperimentalFeature defaultValue]):
628         * UIProcess/WebPreferences.cpp:
629         (WebKit::createExperimentalFeaturesVector):
630
631 2016-12-06  Commit Queue  <commit-queue@webkit.org>
632
633         Unreviewed, rolling out r209391.
634         https://bugs.webkit.org/show_bug.cgi?id=165501
635
636         requires explicit nullptr checks so missing env vars don't
637         flip AC mode (Requested by mcatanzaro on #webkit).
638
639         Reverted changeset:
640
641         "[GTK] Process accelerated compositing env variables only if
642         they are really enabled"
643         https://bugs.webkit.org/show_bug.cgi?id=165300
644         http://trac.webkit.org/changeset/209391
645
646 2016-12-06  Alexey Proskuryakov  <ap@apple.com>
647
648         Correct SDKROOT values in xcconfig files
649         https://bugs.webkit.org/show_bug.cgi?id=165487
650         rdar://problem/29539209
651
652         Reviewed by Dan Bernstein.
653
654         Fix suggested by Dan Bernstein.
655
656         * Configurations/DebugRelease.xcconfig:
657
658 2016-12-06  Andreas Kling  <akling@apple.com>
659
660         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
661         <https://webkit.org/b/165375>
662         <rdar://problem/29057243>
663
664         Reviewed by Darin Adler.
665
666         Follow-up to address two more review comments.
667
668         * WebProcess/cocoa/WebProcessCocoa.mm:
669         (WebKit::WebProcess::registerWithStateDumper): Use adoptNS() instead of autorelease for NSStrings.
670
671 2016-12-06  Eric Carlson  <eric.carlson@apple.com>
672
673         [MediaStream][Mac] Revoke sandbox extensions when capture ends
674         https://bugs.webkit.org/show_bug.cgi?id=165476
675
676         Reviewed by Brady Eidson.
677         
678         Track media capture by process so it is possible to revoke the sandbox extensions issued to
679         a web process when capture stops.
680
681         * CMakeLists.txt: Add new files.
682
683         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
684         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
685           with process manager.
686         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
687         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox 
688           extension code to the process manager.
689         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
690         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
691           change to the process manager.
692         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
693         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
694
695         * UIProcess/UserMediaProcessManager.cpp: Added.
696         (WebKit::ProcessState::ProcessState):
697         (WebKit::ProcessState::managers):
698         (WebKit::ProcessState::sandboxExtensionsGranted):
699         (WebKit::ProcessState::setSandboxExtensionsGranted):
700         (WebKit::stateMap):
701         (WebKit::processState):
702         (WebKit::ProcessState::addRequestManager):
703         (WebKit::ProcessState::removeRequestManager):
704         (WebKit::UserMediaProcessManager::singleton):
705         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
706         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
707         (WebKit::UserMediaProcessManager::willCreateMediaStream):
708         (WebKit::UserMediaProcessManager::startedCaptureSession):
709         (WebKit::UserMediaProcessManager::endedCaptureSession):
710         * UIProcess/UserMediaProcessManager.h: Added.
711
712         * UIProcess/WebPageProxy.cpp:
713         (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
714           manager proxy.
715         * UIProcess/WebPageProxy.h:
716
717         * WebKit2.xcodeproj/project.pbxproj: Add new files.
718
719         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
720         (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
721         (WebKit::MediaDeviceSandboxExtensions::encode):
722         (WebKit::MediaDeviceSandboxExtensions::decode):
723         (WebKit::MediaDeviceSandboxExtensions::operator[]):
724         (WebKit::MediaDeviceSandboxExtensions::size):
725         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
726
727         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
728         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
729           is now in a HashMap, not a Vector.
730         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
731           IDs with extensions so they can be revoked later.
732         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
733         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
734         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
735
736         * WebProcess/WebPage/WebPage.cpp:
737         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
738         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
739         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
740         * WebProcess/WebPage/WebPage.h:
741         * WebProcess/WebPage/WebPage.messages.in:
742
743 2016-12-06  Anders Carlsson  <andersca@apple.com>
744
745         Add a new MachMessage class and use it for sending outgoing messages
746         https://bugs.webkit.org/show_bug.cgi?id=165484
747
748         Reviewed by Sam Weinig.
749
750         * Platform/IPC/mac/ConnectionMac.mm:
751         (IPC::Connection::sendOutgoingMessage):
752         Instead of trying to randomly use memory from the stack as well as using mmap for the message data for out of line messages
753         (which makes no sense at all, since the body data is already mmapped), just always create a MachMessage object and use it.
754         
755         (IPC::machMessageSize): Deleted.
756         This has been moved to MachMessage::messageSize().
757         
758         * Platform/IPC/mac/MachMessage.cpp: Added.
759         (IPC::MachMessage::create):
760         Allocate extra memory to store the actual buffer.
761
762         (IPC::MachMessage::MachMessage):
763         Initialize variables. m_size isn't really used right now, but will be in a subsequent patch.
764
765         (IPC::MachMessage::header):
766         Return the header.
767         
768         * Platform/IPC/mac/MachMessage.h: Added.
769         (IPC::MachMessage::length):
770
771         * WebKit2.xcodeproj/project.pbxproj:
772         Add new files.
773
774 2016-12-06  Simon Fraser  <simon.fraser@apple.com>
775
776         Enable visual viewports by default on Mac, and iOS Wk2
777         https://bugs.webkit.org/show_bug.cgi?id=165452
778
779         Reviewed by Zalan Bujtas.
780
781         Turn visual viewports on by default for WK2.
782
783         * Shared/WebPreferencesDefinitions.h:
784
785 2016-12-06  Daniel Bates  <dabates@apple.com>
786
787         WebKitTestRunner: Plugins are disabled in new windows
788         https://bugs.webkit.org/show_bug.cgi?id=165410
789
790         Reviewed by Alex Christensen.
791
792         Remove SPI exposed to explicitly toggle plugins from WebKitTestRunner.
793         Instead we will update WebKitTestRunner to make use of the SPI
794         WKBundleOverrideBoolPreferenceForTestRunner() to toggle plugins in
795         all windows.
796
797         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
798         (WKBundleSetPluginsEnabled): Deleted.
799         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
800         * WebProcess/InjectedBundle/InjectedBundle.cpp:
801         (WebKit::InjectedBundle::setPluginsEnabled): Deleted.
802
803 2016-12-05  Anders Carlsson  <andersca@apple.com>
804
805         Don't memcpy out of line data
806         https://bugs.webkit.org/show_bug.cgi?id=165434
807
808         Reviewed by Sam Weinig.
809
810         Change the Decoder constructor to take a buffer deallocator parameter. If the buffer deallocator is null, the
811         data will be copied as before. Otherwise, the memory will be adopted by the Decoder object, and will be deallocated
812         by invoking the data deallocator.
813
814         * Platform/IPC/Decoder.cpp:
815         (IPC::copyBuffer):
816         Add a new helper.
817
818         (IPC::Decoder::Decoder):
819         Copy the buffer if the deallocator is null.
820
821         (IPC::Decoder::~Decoder):
822         Invoke the deallocator or call fastFree if it is null.
823
824         (IPC::Decoder::unwrapForTesting):
825         Update constructor.
826         
827         (IPC::roundUpToAlignment):
828         (IPC::Decoder::alignBufferPosition):
829         (IPC::Decoder::decodeVariableLengthByteArray):
830         (IPC::decodeValueFromBuffer):
831         Change all these to deal with const pointers.
832
833         * Platform/IPC/Decoder.h:
834         Add new members.
835
836         * Platform/IPC/mac/ConnectionMac.mm:
837         (IPC::createMessageDecoder):
838         When we have out of line data, pass a deallocator that calls vm_deallocate, instead of copying the data
839         and then immediately throwing the original away.
840
841 2016-12-06  Tim Horton  <timothy_horton@apple.com>
842
843         Almost half-second stall scrolling apple.com because of synchronous getPositionInformation
844         https://bugs.webkit.org/show_bug.cgi?id=165403
845         <rdar://problem/29493285>
846
847         Reviewed by Enrica Casucci.
848
849         When retrieving interaction information, we don't always need to do
850         snapshots for 3D Touch or the action sheet, especially if we're
851         synchronously blocking the UI process main thread waiting for the reply.
852
853         Add a new InteractionInformationRequest, which allows callers of
854         getPositionInformation and requestPositionInformation to specify which
855         optional pieces of information they would like to compute.
856
857         * Shared/AssistedNodeInformation.h:
858         Fix a incorrect comment.
859
860         * Shared/ios/InteractionInformationRequest.cpp: Added.
861         (WebKit::InteractionInformationRequest::encode):
862         (WebKit::InteractionInformationRequest::decode):
863         (WebKit::InteractionInformationRequest::isValidForRequest):
864         * Shared/ios/InteractionInformationRequest.h: Added.
865         (WebKit::InteractionInformationRequest::InteractionInformationRequest):
866         * WebKit2.xcodeproj/project.pbxproj:
867         Add InteractionInformationRequest, which encapsulates all of the
868         parameters required to generate an InteractionInformationAtPosition.
869         Previously, that was just a point, but now we have two new parameters:
870         whether we should generate a snapshot of the element, and whether
871         we should generate a TextIndicator if the element is a link.
872
873         * Shared/ios/InteractionInformationAtPosition.h:
874         * Shared/ios/InteractionInformationAtPosition.mm:
875         (WebKit::InteractionInformationAtPosition::encode):
876         (WebKit::InteractionInformationAtPosition::decode):
877         (WebKit::InteractionInformationAtPosition::mergeCompatibleOptionalInformation):
878         Adopt InteractionInformationRequest.
879
880         * UIProcess/WebPageProxy.h:
881         * UIProcess/ios/WebPageProxyIOS.mm:
882         (WebKit::WebPageProxy::getPositionInformation):
883         (WebKit::WebPageProxy::requestPositionInformation):
884         * UIProcess/ios/WKActionSheetAssistant.mm:
885         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
886         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
887         (-[WKActionSheetAssistant showImageSheet]):
888         (-[WKActionSheetAssistant showLinkSheet]):
889         * UIProcess/ios/WKPDFView.mm:
890         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
891         * WebProcess/WebPage/WebPage.h:
892         * WebProcess/WebPage/WebPage.messages.in:
893         Adopt InteractionInformationRequest.
894         
895         * UIProcess/ios/WKContentViewInteraction.h:
896         * UIProcess/ios/WKContentViewInteraction.mm:
897         (-[WKContentView _showAttachmentSheet]):
898         (-[WKContentView ensurePositionInformationIsUpToDate:]):
899         If we have a outstanding asynchronous position information request
900         for the current point, instead of sending a second separate request,
901         just wait for the async one to come in.
902
903         (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
904         If asked to do an asynchronous request with more optional bits than
905         the current otherwise-valid response's request, update the position information.
906
907         (-[WKContentView gestureRecognizerShouldBegin:]):
908         The design of this mechanism is that during the highlight long press,
909         we do an async position information update, and then when we actually
910         begin a 3D Touch gesture, we hope to already have the requisite snapshots
911         ready (so that we can avoid synchronously blocking for them, there).
912         So, in the highlight long-press async request, ask for all the goodies.
913
914         (-[WKContentView hasSelectablePositionAtPoint:]):
915         (-[WKContentView pointIsNearMarkedText:]):
916         (-[WKContentView pointIsInAssistedNode:]):
917         (-[WKContentView _didNotHandleTapAsClick:]):
918         (-[WKContentView _positionInformationDidChange:]):
919         If we get a position information update for the same point, but with less
920         goodies attached (the snapshot/link indicator), copy them over from the old
921         position information, so that we never accidentally "downgrade" our info.
922
923         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
924         (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
925         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
926         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
927         (-[WKContentView _presentedViewControllerForPreviewItemController:]):        
928         More adoption.
929         
930         * WebProcess/WebPage/ios/WebPageIOS.mm:
931         (WebKit::WebPage::handleTap):
932         (WebKit::WebPage::handleTwoFingerTapAtPoint):
933         (WebKit::WebPage::commitPotentialTap):
934         Adopt InteractionInformationRequest.
935
936         (WebKit::WebPage::getPositionInformation):
937         (WebKit::WebPage::requestPositionInformation):
938         Copy the request into the response.
939         Only snapshot if the request wants a snapshot.
940         Only make a link indicator if the request wants one.
941
942 2016-12-06  Daniel Bates  <dabates@apple.com>
943
944         Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
945         https://bugs.webkit.org/show_bug.cgi?id=165451
946
947         Reviewed by Alex Christensen.
948
949         * NetworkProcess/NetworkDataTask.cpp:
950         (WebKit::NetworkDataTask::didReceiveResponse):
951
952 2016-12-06  Daniel Bates  <dabates@apple.com>
953
954         Remove unused InjectedBundle::overrideXSSAuditorEnabledForTestRunner()
955         https://bugs.webkit.org/show_bug.cgi?id=165408
956
957         Reviewed by Alex Christensen.
958
959         InjectedBundle::overrideXSSAuditorEnabledForTestRunner() is unused. This function was only
960         called by WKBundleOverrideXSSAuditorEnabledForTestRunner(), which was removed in r106005.
961
962         * WebProcess/InjectedBundle/InjectedBundle.cpp:
963         (WebKit::InjectedBundle::overrideXSSAuditorEnabledForTestRunner): Deleted.
964         * WebProcess/InjectedBundle/InjectedBundle.h:
965
966 2016-12-04  Darin Adler  <darin@apple.com>
967
968         Use ASCIICType more, and improve it a little bit
969         https://bugs.webkit.org/show_bug.cgi?id=165360
970
971         Reviewed by Sam Weinig.
972
973         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
974         (WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
975
976 2016-12-06  Dave Hyatt  <hyatt@apple.com>
977
978         [CSS Parser] Turn on the new CSS parser
979         https://bugs.webkit.org/show_bug.cgi?id=165213
980
981         Reviewed by Zalan Bujtas.
982
983         * Shared/WebPreferencesDefinitions.h:
984
985 2016-12-06  Tomas Popela  <tpopela@redhat.com>
986
987         [GTK] Process accelerated compositing env variables only if they are really enabled
988         https://bugs.webkit.org/show_bug.cgi?id=165300
989
990         Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
991         WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
992         (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
993
994         Reviewed by Michael Catanzaro.
995
996         * UIProcess/gtk/WebPreferencesGtk.cpp:
997         (WebKit::WebPreferences::platformInitializeStore):
998
999 2016-12-06  Sam Weinig  <sam@webkit.org>
1000
1001         [WebIDL] Add support for converting dictionaries to JS
1002         https://bugs.webkit.org/show_bug.cgi?id=165367
1003
1004         Reviewed by Darin Adler and Alex Christensen.
1005
1006         * CMakeLists.txt:
1007         Add missing directories to look in for headers.
1008
1009 2016-12-05  Tim Horton  <timothy_horton@apple.com>
1010
1011         Try to fix the iOS Simulator build.
1012
1013         * UIProcess/mac/RemoteLayerTreeHost.mm:
1014         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
1015
1016 2016-12-03  Simon Fraser  <simon.fraser@apple.com>
1017
1018         Minor reformat and renames in -didUpdateVisibleRect:
1019         https://bugs.webkit.org/show_bug.cgi?id=165365
1020
1021         Reviewed by Dave Hyatt.
1022         
1023         didUpdateVisibleRect:... has lots of parameters. Put one on each line.
1024
1025         Rename the rects to make it clear they are "content" rects (i.e. in document coordinates).
1026
1027         * UIProcess/ios/WKContentView.h:
1028         * UIProcess/ios/WKContentView.mm:
1029         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1030
1031 2016-12-05  Tim Horton  <timothy_horton@apple.com>
1032
1033         Adopt CAMachPort-as-layer-contents
1034         https://bugs.webkit.org/show_bug.cgi?id=141687
1035         <rdar://problem/19393233>
1036
1037         Reviewed by Darin Adler.
1038
1039         * Shared/mac/RemoteLayerBackingStore.h:
1040         * Shared/mac/RemoteLayerBackingStore.mm:
1041         (WebKit::RemoteLayerBackingStore::decode):
1042         On the UI process side, instead of actually looking up the surface,
1043         just keep the MachSendRight around, to later be turned into a CAMachPort.
1044
1045         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
1046         Make a CAMachPort and leak our send right into it. CAMachPort
1047         will adopt the port and destroy it when needed.
1048
1049         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
1050         Tiny style fix.
1051
1052         * Shared/mac/RemoteLayerTreePropertyApplier.h:
1053         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1054         (WebKit::applyPropertiesToLayer):
1055         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
1056         * UIProcess/DrawingAreaProxy.h:
1057         (WebKit::DrawingAreaProxy::prepareForAppSuspension):
1058         * UIProcess/ios/WebPageProxyIOS.mm:
1059         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
1060         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1061         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1062         (WebKit::RemoteLayerTreeDrawingAreaProxy::prepareForAppSuspension):
1063         * UIProcess/mac/RemoteLayerTreeHost.h:
1064         * UIProcess/mac/RemoteLayerTreeHost.mm:
1065         (WebKit::RemoteLayerTreeHost::updateLayerTree):
1066         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
1067         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1068         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1069         Two supporting changes in order to fix the two regressions that this
1070         caused when we tried to land it two years ago:
1071
1072         When an app is being suspended, resolve all CAMachPort backing store
1073         into actual IOSurfaces. Otherwise, any live CAMachPorts will keep a
1074         +1 on their respective IOSurface's use count, causing us to fail to
1075         mark them volatile, keeping the app alive for more time (re-trying the
1076         volatility change), and increasing the likelihood of background jetsam.
1077
1078         If the debugging tile map is enabled, do not use CAMachPort, because
1079         we don't have a great way to plumb the same CAMachPort to two layers
1080         (and it doesn't seem to work even if you do). Instead, just map the
1081         IOSurface into the UI process like we used to.
1082
1083 2016-12-05  Dean Jackson  <dino@apple.com>
1084
1085         pointer lock needs to be feature detectable
1086         https://bugs.webkit.org/show_bug.cgi?id=165426
1087         <rdar://problem/29486715>
1088
1089         Reviewed by Antoine Quint.
1090
1091         Set the RuntimeEnabledFeature as preferences
1092         change.
1093
1094         * UIProcess/API/C/WKPreferences.cpp:
1095         (WKPreferencesSetPointerLockEnabled):
1096         (WKPreferencesGetPointerLockEnabled):
1097         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1098         * WebProcess/WebPage/WebPage.cpp:
1099         (WebKit::WebPage::updatePreferences):
1100
1101 2016-12-05  Andreas Kling  <akling@apple.com>
1102
1103         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
1104         <https://webkit.org/b/165375>
1105         <rdar://problem/29057243>
1106
1107         Reviewed by Darin Adler.
1108
1109         Add two new entries to the sysdiagnose state dumps for WebContent processes:
1110         "Memory Usage Stats" and "JavaScript Object Counts".
1111
1112         The first category contains all the interesting stuff from task_info()
1113         along with some WebCore and JavaScriptCore object/memory counters.
1114
1115         The second category contains a list of all the JS object types currently live
1116         on the heap, along with a count.
1117
1118         * WebProcess/cocoa/WebProcessCocoa.mm:
1119         (WebKit::WebProcess::registerWithStateDumper): Add two new entries to the
1120         state dictionary: "Memory Usage Stats" and "JavaScript Object Counts".
1121
1122 2016-12-05  Csaba Osztrogonác  <ossy@webkit.org>
1123
1124         Unreviewed cmake buildfix after r209307.
1125
1126         * PlatformMac.cmake:
1127
1128 2016-12-03  Dan Bernstein  <mitz@apple.com>
1129
1130         [Cocoa] Expose InjectedBundlePageEditorClient via the Objective-C bundle SPI
1131         https://bugs.webkit.org/show_bug.cgi?id=165276
1132         <rdar://problem/29467040>
1133
1134         Reviewed by Darin Adler.
1135
1136         Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegate.mm
1137
1138         * Shared/Cocoa/APIObject.mm:
1139         (API::Object::newObject): Wrap InjectedBundleRangeHandle in WKWebProcessPlugInRangeHandle.
1140
1141         * WebKit2.xcodeproj/project.pbxproj: Added references to new files, making
1142           WKWebProcessPlugInEditingDelegate.h and WKWebProcessPlugInRangeHandle.h private headers.
1143
1144         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: Added. An base class
1145           based on InjectedBundlePageEditorClient.
1146         (API::InjectedBundle::EditorClient::~EditorClient):
1147         (API::InjectedBundle::EditorClient::shouldBeginEditing):
1148         (API::InjectedBundle::EditorClient::shouldEndEditing):
1149         (API::InjectedBundle::EditorClient::shouldInsertNode):
1150         (API::InjectedBundle::EditorClient::shouldInsertText):
1151         (API::InjectedBundle::EditorClient::shouldDeleteRange):
1152         (API::InjectedBundle::EditorClient::shouldChangeSelectedRange):
1153         (API::InjectedBundle::EditorClient::shouldApplyStyle):
1154         (API::InjectedBundle::EditorClient::didBeginEditing):
1155         (API::InjectedBundle::EditorClient::didEndEditing):
1156         (API::InjectedBundle::EditorClient::didChange):
1157         (API::InjectedBundle::EditorClient::didChangeSelection):
1158         (API::InjectedBundle::EditorClient::willWriteToPasteboard):
1159         (API::InjectedBundle::EditorClient::getPasteboardDataForRange):
1160         (API::InjectedBundle::EditorClient::didWriteToPasteboard):
1161
1162         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Added. Declares
1163           the new delegate protocol, currently comprising three methods corresponding to
1164           willWriteToPasteboard, getPasteboardDataForRange, and didWriteToPasteboard.
1165
1166         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1167         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1168         (-[WKWebProcessPlugInFrame jsRangeForRangeHandle:inWorld:]): Added. Gets the JS wrapper for
1169           the specified range handle.
1170
1171         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: Added.
1172         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: Added.
1173         (-[WKWebProcessPlugInRangeHandle dealloc]): Call the InjectedBundleRangeHandle destructor.
1174         (+[WKWebProcessPlugInRangeHandle rangeHandleWithJSValue:inContext:]): Get or create an
1175           InjectedBundleRangeHandle for the specified object.
1176         (-[WKWebProcessPlugInRangeHandle frame]): Return the range’s owner document’s frame.
1177         (-[WKWebProcessPlugInRangeHandle _rangeHandle]): Return the InjectedBundleRangeHandle.
1178         (-[WKWebProcessPlugInRangeHandle _apiObject]): Ditto.
1179
1180         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h: Added.
1181         (WebKit::wrapper):
1182
1183         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1184         (WKBundlePageSetEditorClient): Updated for WebPage change.
1185
1186         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1187         (-[WKWebProcessPlugInBrowserContextController _editingDelegate]): Added. Returns the
1188           delegate.
1189         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Added. Defines a
1190           Client class, which derives from API::InjectedBundle::EditorClient, and invokes the
1191           delegate methods. Instantiates a Client and sets it on the WebPage.
1192
1193         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1194           Declared new _editingDelegate property.
1195
1196         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1197         (WebKit::InjectedBundleRangeHandle::document): Added. Returns an InjectedBundleNodeHandle
1198           for the range’s owner document.
1199         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
1200
1201         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
1202         (WebKit::InjectedBundlePageEditorClient::InjectedBundlePageEditorClient): Added. Calls
1203           initialize().
1204         (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing): Updated for type change.
1205         (WebKit::InjectedBundlePageEditorClient::shouldEndEditing): Ditto.
1206         (WebKit::InjectedBundlePageEditorClient::shouldInsertNode): Ditto.
1207         (WebKit::InjectedBundlePageEditorClient::shouldInsertText): Ditto.
1208         (WebKit::InjectedBundlePageEditorClient::shouldDeleteRange): Ditto.
1209         (WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange): Ditto.
1210         (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle): Ditto.
1211         (WebKit::InjectedBundlePageEditorClient::didBeginEditing): Ditto.
1212         (WebKit::InjectedBundlePageEditorClient::didEndEditing): Ditto.
1213         (WebKit::InjectedBundlePageEditorClient::didChange): Ditto.
1214         (WebKit::InjectedBundlePageEditorClient::didChangeSelection): Ditto.
1215         (WebKit::InjectedBundlePageEditorClient::willWriteToPasteboard): Ditto.
1216         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): Ditto.
1217         (WebKit::InjectedBundlePageEditorClient::didWriteToPasteboard): Ditto.
1218         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: Now derives from
1219           API::InjectedBundle::EditorClient.
1220
1221         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1222         (WebKit::WebEditorClient::shouldDeleteRange): Ditto.
1223         (WebKit::WebEditorClient::shouldBeginEditing): Ditto.
1224         (WebKit::WebEditorClient::shouldEndEditing): Ditto.
1225         (WebKit::WebEditorClient::shouldInsertNode): Ditto.
1226         (WebKit::WebEditorClient::shouldInsertText): Ditto.
1227         (WebKit::WebEditorClient::shouldChangeSelectedRange): Ditto.
1228         (WebKit::WebEditorClient::shouldApplyStyle): Ditto.
1229         (WebKit::WebEditorClient::didBeginEditing): Ditto.
1230         (WebKit::WebEditorClient::respondToChangedContents): Ditto.
1231         (WebKit::WebEditorClient::respondToChangedSelection): Ditto.
1232         (WebKit::WebEditorClient::didEndEditing): Ditto.
1233         (WebKit::WebEditorClient::didWriteSelectionToPasteboard): Ditto.
1234         (WebKit::WebEditorClient::willWriteSelectionToPasteboard): Ditto.
1235         (WebKit::WebEditorClient::getClientPasteboardDataForRange): Ditto.
1236
1237         * WebProcess/WebPage/WebPage.cpp:
1238         (WebKit::WebPage::WebPage): Initialize m_editorClient.
1239         (WebKit::WebPage::setInjectedBundleEditorClient): Replaces
1240           initializeInjectedBundleEditorClient and just sets m_editorClient.
1241         (WebKit::WebPage::close): Resets m_editorClient.
1242
1243         * WebProcess/WebPage/WebPage.h: Changed m_editorClient to a unique_ptr.
1244
1245 2016-12-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
1246
1247         [iOS] Add a WebView private configuration for changing the WebContent update frequency
1248         https://bugs.webkit.org/show_bug.cgi?id=165289
1249         <rdar://problem/29472577>
1250
1251         Reviewed by Tim Horton.
1252         
1253         Expose a preference which allows us to control the fps of web content updates.
1254
1255         * UIProcess/API/APIPageConfiguration.h:
1256         (API::PageConfiguration::contentUpdateFrequency):
1257         (API::PageConfiguration::setContentUpdateFrequency):
1258         * UIProcess/API/Cocoa/WKWebView.mm:
1259         (-[WKWebView _initializeWithConfiguration:]):
1260         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1261         (-[WKWebViewConfiguration copyWithZone:]):
1262         (-[WKWebViewConfiguration _contentUpdateFrequency]):
1263         (-[WKWebViewConfiguration _setContentUpdateFrequency:]):
1264         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1265         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1266         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1267         (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
1268         (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency):
1269
1270 2016-12-02  Andy Estes  <aestes@apple.com>
1271
1272         [Cocoa] Adopt the PRODUCT_BUNDLE_IDENTIFIER build setting
1273         https://bugs.webkit.org/show_bug.cgi?id=164492
1274
1275         Reviewed by Dan Bernstein.
1276
1277         * Configurations/DatabaseService.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
1278         $(PRODUCT_NAME).
1279         * Configurations/NetworkService.xcconfig: Ditto.
1280         * Configurations/PluginService.32.xcconfig: Ditto.
1281         * Configurations/PluginService.64.xcconfig: Ditto.
1282         * Configurations/WebContentService.xcconfig: Ditto.
1283         * Configurations/WebKit.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
1284         com.apple.$(PRODUCT_NAME:rfc1034identifier).
1285         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist: Changed
1286         CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
1287         * Info.plist: Changed CFBundleIdentifier's value from com.apple.${PRODUCT_NAME} to
1288         ${PRODUCT_BUNDLE_IDENTIFIER}.
1289         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Changed
1290         CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
1291         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: Ditto.
1292         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: Ditto.
1293         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto.
1294         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Ditto.
1295         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Ditto.
1296         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Ditto.
1297         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto.
1298
1299 2016-12-02  Brent Fulgham  <bfulgham@apple.com>
1300
1301         [Mac] Update sandbox profiles to use modern syntax and avoid duplication
1302         https://bugs.webkit.org/show_bug.cgi?id=165332
1303         <rdar://problem/26898991>
1304
1305         Reviewed by Anders Carlsson.
1306
1307         Update the Mac sandbox profiles to reflect that modern Cocoa applications
1308         communicate with cfprefsd, rather than plists on disk (and have done so
1309         for the past several releases).
1310
1311         Get rid of some duplicated rules, as well as old compatibility rules that
1312         are never triggered under supported operating systems.
1313
1314         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
1315         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1316         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1317         * WebProcess/com.apple.WebProcess.sb.in:
1318
1319 2016-12-02  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
1320
1321         Fix build break when disabling some features.
1322         https://bugs.webkit.org/show_bug.cgi?id=165254
1323
1324         The EFL port was broken if SPELLCHECK was disabled or
1325         PLUGIN_ARCHITECTURE is not x11.
1326
1327         Reviewed by Michael Catanzaro.
1328
1329         * UIProcess/efl/TextCheckerEfl.cpp:
1330         (WebKit::TextChecker::checkTextOfParagraph):
1331         (WebKit::TextChecker::checkSpellingOfString):
1332         Fix UNUSED_PARAM() usage if SPELLCHECK is disabled.
1333         * UIProcess/efl/WebPageProxyEfl.cpp:
1334         Isolate methods within #if PLUGIN_ARCHITECTURE(X11).
1335
1336 2016-12-01  Jiewen Tan  <jiewen_tan@apple.com>
1337
1338         Add a runtime flag for SubtleCrypto
1339         https://bugs.webkit.org/show_bug.cgi?id=164982
1340
1341         Reviewed by Brent Fulgham.
1342
1343         * Shared/WebPreferencesDefinitions.h:
1344         * UIProcess/API/C/WKPreferences.cpp:
1345         (WKPreferencesSetSubtleCryptoEnabled):
1346         (WKPreferencesGetSubtleCryptoEnabled):
1347         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1348         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1349         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1350         * WebProcess/WebPage/WebPage.cpp:
1351         (WebKit::WebPage::updatePreferences):
1352
1353 2016-12-01  Saam Barati  <sbarati@apple.com>
1354
1355         Rename CallFrame::callee() to CallFrame::jsCallee()
1356         https://bugs.webkit.org/show_bug.cgi?id=165293
1357
1358         Reviewed by Keith Miller.
1359
1360         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
1361         (WebKit::callMethod):
1362         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1363         (WebKit::callNPJSObject):
1364         (WebKit::constructWithConstructor):
1365
1366 2016-12-01  Chris Dumez  <cdumez@apple.com>
1367
1368         [iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp
1369         https://bugs.webkit.org/show_bug.cgi?id=165270
1370         <rdar://problem/29224355>
1371
1372         Reviewed by Simon Fraser.
1373
1374         Tapping an element generates a 'click' event that has 0 as timeStamp
1375         instead of having a proper timeStamp value. This is breaking some
1376         sites.
1377
1378         * WebProcess/WebPage/ios/WebPageIOS.mm:
1379         (WebKit::WebPage::handleSyntheticClick):
1380         (WebKit::WebPage::completeSyntheticClick):
1381
1382 2016-12-01  Tim Horton  <timothy_horton@apple.com>
1383
1384         Try to fix the EFL/Gtk build
1385
1386         * UIProcess/efl/WebProcessPoolEfl.cpp:
1387         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
1388         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1389         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
1390
1391 2016-12-01  Tim Horton  <timothy_horton@apple.com>
1392
1393         Every WKWebView initialization spends a few milliseconds hitting the disk
1394         https://bugs.webkit.org/show_bug.cgi?id=165268
1395         <rdar://problem/29010113>
1396
1397         Reviewed by Brady Eidson.
1398
1399         Every WKWebView init currently involves doing directory creation and
1400         symlink resolution for a number of paths (to create sandbox extensions
1401         for all of our storage directories), which means touching the disk a
1402         lot during init. All of these paths are immutable per-WebProcessPool,
1403         so, instead, cache them on WebProcessPool and create sandbox extensions
1404         from the already-resolved paths. This is a sizable (~4x) speedup when
1405         initializing subsequent web views.
1406
1407         * Shared/SandboxExtension.h:
1408         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
1409         Add createHandleWithoutResolvingPath, which makes a sandbox extension
1410         handle without doing symlink resolution.
1411
1412         (WebKit::resolvePathForSandboxExtension):
1413         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
1414         Add two functions that do the same resolution that SandboxExtension::createHandle
1415         and ::createHandleForReadWriteDirectory do, but just return the paths,
1416         for later use with createHandleWithoutResolvingPath.
1417
1418         * Shared/mac/SandboxExtensionMac.mm:
1419         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
1420         (WebKit::resolvePathForSandboxExtension):
1421         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
1422         (WebKit::SandboxExtension::createHandle):
1423         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
1424         Implement the aforementioned functions, and reimplement the existing
1425         createHandle{ForReadWriteDirectory} functions in terms of them.
1426
1427         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1428         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
1429         Stop wasting time generating and resolving a platform default icon
1430         database path, since we don't actually use it for anything anymore except
1431         to determine whether the icon database is enabled, and we only want to
1432         enable it if the client has provided a path.
1433
1434         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
1435         (WebKit::WebProcessPool::platformInitializeWebProcess):
1436         * UIProcess/WebProcessPool.cpp:
1437         (WebKit::m_hiddenPageThrottlingTimer):
1438         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
1439         (WebKit::WebProcessPool::createNewWebProcess):
1440         * UIProcess/WebProcessPool.h:
1441         Resolve paths in resolvePathsForSandboxExtensions, and use the resolved
1442         paths along with createHandleWithoutResolvingPath in order to effectively
1443         cache the resolution operation.
1444
1445 2016-12-01  Antti Koivisto  <antti@apple.com>
1446
1447         Revert r208931
1448         https://bugs.webkit.org/show_bug.cgi?id=164924
1449
1450         PLT regression.
1451
1452         * NetworkProcess/cache/NetworkCache.cpp:
1453         (WebKit::NetworkCache::makeCacheKey):
1454         (WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
1455         * NetworkProcess/cache/NetworkCache.h:
1456         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
1457         (WebKit::NetworkCache::BlobStorage::BlobStorage):
1458         (WebKit::NetworkCache::BlobStorage::add):
1459         (WebKit::NetworkCache::BlobStorage::get):
1460         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
1461         * NetworkProcess/cache/NetworkCacheData.cpp:
1462         (WebKit::NetworkCache::computeSHA1):
1463         (WebKit::NetworkCache::makeSalt): Deleted.
1464         (WebKit::NetworkCache::readOrMakeSalt): Deleted.
1465         * NetworkProcess/cache/NetworkCacheData.h:
1466         * NetworkProcess/cache/NetworkCacheKey.cpp:
1467         (WebKit::NetworkCache::noPartitionString):
1468         (WebKit::NetworkCache::Key::Key):
1469         (WebKit::NetworkCache::Key::hasPartition):
1470         (WebKit::NetworkCache::Key::computeHash):
1471         (WebKit::NetworkCache::Key::hashAsString):
1472         (WebKit::NetworkCache::Key::computePartitionHash): Deleted.
1473         * NetworkProcess/cache/NetworkCacheKey.h:
1474         (WebKit::NetworkCache::Key::hash):
1475         (WebKit::NetworkCache::Key::partitionHash): Deleted.
1476         (WebKit::NetworkCache::Key::hashAsString): Deleted.
1477         (WebKit::NetworkCache::Key::partitionHashAsString): Deleted.
1478         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1479         (WebKit::NetworkCache::makeSubresourcesKey):
1480         (WebKit::NetworkCache::constructRevalidationRequest):
1481         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
1482         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
1483         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1484         (WebKit::NetworkCache::Storage::open):
1485         (WebKit::NetworkCache::traverseRecordsFiles):
1486         (WebKit::NetworkCache::Storage::Storage):
1487         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
1488         (WebKit::NetworkCache::decodeRecordHeader):
1489         (WebKit::NetworkCache::Storage::readRecord):
1490         (WebKit::NetworkCache::Storage::encodeRecord):
1491         (WebKit::NetworkCache::Storage::traverse):
1492         (WebKit::NetworkCache::makeSaltFilePath): Deleted.
1493         * NetworkProcess/cache/NetworkCacheStorage.h:
1494         (WebKit::NetworkCache::Storage::salt): Deleted.
1495
1496 2016-11-30  Sam Weinig  <sam@webkit.org>
1497
1498         [WebIDL] Remove custom bindings for File and Blob constructors
1499         https://bugs.webkit.org/show_bug.cgi?id=165218
1500
1501         Reviewed by Darin Adler.
1502
1503         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1504         (WebKit::NetworkBlobRegistry::registerBlobURL):
1505         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1506         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1507         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
1508         * NetworkProcess/NetworkConnectionToWebProcess.h:
1509         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1510         (WebKit::BlobRegistryProxy::registerBlobURL):
1511         * WebProcess/FileAPI/BlobRegistryProxy.h:
1512         Avoid copies of the BlobPart Vector.
1513
1514 2016-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1515
1516         [GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
1517         https://bugs.webkit.org/show_bug.cgi?id=164911
1518
1519         Reviewed by Michael Catanzaro.
1520
1521         The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an
1522         image. We only use the buffer to get the image size, so we could save the image size when the image is created,
1523         and then we don't need to care about the buffer anymore.
1524
1525         * UIProcess/gtk/WaylandCompositor.cpp:
1526         (WebKit::WaylandCompositor::Surface::prepareTextureForPainting):
1527         (WebKit::WaylandCompositor::Surface::commit):
1528         * UIProcess/gtk/WaylandCompositor.h:
1529
1530 2016-11-30  Antoine Quint  <graouts@apple.com>
1531
1532         [Modern Media Controls] Add an HTML comment flag to turn the feature on
1533         https://bugs.webkit.org/show_bug.cgi?id=165226
1534
1535         Reviewed by Dean Jackson.
1536
1537         Add new methods to set the Modern Media Controls preference.
1538
1539         * UIProcess/API/C/WKPreferences.cpp:
1540         (WKPreferencesSetModernMediaControlsEnabled):
1541         (WKPreferencesGetModernMediaControlsEnabled):
1542         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1543
1544 2016-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1545
1546         Add separate settings and preferences to enable/disable async decoding for large images and animated images
1547         https://bugs.webkit.org/show_bug.cgi?id=165177
1548
1549         Reviewed by Simon Fraser.
1550         
1551         Hook up the async image decoding settings for WebKit2.
1552
1553         * Shared/WebPreferencesDefinitions.h:
1554         * UIProcess/API/Cocoa/WKPreferences.mm:
1555         (-[WKPreferences _largeImageAsyncDecodingEnabled]):
1556         (-[WKPreferences _setLargeImageAsyncDecodingEnabled:]):
1557         (-[WKPreferences _animatedImageAsyncDecodingEnabled]):
1558         (-[WKPreferences _setAnimatedImageAsyncDecodingEnabled:]):
1559         (-[WKPreferences _asyncImageDecodingEnabled]): Deleted.
1560         (-[WKPreferences _setAsyncImageDecodingEnabled:]): Deleted.
1561         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1562         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1563         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1564         * WebProcess/WebPage/WebPage.cpp:
1565         (WebKit::WebPage::updatePreferences):
1566
1567 2016-11-30  Chris Dumez  <cdumez@apple.com>
1568
1569         [iOS][WK2] Turn on HTML interactive form validation feature
1570         https://bugs.webkit.org/show_bug.cgi?id=165212
1571         <rdar://problem/29444356>
1572
1573         Reviewed by Simon Fraser.
1574
1575         Turn on HTML interactive form validation feature on iOS WK2
1576         now that we have a native UI.
1577
1578         * Shared/WebPreferencesDefinitions.h:
1579
1580 2016-11-30  Brent Fulgham  <bfulgham@apple.com>
1581
1582         Correct plugin sandbox after r208611
1583         https://bugs.webkit.org/show_bug.cgi?id=165187
1584         <rdar://problem/29431165>
1585
1586         Reviewed by Alex Christensen.
1587
1588         In r208611 I removed the 'else' clause of a Scheme conditional
1589         that was needed to properly run plugins (such as Flash Player).
1590
1591         This change retains the relevant current sandbox content, while
1592         still stripping out the old code that is no longer needed.
1593
1594         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1595
1596 2016-11-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1597
1598         [GTK] Database process should not initialize gtk
1599         https://bugs.webkit.org/show_bug.cgi?id=165138
1600
1601         Reviewed by Sergio Villar Senin.
1602
1603         It doesn't use GTK+ at all.
1604
1605         * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp:
1606         (WebKit::DatabaseProcessMainUnix):
1607         (): Deleted.
1608
1609 2016-11-29  Gavin Barraclough  <barraclough@apple.com>
1610
1611         Remove WebPage::SetPageSuppressed
1612         https://bugs.webkit.org/show_bug.cgi?id=165158
1613
1614         Unreviewed revert accidental change.
1615
1616         * WebProcess/WebPage/WebPage.cpp:
1617         (WebKit::WebPage::setActivityState):
1618
1619 2016-11-29  Gavin Barraclough  <barraclough@apple.com>
1620
1621         Remove WebPage::SetPageSuppressed
1622         https://bugs.webkit.org/show_bug.cgi?id=165158
1623
1624         Reviewed by Tim Horton.
1625
1626         This was scaffolding. We've now refactored to the point that the information driving throttling originates
1627         from the UI process (so UI and web processes can have a consistent view of what should throttle), but we
1628         don't need a separate message to handle this - necessary state to determine is provided in ActivityState.
1629
1630         * UIProcess/WebPageProxy.cpp:
1631         (WebKit::WebPageProxy::updateThrottleState):
1632             - used to send SetPageSuppressed; no longer does.
1633         * UIProcess/WebPageProxy.h:
1634             - removed m_pageSuppressed (was used to avoid duplicated messages).
1635         * WebProcess/WebPage/WebPage.cpp:
1636         (WebKit::WebPage::updateThrottleState):
1637             - compute throttle state based on m_activityState.
1638         (WebKit::WebPage::setActivityState):
1639             - update throttle state whenever activity state changes.
1640         (WebKit::WebPage::updatePreferences):
1641             - update throttle state whenever preferences change (throttling can be disabled via preference).
1642         (WebKit::WebPage::setPageSuppressed): Deleted.
1643             - Removed WebPage::SetPageSuppressed.
1644         * WebProcess/WebPage/WebPage.h:
1645             - Removed WebPage::SetPageSuppressed.
1646             - Added m_processSuppressionEnabled, to cache preference state.
1647         * WebProcess/WebPage/WebPage.messages.in:
1648             - Removed WebPage::SetPageSuppressed.
1649
1650 2016-11-29  Andy Estes  <aestes@apple.com>
1651
1652         [Cocoa] Enable two clang warnings recommended by Xcode
1653         https://bugs.webkit.org/show_bug.cgi?id=164498
1654
1655         Reviewed by Mark Lam.
1656
1657         * Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.
1658
1659 2016-11-29  Eric Carlson  <eric.carlson@apple.com>
1660
1661         [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
1662         https://bugs.webkit.org/show_bug.cgi?id=164760
1663         <rdar://problem/29261266>
1664
1665         Reviewed by Youenn Fablet.
1666
1667         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1668         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
1669         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
1670         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
1671         (WebKit::FrameAuthorizationState::reset):
1672         (WebKit::FrameAuthorizationState::securityOriginsAreEqual):
1673         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
1674         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
1675         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
1676         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
1677         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1678         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1679         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1680         (WebKit::FrameAuthorizationState::~FrameAuthorizationState):
1681         (WebKit::FrameAuthorizationState::frameID):
1682         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1683         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
1684         * UIProcess/UserMediaPermissionRequestProxy.h:
1685         (WebKit::UserMediaPermissionRequestProxy::create):
1686         (WebKit::UserMediaPermissionRequestProxy::frameID):
1687         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
1688         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
1689         * UIProcess/WebPageProxy.cpp:
1690         (WebKit::WebPageProxy::didCommitLoadForFrame):
1691         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1692         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
1693
1694 2016-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1695
1696         Scroll snapping on Mac should use AppKit animations
1697         https://bugs.webkit.org/show_bug.cgi?id=147261
1698         <rdar://problem/29395293>
1699
1700         Reviewed by Brent Fulgham.
1701
1702         Add some logic to plumb filtered wheel velocity over to WebCore in the case of mainframe scrolling. See
1703         WebCore/ChangeLog for more details.
1704
1705         * WebProcess/WebPage/EventDispatcher.cpp:
1706         (WebKit::EventDispatcher::wheelEvent):
1707
1708 2016-11-21  Brian Burg  <bburg@apple.com>
1709
1710         Web Automation: add ObjC SPI to set whether a page is controlled by automation
1711         https://bugs.webkit.org/show_bug.cgi?id=165001
1712         <rdar://problem/29350432>
1713
1714         Reviewed by Dan Bernstein.
1715
1716         Add SPI property to WKWebViewConfiguration and plumb it through to
1717         initialize WebPageProxy::m_controlledByAutomation. This is propagated
1718         to the WebProcess on creation via WebPageCreationParameters.
1719
1720         * UIProcess/API/APIPageConfiguration.cpp:
1721         (API::PageConfiguration::copy):
1722         * UIProcess/API/APIPageConfiguration.h:
1723         (API::PageConfiguration::isControlledByAutomation):
1724         (API::PageConfiguration::setControlledByAutomation):
1725         * UIProcess/API/Cocoa/WKWebView.mm:
1726         (-[WKWebView _initializeWithConfiguration:]):
1727         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1728         (-[WKWebViewConfiguration init]):
1729         (-[WKWebViewConfiguration copyWithZone:]):
1730         (-[WKWebViewConfiguration _isControlledByAutomation]):
1731         (-[WKWebViewConfiguration _setControlledByAutomation:]):
1732         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1733         * UIProcess/WebPageProxy.cpp:
1734         (WebKit::WebPageProxy::WebPageProxy):
1735
1736 2016-11-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1737
1738         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
1739         https://bugs.webkit.org/show_bug.cgi?id=164303
1740
1741         Reviewed by Michael Catanzaro.
1742
1743         Trap also BadDrawable and BadDamage X errors when creating the surface and damage.
1744
1745         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
1746         (WebKit::AcceleratedBackingStoreX11::update):
1747
1748 2016-11-28  Chris Dumez  <cdumez@apple.com>
1749
1750         [Mac][WK2] Enable HTML interactive form validation
1751         https://bugs.webkit.org/show_bug.cgi?id=165123
1752         <rdar://problem/28944652>
1753
1754         Reviewed by Simon Fraser.
1755
1756         Enable HTML interactive form validation now that we have a native UI
1757         for it.
1758
1759         * Shared/WebPreferencesDefinitions.h:
1760
1761 2016-11-28  Brent Fulgham  <bfulgham@apple.com>
1762
1763         Generated sandbox profile is not being put in the correct Resources directory
1764         https://bugs.webkit.org/show_bug.cgi?id=165126
1765
1766         Reviewed by Tim Horton.
1767
1768         * WebKit2.xcodeproj/project.pbxproj: Copy the generated file to the 'PlugInSandboxProfiles'
1769         sub-directory.
1770
1771 2016-11-28  Ryan Haddad  <ryanhaddad@apple.com>
1772
1773         Unreviewed, rolling out r209008.
1774
1775         This change appears to have caused two fast/mediastrem
1776         LayoutTests to fail.
1777
1778         Reverted changeset:
1779
1780         "[MediaStream] Don't request user permission for a device if
1781         it has already been granted in the current browsing context"
1782         https://bugs.webkit.org/show_bug.cgi?id=164760
1783         http://trac.webkit.org/changeset/209008
1784
1785 2016-11-28  Andrew Gold  <agold@apple.com>
1786
1787         Support for HTML Media Capture API
1788         https://bugs.webkit.org/show_bug.cgi?id=43239
1789
1790         Reviewed by Tim Horton.
1791
1792         In order to enable media capture on iOS, we must first use the AVFoundation API to 
1793         check/request capture permission from the user for Safari. Then, Safari must request
1794         permission on behalf of the webpage to use the capture devices. Additionally, Safari
1795         must present UI when the capture is taking place, so WebKit needs to notify the client
1796         of a capture session beginning and ending. To do this, we added four methods to 
1797         WKUIDelegatePrivate to request permission from the user, check for permissions, notify
1798         that a capture session has begun, and notify that a capture session has ended. Additionally,
1799         we added a private method to WKWebView that allows the client to stop a capture session.
1800
1801         * UIProcess/API/APIUIClient.h:
1802         (API::UIClient::didBeginCaptureSession): Notifies the client of a capture session beginning.
1803         (API::UIClient::didEndCaptureSession): Notifies the client of a capture session ending.
1804
1805         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added new delegate methods to request permission,
1806         check for permission, notify of a capture session beginning, and notify of a capture session
1807         ending.
1808
1809         * UIProcess/API/Cocoa/WKWebView.mm:
1810         (-[WKWebView _stopMediaCapture]): Cancels a media capture session.
1811         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1812
1813         * UIProcess/Cocoa/UIDelegate.h:
1814         * UIProcess/Cocoa/UIDelegate.mm:
1815         (WebKit::UIDelegate::setDelegate): Added the new delegate methods.
1816         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
1817         First checks if the user has authorized the client application access capture devices,
1818         then uses the WKUIDelegate to request permission for a site from the user.
1819         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): Checks the client
1820         for permission to access capture devices.
1821         (WebKit::UIDelegate::UIClient::didBeginCaptureSession): Notifies the client of a capture
1822         session beginning.
1823         (WebKit::UIDelegate::UIClient::didEndCaptureSession): Notifies the client of a capture
1824         session ending.
1825
1826         * UIProcess/WebPageProxy.cpp:
1827         (WebKit::WebPageProxy::isPlayingMediaDidChange): Calls UIDelegate method to notify the
1828         client of a capture session beginning/ending.
1829
1830 2016-11-28  Eric Carlson  <eric.carlson@apple.com>
1831
1832         [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
1833         https://bugs.webkit.org/show_bug.cgi?id=164760
1834         <rdar://problem/29261266>
1835
1836         Reviewed by Youenn Fablet.
1837
1838         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1839         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
1840         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
1841         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
1842         (WebKit::FrameAuthorizationState::reset):
1843         (WebKit::FrameAuthorizationState::securityOriginsAreEqual):
1844         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
1845         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
1846         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
1847         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
1848         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1849         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1850         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1851         (WebKit::FrameAuthorizationState::~FrameAuthorizationState):
1852         (WebKit::FrameAuthorizationState::frameID):
1853         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1854         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
1855         * UIProcess/UserMediaPermissionRequestProxy.h:
1856         (WebKit::UserMediaPermissionRequestProxy::create):
1857         (WebKit::UserMediaPermissionRequestProxy::frameID):
1858         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
1859         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
1860         * UIProcess/WebPageProxy.cpp:
1861         (WebKit::WebPageProxy::didCommitLoadForFrame):
1862         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1863         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
1864
1865 2016-11-27  Dean Jackson  <dino@apple.com>
1866
1867         Removed a WTFLogAlways I left in with a recent commit.
1868
1869         * UIProcess/Cocoa/WebViewImpl.mm:
1870         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
1871
1872 2016-11-27  Csaba Osztrogonác  <ossy@webkit.org>
1873
1874         Fix unused-private-field build warning in WebKit2/Platform/SharedMemory.h
1875         https://bugs.webkit.org/show_bug.cgi?id=165069
1876
1877         Reviewed by Darin Adler.
1878
1879         * Platform/SharedMemory.h:
1880
1881 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
1882
1883         Fix the iOS build.
1884
1885         * WebProcess/WebPage/ios/WebPageIOS.mm:
1886         (WebKit::WebPage::eventThrottlingDelay):
1887
1888 2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
1889
1890         [WTF] Import std::optional reference implementation as WTF::Optional
1891         https://bugs.webkit.org/show_bug.cgi?id=164199
1892
1893         Reviewed by Saam Barati and Sam Weinig.
1894
1895         * NetworkProcess/NetworkDataTask.cpp:
1896         (WebKit::NetworkDataTask::didReceiveResponse):
1897         * NetworkProcess/NetworkLoad.h:
1898         * NetworkProcess/cache/NetworkCache.cpp:
1899         (WebKit::NetworkCache::responseHasExpired):
1900         * NetworkProcess/cache/NetworkCacheCoders.h:
1901         (WebKit::NetworkCache::Coder<std::optional<T>>::encode):
1902         (WebKit::NetworkCache::Coder<std::optional<T>>::decode):
1903         (WebKit::NetworkCache::Coder<Optional<T>>::encode): Deleted.
1904         (WebKit::NetworkCache::Coder<Optional<T>>::decode): Deleted.
1905         * NetworkProcess/cache/NetworkCacheData.cpp:
1906         (WebKit::NetworkCache::readOrMakeSalt):
1907         * NetworkProcess/cache/NetworkCacheData.h:
1908         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1909         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
1910         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
1911         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
1912         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1913         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1914         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
1915         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
1916         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
1917         * NetworkProcess/cache/NetworkCacheStatistics.h:
1918         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1919         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
1920         (WebKit::NetworkCache::Storage::encodeRecord):
1921         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
1922         * NetworkProcess/cache/NetworkCacheStorage.h:
1923         * Platform/IPC/ArgumentCoders.h:
1924         (IPC::ArgumentCoder<std::optional<T>>::encode):
1925         (IPC::ArgumentCoder<std::optional<T>>::decode):
1926         (IPC::ArgumentCoder<WTF::Optional<T>>::encode): Deleted.
1927         (IPC::ArgumentCoder<WTF::Optional<T>>::decode): Deleted.
1928         * Platform/IPC/Connection.h:
1929         (IPC::Connection::sendWithReply):
1930         * Platform/SharedMemory.h:
1931         * Platform/unix/SharedMemoryUnix.cpp:
1932         (WebKit::SharedMemory::map):
1933         * Scripts/webkit/messages.py:
1934         (class_template_headers):
1935         * Shared/API/APISecurityOrigin.h:
1936         (API::SecurityOrigin::create):
1937         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
1938         * Shared/API/c/WKSecurityOriginRef.cpp:
1939         (WKSecurityOriginGetPort):
1940         * Shared/SessionState.h:
1941         * Shared/WebPageCreationParameters.h:
1942         * Shared/mac/ObjCObjectGraph.mm:
1943         (WebKit::typeFromObject):
1944         * Shared/mac/SecItemShim.cpp:
1945         (WebKit::sendSecItemRequest):
1946         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1947         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1948         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
1949         (-[WKSecurityOrigin port]):
1950         * UIProcess/API/Cocoa/WKWebView.mm:
1951         (-[WKWebView _didCommitLayerTree:]):
1952         (-[WKWebView _navigationGestureDidEnd]):
1953         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1954         (WebKit::toWebsiteDataType):
1955         * UIProcess/API/efl/EwkView.cpp:
1956         (EwkView::setCursor):
1957         * UIProcess/API/mac/WKView.mm:
1958         (toCoreScrollbarStyle):
1959         (toAPIScrollbarStyle):
1960         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1961         (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
1962         (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
1963         (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
1964         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1965         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1966         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1967         (WebKit::toPKPaymentSummaryItem):
1968         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
1969         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
1970         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
1971         * UIProcess/Automation/WebAutomationSession.cpp:
1972         (WebKit::WebAutomationSession::webFrameIDForHandle):
1973         (WebKit::WebAutomationSession::switchToBrowsingContext):
1974         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
1975         (WebKit::WebAutomationSession::resolveChildFrameHandle):
1976         (WebKit::WebAutomationSession::resolveParentFrameHandle):
1977         (WebKit::WebAutomationSession::computeElementLayout):
1978         * UIProcess/Automation/WebAutomationSession.h:
1979         * UIProcess/Cocoa/WebViewImpl.h:
1980         * UIProcess/Cocoa/WebViewImpl.mm:
1981         (WebKit::WebViewImpl::updateViewExposedRect):
1982         (WebKit::WebViewImpl::setOverlayScrollbarStyle):
1983         (WebKit::WebViewImpl::overlayScrollbarStyle):
1984         * UIProcess/DrawingAreaProxy.cpp:
1985         (WebKit::DrawingAreaProxy::setViewExposedRect):
1986         * UIProcess/DrawingAreaProxy.h:
1987         (WebKit::DrawingAreaProxy::viewExposedRect):
1988         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
1989         (WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
1990         * UIProcess/InspectorServer/WebSocketServerConnection.h:
1991         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1992         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
1993         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1994         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1995         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
1996         * UIProcess/Scrolling/RemoteScrollingTree.h:
1997         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1998         (WebKit::fileCreationTime):
1999         (WebKit::fileModificationTime):
2000         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2001         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2002         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2003         * UIProcess/WebBackForwardList.cpp:
2004         (WebKit::WebBackForwardList::backForwardListState):
2005         (WebKit::WebBackForwardList::restoreFromState):
2006         * UIProcess/WebPageProxy.cpp:
2007         (WebKit::WebPageProxy::didCommitLoadForFrame):
2008         (WebKit::WebPageProxy::creationParameters):
2009         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
2010         * UIProcess/WebPageProxy.h:
2011         (WebKit::WebPageProxy::overlayScrollbarStyle):
2012         * UIProcess/WebPageProxy.messages.in:
2013         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2014         * UIProcess/efl/WebView.cpp:
2015         (WebKit::WebView::transformFromScene):
2016         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2017         * UIProcess/gtk/WebPreferencesGtk.cpp:
2018         (WebKit::WebPreferences::platformInitializeStore):
2019         * UIProcess/ios/WKContentViewInteraction.mm:
2020         (-[WKContentView _scrollOffsetForEvent:]):
2021         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
2022         * UIProcess/mac/LegacySessionStateCoding.cpp:
2023         (WebKit::encodeFormDataElement):
2024         (WebKit::decodeFormDataElement):
2025         (WebKit::decodeV1SessionHistory):
2026         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2027         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2028         (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
2029         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2030         (WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
2031         (WebKit::WebPaymentCoordinator::completeShippingContactSelection):
2032         (WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
2033         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2034         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2035         (WKBundlePageSetEventThrottlingBehaviorOverride):
2036         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2037         (WebKit::PDFPlugin::convertFromPDFViewToRootView):
2038         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
2039         (WebKit::PDFPlugin::boundsOnScreen):
2040         (WebKit::PDFPlugin::geometryDidChange):
2041         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2042         (WebKit::PDFPlugin::geometryDidChange):
2043         * WebProcess/Plugins/PluginView.cpp:
2044         (WebKit::PluginView::performFrameLoadURLRequest):
2045         (WebKit::PluginView::evaluate):
2046         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2047         (WebKit::WebPluginInfoProvider::pluginLoadClientPolicyForHost):
2048         * WebProcess/Plugins/WebPluginInfoProvider.h:
2049         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2050         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2051         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2052         (WebKit::toFormData):
2053         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2054         (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
2055         * WebProcess/WebCoreSupport/WebChromeClient.h:
2056         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2057         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2058         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2059         * WebProcess/WebPage/DrawingArea.h:
2060         * WebProcess/WebPage/DrawingArea.messages.in:
2061         * WebProcess/WebPage/WebFrame.cpp:
2062         (WebKit::WebFrame::certificateInfo):
2063         * WebProcess/WebPage/WebPage.cpp:
2064         (WebKit::m_userInterfaceLayoutDirection):
2065         (WebKit::WebPage::setScrollbarOverlayStyle):
2066         * WebProcess/WebPage/WebPage.h:
2067         (WebKit::WebPage::scrollbarOverlayStyle):
2068         * WebProcess/WebPage/WebPage.messages.in:
2069         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2070         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2071         (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
2072         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2073         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2074         (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
2075
2076 2016-11-26  Sam Weinig  <sam@webkit.org>
2077
2078         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
2079         https://bugs.webkit.org/show_bug.cgi?id=164965
2080
2081         Reviewed by Simon Fraser.
2082
2083         * Shared/WebPreferencesDefinitions.h:
2084         * UIProcess/API/C/WKPreferences.cpp:
2085         (WKPreferencesSetIntersectionObserverEnabled):
2086         (WKPreferencesGetIntersectionObserverEnabled):
2087         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2088         * WebProcess/WebPage/WebPage.cpp:
2089         (WebKit::WebPage::updatePreferences):
2090         Add a preference, defaulting to off, for enabling IntersectionObserver.
2091
2092 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
2093
2094         Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
2095         https://bugs.webkit.org/show_bug.cgi?id=164992
2096
2097         Reviewed by Darin Adler.
2098         
2099         No more ugly conversion from seconds to milliseconds.
2100
2101         * WebProcess/WebPage/WebPage.cpp:
2102         (WebKit::WebPage::updatePreferences):
2103         * WebProcess/WebPage/ios/WebPageIOS.mm:
2104         (WebKit::WebPage::eventThrottlingDelay):
2105
2106 2016-11-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2107
2108         [GTK] Follow-up fixes to r208974
2109         https://bugs.webkit.org/show_bug.cgi?id=164771
2110
2111         Unreviewed, implement Carlos's review feedback.
2112
2113         * UIProcess/API/gtk/WebKitNotification.cpp:
2114         (webkit_notification_get_tag):
2115         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2116         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
2117         (WebKitNotificationProvider::show):
2118         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2119
2120 2016-11-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2121
2122         [GTK] Notifications API does not expose or respect the "tag" attribute
2123         https://bugs.webkit.org/show_bug.cgi?id=164771
2124
2125         Reviewed by Gustavo Noronha Silva.
2126
2127         Expose a tag property on WebKitNotification. Ensure that any previous notification with the
2128         same tag is closed when showing a new notification with that tag.
2129
2130         * UIProcess/API/gtk/WebKitNotification.cpp:
2131         (webkit_notification_class_init):
2132         (webkitNotificationCreate):
2133         (webkit_notification_get_tag):
2134         * UIProcess/API/gtk/WebKitNotification.h:
2135         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2136         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
2137         (WebKitNotificationProvider::show):
2138         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2139         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2140
2141 2016-11-22  Sergio Villar Senin  <svillar@igalia.com>
2142
2143         [GTK] Fix introspection warning
2144         https://bugs.webkit.org/show_bug.cgi?id=165026
2145
2146         Reviewed by Michael Catanzaro.
2147
2148         This fixes an introspection annotation for a new API added in r208532.
2149
2150         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2151         (webkit_web_page_class_init):
2152
2153 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2154
2155         [SOUP] Simplify custom protocols handler implementation
2156         https://bugs.webkit.org/show_bug.cgi?id=164922
2157
2158         Reviewed by Michael Catanzaro.
2159
2160         We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
2161         their own APIs and this is not used by WTR at all.
2162
2163         * PlatformEfl.cmake: Remove files from compilation.
2164         * PlatformGTK.cmake: Ditto.
2165         * Shared/API/c/WKBase.h:
2166         * Shared/API/c/soup/WKBaseSoup.h: Removed.
2167         * UIProcess/API/APICustomProtocolManagerClient.h: Added.
2168         (API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
2169         (API::CustomProtocolManagerClient::startLoading):
2170         (API::CustomProtocolManagerClient::stopLoading):
2171         (API::CustomProtocolManagerClient::invalidate):
2172         * UIProcess/API/C/WKAPICast.h:
2173         * UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
2174         * UIProcess/API/C/soup/WKContextSoup.h: Removed.
2175         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
2176         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
2177         * UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
2178         * UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
2179         * UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
2180         (EwkUrlSchemeRequest::EwkUrlSchemeRequest):
2181         (EwkUrlSchemeRequest::finish):
2182         (EwkUrlSchemeRequest::invalidate):
2183         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
2184         (EwkUrlSchemeRequest::create):
2185         (EwkUrlSchemeRequest::manager):
2186         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
2187         (attachCustomProtocolManagerClientToContext):
2188         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
2189         * UIProcess/API/gtk/WebKitPrivate.h:
2190         * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
2191         * UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
2192         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
2193         (webkitURISchemeRequestCreate):
2194         (webkitURISchemeRequestCancel):
2195         (webkitURISchemeRequestGetManager):
2196         (webkitURISchemeRequestInvalidate):
2197         (webkitURISchemeRequestReadCallback):
2198         (webkit_uri_scheme_request_finish_error):
2199         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
2200         * UIProcess/API/gtk/WebKitWebContext.cpp:
2201         (webkitWebContextConstructed):
2202         (webkitWebContextDispose):
2203         (webkit_web_context_register_uri_scheme):
2204         (webkitWebContextStartLoadingCustomProtocol):
2205         (webkitWebContextInvalidateCustomProtocolRequests):
2206         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
2207         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
2208         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
2209         (WebKit::CustomProtocolManagerProxy::processDidClose):
2210         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
2211         (WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
2212         (WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
2213         (WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
2214         (WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
2215         (WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
2216         (WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
2217         (WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
2218         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
2219         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
2220         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
2221         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
2222         * UIProcess/Network/NetworkProcessProxy.cpp:
2223         (WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
2224         * UIProcess/WebProcessPool.cpp:
2225         (WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
2226         (WebKit::WebProcessPool::setCustomProtocolManagerClient):
2227         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
2228         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
2229         * UIProcess/WebProcessPool.h:
2230         * UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
2231         (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
2232         (WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
2233         * UIProcess/efl/RequestManagerClientEfl.h:
2234         * UIProcess/efl/WebProcessPoolEfl.cpp:
2235         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2236         * UIProcess/soup/WebProcessPoolSoup.cpp:
2237         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
2238         build the list of custom protocols to send to the network process.
2239
2240 2016-11-21  Alex Christensen  <achristensen@webkit.org>
2241
2242         Fix Sierra CMake build after r208452
2243         https://bugs.webkit.org/show_bug.cgi?id=164437
2244
2245         * UIProcess/Cocoa/WebViewImpl.mm:
2246         (WebKit::WebViewImpl::updateMediaTouchBar):
2247         I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet.
2248         It's needed for WebPlaybackSessionInterfaceMac to exist.
2249
2250 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2251
2252         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release.
2253
2254         * gtk/NEWS: Add release notes for 2.15.2.
2255
2256 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2257
2258         Remove m_customProtocolManagerProxy from WebProcessProxy
2259         https://bugs.webkit.org/show_bug.cgi?id=164908
2260
2261         Reviewed by Andreas Kling.
2262
2263         Since the network process is mandatory, the custom protocol manager proxy of WebProcessProxy is unused and can
2264         be removed.
2265
2266         * UIProcess/WebProcessProxy.cpp:
2267         (WebKit::WebProcessProxy::WebProcessProxy):
2268         * UIProcess/WebProcessProxy.h:
2269
2270 2016-11-20  Zan Dobersek  <zdobersek@igalia.com>
2271
2272         [EncryptedMedia] Make EME API runtime-enabled
2273         https://bugs.webkit.org/show_bug.cgi?id=164927
2274
2275         Reviewed by Jer Noble.
2276
2277         Add the new EncryptedMediaAPI preference. Set the same feature
2278         flag on the shared RuntimeEnabledFeatures object to the
2279         corresponding value that's stored in the WebPreferencesStore.
2280
2281         InjectedBundle::overrideBoolPreferenceForTestRunner() does the
2282         same when the 'WebKitEncryptedMediaAPIEnabled' preference is
2283         overridden in WKTR for testing purposes.
2284
2285         * Shared/WebPreferencesDefinitions.h:
2286         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2287         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2288         * WebProcess/WebPage/WebPage.cpp:
2289         (WebKit::WebPage::updatePreferences):
2290
2291 2016-11-19  Antti Koivisto  <antti@apple.com>
2292
2293         Salt network cache hashes
2294         https://bugs.webkit.org/show_bug.cgi?id=164924
2295
2296         Reviewed by Alex Christensen.
2297
2298         To enhance privacy make cache content unidentifiable from file names alone.
2299         This is done by generating a unique persistent salt for each cache instance.
2300         It is used when computing hashes used in file names.
2301
2302         The patch also replaces plain text partition directory names with salted hashes.
2303
2304         * NetworkProcess/cache/NetworkCache.cpp:
2305         (WebKit::NetworkCache::Cache::makeCacheKey):
2306         (WebKit::NetworkCache::makeCacheKey): Deleted.
2307         * NetworkProcess/cache/NetworkCache.h:
2308
2309             Increment cache version.
2310
2311         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2312         (WebKit::NetworkCache::BlobStorage::BlobStorage):
2313         (WebKit::NetworkCache::BlobStorage::add):
2314         (WebKit::NetworkCache::BlobStorage::get):
2315
2316             Use salt for blob content hash.
2317
2318         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
2319         * NetworkProcess/cache/NetworkCacheData.cpp:
2320         (WebKit::NetworkCache::computeSHA1):
2321
2322             For simplicity all SHA1s are now salted.
2323
2324         (WebKit::NetworkCache::makeSalt):
2325         (WebKit::NetworkCache::readOrMakeSalt):
2326
2327             Read salt if it exists, generate and persist it otherwise.
2328
2329         * NetworkProcess/cache/NetworkCacheData.h:
2330         * NetworkProcess/cache/NetworkCacheKey.cpp:
2331         (WebKit::NetworkCache::Key::Key):
2332
2333             Remove the "No partition" string and just empty.
2334             That was only needed to have a directory name of some sort.
2335
2336         (WebKit::NetworkCache::Key::computeHash):
2337
2338             Use salt for key hash.
2339
2340         (WebKit::NetworkCache::Key::computePartitionHash):
2341
2342             Separate hash for partition.
2343
2344         * NetworkProcess/cache/NetworkCacheKey.h:
2345         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2346         (WebKit::NetworkCache::makeSubresourcesKey):
2347         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
2348         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
2349         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2350         (WebKit::NetworkCache::makeSaltFilePath):
2351         (WebKit::NetworkCache::Storage::open):
2352
2353             Cache can't be opened if we can't read or persist a salt.
2354
2355         (WebKit::NetworkCache::traverseRecordsFiles):
2356         (WebKit::NetworkCache::Storage::Storage):
2357         (WebKit::NetworkCache::Storage::synchronize):
2358         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
2359
2360             Use the partition hash in the directory name instead of a plain text name.
2361
2362         (WebKit::NetworkCache::decodeRecordHeader):
2363         (WebKit::NetworkCache::Storage::readRecord):
2364         (WebKit::NetworkCache::Storage::encodeRecord):
2365         (WebKit::NetworkCache::Storage::traverse):
2366         (WebKit::NetworkCache::Storage::clear):
2367         * NetworkProcess/cache/NetworkCacheStorage.h:
2368         (WebKit::NetworkCache::Storage::salt):
2369
2370 2016-11-19  Simon Fraser  <simon.fraser@apple.com>
2371
2372         [iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
2373         https://bugs.webkit.org/show_bug.cgi?id=164855
2374
2375         Reviewed by Sam Weinig.
2376
2377         During UI-process panning and zooming, we send visible rect updates to the web process
2378         with inStableState=false, and don't update GraphicsLayers until we get into a stable state.
2379
2380         This causes a problem where the web process has a stale notion of where the GraphicsLayers
2381         for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
2382         visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
2383         breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
2384         in the scrolling tree.
2385
2386         To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
2387         only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
2388         are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
2389         reconcileViewportConstrainedLayerPositions).
2390
2391         Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html
2392
2393         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2394         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2395         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2396         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2397         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2398         * UIProcess/Scrolling/RemoteScrollingTree.h:
2399         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2400         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2401         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2402         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
2403         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2404         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
2405         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2406         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
2407         * WebProcess/WebPage/ios/WebPageIOS.mm:
2408         (WebKit::WebPage::updateVisibleContentRects): Always push the custom fixed position rect down, but send
2409         ScrollingLayerPositionAction::SetApproximate if the state is not stable.
2410         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2411         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2412         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2413         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2414
2415 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
2416
2417         Make it possible to test non-stable-state scrolling on iOS
2418         https://bugs.webkit.org/show_bug.cgi?id=164905
2419
2420         Reviewed by Dan Bernstein.
2421
2422         Make it possible for an iOS layout test to force every visible rect update
2423         from the UI process to the web process to be in a non-stable state. This emulates
2424         what happens during panning and zooming interactions, and allows us to test the
2425         scrolling and layer trees in these transient states.
2426
2427         This is done by adding a testing property on WKWebView, _stableStateOverride, whose
2428         getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
2429         consults the NSNumber's boolValue and uses it to override the stable state.
2430
2431         To facilitate this kind of testing, also add immediateScrollToOffset() and
2432         immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
2433         which provides a callback that fires after one trip to the web process and back.
2434
2435         * UIProcess/API/Cocoa/WKWebView.mm:
2436         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
2437         (-[WKWebView _stableStateOverride]):
2438         (-[WKWebView _setStableStateOverride:]):
2439         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2440
2441 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
2442
2443         [iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
2444         https://bugs.webkit.org/show_bug.cgi?id=164980
2445
2446         Reviewed by Chris Dumez.
2447
2448         WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
2449         to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
2450         flag that impacts tile coverage.
2451
2452         During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
2453         WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().
2454
2455         Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.
2456
2457         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2458         (WKBundlePageSetEventThrottlingBehaviorOverride):
2459         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2460         * WebProcess/WebPage/ios/WebPageIOS.mm:
2461         (WebKit::WebPage::eventThrottlingDelay):
2462
2463 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
2464
2465         Remove use of std::chrono in WebPage and entrained code
2466         https://bugs.webkit.org/show_bug.cgi?id=164967
2467
2468         Reviewed by Tim Horton.
2469
2470         Replace std::chrono with Seconds and Monotonic Time.
2471
2472         Use more C++11 initialization for WebPage data members.
2473
2474         * Shared/VisibleContentRectUpdateInfo.cpp:
2475         (WebKit::operator<<):
2476         * Shared/VisibleContentRectUpdateInfo.h:
2477         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2478         (WebKit::VisibleContentRectUpdateInfo::timestamp):
2479         * Shared/WebCoreArgumentCoders.cpp:
2480         (IPC::ArgumentCoder<MonotonicTime>::encode):
2481         (IPC::ArgumentCoder<MonotonicTime>::decode):
2482         (IPC::ArgumentCoder<Seconds>::encode):
2483         (IPC::ArgumentCoder<Seconds>::decode):
2484         * Shared/WebCoreArgumentCoders.h:
2485         * UIProcess/ios/WKContentView.mm:
2486         (WebKit::HistoricalVelocityData::HistoricalVelocityData):
2487         (WebKit::HistoricalVelocityData::velocityForNewData):
2488         (WebKit::HistoricalVelocityData::append):
2489         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2490         * WebProcess/WebCoreSupport/WebChromeClient.h:
2491         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2492         (WebKit::WebChromeClient::eventThrottlingDelay):
2493         * WebProcess/WebPage/ViewUpdateDispatcher.h:
2494         * WebProcess/WebPage/WebPage.cpp:
2495         (WebKit::WebPage::WebPage):
2496         (WebKit::m_userActivityHysteresis):
2497         (WebKit::WebPage::didFlushLayerTreeAtTime):
2498         (WebKit::WebPage::didCommitLoad):
2499         * WebProcess/WebPage/WebPage.h:
2500         * WebProcess/WebPage/ios/WebPageIOS.mm:
2501         (WebKit::WebPage::eventThrottlingDelay):
2502         (WebKit::WebPage::updateVisibleContentRects):
2503         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2504         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2505
2506 2016-11-18  Dean Jackson  <dino@apple.com>
2507
2508         AX: "(inverted-colors)" media query only matches on page reload; should match on change
2509         https://bugs.webkit.org/show_bug.cgi?id=163564
2510         <rdar://problem/28807350>
2511
2512         Reviewed by Simon Fraser.
2513
2514         Listen for the appropriate notifications that accessibility settings
2515         have changed. This is a single notification on macOS, which uses WebViewImpl,
2516         and more fine-grained notifications on iOS, using WKWebView.
2517
2518         When we see the notification, send a message to the WebProcess which will
2519         then tell the WebCore::Page.
2520
2521         * UIProcess/API/Cocoa/WKWebView.mm:
2522         (-[WKWebView _initializeWithConfiguration:]):
2523         (-[WKWebView _accessibilitySettingsDidChange:]):
2524         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2525         * UIProcess/Cocoa/WebViewImpl.h:
2526         * UIProcess/Cocoa/WebViewImpl.mm:
2527         (-[WKAccessibilitySettingsObserver initWithImpl:]):
2528         (-[WKAccessibilitySettingsObserver dealloc]):
2529         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
2530         (WebKit::WebViewImpl::WebViewImpl):
2531         (WebKit::WebViewImpl::accessibilitySettingsDidChange):
2532         * UIProcess/WebPageProxy.cpp:
2533         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
2534         * UIProcess/WebPageProxy.h:
2535         * WebProcess/WebPage/WebPage.cpp:
2536         (WebKit::WebPage::accessibilitySettingsDidChange):
2537         * WebProcess/WebPage/WebPage.h:
2538         * WebProcess/WebPage/WebPage.messages.in:
2539
2540 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
2541
2542         USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
2543         https://bugs.webkit.org/show_bug.cgi?id=164962
2544
2545         Reviewed by Dean Jackson.
2546
2547         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2548
2549 2016-11-18  Enrica Casucci  <enrica@apple.com>
2550
2551         Refactor drag and drop for WebKit2 to encode DragData message exchange.
2552         https://bugs.webkit.org/show_bug.cgi?id=164945
2553
2554         Reviewed by Tim Horton.
2555
2556         * Shared/WebCoreArgumentCoders.cpp:
2557         (IPC::ArgumentCoder<DragData>::encode):
2558         (IPC::ArgumentCoder<DragData>::decode):
2559         * Shared/WebCoreArgumentCoders.h:
2560         * UIProcess/WebPageProxy.cpp:
2561         (WebKit::WebPageProxy::performDragControllerAction):
2562         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2563         (WebKit::WebDragClient::willPerformDragDestinationAction):
2564         (WebKit::WebDragClient::actionMaskForDrag):
2565         * WebProcess/WebCoreSupport/WebDragClient.h:
2566         * WebProcess/WebPage/WebPage.cpp:
2567         (WebKit::WebPage::performDragControllerAction):
2568         * WebProcess/WebPage/WebPage.h:
2569         * WebProcess/WebPage/WebPage.messages.in:
2570
2571 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
2572
2573         Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
2574         https://bugs.webkit.org/show_bug.cgi?id=163801
2575
2576         Reviewed by Simon Fraser.
2577
2578         Add SPI to notify client of pointer lock and for client to allow or deny.
2579         Unlock pointer when view is not longer active.
2580
2581         * Configurations/FeatureDefines.xcconfig:
2582         * Shared/WebPreferencesDefinitions.h:
2583         * UIProcess/API/APIUIClient.h:
2584         (API::UIClient::requestPointerLock):
2585         (API::UIClient::didLosePointerLock):
2586         * UIProcess/API/C/WKPage.cpp:
2587         (WKPageSetPageUIClient):
2588         (WKPageDidAllowPointerLock):
2589         (WKPageDidDenyPointerLock):
2590         * UIProcess/API/C/WKPagePrivate.h:
2591         * UIProcess/API/C/WKPageUIClient.h:
2592         * UIProcess/API/C/WKPreferences.cpp:
2593         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2594         * UIProcess/Cocoa/UIDelegate.h:
2595         * UIProcess/Cocoa/UIDelegate.mm:
2596         (WebKit::UIDelegate::setDelegate):
2597         (WebKit::UIDelegate::UIClient::requestPointerLock):
2598         (WebKit::UIDelegate::UIClient::didLosePointerLock):
2599         * UIProcess/WebPageProxy.cpp:
2600         (WebKit::WebPageProxy::dispatchActivityStateChange):
2601         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2602         (WebKit::WebPageProxy::requestPointerLock):
2603         (WebKit::WebPageProxy::didAllowPointerLock):
2604         (WebKit::WebPageProxy::didDenyPointerLock):
2605         (WebKit::WebPageProxy::requestPointerUnlock):
2606         * UIProcess/WebPageProxy.h:
2607         * WebProcess/WebPage/WebPage.cpp:
2608         (WebKit::WebPage::updatePreferences):
2609
2610 2016-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2611
2612         Downloads started by context menu actions should also have a web view associated
2613         https://bugs.webkit.org/show_bug.cgi?id=164364
2614
2615         Reviewed by Michael Catanzaro.
2616
2617         When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
2618         associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
2619         WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.
2620
2621         * UIProcess/API/gtk/WebKitDownload.cpp:
2622         (webkitDownloadCreateForRequest): Deleted.
2623         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
2624         * UIProcess/API/gtk/WebKitWebContext.cpp:
2625         (webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
2626         because the WebKitDownload could have already been created by the web view download handler at this point.
2627         * UIProcess/API/gtk/WebKitWebView.cpp:
2628         (webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
2629         * UIProcess/WebProcessPool.cpp:
2630         (WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
2631         the page client.
2632
2633 2016-11-17  Alex Christensen  <achristensen@webkit.org>
2634
2635         REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
2636         https://bugs.webkit.org/show_bug.cgi?id=164631
2637
2638         Reviewed by Carlos Garcia Campos.
2639
2640         * NetworkProcess/NetworkResourceLoader.cpp:
2641         (WebKit::NetworkResourceLoader::convertToDownload):
2642         I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
2643         by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
2644         was not being set to nullptr before it was being checked in NetworkResourceLoader::abort
2645
2646 2016-11-17  Alex Christensen  <achristensen@webkit.org>
2647
2648         Fix CMake build after r208865
2649         https://bugs.webkit.org/show_bug.cgi?id=164894
2650
2651         * PlatformMac.cmake:
2652         Add new files.
2653
2654 2016-11-17  Ryosuke Niwa  <rniwa@webkit.org>
2655
2656         WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
2657         https://bugs.webkit.org/show_bug.cgi?id=164857
2658         <rdar://problem/27721742>
2659
2660         Reviewed by Wenson Hsieh.
2661
2662         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2663         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
2664
2665 2016-11-17  John Wilander  <wilander@apple.com>
2666
2667         Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
2668         https://bugs.webkit.org/show_bug.cgi?id=164659
2669
2670         Reviewed by Andy Estes.
2671
2672         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2673         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2674             Consistent naming with 'remove' rather than 'delete'.
2675             Now removes localStorage, IndexDB, disk cache, and memory cache too.
2676             Updates statistics with number of times it has removed data records.
2677         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2678             No longer checks whether it has enough data since the classification rules
2679             are absolute, not relative.
2680         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
2681         * UIProcess/WebResourceLoadStatisticsStore.h:
2682             Consistent naming with 'remove' rather than 'delete'.
2683
2684 2016-11-17  Brady Eidson  <beidson@apple.com>
2685
2686         Add _WKIconLoadingDelegate SPI.
2687         https://bugs.webkit.org/show_bug.cgi?id=164894
2688
2689         Reviewed by Alex Christensen.
2690
2691         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
2692
2693         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
2694
2695         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
2696
2697         * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
2698         (API::IconLoadingClient::~IconLoadingClient):
2699         (API::IconLoadingClient::getLoadDecisionForIcon):
2700
2701         * UIProcess/API/Cocoa/WKWebView.mm:
2702         (-[WKWebView _initializeWithConfiguration:]):
2703         (-[WKWebView _iconLoadingDelegate]):
2704         (-[WKWebView _setIconLoadingDelegate:]):
2705         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2706
2707         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
2708
2709         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
2710         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
2711         (-[_WKLinkIconParameters _initWithLinkIcon:]):
2712         (-[_WKLinkIconParameters url]):
2713         (-[_WKLinkIconParameters mimeType]):
2714         (-[_WKLinkIconParameters size]):
2715         (-[_WKLinkIconParameters iconType]):
2716         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
2717
2718         * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
2719         * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
2720         (WebKit::IconLoadingDelegate::IconLoadingDelegate):
2721         (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
2722         (WebKit::IconLoadingDelegate::createIconLoadingClient):
2723         (WebKit::IconLoadingDelegate::delegate):
2724         (WebKit::IconLoadingDelegate::setDelegate):
2725         (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
2726         (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
2727         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
2728
2729         * UIProcess/WebPageProxy.cpp:
2730         (WebKit::WebPageProxy::setIconLoadingClient):
2731         (WebKit::WebPageProxy::getLoadDecisionForIcon):
2732         (WebKit::WebPageProxy::finishedLoadingIcon):
2733         * UIProcess/WebPageProxy.h:
2734         (WebKit::WebPageProxy::iconLoadingClient):
2735         * UIProcess/WebPageProxy.messages.in:
2736
2737         * WebKit2.xcodeproj/project.pbxproj:
2738
2739         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2740         (WebKit::WebFrameLoaderClient::useIconLoadingClient):
2741         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
2742         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
2743         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2744         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
2745
2746         * WebProcess/WebPage/WebPage.cpp:
2747         (WebKit::WebPage::didGetLoadDecisionForIcon):
2748         (WebKit::WebPage::setUseIconLoadingClient):
2749         * WebProcess/WebPage/WebPage.h:
2750         * WebProcess/WebPage/WebPage.messages.in:
2751
2752 2016-11-17  Saam Barati  <sbarati@apple.com>
2753
2754         Remove async/await compile time flag and enable tests
2755         https://bugs.webkit.org/show_bug.cgi?id=164828
2756         <rdar://problem/28639334>
2757
2758         Reviewed by Yusuke Suzuki.
2759
2760         * Configurations/FeatureDefines.xcconfig:
2761
2762 2016-11-17  Yusuke Suzuki  <utatane.tea@gmail.com>
2763
2764         [JSC] WTF::TemporaryChange with WTF::SetForScope
2765         https://bugs.webkit.org/show_bug.cgi?id=164761
2766
2767         Reviewed by Saam Barati.
2768
2769         * PluginProcess/PluginControllerProxy.cpp:
2770         (WebKit::PluginControllerProxy::initialize):
2771         * PluginProcess/WebProcessConnection.cpp:
2772         (WebKit::WebProcessConnection::didReceiveMessage):
2773         (WebKit::WebProcessConnection::didReceiveSyncMessage):
2774         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2775         (createEncodedObject):
2776         (decodeObject):
2777         * UIProcess/API/Cocoa/WKWebView.mm:
2778         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
2779         * UIProcess/Cocoa/WebViewImpl.mm:
2780         (WebKit::WebViewImpl::updateTextTouchBar):
2781         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2782         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
2783         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
2784         (WebKit::WebPasteboardProxy::writeToClipboard):
2785         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2786         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
2787         (WebKit::CompositingCoordinator::purgeBackingStores):
2788         * WebProcess/WebPage/WebPage.cpp:
2789         (WebKit::WebPage::mouseEvent):
2790         (WebKit::WebPage::keyEvent):
2791         (WebKit::WebPage::dispatchTouchEvent):
2792         (WebKit::WebPage::setInitialFocus):
2793         (WebKit::WebPage::insertTextAsync):
2794         * WebProcess/WebPage/ios/WebPageIOS.mm:
2795         (WebKit::WebPage::dynamicViewportSizeUpdate):
2796         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2797         * WebProcess/WebPage/mac/WebPageMac.mm:
2798
2799 2016-11-16  Brent Fulgham  <bfulgham@apple.com>
2800
2801         Unreviewed build fix after r208589
2802
2803         The generated com.apple.WebKit.plugin-common.sb file was not getting copied into
2804         the Resources folder, so was not deployed with WebKit. We need to treat it like
2805         com.apple.WebProcess.sb and the other generated files.
2806
2807         * WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in
2808         the framework Resources.
2809
2810 2016-11-16  Yusuke Suzuki  <utatane.tea@gmail.com>
2811
2812         [ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
2813         https://bugs.webkit.org/show_bug.cgi?id=164827
2814
2815         Reviewed by Ryosuke Niwa.
2816
2817         * Configurations/FeatureDefines.xcconfig:
2818         * Shared/WebPreferencesDefinitions.h:
2819         Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
2820         * UIProcess/API/C/WKPreferences.cpp:
2821         (WKPreferencesSetES6ModulesEnabled):
2822         (WKPreferencesGetES6ModulesEnabled):
2823         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2824         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2825         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2826         * WebProcess/WebPage/WebPage.cpp:
2827         (WebKit::WebPage::updatePreferences):
2828
2829 2016-11-16  Simon Fraser  <simon.fraser@apple.com>
2830
2831         Add logging support to VisibleContentRectUpdateInfo
2832         https://bugs.webkit.org/show_bug.cgi?id=164825
2833
2834         Reviewed by Zalan Bujtas.
2835
2836         Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
2837         stream does single-line output, so also make a convenience dump() function that will
2838         product multiline output. Result look like:
2839
2840             (VisibleContentRectUpdateInfo
2841               (lastLayerTreeTransactionID 54)
2842               (exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
2843               (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
2844               (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
2845               (customFixedPositionRect (219.64,935) width=980 height=1225)
2846               (obscuredInset width=0 height=39.50)
2847               (scale 1.14)
2848               (inStableState 0)
2849               (timestamp 736446.61)
2850               (verticalVelocity -11.36))
2851
2852         * Shared/VisibleContentRectUpdateInfo.cpp:
2853         (WebKit::VisibleContentRectUpdateInfo::dump):
2854         (WebKit::operator<<):
2855         * Shared/VisibleContentRectUpdateInfo.h:
2856         * UIProcess/ios/WKContentView.mm:
2857         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2858
2859 2016-11-15  Simon Fraser  <simon.fraser@apple.com>
2860
2861         [iOS WK2] Scroll view scrolling and zooming animations can keep running across page loads
2862         https://bugs.webkit.org/show_bug.cgi?id=164810
2863
2864         Reviewed by Tim Horton.
2865         
2866         Scrolling and zooming animations can leak across page loads, which makes tests flakey,
2867         and is unexpected by users.
2868
2869         Tested by scrollingcoordinator/ios/sync-layer-positions-after-scroll.html followed by
2870         scrollingcoordinator/ios/ui-scrolling-tree.html
2871
2872         * UIProcess/API/Cocoa/WKWebView.mm:
2873         (-[WKWebView _didCommitLoadForMainFrame]):
2874
2875 2016-11-15  Jon Lee  <jonlee@apple.com>
2876
2877         Report active video and audio capture devices separately
2878         https://bugs.webkit.org/show_bug.cgi?id=164769
2879
2880         Reviewed by Eric Carlson.
2881
2882         Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and
2883         kWKMediaHasActiveVideoCaptureDevice
2884
2885         * UIProcess/API/C/WKPage.cpp:
2886         (WKPageGetMediaState):
2887         * UIProcess/API/C/WKPagePrivate.h:
2888         * UIProcess/WebPageProxy.cpp:
2889         (WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two
2890         bits.
2891
2892 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
2893
2894         [iOS WK2] Implement support for visual viewports
2895         https://bugs.webkit.org/show_bug.cgi?id=164765
2896
2897         Reviewed by Tim Horton.
2898
2899         Adopt the visual viewport scrolling model in iOS WK2.
2900
2901         Pass the parameters used for computing the layout viewport up to WK2 via RemoteLayerTreeTransaction.
2902         These are stored on WebPageProxy. When they change, _didCommitLayerTree triggers a -_updateVisibleContentRects.
2903         
2904         WebPageProxy::computeCustomFixedPositionRect() is the function that computes the "override" layout viewport.
2905         It starts with the baseLayoutViewportSize from the web process (which is based on the initial containing block
2906         size), then ensures that it's no smaller than the unobscured content rect, since it makes no sense for the
2907         layout viewport to be smaller than the visual viewport. The static FrameView::computeLayoutViewportOrigin()
2908         is then use to "push" the layout viewport around as the visual viewport changes.
2909
2910         * Shared/VisibleContentRectUpdateInfo.h:
2911         * Shared/WebCoreArgumentCoders.cpp: Encode LayoutSize and LayoutPoint.
2912         (IPC::ArgumentCoder<LayoutSize>::encode):
2913         (IPC::ArgumentCoder<LayoutSize>::decode):
2914         (IPC::ArgumentCoder<LayoutPoint>::encode):
2915         (IPC::ArgumentCoder<LayoutPoint>::decode):
2916         * Shared/WebCoreArgumentCoders.h:
2917         * Shared/mac/RemoteLayerTreeTransaction.h:
2918         (WebKit::RemoteLayerTreeTransaction::baseLayoutViewportSize):
2919         (WebKit::RemoteLayerTreeTransaction::setBaseLayoutViewportSize):
2920         (WebKit::RemoteLayerTreeTransaction::minStableLayoutViewportOrigin):
2921         (WebKit::RemoteLayerTreeTransaction::setMinStableLayoutViewportOrigin):
2922         (WebKit::RemoteLayerTreeTransaction::maxStableLayoutViewportOrigin):
2923         (WebKit::RemoteLayerTreeTransaction::setMaxStableLayoutViewportOrigin):
2924         * Shared/mac/RemoteLayerTreeTransaction.mm:
2925         (WebKit::RemoteLayerTreeTransaction::encode):
2926         (WebKit::RemoteLayerTreeTransaction::decode):
2927         (WebKit::RemoteLayerTreeTransaction::description):
2928         * UIProcess/API/Cocoa/WKWebView.mm:
2929         (-[WKWebView _didCommitLayerTree:]):
2930         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2931         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled): Accessor.
2932         * UIProcess/WebPageProxy.h:
2933         (WebKit::WebPageProxy::customFixedPositionRect):
2934         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2935         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
2936         * UIProcess/ios/WKContentView.mm:
2937         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2938         (-[WKContentView _didCommitLayerTree:]):
2939         * UIProcess/ios/WebPageProxyIOS.mm:
2940         (WebKit::WebPageProxy::computeCustomFixedPositionRect): When visual viewports are enabled, compute
2941         the layout viewport rect, taking the baseLayoutViewportSize and the current unobscured rect into account.
2942         (WebKit::WebPageProxy::updateLayoutViewportParameters):
2943         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2944         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2945         * WebProcess/WebPage/WebPage.cpp: Encode in the transaction the layout viewport parameters (with minor refactor).
2946         (WebKit::WebPage::willCommitLayerTree):
2947         * WebProcess/WebPage/ios/WebPageIOS.mm:
2948         (WebKit::WebPage::updateVisibleContentRects): This is where the web process receives the new override layout viewport
2949         from the web process (with some logging).
2950
2951 2016-11-15  Jon Lee  <jonlee@apple.com>
2952
2953         Remove HasMediaCaptureDevice
2954         https://bugs.webkit.org/show_bug.cgi?id=164767
2955         <rdar://problem/29263696>
2956
2957         Reviewed by Eric Carlson.
2958
2959         * UIProcess/API/C/WKPage.cpp: Remove kWKMediaHasCaptureDevice.
2960         (WKPageGetMediaState):
2961         * UIProcess/API/C/WKPagePrivate.h:
2962
2963 2016-11-15  Daniel Bates  <dabates@apple.com>
2964
2965         Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
2966         https://bugs.webkit.org/show_bug.cgi?id=164662
2967         <rdar://problem/29268514>
2968
2969         Reviewed by Alex Christensen and Brady Eidson.
2970
2971         Make changes to NetworkDataTask similar to the changes made to ResourceHandle so as to
2972         disallow non-default port HTTP 0.9 loads when using the ENABLE(NETWORK_SESSION) networking
2973         code path in WebKit2.
2974
2975         * NetworkProcess/NetworkDataTask.cpp:
2976         (WebKit::NetworkDataTask::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
2977         Otherwise notify the client that we received a response.
2978         * NetworkProcess/NetworkDataTask.h:
2979         * NetworkProcess/NetworkDataTaskBlob.cpp:
2980         (WebKit::NetworkDataTaskBlob::resume): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
2981         as the latter has been renamed to the former.
2982         (WebKit::NetworkDataTaskBlob::getSizeForNext): Ditto.
2983         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): Renamed from didReceiveResponse().
2984         * NetworkProcess/NetworkDataTaskBlob.h:
2985         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2986         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2987         (WebKit::NetworkDataTaskCocoa::didReceiveResponse): Deleted.
2988         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2989         (WebKit::NetworkDataTaskSoup::didSendRequest): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
2990         as the latter has been renamed to the former.
2991         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). Also
2992         remove the local variable response and inline its value into the call to ResourceHandle::didReceiveResponse()
2993         as this variable is used exactly once in this function and its name does not describe its purpose any more
2994         than its value.
2995         (WebKit::NetworkDataTaskSoup::didRequestNextPart): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
2996         as the latter has been renamed to the former.
2997         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2998
2999 2016-11-14  Alex Christensen  <achristensen@webkit.org>
3000
3001         Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
3002         https://bugs.webkit.org/show_bug.cgi?id=164720
3003
3004         Reviewed by Brady Eidson.
3005
3006         * DatabaseProcess/DatabaseProcess.cpp:
3007         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
3008         * DatabaseProcess/DatabaseProcess.h:
3009         * NetworkProcess/NetworkProcess.cpp:
3010         (WebKit::fetchDiskCacheEntries):
3011         * Shared/API/c/WKSecurityOriginRef.cpp:
3012         (WKSecurityOriginCreateFromDatabaseIdentifier):
3013         * Shared/WebsiteData/WebsiteData.cpp:
3014         (WebKit::WebsiteData::Entry::encode):
3015         (WebKit::WebsiteData::Entry::decode):
3016         * Shared/WebsiteData/WebsiteData.h:
3017         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
3018         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
3019         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3020         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
3021         (WebKit::LocalStorageDatabaseTracker::origins):
3022         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3023         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3024         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3025         * UIProcess/WebPageProxy.cpp:
3026         (WebKit::WebPageProxy::exceededDatabaseQuota):
3027         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
3028         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3029         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3030         (WebKit::WebsiteDataStore::fetchData):
3031         (WebKit::WebsiteDataStore::removeData):
3032         (WebKit::WebsiteDataStore::mediaKeyOrigins):
3033         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3034         (WKBundleSetDatabaseQuota):
3035         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3036         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
3037         * WebProcess/Storage/StorageAreaImpl.cpp:
3038         (WebKit::StorageAreaImpl::create):
3039         (WebKit::StorageAreaImpl::StorageAreaImpl):
3040         (WebKit::StorageAreaImpl::securityOrigin):
3041         * WebProcess/Storage/StorageAreaImpl.h:
3042         * WebProcess/Storage/StorageAreaMap.cpp:
3043         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
3044         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
3045         * WebProcess/Storage/StorageAreaMap.h:
3046         (WebKit::StorageAreaMap::securityOrigin):
3047         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3048         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
3049         (WebKit::StorageNamespaceImpl::storageArea):
3050         * WebProcess/Storage/StorageNamespaceImpl.h:
3051         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3052         (WebKit::WebChromeClient::exceededDatabaseQuota):
3053         * WebProcess/WebProcess.cpp:
3054         (WebKit::WebProcess::fetchWebsiteData):
3055
3056 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
3057
3058         [Mac][iOS][WK2] Tighten permissions to change CapsLock delay
3059         https://bugs.webkit.org/show_bug.cgi?id=164725
3060         <rdar://problem/28970910>
3061
3062         Reviewed by Alexey Proskuryakov.
3063
3064         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Limit access
3065         to the IOKit connection that actually needs it.
3066
3067 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
3068
3069         Unreviewed sandbox fix after r208702
3070
3071         Correct version check to avoid breaking users in Safari Technology Preview
3072         or WebKit nightlies.
3073
3074         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3075         * WebProcess/com.apple.WebProcess.sb.in:
3076
3077 2016-11-14  Pranjal Jumde  <pjumde@apple.com>
3078
3079         Keychain access in WebKit should be limited to a single process. Earlier this was blocked on the networking framework requiring direct access to keychain, this will be resolved in the upcoming version of macOS.
3080         https://bugs.webkit.org/show_bug.cgi?id=163710
3081         <rdar://problem/24357468>
3082
3083         Reviewed by Darin Adler.
3084
3085         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3086         * WebProcess/com.apple.WebProcess.sb.in:
3087
3088 2016-11-13  Darin Adler  <darin@apple.com>
3089
3090         Remove many includes of ExceptionCode.h
3091         https://bugs.webkit.org/show_bug.cgi?id=164706
3092
3093         Reviewed by Alex Christensen.
3094
3095         * WebProcess/Storage/StorageAreaImpl.cpp: Removed include of ExceptionCode.h.
3096
3097 2016-11-13  Darin Adler  <darin@apple.com>
3098
3099         Fix exception handling in SQL database code, streamline and update code
3100         https://bugs.webkit.org/show_bug.cgi?id=164685
3101
3102         Reviewed by Sam Weinig.
3103
3104         * UIProcess/API/efl/ewk_database_manager.cpp:
3105         (EwkDatabaseManager::getDatabaseOrigins): Update for change to the
3106         DatabaseTracker::origins function.
3107         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3108         (WebKit::WebsiteDataStore::fetchData): Use DatabaseTracker.
3109         (WebKit::WebsiteDataStore::removeData): Ditto.
3110         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3111         (WKBundleSetDatabaseQuota): Ditto.
3112         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3113         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
3114         * WebProcess/WebProcess.cpp:
3115         (WebKit::WebProcess::processWillSuspendImminently): Ditto.
3116
3117 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
3118
3119         Add a way to get the UI-side scrolling tree as text via UIScriptController
3120         https://bugs.webkit.org/show_bug.cgi?id=164697
3121
3122         Reviewed by Zalan Bujtas.
3123
3124         Add a property to WKWebView to retrieve the scrolling tree as text, for testing.
3125         Expose it via the RemoteScrollingCoordinatorProxy.
3126
3127         * UIProcess/API/Cocoa/WKWebView.mm:
3128         (-[WKWebView _scrollingTreeAsText]):
3129         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3130         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3131         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeAsText):
3132         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3133
3134 2016-11-12  Daniel Bates  <dabates@apple.com>
3135
3136         Incorrect release log message emitted when waiting/not waiting for the WebProcess continue a load
3137         https://bugs.webkit.org/show_bug.cgi?id=164605
3138
3139         Reviewed by Darin Adler.
3140
3141         Currently we emit a release log message of the form "didReceiveResponse: Should wait for
3142         message from WebContent process ..." when we are not waiting for the WebProcess and emit
3143         a message of the form "didReceiveResponse: Should not wait for message from WebContent
3144         process" when we are waiting on the WebProcess. Invert these messages to reflect whether
3145         we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponsewhether.
3146
3147         For the main resource NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::No
3148         because we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponse
3149         to continue the load. For a subresource we do not need to wait for the WebProcess to allow the load to continue
3150         and hence NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::Yes.
3151
3152         * NetworkProcess/NetworkResourceLoader.cpp:
3153
3154 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
3155
3156         [iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
3157         https://bugs.webkit.org/show_bug.cgi?id=164694
3158
3159         Reviewed by Zalan Bujtas.
3160
3161         Rather than calling FrameView directly, call reconcileScrollingState() on the scrolling
3162         coordinator.
3163
3164         * WebProcess/WebPage/ios/WebPageIOS.mm:
3165         (WebKit::WebPage::updateVisibleContentRects):
3166
3167 2016-11-12  Brian Burg  <bburg@apple.com>
3168
3169         Web Automation: terminate the automation session if the web process crashes
3170         https://bugs.webkit.org/show_bug.cgi?id=164671
3171         <rdar://problem/29028964>
3172
3173         Reviewed by Joseph Pecoraro.
3174
3175         * UIProcess/Automation/WebAutomationSession.h:
3176         * UIProcess/Automation/WebAutomationSession.cpp:
3177         (WebKit::WebAutomationSession::disconnect):
3178         (WebKit::WebAutomationSession::terminate):
3179         Factor out code that disconnects the remote, unpairs, and notifies the client.
3180         Then, expose terminate() which can be called without a FrontendChannel.
3181         Calling this causes the _WKAutomationDelegate to clear the local-side session in the
3182         browser, and disconnecting from the remote will hang up the remote-side session.
3183
3184         * UIProcess/WebPageProxy.cpp:
3185         (WebKit::WebPageProxy::processDidCrash):
3186         Terminate the session.
3187
3188 2016-11-11  Alex Christensen  <achristensen@webkit.org>
3189
3190         Use SecurityOriginData as keys in StorageManager
3191         https://bugs.webkit.org/show_bug.cgi?id=159834
3192         <rdar://problem/27346948>
3193
3194         Reviewed by Brady Eidson.
3195
3196         * Platform/IPC/HandleMessage.h:
3197         (IPC::callMemberFunctionImpl):
3198         Add a missing std::forward so we can use this callMemberFunctionImpl with rvalues.
3199         * UIProcess/API/C/WKApplicationCacheManager.cpp:
3200         (WKApplicationCacheManagerGetApplicationCacheOrigins):
3201         (WKApplicationCacheManagerDeleteEntriesForOrigin):
3202         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
3203         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
3204         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
3205         * UIProcess/API/C/WKResourceCacheManager.cpp:
3206         (WKResourceCacheManagerGetCacheOrigins):
3207         (WKResourceCacheManagerClearCacheForOrigin):
3208         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3209         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
3210         * UIProcess/Databases/DatabaseProcessProxy.cpp:
3211         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
3212         * UIProcess/Databases/DatabaseProcessProxy.h:
3213         * UIProcess/Network/NetworkProcessProxy.cpp:
3214         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
3215         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
3216         * UIProcess/Network/NetworkProcessProxy.h:
3217         * UIProcess/Storage/LocalStorageDatabase.cpp:
3218         (WebKit::LocalStorageDatabase::create):
3219         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3220         (WebKit::LocalStorageDatabase::openDatabase):
3221         (WebKit::LocalStorageDatabase::close):
3222         * UIProcess/Storage/LocalStorageDatabase.h:
3223         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3224         (WebKit::LocalStorageDatabaseTracker::databasePath):
3225         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
3226         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
3227         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
3228         (WebKit::LocalStorageDatabaseTracker::origins):
3229         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
3230         * UIProcess/Storage/StorageManager.cpp:
3231         (WebKit::StorageManager::StorageArea::securityOrigin):
3232         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
3233         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
3234         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
3235         (WebKit::StorageManager::StorageArea::StorageArea):
3236         (WebKit::StorageManager::StorageArea::clone):
3237         (WebKit::StorageManager::StorageArea::items):
3238         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
3239         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
3240         (WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
3241         (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
3242         (WebKit::StorageManager::SessionStorageNamespace::origins):
3243         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
3244         (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
3245         (WebKit::StorageManager::getSessionStorageOrigins):
3246         (WebKit::StorageManager::deleteSessionStorageOrigins):
3247         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
3248         (WebKit::StorageManager::getLocalStorageOrigins):
3249         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
3250         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
3251         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
3252         (WebKit::StorageManager::createLocalStorageMap):
3253         (WebKit::StorageManager::createTransientLocalStorageMap):
3254         (WebKit::StorageManager::createSessionStorageMap):
3255         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
3256         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
3257         (WebKit::StorageManager::StorageArea::create): Deleted.
3258         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea): Deleted.
3259         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea): Deleted.
3260         * UIProcess/Storage/StorageManager.h:
3261         * UIProcess/WebProcessProxy.cpp:
3262         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
3263         * UIProcess/WebProcessProxy.h:
3264         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
3265         (WebKit::WebsiteDataRecord::displayNameForOrigin):
3266         (WebKit::WebsiteDataRecord::add):
3267         * UIProcess/WebsiteData/WebsiteDataRecord.h:
3268         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3269         (WebKit::WebsiteDataStore::fetchData):
3270         (WebKit::WebsiteDataStore::removeData):
3271         (WebKit::WebsiteDataStore::mediaKeyOrigins):
3272         (WebKit::WebsiteDataStore::removeMediaKeys):
3273         * UIProcess/WebsiteData/WebsiteDataStore.h:
3274         Fewer SecurityOrigin uses in the UIProcess!  Hooray!
3275
3276 2016-11-11  Ryosuke Niwa  <rniwa@webkit.org>
3277
3278         Hovering over a slotted Text node clears hover state
3279         https://bugs.webkit.org/show_bug.cgi?id=164002
3280         <rdar://problem/29040471>
3281
3282         Reviewed by Simon Fraser.
3283
3284         * WebProcess/WebPage/WebPage.cpp:
3285         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
3286         * WebProcess/WebPage/mac/WebPageMac.mm:
3287         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
3288
3289 2016-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3290
3291         [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
3292         https://bugs.webkit.org/show_bug.cgi?id=164538
3293         <rdar://problem/8418711>
3294
3295         Reviewed by Ryosuke Niwa.
3296
3297         Consult HTMLElement::autocorrect() and HTMLElement::autocapitalizeType() when assembling the assisted node
3298         information for the currently assisted node.
3299
3300         * Shared/AssistedNodeInformation.h:
3301         * UIProcess/ios/WKContentViewInteraction.mm:
3302         (toUITextAutocapitalize):
3303         * WebProcess/WebPage/ios/WebPageIOS.mm:
3304         (WebKit::WebPage::getAssistedNodeInformation):
3305
3306 2016-11-11  Beth Dakin  <bdakin@apple.com>
3307
3308         Move to modern TouchBar methods
3309         https://bugs.webkit.org/show_bug.cgi?id=164655
3310         -and corresponding-
3311         rdar://problem/29226911
3312
3313         Reviewed by Wenson Hsieh.
3314
3315         customizationDefaultItemIdentifiers -> defaultItemIdentifiers
3316         itemIdentifiers -> defaultItemIdentifiers
3317         defaultItems -> templateItems
3318
3319         * UIProcess/Cocoa/WebViewImpl.mm:
3320         (WebKit::plainTextTouchBarDefaultItemIdentifiers):
3321         (WebKit::richTextTouchBarDefaultItemIdentifiers):
3322         (WebKit::WebViewImpl::setUpTextTouchBar):
3323         (WebKit::WebViewImpl::updateTextTouchBar):
3324         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
3325         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
3326
3327 2016-11-11  Brent Fulgham  <bfulgham@apple.com>
3328
3329         Get rid of old sandbox rules for OS's we no longer support
3330         https://bugs.webkit.org/show_bug.cgi?id=164638
3331
3332         Reviewed by Simon Fraser.
3333
3334         Clean up the various sandbox profiles to get rid of rules that applied to operating system
3335         versions we no longer support, or were added in support of bugs that have long since been
3336         fixed.
3337
3338         This should introduce no change in behavior.
3339
3340         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
3341         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3342         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3343         * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
3344         * WebProcess/com.apple.WebProcess.sb.in:
3345
3346 2016-11-11  Brady Eidson  <beidson@apple.com>
3347
3348         IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
3349         https://bugs.webkit.org/show_bug.cgi?id=164641
3350
3351         Reviewed by Alex Christensen.
3352
3353         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3354         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
3355         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
3356         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
3357
3358         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3359         (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
3360         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3361
3362 2016-11-11  Eric Carlson  <eric.carlson@apple.com>
3363
3364         [MediaStream] defer resolution of getUserMedia promise made in a background tab
3365         https://bugs.webkit.org/show_bug.cgi?id=164643
3366         <rdar://problem/29048317>
3367
3368         Reviewed by Brady Eidson.
3369
3370         Do not ask for user for access to capture devices when the document does not
3371         allow media to play, wait until playback is allowed.
3372
3373         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3374         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
3375         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
3376         (WebKit::UserMediaPermissionRequestManager::mediaCanStart):
3377         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension):
3378         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3379         * WebProcess/Plugins/PluginView.cpp:
3380         (WebKit::PluginView::mediaCanStart):
3381         * WebProcess/Plugins/PluginView.h:
3382
3383 2016-11-11  Darin Adler  <darin@apple.com>
3384
3385         Move Node from ExceptionCode to ExceptionOr
3386         https://bugs.webkit.org/show_bug.cgi?id=164515
3387
3388         Reviewed by Sam Weinig.
3389
3390         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
3391         (webkit_dom_html_select_element_remove): Updated exception handling.
3392         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
3393         (webkit_dom_node_insert_before): Ditto.
3394         (webkit_dom_node_replace_child): Ditto.
3395         (webkit_dom_node_remove_child): Ditto.
3396         (webkit_dom_node_append_child): Ditto.
3397         (webkit_dom_node_clone_node_with_error): Ditto.
3398         (webkit_dom_node_set_node_value): Ditto.
3399         (webkit_dom_node_set_text_content): Ditto.
3400         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
3401         (-[WKDOMNode insertNode:before:]): Ditto.
3402         (-[WKDOMNode appendChild:]): Ditto.
3403         (-[WKDOMNode removeChild:]): Ditto.
3404
3405         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
3406         (WebKit::PDFPlugin::PDFPlugin): Removed unneeded ASSERT_NO_EXCEPTION.
3407         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
3408         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Ditto.
3409
3410 2016-11-11  Megan Gardner  <megan_gardner@apple.com>
3411
3412         [Cocoa] Support wide gamut for Drag Image UI
3413         https://bugs.webkit.org/show_bug.cgi?id=164490
3414
3415         Reviewed by Tim Horton.
3416
3417         Fixed an error in the gating for the new wide gamut support in ShareableBitmap.
3418         We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage.
3419         Added support for wide gamut in createCGImage.
3420
3421         * Shared/cg/ShareableBitmapCG.cpp:
3422         (WebKit::bitmapInfo):
3423         (WebKit::colorSpace):
3424         (WebKit::ShareableBitmap::createGraphicsContext):
3425         (WebKit::ShareableBitmap::createCGImage):
3426         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3427         (WebKit::convertImageToBitmap):
3428         (WebKit::WebDragClient::startDrag):
3429
3430 2016-11-11  Beth Dakin  <bdakin@apple.com>
3431
3432         Get touch bar code building for open source builds
3433         https://bugs.webkit.org/show_bug.cgi?id=164610
3434
3435         Reviewed by Wenson Hsieh.
3436