[GTK] Expose WebKitSecurityOrigin API
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-01-03  Michael Catanzaro  <mcatanzaro@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [GTK] Expose WebKitSecurityOrigin API
4         https://bugs.webkit.org/show_bug.cgi?id=166632
5
6         Reviewed by Carlos Garcia Campos.
7
8         This API will be useful to have for various purposes, such as setting initial notification
9         permissions.
10
11         * PlatformGTK.cmake:
12         * UIProcess/API/gtk/WebKitAutocleanups.h:
13         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp: Added.
14         (_WebKitSecurityOrigin::_WebKitSecurityOrigin):
15         (webkitSecurityOriginCreate):
16         (webkit_security_origin_new):
17         (webkit_security_origin_new_for_uri):
18         (webkit_security_origin_ref):
19         (webkit_security_origin_unref):
20         (webkit_security_origin_get_protocol):
21         (webkit_security_origin_get_host):
22         (webkit_security_origin_get_port):
23         (webkit_security_origin_is_opaque):
24         (webkit_security_origin_to_string):
25         * UIProcess/API/gtk/WebKitSecurityOrigin.h: Added.
26         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h: Added.
27         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
28         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
29         * UIProcess/API/gtk/webkit2.h:
30
31 2017-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
32
33         [SOUP] Load options allowStoredCredentials = DoNotAllowStoredCredentials with clientCredentialPolicy = MayAskClientForCredentials doesn't work
34         https://bugs.webkit.org/show_bug.cgi?id=164471
35
36         Reviewed by Michael Catanzaro.
37
38         When DoNotAllowStoredCredentials is used we disable the SoupAuthManager feature for the message, but that
39         disables all HTTP authentication, causing the load to always fail with Authorization required even when
40         clientCredentialPolicy allows to ask the user for credentials. The problem is that even if we don't use the
41         WebCore credentials for that request, libsoup will always use its internal cache of SoupAuth if we enable the
42         SoupAuthManager feature. Libsoup 2.57.1 has new API to disable the use of cached credentials for a particular
43         message, adding the new message flag SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE.
44
45         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
46         (WebKit::NetworkDataTaskSoup::createRequest): Set SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE flag to disable cached
47         credentials for the message if libsoup >= 2.57.1 is used.
48
49 2017-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
50
51         [GTK] HTTP auth layout tests are flaky
52         https://bugs.webkit.org/show_bug.cgi?id=158919
53
54         Reviewed by Michael Catanzaro.
55
56         Implement NetworkSession::clearCredentials() for soup using the new libsoup API when available.
57
58         * NetworkProcess/soup/NetworkSessionSoup.cpp:
59         (WebKit::NetworkSessionSoup::clearCredentials):
60         * NetworkProcess/soup/NetworkSessionSoup.h:
61
62 2017-01-01  Jeff Miller  <jeffm@apple.com>
63
64         Update user-visible copyright strings to include 2017
65         https://bugs.webkit.org/show_bug.cgi?id=166278
66
67         Reviewed by Dan Bernstein.
68
69         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist:
70         * Info.plist:
71         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist:
72         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
73         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
74         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist:
75         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
76         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist:
77         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
78         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
79
80 2016-12-30  Darin Adler  <darin@apple.com>
81
82         Remove PassRefPtr use from the "dom" directory, related cleanup
83         https://bugs.webkit.org/show_bug.cgi?id=166569
84
85         Reviewed by Alex Christensen.
86
87         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
88         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): Updated to use struct.
89         (WebKit::WebFrameLoaderClient::updateGlobalHistory): Ditto.
90         (WebKit::WebFrameLoaderClient::setTitle): Ditto.
91
92 2016-12-27  Alex Christensen  <achristensen@webkit.org>
93
94         reduce PassRefPtr use in WebKit2
95         https://bugs.webkit.org/show_bug.cgi?id=166452
96
97         Reviewed by Yusuke Suzuki.
98
99         * Shared/API/c/cg/WKImageCG.cpp:
100         (WKImageCreateCGImage):
101         (WKImageCreateFromCGImage):
102         * Shared/ShareableBitmap.cpp:
103         (WebKit::ShareableBitmap::createHandle):
104         * Shared/ShareableBitmap.h:
105         * Shared/UserData.cpp:
106         (WebKit::UserData::encode):
107         (WebKit::UserData::decode):
108         * Shared/WebImage.cpp:
109         (WebKit::WebImage::create):
110         (WebKit::WebImage::WebImage):
111         * Shared/WebImage.h:
112         (WebKit::WebImage::bitmap):
113         * UIProcess/WebPageProxy.cpp:
114         (WebKit::WebPageProxy::didGetImageForFindMatch):
115         * UIProcess/mac/WKTextFinderClient.mm:
116         (-[WKTextFinderClient didGetImageForMatchResult:]):
117         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
118         (WebKit::WebAutomationSessionProxy::takeScreenshot):
119         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
120         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]):
121         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
122         (WebKit::imageForRect):
123         (WebKit::InjectedBundleNodeHandle::renderedImage):
124         (WebKit::InjectedBundleNodeHandle::visibleRange):
125         (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
126         (WebKit::InjectedBundleNodeHandle::documentFrame):
127         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
128         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
129         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
130         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
131         (WebKit::InjectedBundleRangeHandle::renderedImage):
132         * WebProcess/WebPage/WebPage.cpp:
133         (WebKit::WebPage::takeSnapshot):
134         (WebKit::WebPage::snapshotAtSize):
135         (WebKit::WebPage::snapshotNode):
136         (WebKit::WebPage::drawRectToImage):
137         * WebProcess/WebPage/ios/WebPageIOS.mm:
138         (WebKit::WebPage::getPositionInformation):
139         * WebProcess/WebPage/mac/WebPageMac.mm:
140         (WebKit::WebPage::setTopOverhangImage):
141         (WebKit::WebPage::setBottomOverhangImage):
142
143 2016-12-27  Emanuele Aina  <emanuele.aina@collabora.com>
144
145         Ensure NetworkProcess is ready before whitelisting TLS certificates
146         https://bugs.webkit.org/show_bug.cgi?id=162962
147
148         Reviewed by Alex Christensen.
149
150         If the API user tries to whitelist TLS certificates before any web
151         view has been created, the action will be ignored because the
152         NetworkProcess hasn't been fired up yet.
153
154         For example, the snippet below using the GTK+ API does not work,
155         unless the whitelisting is moved after the web view creation:
156
157           webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host);
158           webView = webkit_web_view_new();
159
160         * UIProcess/WebProcessPool.cpp:
161         (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost): Ensure
162         that the NetworkProcess has been already fired up when adding
163         certificates, so they can be whitelisted before the first web view is
164         instantiated.
165
166 2016-12-25  Yusuke Suzuki  <utatane.tea@gmail.com>
167
168         Propagate the source origin as much as possible
169         https://bugs.webkit.org/show_bug.cgi?id=166348
170
171         Reviewed by Darin Adler.
172
173         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
174         (WebKit::NPRuntimeObjectMap::evaluate):
175
176 2016-12-22  Andy Estes  <aestes@apple.com>
177
178         Reduce QuickLook.h include overhead
179         https://bugs.webkit.org/show_bug.cgi?id=166454
180
181         Reviewed by Andreas Kling.
182
183         * WebProcess/Network/WebLoaderStrategy.cpp: Included QuickLook.h for QLPreviewProtocol().
184         * WebProcess/Network/WebResourceLoader.cpp: Included QuickLook.h for QuickLookHandle.
185         * WebProcess/Network/WebResourceLoader.h: Stopped including QuickLook.h.
186
187 2016-12-22  Tim Horton  <timothy_horton@apple.com>
188
189         Null deref under WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground
190         https://bugs.webkit.org/show_bug.cgi?id=166433
191         <rdar://problem/29732407>
192
193         Reviewed by Daniel Bates.
194
195         * UIProcess/ios/WebPageProxyIOS.mm:
196         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
197         m_drawingArea can be null if the process is not valid.
198
199 2016-12-22  Andy Estes  <aestes@apple.com>
200
201         Make WebCore::EditorInsertAction an enum class
202         https://bugs.webkit.org/show_bug.cgi?id=166424
203
204         Reviewed by Brent Fulgham.
205
206         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
207         (WebKit::toAPI):
208         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
209         (toWK):
210
211 2016-12-22  Zhuo Li  <zachli@apple.com>
212
213         [Cocoa] SPI for setloadsImagesAutomatically
214         https://bugs.webkit.org/show_bug.cgi?id=166401
215
216         Reviewed by Darin Adler.
217
218         * UIProcess/API/Cocoa/WKPreferences.mm: Call the C API under the hood.
219         (-[WKPreferences _loadsImagesAutomatically]):
220         (-[WKPreferences _setLoadsImagesAutomatically:]):
221
222         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
223         Add `_loadsImagesAutomatically` property.
224
225 2016-12-22  Eric Carlson  <eric.carlson@apple.com>
226
227         AVPlayerLayer isn't available on every system
228         https://bugs.webkit.org/show_bug.cgi?id=166399
229
230         Reviewed by Jer Noble.
231
232         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: Use SOFT_LINK_CLASS_OPTIONAL.
233
234 2016-12-22  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
235
236         MediaStream: ASSERTION FAILED: m_ids.size() == m_handles.size() in MediaDeviceSandboxExtensions
237         https://bugs.webkit.org/show_bug.cgi?id=166328
238
239         Reviewed by Eric Carlson.
240
241         This assertion failure happens for ports with sandbox extensions disabled. SandboxExtension is empty and
242         HandleArray:size() always returns 0. Disable creation of MediaDevicesSandboxExtension in UserMediaProcessManager
243         when building without support of sandbox extension. Disable also WebPage::grantUserMediaDeviceSandboxExtensions
244         and WebPage::revokeUserMediaDeviceSandboxExtensions which can be avoided when sandbox extension is empty.
245
246         * UIProcess/UserMediaProcessManager.cpp:
247         (WebKit::UserMediaProcessManager::willCreateMediaStream):
248         (WebKit::UserMediaProcessManager::endedCaptureSession):
249         * WebProcess/WebPage/WebPage.cpp:
250         * WebProcess/WebPage/WebPage.h:
251         * WebProcess/WebPage/WebPage.messages.in:
252
253 2016-12-22  Alejandro G. Castro  <alex@igalia.com>
254
255         [WebRTC] Add support for runtime PeeConnection setting, required after r209757
256         https://bugs.webkit.org/show_bug.cgi?id=166346
257
258         Reviewed by Carlos Garcia Campos.
259
260         After that commit we have to enable the peerConnection runtime
261         flag if we want webrtc to work. We are not adding a new API for
262         the moment to control the peerConnection feature.
263
264         * UIProcess/API/gtk/WebKitSettings.cpp:
265         (webkit_settings_set_enable_media_stream): Use the mediaStream
266         setting to control the peerConnection
267
268 2016-12-21  Brent Fulgham  <bfulgham@apple.com>
269
270         [Mac][WK2] Stop using file* rules in WebProcess sandbox profiles
271         https://bugs.webkit.org/show_bug.cgi?id=165824
272         <rdar://problem/14024823>
273
274         Reviewed by Alexey Proskuryakov
275
276         Switch from blanket 'file*' sandbox rules, to the specific 'file-read*' and 'file-write*' rules
277         we actually need.
278
279         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
280         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
281         * WebProcess/com.apple.WebProcess.sb.in:
282
283 2016-12-21  Beth Dakin  <bdakin@apple.com>
284
285         Holding down on candidates in the TouchBar should show panel on screen
286         https://bugs.webkit.org/show_bug.cgi?id=166367
287         -and corresponding-
288         <rdar://problem/28479236>
289
290         Reviewed by Tim Horton.
291
292         The showCandidates() helper function is not needed. We can call the AppKit method 
293         directly at the one call site.
294         * UIProcess/Cocoa/WebViewImpl.h:
295         * UIProcess/Cocoa/WebViewImpl.mm:
296
297         The panel should appear under the selection, so offset the selection rect.
298         (WebKit::WebViewImpl::handleRequestedCandidates):
299
300         No more showCandidates() since we can call it directly. 
301         (WebKit::WebViewImpl::showCandidates): Deleted.
302
303 2016-12-20  Taras Tsugrii  <ttsugrii@fb.com>
304
305         Fix undefined behavior caused by macro expansion producing 'defined'
306         https://bugs.webkit.org/show_bug.cgi?id=166047
307
308         Reviewed by Darin Adler.
309
310         * Shared/API/Cocoa/WKFoundation.h:
311
312 2016-12-20  Brent Fulgham  <bfulgham@apple.com>
313
314         Address some style problems found by static analysis
315         https://bugs.webkit.org/show_bug.cgi?id=165975
316
317         Reviewed by Alex Christensen.
318
319         Avoid passing large ANGLE data structures through the ANGLEWebKitBridge methods.
320
321         * Shared/WebBackForwardListItem.cpp:
322         (WebKit::WebBackForwardListItem::create):
323         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
324         * Shared/WebBackForwardListItem.h:
325
326 2016-12-20  Simon Fraser  <simon.fraser@apple.com>
327
328         [iOS WK2] Switching or closing a tab leads to all-white tab content if the status bar is double height
329         https://bugs.webkit.org/show_bug.cgi?id=166286
330         rdar://problem/29593525
331
332         Reviewed by Tim Horton.
333
334         A double-height status bar triggers view resize while snapshotting in the background,
335         which also triggers calls to _endAnimatedResize on tab resume. However, it was possible
336         for _endAnimatedResize to re-enter via synchronizeDynamicViewportUpdate()/didCommitLayerTree(),
337         causing us to use a nil _resizeAnimationView for scale computations, thus setting a zero
338         scale on the WKContentView.
339
340         Fix by checking _dynamicViewportUpdateMode again after the call to synchronizeDynamicViewportUpdate(),
341         and do a belt-and-braces check for a nil _resizeAnimationView.
342
343         * UIProcess/API/Cocoa/WKWebView.mm:
344         (-[WKWebView _endAnimatedResize]):
345
346 2016-12-20  Andy Estes  <aestes@apple.com>
347
348         [Cocoa] REGRESSION (r209558): Calling decisionHandler multiple times in webView:decidePolicyForNavigationAction:decisionHandler: leads to a crash
349         https://bugs.webkit.org/show_bug.cgi?id=165992
350         <rdar://problem/29693817>
351
352         Reviewed by Brady Eidson.
353
354         r209558 added additional move semantics to the decisionHandler block passed to
355         -webView:decidePolicyForNavigationAction:decisionHandler:, resulting in a null pointer
356         dereference in clients that call the decisionHandler block more than once.
357
358         None of the completion handlers we expose in the WebKit API are intended to be called more
359         than once, and we ASSERT in CompletionHandlerCallChecker::didCallCompletionHandler() that
360         this doesn't happen.
361
362         This change strenghtens that protection by returning immediately in completion handlers
363         called more than once. And in programs linked on or after WebKit 603.1.17, an NSException is
364         thrown if a completion handler is called a second time, like we do for completion handlers
365         that are never called.
366
367         New API test: WebKit2.DuplicateCompletionHandlerCalls
368
369         * Shared/Cocoa/CompletionHandlerCallChecker.h: Declared completionHandlerHasBeenCalled().
370         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
371         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): Added. Returns true if the
372         program is linked on or after
373         LibraryVersion::FirstWithExceptionsForDuplicateCompletionHandlerCalls.
374         (WebKit::CompletionHandlerCallChecker::completionHandlerHasBeenCalled): Added. Returns
375         whether or not the completion handler has been called. If it has, and
376         shouldThrowExceptionForDuplicateCompletionHandlerCall() returns true, throws an
377         NSInternalInconsistencyException.
378         * UIProcess/API/Cocoa/WKWebView.mm:
379         (-[WKWebView _setInputDelegate:]): Added an early return if the completion handler has
380         already been called.
381         * UIProcess/Cocoa/NavigationState.mm:
382         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): Ditto.
383         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): Ditto.
384         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): Ditto.
385         * UIProcess/Cocoa/UIDelegate.mm:
386         (WebKit::UIDelegate::UIClient::runJavaScriptAlert): Ditto.
387         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): Ditto.
388         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): Ditto.
389         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Ditto.
390         (WebKit::UIDelegate::UIClient::runOpenPanel): Ditto.
391         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Ditto.
392         * UIProcess/Cocoa/VersionChecks.h: Added
393         FirstWithExceptionsForDuplicateCompletionHandlerCalls with the version number for 603.1.17.
394
395 2016-12-20  Dean Jackson  <dino@apple.com>
396
397         Remove INDIE_UI
398         https://bugs.webkit.org/show_bug.cgi?id=165881
399         <rdar://problem/29672532>
400
401         Reviewed by Simon Fraser.
402
403         The Indie UI work has been discontinued.
404
405         * Configurations/FeatureDefines.xcconfig:
406
407 2016-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
408
409         Implement the updated port/area-based Scroll Snap Module Level 1 Spec
410         https://bugs.webkit.org/show_bug.cgi?id=165317
411         <rdar://problem/29490956>
412
413         Reviewed by Dean Jackson.
414
415         Remove unused code for adopting scroll snapping in the PDF plugin.
416
417         * WebProcess/Plugins/PDF/PDFPlugin.mm:
418         (WebKit::PDFPlugin::didCalculateSizes):
419
420 2016-12-19  Yusuke Suzuki  <utatane.tea@gmail.com>
421
422         [ES6] Enable ES6 Modules
423         https://bugs.webkit.org/show_bug.cgi?id=165849
424
425         Reviewed by Geoffrey Garen.
426
427         * Shared/WebPreferencesDefinitions.h:
428         * UIProcess/API/C/WKPreferences.cpp:
429         (WKPreferencesSetES6ModulesEnabled): Deleted.
430         (WKPreferencesGetES6ModulesEnabled): Deleted.
431         * UIProcess/API/C/WKPreferencesRefPrivate.h:
432         * WebProcess/InjectedBundle/InjectedBundle.cpp:
433         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
434         * WebProcess/WebPage/WebPage.cpp:
435         (WebKit::WebPage::updatePreferences):
436
437 2016-12-19  Keith Rollin  <krollin@apple.com>
438
439         Fix unwanted deletion of record/replay files
440         https://bugs.webkit.org/show_bug.cgi?id=166040
441
442         Reviewed by Alex Christensen.
443
444         As part of some refactoring, the objects that create the meta files
445         that are part of the record/replay cache would get deleted. They were
446         always getting opened in "write" mode", which would truncate the
447         files. Fix this so that the files are opened in the right modes for
448         record, replay, and neither.
449
450         * NetworkProcess/capture/NetworkCaptureManager.cpp:
451         (WebKit::NetworkCapture::Manager::initialize):
452
453 2016-12-19  Gavin Barraclough  <barraclough@apple.com>
454
455         [CSS Parser] Enable CSS Deferred Parsing
456         https://bugs.webkit.org/show_bug.cgi?id=165869
457
458         Unreviewed rollout – looks like this regressed performance.
459
460         * Shared/WebPreferencesDefinitions.h:
461
462 2016-12-19  Anders Carlsson  <andersca@apple.com>
463
464         REGRESSION: Crash in com.apple.WebKit:IPC::Connection::platformCanSendOutgoingMessages() const + 0
465         https://bugs.webkit.org/show_bug.cgi?id=165817
466         rdar://problem/29626731
467
468         Reviewed by Dan Bernstein.
469
470         If the receive right is invalidated before we send the message, the kernel won't be able to create a send right,
471         and we'll crash due to mach_msg returning MACH_SEND_INVALID_RIGHT.
472         
473         Fix this by immediately creating a send right, and passing MACH_MSG_TYPE_MOVE_SEND to the attachment constructor.
474
475         * WebProcess/WebPage/WebInspector.cpp:
476         (WebKit::WebInspector::openFrontendConnection):
477
478 2016-12-18  Simon Fraser  <simon.fraser@apple.com>
479
480         Expose a way for MiniBrowser to simulate header and footer banners
481         https://bugs.webkit.org/show_bug.cgi?id=166005
482
483         Reviewed by Wenson Hsieh.
484         
485         Expose testing SPI that allows a client to simulate the presence of header
486         and footer banners. These are simply plumbed through to set FrameView's
487         m_headerHeight and m_footerHeight.
488
489         * UIProcess/API/Cocoa/WKWebView.mm:
490         (-[WKWebView _setHeaderBannerHeightForTesting:]):
491         (-[WKWebView _setFooterBannerHeightForTesting:]):
492         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
493         * UIProcess/WebPageProxy.cpp:
494         (WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
495         (WebKit::WebPageProxy::setFooterBannerHeightForTesting):
496         * UIProcess/WebPageProxy.h:
497         * WebProcess/WebPage/WebPage.cpp:
498         (WebKit::WebPage::setHeaderBannerHeightForTesting):
499         (WebKit::WebPage::setFooterBannerHeightForTesting):
500         * WebProcess/WebPage/WebPage.h:
501         * WebProcess/WebPage/WebPage.messages.in:
502
503 2016-12-16  Dave Hyatt  <hyatt@apple.com>
504
505         [CSS Values] Make separate wrapper classes for the deprecated CSS Values OM
506         https://bugs.webkit.org/show_bug.cgi?id=165968
507
508         Reviewed by Andreas Kling.
509
510         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
511         (WebKit::kit):
512         (WebKit::core):
513         (WebKit::wrapCSSValue):
514         (webkit_dom_css_value_constructor):
515         (webkit_dom_css_value_get_css_text):
516         (webkit_dom_css_value_set_css_text):
517         (webkit_dom_css_value_get_css_value_type):
518         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
519
520 2016-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
521
522         Visual viewports: bottom fixed elements disappear behind the keyboard
523         https://bugs.webkit.org/show_bug.cgi?id=165983
524         <rdar://problem/29409852>
525
526         Reviewed by Simon Fraser.
527
528         Accounts for input view bounds in WebPageProxy::computeCustomFixedPositionRect. To do this, we introduce and
529         pass unobscuredContentRectRespectingInputViewBounds along with the regular unobscuredContentRect (which does not
530         respect the obscuring keyboard rect). This unobscuredContentRectRespectingInputViewBounds is then used when
531         computing the origin of the updated layout viewport rect (and also, when we are _not_ below minimum scale),
532         
533         Additionally, the size is computed using the (unconstrained) unobscured rect. This is because we previously
534         would use the document-constrained version of the unobscured rect, which caused the layout viewport to shrink
535         when approaching the max scroll extents of the document while the keyboard is up, since the unobscured rect
536         would spill out of the document rect. However, using this unconstrained rect's size also means that if the user
537         rubber-bands out of the document rect, we would end up pushing the layout viewport rect out of the document,
538         with no way of adjusting it back in without the user scrolling to push the layout viewport into back document
539         bounds. To address this, we move the layout rect to be within document bounds after computing its size and
540         location.
541
542         Added a new layout test: fast/visual-viewport/ios/fixed-element-on-bottom-with-keyboard.html, and also tweaked
543         fixed-caret-position-after-scroll.html to cover these changes.
544
545         * Shared/VisibleContentRectUpdateInfo.cpp:
546         (WebKit::operator<<):
547         * Shared/VisibleContentRectUpdateInfo.h:
548         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
549         (WebKit::VisibleContentRectUpdateInfo::unobscuredContentRectRespectingInputViewBounds):
550         * UIProcess/API/Cocoa/WKWebView.mm:
551         (-[WKWebView _updateContentRectsWithState:]):
552         (-[WKWebView _inputViewBounds]):
553
554         Returns the current bounds of the input view. For testing purposes.
555
556         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
557         * UIProcess/WebPageProxy.h:
558         (WebKit::WebPageProxy::unobscuredContentRectRespectingInputViewBounds):
559         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
560         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
561         * UIProcess/ios/WKContentView.h:
562         * UIProcess/ios/WKContentView.mm:
563         (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):
564
565         Helper to compute the unobscured rect, accounting for the bounds of the current input view.
566
567         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
568         (-[WKContentView _didCommitLayerTree:]):
569         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
570         * UIProcess/ios/WebPageProxyIOS.mm:
571         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
572         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
573         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
574
575 2016-12-16  Ryosuke Niwa  <rniwa@webkit.org>
576
577         Deleting a character converted from pinyin after an image causes a Safari crash
578         https://bugs.webkit.org/show_bug.cgi?id=165839
579
580         Reviewed by Darin Adler.
581
582         The crash was caused by the payload of the IPC not being decoded correctly when the encoded attributed string
583         contains a NSTextAttachment but send<> would still gladly send it to the UIProcess.
584
585         Fixed it by omitting the image as done in r176412 since encoding NSFileWrapper, etc... would require
586         quite a bit of work, and IME doesn't really need to see the image in its attributed string.
587
588         * WebProcess/WebPage/mac/WebPageMac.mm:
589         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync): Fixed the bug.
590
591 2016-12-16  Andy Estes  <aestes@apple.com>
592
593         Add a setting to suppress keyboard input during provisional navigation
594         https://bugs.webkit.org/show_bug.cgi?id=165830
595
596         Reviewed by Brent Fulgham.
597
598         * Shared/WebPreferencesDefinitions.h: Defined
599         shouldSuppressKeyboardDOMEventsDuringProvisionalNavigation.
600         * UIProcess/API/C/WKPreferences.cpp:
601         (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
602         (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
603         * UIProcess/API/C/WKPreferencesRefPrivate.h: Declared a getter and setter for the new
604         preference.
605         * UIProcess/API/Cocoa/WKPreferences.mm:
606         (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]): Added.
607         (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]): Added.
608         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared a property for the new preference.
609         * WebProcess/WebPage/WebPage.cpp:
610         (WebKit::WebPage::updatePreferences): Mapped the new preference to its corresponding
611         WebCore::Setting.
612
613 2016-12-16  Chris Dumez  <cdumez@apple.com>
614
615         HTML form validation bubble should be dismissed on navigation
616         https://bugs.webkit.org/show_bug.cgi?id=165960
617         <rdar://problem/29668086>
618
619         Reviewed by Simon Fraser.
620
621         Dismiss HTML form validation bubble on top-level navigation on WK2.
622
623         * UIProcess/WebPageProxy.cpp:
624         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
625
626 2016-12-16  Jer Noble  <jer.noble@apple.com>
627
628         Small refactor: Use HashCountedSet rather than HashMap<..., int> to store client counts in WebPlaybackSessionManager{,Proxy}.
629         https://bugs.webkit.org/show_bug.cgi?id=165807
630
631         Reviewed by Eric Carlson.
632
633         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
634         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
635         (WebKit::WebPlaybackSessionManagerProxy::addClientForContext):
636         (WebKit::WebPlaybackSessionManagerProxy::removeClientForContext):
637         * WebProcess/cocoa/WebPlaybackSessionManager.h:
638         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
639         (WebKit::WebPlaybackSessionManager::addClientForContext):
640         (WebKit::WebPlaybackSessionManager::removeClientForContext):
641
642 2016-12-16  Wenson Hsieh  <wenson_hsieh@apple.com>
643
644         Visual viewports: carets and selection UI are incorrectly positioned when editing fixed elements
645         https://bugs.webkit.org/show_bug.cgi?id=165767
646         <rdar://problem/29602382>
647
648         Reviewed by Simon Fraser.
649
650         When focusing an input, the position of the caret on iOS is determined by the overridden layout viewport rect in
651         the web process. However, this rect is not updated until the end the scroll gesture. Whereas this is fine for
652         non-fixed inputs since their document location does not change, fixed inputs effectively change their position
653         in the document as the user scrolls. This causes the caret to be 'left behind' in the document position it was
654         in at the start of the scroll. To fix this, we deactivate the selection when exiting stable state if the
655         assisted node is in a fixed position container, and reenable it upon receiving the next stable state EditorState
656         update (as indicated by postLayoutData().isStableStateUpdate). Additionally, we apply similar treatment to the
657         web selection assistant -- this time, we need to force the selection view to hide (analagous to deactivating
658         the text selection assistant) and show it again upon receiving the next selection change update when the WebPage
659         (in the web process) is stable.
660
661         Furthermore, adds test support for querying text caret and selection rects, as well as perform a callback after
662         the WebPage has indicated that it is stable, both as SPI on the WKWebView.
663
664         Covered by 4 new layout tests in fast/editing/caret/ios and fast/editing/selection/ios.
665
666         * Platform/spi/ios/UIKitSPI.h:
667         * Shared/EditorState.cpp:
668         (WebKit::EditorState::PostLayoutData::encode):
669         (WebKit::EditorState::PostLayoutData::decode):
670         * Shared/EditorState.h:
671
672         Introduce isStableStateUpdate, which is true when the WebPage is known to be in stable state, as well as
673         insideFixedPosition, which is true when the current selection is inside a fixed position container.
674
675         * Shared/mac/RemoteLayerTreeTransaction.h:
676         (WebKit::RemoteLayerTreeTransaction::isInStableState):
677         (WebKit::RemoteLayerTreeTransaction::setIsInStableState):
678         * Shared/mac/RemoteLayerTreeTransaction.mm:
679         (WebKit::RemoteLayerTreeTransaction::encode):
680         (WebKit::RemoteLayerTreeTransaction::decode):
681         (WebKit::RemoteLayerTreeTransaction::description):
682         * UIProcess/API/Cocoa/WKWebView.mm:
683         (-[WKWebView _didCommitLayerTree:]):
684         (-[WKWebView _uiTextCaretRect]):
685
686         Introduced a new SPI method for fetching the current rect of the text assistant's caret view, at keyPath
687         "selectionView.selection.caretRect".
688
689         (-[WKWebView _uiTextSelectionRects]):
690
691         Renamed (and refactored) from _uiTextSelectionRectViews, which was previously fetching an array of UIViews. I
692         found this to cause character-granularity-rect.html to fail due to the array of UIViews here being empty, so I
693         refactored this to simply return an array of rects from the keyPath "selectionView.selection.selectionRects" for
694         the text selection assistant and @"selectionView.selectionRects" for the web selection assistant.
695
696         (-[WKWebView _doAfterNextStablePresentationUpdate:]):
697
698         Runs the given block after both the UI process and web processes agree that the visible content rect state is 
699         stable. To do this, we fire presentation updates until the UI process (via RemoteLayerTreeTransactions)
700         discovers that the web page is in stable state. This is used solely for testing purposes.
701
702         (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
703         (-[WKWebView _uiTextSelectionRectViews]): Deleted.
704         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
705         * UIProcess/WebPageProxy.h:
706         (WebKit::WebPageProxy::inStableState):
707         * UIProcess/ios/WKContentView.mm:
708         (-[WKContentView _didExitStableState]):
709
710         Deactivate the text selection if the assisted node is inside a fixed container.
711
712         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
713         * UIProcess/ios/WKContentViewInteraction.h:
714         * UIProcess/ios/WKContentViewInteraction.mm:
715         (-[WKContentView setupInteraction]):
716         (-[WKContentView cleanupInteraction]):
717         (-[WKContentView shouldHideSelectionWhenScrolling]):
718         (-[WKContentView _uiTextSelectionRects]):
719         (-[WKContentView _didEndScrollingOrZooming]):
720         (-[WKContentView _updateChangedSelection:]):
721
722         If the EditorState was created after a stable state update, reactivate the text selection assistant if it exists.
723         Additionally, if we are deferring the end scrolling selection update until after the first stable editor state
724         update arrives from the web process, we need to also call [_textSelectionAssistant didEndScrollingOverflow]
725         and [_webSelectionAssistant didEndScrollingOrZoomingPage] here instead of doing so immediately after scrolling
726         finishes. This ensures that selection UI (the callout and selection highlights) do not flicker from their old
727         position to the new position when scrolling finishes.
728
729         * WebProcess/WebPage/WebPage.cpp:
730         (WebKit::WebPage::willCommitLayerTree):
731         * WebProcess/WebPage/ios/WebPageIOS.mm:
732         (WebKit::WebPage::platformEditorState):
733         (WebKit::WebPage::updateVisibleContentRects):
734
735         When updating the layout viewport override rect, also recompute the caret if needed and send an updated
736         EditorState over to the UI process.
737
738 2016-12-16  Claudio Saavedra  <csaavedra@igalia.com>
739
740         [WK2] SharedMemory: include cleanups
741         https://bugs.webkit.org/show_bug.cgi?id=165950
742
743         Reviewed by Žan Doberšek.
744
745         The WTFString include is not needed in the header, so move to the
746         Unix file. Use the existing UNIX_DOMAIN_SOCKETS define. Also
747         include the WTFOptional header where needed.
748
749         * Platform/SharedMemory.h:
750         * Platform/unix/SharedMemoryUnix.cpp:
751
752 2016-12-16  Joonghun Park  <jh718.park@samsung.com>
753
754         [EFL] Fix build break since r209907. Unreviewed.
755         https://bugs.webkit.org/show_bug.cgi?id=165954
756
757         * UIProcess/efl/TextCheckerEfl.cpp: Change the remaining TextBreakIterator to UBreakIterator
758         (WebKit::nextWordOffset):
759         (WebKit::TextChecker::checkTextOfParagraph):
760
761 2016-12-15  Darin Adler  <darin@apple.com>
762
763         Use asString instead of toWTFString, toString, or getString when we already checked isString
764         https://bugs.webkit.org/show_bug.cgi?id=165895
765
766         Reviewed by Yusuke Suzuki.
767
768         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
769         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): Use asString/value instead of toWTFString.
770
771 2016-12-15  Chris Dumez  <cdumez@apple.com>
772
773         Make sure HTML validation bubble's state is updated after layout
774         https://bugs.webkit.org/show_bug.cgi?id=165922
775         <rdar://problem/29694730>
776
777         Reviewed by Simon Fraser.
778
779         Make sure HTML validation bubble's state is updated after layout.
780         In particular, if the validation bubble's associated element has
781         moved or is no longer visible, we now hide the bubble.
782
783         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
784         (WebKit::WebValidationMessageClient::showValidationMessage):
785         (WebKit::WebValidationMessageClient::hideValidationMessage):
786         (WebKit::WebValidationMessageClient::updateValidationBubbleStateIfNeeded):
787         * WebProcess/WebCoreSupport/WebValidationMessageClient.h:
788
789 2016-12-15  Alex Christensen  <achristensen@webkit.org>
790
791         Improve NetworkSession logging
792         https://bugs.webkit.org/show_bug.cgi?id=165941
793
794         Reviewed by Tim Horton.
795
796         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
797         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
798         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
799         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
800         One of the "didReceiveResponse completionHandler (cancel)" messages was wrong,
801         and other messages could have more useful information without being overwhelming.
802
803 2016-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
804
805         Sort Xcode project files
806         https://bugs.webkit.org/show_bug.cgi?id=165937
807
808         Reviewed by Simon Fraser.
809
810         * WebKit2.xcodeproj/project.pbxproj:
811
812 2016-12-15  Anders Carlsson  <andersca@apple.com>
813
814         Add more mach_msg logging instrumentation
815         https://bugs.webkit.org/show_bug.cgi?id=165914
816
817         Reviewed by Darin Adler.
818
819         * Platform/IPC/mac/ConnectionMac.mm:
820         (IPC::Connection::sendMessage):
821         (IPC::Connection::sendOutgoingMessage):
822         * Platform/IPC/mac/MachMessage.h:
823         (IPC::MachMessage::messageName):
824         (IPC::MachMessage::setMessageName):
825
826 2016-12-15  Konstantin Tokarev  <annulen@yandex.ru>
827
828         Added missing override and final specifiers
829         https://bugs.webkit.org/show_bug.cgi?id=165903
830
831         Reviewed by Darin Adler.
832
833         * UIProcess/API/gtk/WebKitGeolocationProvider.h:
834         * UIProcess/WebFormSubmissionListenerProxy.h:
835         * UIProcess/WebFramePolicyListenerProxy.h:
836         * WebProcess/Automation/WebAutomationSessionProxy.h:
837         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.h:
838         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
839         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
840         * WebProcess/WebCoreSupport/WebPlugInClient.h:
841         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
842         * WebProcess/WebPage/FindController.h:
843
844 2016-12-15  Simon Fraser  <simon.fraser@apple.com>
845
846         [iOS WK2] Don't disable position:fixed when a form element has focus
847         https://bugs.webkit.org/show_bug.cgi?id=165891
848         rdar://problem/29271694
849
850         Reviewed by Wenson Hsieh.
851
852         Before visual viewports, we had to lay out position:fixed relative to the document rect (effectively
853         disabling position:fixed) when a form element was focused, to ensure that we could scroll to inputs
854         inside position:Fixed.
855
856         When visual viewports are enabled, we can do a better job of this, and keep position:fixed active.
857         
858         Test: fast/visual-viewport/ios/zoomed-focus-in-fixed.html
859
860         * UIProcess/API/Cocoa/WKWebView.mm: 
861         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Soon this will use
862         insideFixed to have better scroll-into-view behavior.
863         (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
864         * UIProcess/API/Cocoa/WKWebViewInternal.h:
865         * UIProcess/ios/WKContentView.h:
866         * UIProcess/ios/WKContentView.mm:
867         (-[WKContentView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
868         (-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
869         * UIProcess/ios/WKContentViewInteraction.mm:
870         (-[WKContentView _displayFormNodeInputView]):
871         * UIProcess/ios/WebPageProxyIOS.mm:
872         (WebKit::WebPageProxy::computeCustomFixedPositionRect): Don't fall back to using the documentRect as the fixed
873         position rect if visual viewports are enabled.
874         * WebProcess/WebPage/ios/WebPageIOS.mm:
875         (WebKit::WebPage::getAssistedNodeInformation): Don't reset the customtFixedPositionRect around computing element
876         coordinates if visual viewports are enabled.
877
878 2016-12-15  Andreas Kling  <akling@apple.com>
879
880         Always clear RenderLayer backing stores when going into page cache.
881         <https://webkit.org/b/165901>
882
883         Reviewed by Simon Fraser.
884
885         * WebProcess/WebProcess.cpp:
886         (WebKit::WebProcess::WebProcess):
887
888 2016-12-15  Darin Adler  <darin@apple.com>
889
890         Remove custom binding for MediaDevices
891         https://bugs.webkit.org/show_bug.cgi?id=165894
892
893         Reviewed by Eric Carlson.
894
895         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
896         Added include of MediaConstraintsImpl.h, now needed because we
897         removed some unneeded includes from the WebCore headers.
898
899 2016-12-15  Dave Hyatt  <hyatt@apple.com>
900
901         [CSS Parser] Enable CSS Deferred Parsing
902         https://bugs.webkit.org/show_bug.cgi?id=165869
903
904         Reviewed by Sam Weinig.
905
906         * Shared/WebPreferencesDefinitions.h:
907
908 2016-12-14  Andreas Kling  <akling@apple.com>
909
910         Only send Messages::WebPageProxy::DidSaveToPageCache once when entering page cache.
911         <https://webkit.org/b/165887>
912
913         Reviewed by Brady Eidson.
914
915         We were sending one of these IPC messages per frame when a page enters the page cache,
916         and we really only need one, so only do it for the main frame.
917
918         (This message is used to adopt the page cache on the UI process side, in case another
919         web process currently owns the cache. That happens in WebProcessPool::processDidCachePage().)
920
921         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
922         (WebKit::WebFrameLoaderClient::didSaveToPageCache):
923
924 2016-12-14  Simon Fraser  <simon.fraser@apple.com>
925
926         Fix cause of viewport-related flakiness in iOS tests
927         https://bugs.webkit.org/show_bug.cgi?id=165878
928
929         Reviewed by Tim Horton.
930
931         When TestController::platformConfigureViewForTest() changes the view size for a flexible
932         viewport test, the page would not have updated with the new scale by the time the load event
933         fired, causing flakiness depending on test order.
934
935         This was caused by code added in r170325 that delayed visible content rect updates until
936         after the UI process has received the transaction after didCommitLoad. So fix by overriding
937         this mechanism if the view has been resized.
938
939         * Shared/VisibleContentRectUpdateInfo.cpp:
940         (WebKit::VisibleContentRectUpdateInfo::encode):
941         (WebKit::VisibleContentRectUpdateInfo::decode):
942         (WebKit::operator<<):
943         * Shared/VisibleContentRectUpdateInfo.h:
944         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
945         (WebKit::VisibleContentRectUpdateInfo::isFirstUpdateForNewViewSize):
946         (WebKit::operator==):
947         * UIProcess/API/Cocoa/WKWebView.mm:
948         (-[WKWebView _frameOrBoundsChanged]):
949         (-[WKWebView _updateContentRectsWithState:]):
950         * UIProcess/DrawingAreaProxy.cpp:
951         (WebKit::DrawingAreaProxy::setSize):
952         * UIProcess/DrawingAreaProxy.h:
953         * UIProcess/WebPageProxy.cpp:
954         (WebKit::WebPageProxy::WebPageProxy):
955         * UIProcess/WebPageProxy.h:
956         * UIProcess/ios/WKContentView.h:
957         * UIProcess/ios/WKContentView.mm:
958         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
959         * WebProcess/WebPage/ios/WebPageIOS.mm:
960         (WebKit::WebPage::updateVisibleContentRects):
961
962 2016-12-04  Sam Weinig  <sam@webkit.org>
963
964         [WebIDL] Add support for converting dictionaries to JS
965         https://bugs.webkit.org/show_bug.cgi?id=165367
966
967         Reviewed by Chris Dumez.
968
969         * CMakeLists.txt:
970         Add missing directories to look in for headers.
971
972 2016-12-14  Anders Carlsson  <andersca@apple.com>
973
974         Add WKContextRefreshPlugIns
975         https://bugs.webkit.org/show_bug.cgi?id=165879
976         rdar://problem/29602414
977
978         Reviewed by Tim Horton.
979
980         * UIProcess/API/C/WKContext.cpp:
981         (WKContextRefreshPlugIns):
982         * UIProcess/API/C/WKContext.h:
983         * UIProcess/WebProcessPool.cpp:
984         (WebKit::WebProcessPool::refreshPlugins):
985         * UIProcess/WebProcessPool.h:
986         * WebProcess/Plugins/WebPluginInfoProvider.h:
987         * WebProcess/WebProcess.cpp:
988         (WebKit::WebProcess::refreshPlugins):
989         * WebProcess/WebProcess.h:
990         * WebProcess/WebProcess.messages.in:
991
992 2016-12-14  Tim Horton  <timothy_horton@apple.com>
993
994         API Test Fullscreen.TopContentInset is asserting on Yosemite
995         https://bugs.webkit.org/show_bug.cgi?id=165877
996
997         Reviewed by Brady Eidson.
998
999         * UIProcess/WebPageProxy.cpp:
1000         (WebKit::WebPageProxy::setTopContentInset):
1001         * WebProcess/WebPage/WebPage.cpp:
1002         * WebProcess/WebPage/WebPage.h:
1003         * WebProcess/WebPage/WebPage.messages.in:
1004         We don't use fences on Yosemite, but this codepath still tried to.
1005         Instead of guarding with PLATFORM(COCOA), make use of the more accurate
1006         HAVE(COREANIMATION_FENCES) guard.
1007
1008 2016-12-14  Anders Carlsson  <andersca@apple.com>
1009
1010         Add some instrumentation to try to detect a crash on the bots
1011         https://bugs.webkit.org/show_bug.cgi?id=165866
1012
1013         Reviewed by Sam Weinig.
1014
1015         * Platform/IPC/mac/ConnectionMac.mm:
1016         (IPC::Connection::sendMessage):
1017
1018 2016-12-14  Dave Hyatt  <hyatt@apple.com>
1019
1020         [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
1021         https://bugs.webkit.org/show_bug.cgi?id=165743
1022
1023         Reviewed by Dean Jackson.
1024
1025         Repurpose the newCSSParserEnabled preference for deferred parsing. Just change the name
1026         from "new" to "deferred."
1027
1028         * Shared/WebPreferencesDefinitions.h:
1029         * UIProcess/API/C/WKPreferences.cpp:
1030         (WKPreferencesSetDeferredCSSParserEnabled):
1031         (WKPreferencesGetDeferredCSSParserEnabled):
1032         (WKPreferencesSetNewCSSParserEnabled): Deleted.
1033         (WKPreferencesGetNewCSSParserEnabled): Deleted.
1034         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1035         * WebProcess/WebPage/WebPage.cpp:
1036         (WebKit::WebPage::updatePreferences):
1037
1038 2016-12-14  Brent Fulgham  <bfulgham@apple.com>
1039
1040         Unreviewed test fix after r209806.
1041
1042         Plugin-common doesn't define 'home-subpath'. Instead it has 'home-library-subpath'. Switch to the correct
1043         function. Also, 'home-library-subpath' adds '/Library' to the path, so revise the arguments so that we
1044         do not generate paths like '/home/username/Library/Library/Keychains'.
1045
1046         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1047
1048 2016-12-14  Brent Fulgham  <bfulgham@apple.com>
1049
1050         Unreviewed test fix after r209779.
1051
1052         The 'Keygen' element requires the ability to create new keys in '$HOME/Library/Keychains'. Remove the
1053         WebProcess and Plugin sandbox restrictions on per-user Keychain creation to support this use.
1054
1055         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1056         * WebProcess/com.apple.WebProcess.sb.in:
1057
1058 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
1059
1060         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
1061         https://bugs.webkit.org/show_bug.cgi?id=165795
1062
1063         Reviewed by Saam Barati.
1064
1065         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1066         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
1067
1068 2016-12-14  Enrique Ocaña González  <eocanha@igalia.com>
1069
1070         REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early
1071         https://bugs.webkit.org/show_bug.cgi?id=164022
1072
1073         Reviewed by Xabier Rodriguez-Calvar.
1074
1075         * Shared/WebPreferencesDefinitions.h:
1076         New GStreamerEnabled preference, defaults to true.
1077         * WebProcess/WebPage/WebPage.cpp: Ditto.
1078         (WebKit::WebPage::updatePreferences):
1079
1080 2016-12-13  Commit Queue  <commit-queue@webkit.org>
1081
1082         Unreviewed, rolling out r209792.
1083         https://bugs.webkit.org/show_bug.cgi?id=165841
1084
1085         Cause build failures (Requested by yusukesuzuki on #webkit).
1086
1087         Reverted changeset:
1088
1089         "Use JSValue::toWTFString instead of calling toString(exec)
1090         and value(exec)"
1091         https://bugs.webkit.org/show_bug.cgi?id=165795
1092         http://trac.webkit.org/changeset/209792
1093
1094 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
1095
1096         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
1097         https://bugs.webkit.org/show_bug.cgi?id=165795
1098
1099         Reviewed by Saam Barati.
1100
1101         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1102         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
1103
1104 2016-12-13  Alex Christensen  <achristensen@webkit.org>
1105
1106         Fix CMake build.
1107
1108         * PlatformMac.cmake:
1109
1110 2016-12-13  Jer Noble  <jer.noble@apple.com>
1111
1112         Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of page not visible
1113         https://bugs.webkit.org/show_bug.cgi?id=165697
1114
1115         Delegate the values of topContentInset() from WebViewImpl (used by WKWebView and WKView) to the
1116         WebPageProxy, so that setting the topContentInset() on WebPageProxy is reflected in the getters
1117         for the two view classes.
1118
1119         Reviewed by Tim Horton.
1120
1121         * UIProcess/Cocoa/WebViewImpl.h:
1122         (WebKit::WebViewImpl::topContentInset): Deleted.
1123         * UIProcess/Cocoa/WebViewImpl.mm:
1124         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
1125         (WebKit::WebViewImpl::topContentInset):
1126         (WebKit::WebViewImpl::setTopContentInset):
1127         (WebKit::WebViewImpl::dispatchSetTopContentInset):
1128         * UIProcess/mac/WKFullScreenWindowController.mm:
1129         (-[WKFullScreenWindowController enterFullScreen:]):
1130         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
1131         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
1132         (-[WKFullScreenWindowController _saveTopContentInset]): Deleted.
1133         (-[WKFullScreenWindowController _restoreTopContentInset]): Deleted.
1134
1135 2016-12-13  Brent Fulgham  <bfulgham@apple.com>
1136
1137         [Mac][WK2] Tighten Keychain directory access
1138         https://bugs.webkit.org/show_bug.cgi?id=165818
1139         <rdar://problem/16863857>
1140
1141         Reviewed by Anders Carlsson.
1142
1143         Lock down Keychain directory access to just the file-read-data, file-read-metadata, and
1144         file-write-data operations we actually need.
1145
1146         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1147         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1148         * WebProcess/com.apple.WebProcess.sb.in:
1149
1150 2016-12-13  Andy Estes  <aestes@apple.com>
1151
1152         [Cocoa] Implement -shouldInsertText: on WKWebProcessPlugInEditingDelegate
1153         https://bugs.webkit.org/show_bug.cgi?id=165785
1154         <rdar://problem/26929398>
1155
1156         Reviewed by Darin Adler.
1157
1158         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Defined
1159         WKEditorInsertAction and declared
1160         -_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction:.
1161         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1162         (toWK): Added. Mapped a WebCore::EditorInsertAction to a WKEditorInsertAction.
1163         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Implemented
1164         EditorClient::shouldInsertText() by calling
1165         -_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction: with
1166         the text, wrapped range handle, and action. Added shouldInsertText to DelegateMethods and
1167         initialized it according to whether the delegate responds to shouldInsertText:.
1168
1169 2016-12-13  Joseph Pecoraro  <pecoraro@apple.com>
1170
1171         NSArray leaks seen in Safari, allocated under WKIconDatabaseTryCopyCGImageArrayForURL
1172         https://bugs.webkit.org/show_bug.cgi?id=165809
1173
1174         Reviewed by Dan Bernstein.
1175
1176         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
1177         (WKIconDatabaseTryCopyCGImageArrayForURL):
1178         Avoid an extra retain on already newly created array.
1179
1180 2016-12-13  Eric Carlson  <eric.carlson@apple.com>
1181
1182         Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
1183         https://bugs.webkit.org/show_bug.cgi?id=165251
1184
1185         Reviewed by Youenn Fablet.
1186
1187         * WebProcess/WebPage/WebPage.cpp:
1188         (WebKit::WebPage::updatePreferences): Update the media stream and peer connection runtime
1189         feature instead of the setting.
1190
1191 2016-12-13  Sergio Villar Senin  <svillar@igalia.com>
1192
1193         Fix GTK build after r209733
1194         https://bugs.webkit.org/show_bug.cgi?id=165794
1195
1196         Document::visibilityState() now returns an IDL string enumeration.
1197
1198         Reviewed by Žan Doberšek.
1199
1200         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1201         (webkit_dom_document_get_visibility_state):
1202
1203 2016-12-12  Dean Jackson  <dino@apple.com>
1204
1205         [iOS] MediaDocument "Done" button should navigate the page back
1206         https://bugs.webkit.org/show_bug.cgi?id=165779
1207
1208         Reviewed by Sam Weinig.
1209
1210         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1211         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1212         (WebKit::WebVideoFullscreenModelContext::requestFullscreenMode):
1213         (WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode):
1214         * WebProcess/cocoa/WebVideoFullscreenManager.h:
1215         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
1216         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1217         (WebKit::WebVideoFullscreenManager::requestFullscreenMode):
1218
1219 2016-12-12  Tim Horton  <timothy_horton@apple.com>
1220
1221         Provide SPI to avoid blocking on painting when coming into view
1222         https://bugs.webkit.org/show_bug.cgi?id=165780
1223         <rdar://problem/29009559>
1224
1225         Reviewed by Simon Fraser.
1226
1227         By default, when parenting a WKWebView which was previously in-window,
1228         we block on painting to ensure that we don't flash stale content.
1229         We added SPI to disable this behavior to WKWebViewConfiguration, but
1230         some clients might want the behavior most of the time, but sometimes
1231         instead want to not block the UI process main thread, but instead do
1232         their own work (e.g. removing a snapshot) when painting eventually occurs.
1233
1234         * UIProcess/API/Cocoa/WKWebView.mm:
1235         (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
1236         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1237         Tell WebPageProxy not to block on painting next time we are parented,
1238         and use doAfterNextPresentationUpdate to call the block when the painting
1239         does eventually happen. This SPI must be called before - but in the same
1240         runloop cycle - the WKWebView is brought back in-window to work correctly.
1241         
1242         * UIProcess/WebPageProxy.cpp:
1243         (WebKit::WebPageProxy::dispatchActivityStateChange):
1244         * UIProcess/WebPageProxy.h:
1245         (WebKit::WebPageProxy::skipWaitingForPaintAfterNextViewDidMoveToWindow):
1246         If we would block because we're coming in-window, but the bit to skip
1247         blocking the next time we get brought in-window is set, reset the bit, 
1248         and avoid blocking.
1249
1250 2016-12-12  Chris Dumez  <cdumez@apple.com>
1251
1252         Document.visibilityState should use an IDL string enumeration
1253         https://bugs.webkit.org/show_bug.cgi?id=165774
1254
1255         Reviewed by Daniel Bates.
1256
1257         * Shared/API/c/WKSharedAPICast.h:
1258         (WebKit::toPageVisibilityState):
1259
1260 2016-12-11  Konstantin Tokarev  <annulen@yandex.ru>
1261
1262         Unreviewed attempt to fix EFL and Mac/cmake builds after r209665.
1263         https://bugs.webkit.org/show_bug.cgi?id=165686
1264
1265         * PlatformEfl.cmake: WebKit2 should precede other target so that right
1266         config.h comes first in include path.
1267
1268 2016-12-11  Tim Horton  <timothy_horton@apple.com>
1269
1270         Quarter-second stalls scrolling images that are links because of sync getPositionInformation
1271         https://bugs.webkit.org/show_bug.cgi?id=165707
1272
1273         Reviewed by Simon Fraser.
1274
1275         * UIProcess/ios/WKContentViewInteraction.mm:
1276         (-[WKContentView positionInformationForActionSheetAssistant:]):
1277         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
1278         For now, synchronously block when presenting the action sheet if we
1279         don't have a snapshot ready.
1280
1281         * WebProcess/WebPage/ios/WebPageIOS.mm:
1282         (WebKit::WebPage::getPositionInformation):
1283         Respect includeSnapshot in another place in getPositionInformation,
1284         so that many getPositionInformations don't have to do extra snapshotting work.
1285
1286 2016-12-10  Filip Pizlo  <fpizlo@apple.com>
1287
1288         The DOM should have an advancing wavefront opaque root barrier
1289         https://bugs.webkit.org/show_bug.cgi?id=165712
1290
1291         Reviewed by Yusuke Suzuki.
1292         
1293         Propagate the JSDOMWindowBase::commonVM() -> commonVM() change.
1294
1295         * Shared/linux/WebMemorySamplerLinux.cpp:
1296         (WebKit::WebMemorySampler::sampleWebKit):
1297         * Shared/mac/WebMemorySampler.mac.mm:
1298         (WebKit::WebMemorySampler::sampleWebKit):
1299         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1300         (WebKit::InjectedBundle::javaScriptObjectsCount):
1301         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1302         (WebKit::JSNPObject::callMethod):
1303         (WebKit::JSNPObject::callObject):
1304         (WebKit::JSNPObject::callConstructor):
1305         (WebKit::JSNPObject::put):
1306         (WebKit::JSNPObject::deleteProperty):
1307         (WebKit::JSNPObject::getOwnPropertyNames):
1308         (WebKit::JSNPObject::propertyGetter):
1309         * WebProcess/WebPage/WebPage.cpp:
1310         (WebKit::WebPage::runJavaScriptInMainFrame):
1311         (WebKit::WebPage::getBytecodeProfile):
1312         (WebKit::WebPage::getSamplingProfilerOutput):
1313         * WebProcess/WebProcess.cpp:
1314         (WebKit::WebProcess::getWebCoreStatistics):
1315
1316 2016-12-11  Konstantin Tokarev  <annulen@yandex.ru>
1317
1318         Unreviewed build fix for EFL after r209665
1319
1320         * UIProcess/efl/TextCheckerClientEfl.h:
1321
1322 2016-12-10  Konstantin Tokarev  <annulen@yandex.ru>
1323
1324         [cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
1325         https://bugs.webkit.org/show_bug.cgi?id=165686
1326
1327         Reviewed by Michael Catanzaro.
1328
1329         This change reduces duplication of include path lists between modules,
1330         and reduces future need for fixes like r209605 (broken build because of
1331         WebCore header suddenly becoming used in WebKit2).
1332
1333         * CMakeLists.txt:
1334         * PlatformEfl.cmake:
1335         * PlatformGTK.cmake:
1336         * PlatformMac.cmake:
1337
1338 2016-12-10  Antti Koivisto  <antti@apple.com>
1339
1340         CrashTracer: com.apple.WebKit.Networking at WTF::ThreadSafeRefCounted<WebKit::NetworkCache::IOChannel>::deref
1341         https://bugs.webkit.org/show_bug.cgi?id=165659
1342         <rdar://problem/27077977>
1343
1344         Reviewed by Darin Adler.
1345
1346         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1347         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1348         (WebKit::NetworkCache::IOChannel::~IOChannel):
1349
1350             Add non-inlined destructor and release assert against double deletion to narrow down this crash.
1351
1352 2016-12-09  Brent Fulgham  <bfulgham@apple.com>
1353
1354         WebCore::Timer is not compatible with UIProcess
1355         https://bugs.webkit.org/show_bug.cgi?id=165706
1356         <rdar://problem/29360564>
1357
1358         Reviewed by Andy Estes.
1359
1360         Anders has explained to me (at least twice) that WebCore::Timer must not
1361         be used in UIProcess code. A recent bug fix introduced a WebCore::Timer,
1362         which led to another crash.
1363         
1364         This patch switches from WebCore::Timer to WTF::RunLoop::Timer to avoid
1365         the problem.
1366
1367         * UIProcess/Cocoa/NavigationState.h:
1368         * UIProcess/Cocoa/NavigationState.mm:
1369         (WebKit::NavigationState::NavigationState):
1370
1371 2016-12-09  Eric Carlson  <eric.carlson@apple.com>
1372
1373         Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
1374         https://bugs.webkit.org/show_bug.cgi?id=165251
1375
1376         Reviewed by Dean Jackson.
1377
1378         Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
1379
1380         * Shared/WebPreferencesDefinitions.h: Add peerConnectionEnabled.
1381
1382         * UIProcess/API/C/WKPreferences.cpp:
1383         (WKPreferencesSetPeerConnectionEnabled): Added.
1384         (WKPreferencesGetPeerConnectionEnabled): Added.
1385         * UIProcess/API/C/WKPreferencesRef.h:
1386
1387         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1388         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Add WebKitMediaStreamEnabled
1389           and WebKitPeerConnectionEnabled.
1390
1391         * WebProcess/WebPage/WebPage.cpp:
1392         (WebKit::WebPage::updatePreferences): Initialize the peerConnection preference.
1393
1394 2016-12-09  Brady Eidson  <beidson@apple.com>
1395
1396         Re-landing:
1397         Add _WKIconLoadingDelegate SPI.
1398         https://bugs.webkit.org/show_bug.cgi?id=164894
1399
1400         Reviewed by Alex Christensen.
1401
1402         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
1403
1404         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
1405
1406         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
1407
1408         * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
1409         (API::IconLoadingClient::~IconLoadingClient):
1410         (API::IconLoadingClient::getLoadDecisionForIcon):
1411
1412         * UIProcess/API/Cocoa/WKWebView.mm:
1413         (-[WKWebView _initializeWithConfiguration:]):
1414         (-[WKWebView _iconLoadingDelegate]):
1415         (-[WKWebView _setIconLoadingDelegate:]):
1416         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1417
1418         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
1419
1420         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
1421         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
1422         (-[_WKLinkIconParameters _initWithLinkIcon:]):
1423         (-[_WKLinkIconParameters url]):
1424         (-[_WKLinkIconParameters mimeType]):
1425         (-[_WKLinkIconParameters size]):
1426         (-[_WKLinkIconParameters iconType]):
1427         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
1428
1429         * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
1430         * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
1431         (WebKit::IconLoadingDelegate::IconLoadingDelegate):
1432         (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
1433         (WebKit::IconLoadingDelegate::createIconLoadingClient):
1434         (WebKit::IconLoadingDelegate::delegate):
1435         (WebKit::IconLoadingDelegate::setDelegate):
1436         (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
1437         (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
1438         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
1439
1440         * UIProcess/WebPageProxy.cpp:
1441         (WebKit::WebPageProxy::setIconLoadingClient):
1442         (WebKit::WebPageProxy::getLoadDecisionForIcon):
1443         (WebKit::WebPageProxy::finishedLoadingIcon):
1444         * UIProcess/WebPageProxy.h:
1445         (WebKit::WebPageProxy::iconLoadingClient):
1446         * UIProcess/WebPageProxy.messages.in:
1447
1448         * WebKit2.xcodeproj/project.pbxproj:
1449
1450         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1451         (WebKit::WebFrameLoaderClient::useIconLoadingClient):
1452         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
1453         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
1454         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1455         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
1456
1457         * WebProcess/WebPage/WebPage.cpp:
1458         (WebKit::WebPage::didGetLoadDecisionForIcon):
1459         (WebKit::WebPage::setUseIconLoadingClient):
1460         * WebProcess/WebPage/WebPage.h:
1461         * WebProcess/WebPage/WebPage.messages.in:
1462
1463 2016-12-09  Simon Fraser  <simon.fraser@apple.com>
1464
1465         Fix initialization of contentUpdateFrequency
1466         https://bugs.webkit.org/show_bug.cgi?id=165705
1467         rdar://problem/29602039
1468
1469         Reviewed by Tim Horton.
1470
1471         The value that controls web content update frequency was not being initialized.
1472
1473         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1474         (-[WKWebViewConfiguration init]):
1475
1476 2016-12-09  Anders Carlsson  <andersca@apple.com>
1477
1478         Once we can send Mach messages again, make sure to send any pending outgoing messages
1479         https://bugs.webkit.org/show_bug.cgi?id=165693
1480
1481         Reviewed by Brady Eidson.
1482
1483         * Platform/IPC/mac/ConnectionMac.mm:
1484         (IPC::Connection::initializeSendSource):
1485
1486 2016-12-09  Beth Dakin  <bdakin@apple.com>
1487
1488         Password fields should not show the emoji button in TouchBar
1489         https://bugs.webkit.org/show_bug.cgi?id=165673
1490         -and corresponding-
1491         rdar://problem/29235739
1492
1493         Reviewed by Wenson Hsieh.
1494
1495         This patch adds a new member variable for the password touch bar and password 
1496         candidateListTouchBarItem. Since this TouchBar will actually have a different set 
1497         of identifiers than the plain text TouchBar, it should just have its own variable.
1498         * UIProcess/Cocoa/WebViewImpl.h:
1499         * UIProcess/Cocoa/WebViewImpl.mm:
1500
1501         Return m_passwordTextCandidateListTouchBarItem when appropriate.
1502         (WebKit::WebViewImpl::candidateListTouchBarItem):
1503
1504         The candidate list should be the only item for passwords.
1505         (WebKit::passwordTextTouchBarDefaultItemIdentifiers):
1506
1507         Account for m_passwordTextTouchBar.
1508         (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
1509         (WebKit::WebViewImpl::setUpTextTouchBar):
1510         (WebKit::WebViewImpl::textTouchBar):
1511
1512         The empty candidates array is not needed. We can just set @[ ] as the candidates 
1513         for the m_passwordTextCandidateListTouchBarItem. Safe guards already exist in the 
1514         other parts of the code to prevent us from requesting or setting other candidates 
1515         when in a password field. 
1516         (WebKit::WebViewImpl::updateTextTouchBar):
1517
1518 2016-12-09  Keith Rollin  <krollin@apple.com>
1519
1520         Fix string specification in print format
1521         https://bugs.webkit.org/show_bug.cgi?id=165650
1522
1523         Reviewed by Alex Christensen.
1524
1525         Change "%{public}s" string specifier to something that can be changed
1526         to "%s" at compile time when the build environment doesn't support the
1527         former.
1528
1529         * NetworkProcess/capture/NetworkCaptureLogging.h:
1530         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1531         (WebKit::NetworkCapture::Manager::initialize):
1532         (WebKit::NetworkCapture::Manager::findMatch):
1533         (WebKit::NetworkCapture::Manager::findExactMatch):
1534         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
1535         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1536         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
1537         (WebKit::NetworkCapture::Manager::openCacheFile):
1538         (WebKit::NetworkCapture::Manager::getLine):
1539         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
1540         (WebKit::NetworkCapture::Recorder::recordRequestSent):
1541         (WebKit::NetworkCapture::Recorder::recordResponseReceived):
1542         (WebKit::NetworkCapture::Recorder::recordRedirectReceived):
1543         (WebKit::NetworkCapture::Recorder::recordRedirectSent):
1544         (WebKit::NetworkCapture::Recorder::writeEvents):
1545         * NetworkProcess/capture/NetworkCaptureResource.cpp:
1546         (WebKit::NetworkCapture::Resource::url):
1547         (WebKit::NetworkCapture::Resource::EventStream::nextEvent):
1548         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
1549         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
1550         (WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay):
1551         (WebKit::NetworkCapture::NetworkDataTaskReplay::resume):
1552         (WebKit::NetworkCapture::NetworkDataTaskReplay::suspend):
1553         (WebKit::NetworkCapture::NetworkDataTaskReplay::complete):
1554         (WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel):
1555         (WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler):
1556         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent):
1557         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived):
1558         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived):
1559         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent):
1560         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived):
1561         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished):
1562         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
1563
1564 2016-12-09  Jeremy Jones  <jeremyj@apple.com>
1565
1566         WebView doesn't become first responder in element fullscreen.
1567         https://bugs.webkit.org/show_bug.cgi?id=165664
1568         rdar://problem/28927252
1569
1570         Reviewed by Tim Horton.
1571
1572         WebView was being set as the first responder while the contentView was still hidden.
1573         A view can not become first responder while it or its ancestor is hidden.
1574
1575         This change waits until after the contentView is visible to make the web view the first responder.
1576
1577         * UIProcess/mac/WKFullScreenWindowController.mm:
1578         (-[WKFullScreenWindowController enterFullScreen:]):
1579         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
1580
1581 2016-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1582
1583         Unreviewed build fix. Thanks to Konstantin Tokarev and Csaba Osztrogonác
1584         for pointing out the fix.
1585
1586         * CMakeLists.txt: add WebCore/html/canvas to include paths.
1587
1588 2016-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1589
1590         [GTK] Fix build after r209558
1591         https://bugs.webkit.org/show_bug.cgi?id=165653
1592
1593         Unreviewed build fix.
1594
1595         * UIProcess/API/APIPolicyClient.h: include WebsitePolicies.h.
1596         * UIProcess/API/gtk/WebKitPolicyClient.cpp: ditto.
1597         * UIProcess/API/gtk/WebKitPolicyDecision.cpp:
1598         (webkit_policy_decision_use):  pass empty structure to new required argument.
1599
1600 2016-12-09  Gavin Barraclough  <barraclough@apple.com>
1601
1602         Revert - Add _WKIconLoadingDelegate SPI
1603         https://bugs.webkit.org/show_bug.cgi?id=164894
1604
1605         Unreviewed rollout due to performance regression.
1606
1607         * PlatformMac.cmake:
1608         * UIProcess/API/APIIconLoadingClient.h: Removed.
1609         * UIProcess/API/Cocoa/WKWebView.mm:
1610         (-[WKWebView _initializeWithConfiguration:]):
1611         (-[WKWebView _iconLoadingDelegate]): Deleted.
1612         (-[WKWebView _setIconLoadingDelegate:]): Deleted.
1613         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1614         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Removed.
1615         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Removed.
1616         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Removed.
1617         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Removed.
1618         * UIProcess/Cocoa/IconLoadingDelegate.h: Removed.
1619         * UIProcess/Cocoa/IconLoadingDelegate.mm: Removed.
1620         * UIProcess/WebPageProxy.cpp:
1621         (WebKit::WebPageProxy::setIconLoadingClient): Deleted.
1622         (WebKit::WebPageProxy::getLoadDecisionForIcon): Deleted.
1623         (WebKit::WebPageProxy::finishedLoadingIcon): Deleted.
1624         * UIProcess/WebPageProxy.h:
1625         (WebKit::WebPageProxy::iconLoadingClient): Deleted.
1626         * UIProcess/WebPageProxy.messages.in:
1627         * WebKit2.xcodeproj/project.pbxproj:
1628         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1629         (WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted.
1630         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted.
1631         (WebKit::WebFrameLoaderClient::finishedLoadingIcon): Deleted.
1632         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1633         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient): Deleted.
1634         (): Deleted.
1635         * WebProcess/WebPage/WebPage.cpp:
1636         (WebKit::WebPage::didGetLoadDecisionForIcon): Deleted.
1637         (WebKit::WebPage::setUseIconLoadingClient): Deleted.
1638         * WebProcess/WebPage/WebPage.h:
1639         * WebProcess/WebPage/WebPage.messages.in:
1640
1641 2016-12-08  Keith Rollin  <krollin@apple.com>
1642
1643         Move FileHandle to WebCore FileHandle.h
1644         https://bugs.webkit.org/show_bug.cgi?id=165562
1645
1646         Reviewed by Alex Christensen.
1647
1648         Move FileHandle from NetworkCaptureTypes.h (which can now be deleted)
1649         to WebCore. Update client code to use the new version.
1650
1651         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
1652         * NetworkProcess/capture/NetworkCaptureEvent.h:
1653         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1654         (WebKit::NetworkCapture::Manager::initialize):
1655         (WebKit::NetworkCapture::Manager::terminate):
1656         (WebKit::NetworkCapture::Manager::logRecordedResource):
1657         (WebKit::NetworkCapture::Manager::logLoadedResource):
1658         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
1659         (WebKit::NetworkCapture::Manager::openCacheFile):
1660         (WebKit::NetworkCapture::Manager::ensureFileHandle): Deleted.
1661         (WebKit::NetworkCapture::Manager::printToFile): Deleted.
1662         * NetworkProcess/capture/NetworkCaptureManager.h:
1663         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
1664         (WebKit::NetworkCapture::Recorder::writeEvents):
1665         * NetworkProcess/capture/NetworkCaptureTypes.h: Removed.
1666         * WebKit2.xcodeproj/project.pbxproj:
1667
1668 2016-12-08  Anders Carlsson  <andersca@apple.com>
1669
1670         Attempt to fix the iOS build.
1671
1672         * Platform/IPC/mac/MachMessage.cpp:
1673
1674 2016-12-08  Anders Carlsson  <andersca@apple.com>
1675
1676         Defer sending Mach messages if the queue is full
1677         https://bugs.webkit.org/show_bug.cgi?id=165622
1678         rdar://problem/29518036
1679
1680         Reviewed by Brady Eidson.
1681
1682         * Platform/IPC/Connection.cpp:
1683         Include MachMessage.h so the Connection destructor can do its thing.
1684
1685         * Platform/IPC/Connection.h:
1686         Add new members.
1687
1688         * Platform/IPC/mac/ConnectionMac.mm:
1689         (IPC::Connection::platformInvalidate):
1690         Null out the pending outgoing mach message.
1691
1692         (IPC::Connection::sendMessage):
1693         New helper that will send a Mach message. If we time out, store the message in m_pendingOutgoingMachMessage.
1694         When our send source will be triggered we'll try to send the message again.
1695
1696         (IPC::Connection::platformCanSendOutgoingMessages):
1697         We can only send messages if we don't have a pending outgoing message.
1698
1699         (IPC::Connection::sendOutgoingMessage):
1700         Call the newly added sendMessage function.
1701
1702         (IPC::Connection::initializeSendSource):
1703         Add the DISPATCH_MACH_SEND_POSSIBLE mask (and DISPATCH_MACH_SEND_DEAD which was previously implicit).
1704         In our event handler, check for DISPATCH_MACH_SEND_POSSIBLE and try to send the pending outgoing message again.
1705
1706         * Platform/IPC/mac/MachMessage.cpp:
1707         (IPC::MachMessage::create):
1708         Rename length to size.
1709
1710         (IPC::MachMessage::MachMessage):
1711         Initialize m_shouldFreeDescriptors.
1712
1713         (IPC::MachMessage::~MachMessage):
1714         Call mach_msg_destroy, which will free the descriptors.
1715
1716         (IPC::MachMessage::leakDescriptors):
1717         Set m_shouldFreeDescriptors to false.
1718
1719         * Platform/IPC/mac/MachMessage.h:
1720         (IPC::MachMessage::size):
1721         (IPC::MachMessage::length): Deleted.
1722
1723 2016-12-08  Chelsea Pugh  <cpugh@apple.com>
1724
1725         [iOS] WKWebView should not allow app links to be opened on back or forward navigation
1726         https://bugs.webkit.org/show_bug.cgi?id=165502
1727
1728         Reviewed by Dan Bernstein.
1729
1730         * UIProcess/WebPageProxy.cpp:
1731         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Add a condition to shouldOpenAppLinks
1732         (which we use when creating a NavigationAction) that the navigationActionData is not a navigation
1733         of type BackForward. This way, we don't open app links when a navigation is done via back or
1734         forward.
1735
1736 2016-12-08  Filip Pizlo  <fpizlo@apple.com>
1737
1738         Enable SharedArrayBuffer, remove the flag
1739         https://bugs.webkit.org/show_bug.cgi?id=165614
1740
1741         Rubber stamped by Geoffrey Garen.
1742
1743         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1744         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1745
1746 2016-12-08  Alex Christensen  <achristensen@webkit.org>
1747
1748         Add SPI for sending WebsiteSettings to WebProcess during navigation
1749         https://bugs.webkit.org/show_bug.cgi?id=165517
1750         <rdar://29341068>
1751
1752         We add the ability for the navigation client to send settings to the WebProcess 
1753         based on the URL of the document being navigated to. This approach adds no new IPC 
1754         messages and allows the application to decide what settings to use during navigation 
1755         instead of declaratively before navigation. Right now there is only one setting, 
1756         whether to disable content blockers, but this infrastructure can be used for more settings.
1757
1758         Reviewed by Anders Carlsson.
1759
1760         * CMakeLists.txt:
1761         * PlatformMac.cmake:
1762         * Shared/API/APIObject.h:
1763         * Shared/API/c/WKBase.h:
1764         * Shared/WebsitePolicies.h: Added.
1765         (WebKit::WebsitePolicies::encode):
1766         (WebKit::WebsitePolicies::decode):
1767         * UIProcess/API/APINavigationClient.h:
1768         (API::NavigationClient::decidePolicyForNavigationAction):
1769         (API::NavigationClient::decidePolicyForNavigationResponse):
1770         * UIProcess/API/APIPolicyClient.h:
1771         (API::PolicyClient::decidePolicyForNavigationAction):
1772         (API::PolicyClient::decidePolicyForNewWindowAction):
1773         (API::PolicyClient::decidePolicyForResponse):
1774         * UIProcess/API/APIWebsitePolicies.cpp: Added.
1775         (API::WebsitePolicies::create):
1776         * UIProcess/API/APIWebsitePolicies.h: Added.
1777         * UIProcess/API/C/WKAPICast.h:
1778         * UIProcess/API/C/WKFramePolicyListener.cpp:
1779         (WKFramePolicyListenerUse):
1780         (WKFramePolicyListenerUseWithPolicies):
1781         * UIProcess/API/C/WKFramePolicyListener.h:
1782         * UIProcess/API/C/WKPage.cpp:
1783         (WKPageSetPagePolicyClient):
1784         * UIProcess/API/C/WKWebsitePolicies.cpp: Added.
1785         (WKWebsitePoliciesGetTypeID):
1786         (WKWebsitePoliciesCreate):
1787         (WKWebsitePoliciesSetContentBlockersEnabled):
1788         (WKWebsitePoliciesGetContentBlockersEnabled):
1789         * UIProcess/API/C/WKWebsitePolicies.h: Added.
1790         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1791         * UIProcess/API/Cocoa/_WKWebsitePolicies.h: Added.
1792         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: Added.
1793         (-[_WKWebsitePolicies dealloc]):
1794         (-[_WKWebsitePolicies init]):
1795         (-[_WKWebsitePolicies setContentBlockersEnabled:]):
1796         (-[_WKWebsitePolicies contentBlockersEnabled]):
1797         (-[_WKWebsitePolicies description]):
1798         (-[_WKWebsitePolicies _apiObject]):
1799         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: Added.
1800         (WebKit::wrapper):
1801         * UIProcess/Automation/WebAutomationSession.cpp:
1802         (WebKit::WebAutomationSession::reloadBrowsingContext):
1803         * UIProcess/Cocoa/NavigationState.h:
1804         * UIProcess/Cocoa/NavigationState.mm:
1805         (WebKit::NavigationState::setNavigationDelegate):
1806         (WebKit::tryAppLink):
1807         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1808         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
1809         * UIProcess/WebFormSubmissionListenerProxy.cpp:
1810         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
1811         * UIProcess/WebFrameListenerProxy.cpp:
1812         (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
1813         * UIProcess/WebFrameListenerProxy.h:
1814         * UIProcess/WebFramePolicyListenerProxy.cpp:
1815         (WebKit::WebFramePolicyListenerProxy::use):
1816         (WebKit::WebFramePolicyListenerProxy::download):
1817         (WebKit::WebFramePolicyListenerProxy::ignore):
1818         * UIProcess/WebFramePolicyListenerProxy.h:
1819         (WebKit::WebFramePolicyListenerProxy::create):
1820         * UIProcess/WebFrameProxy.cpp:
1821         (WebKit::WebFrameProxy::receivedPolicyDecision):
1822         * UIProcess/WebFrameProxy.h:
1823         * UIProcess/WebInspectorProxy.cpp:
1824         (WebKit::decidePolicyForNavigationAction):
1825         * UIProcess/WebPageProxy.cpp:
1826         (WebKit::WebPageProxy::receivedPolicyDecision):
1827         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1828         * UIProcess/WebPageProxy.h:
1829         * UIProcess/WebPageProxy.messages.in:
1830         * WebKit2.xcodeproj/project.pbxproj:
1831         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1832         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1833
1834 2016-12-08  Antti Koivisto  <antti@apple.com>
1835
1836         Salt network cache hashes
1837         https://bugs.webkit.org/show_bug.cgi?id=164924
1838
1839         Reviewed by Alex Christensen.
1840
1841         To enhance privacy make cache content unidentifiable from file names alone.
1842         This is done by generating a unique persistent salt for each cache instance.
1843         It is used when computing hashes used in file names.
1844
1845         The patch also replaces plain text partition directory names with salted hashes.
1846
1847         * NetworkProcess/cache/NetworkCache.cpp:
1848         (WebKit::NetworkCache::Cache::makeCacheKey):
1849         (WebKit::NetworkCache::makeCacheKey): Deleted.
1850         * NetworkProcess/cache/NetworkCache.h:
1851
1852             Increment cache version.
1853
1854         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
1855         (WebKit::NetworkCache::BlobStorage::BlobStorage):
1856         (WebKit::NetworkCache::BlobStorage::add):
1857         (WebKit::NetworkCache::BlobStorage::get):
1858
1859             Use salt for blob content hash.
1860
1861         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
1862         * NetworkProcess/cache/NetworkCacheData.cpp:
1863         (WebKit::NetworkCache::computeSHA1):
1864
1865             For simplicity all SHA1s are now salted.
1866
1867         (WebKit::NetworkCache::makeSalt):
1868         (WebKit::NetworkCache::readOrMakeSalt):
1869
1870             Read salt if it exists, generate and persist it otherwise.
1871
1872         * NetworkProcess/cache/NetworkCacheData.h:
1873         * NetworkProcess/cache/NetworkCacheKey.cpp:
1874         (WebKit::NetworkCache::Key::Key):
1875
1876             Remove the "No partition" string and just empty.
1877             That was only needed to have a directory name of some sort.
1878
1879         (WebKit::NetworkCache::Key::computeHash):
1880
1881             Use salt for key hash.
1882
1883         (WebKit::NetworkCache::Key::computePartitionHash):
1884
1885             Separate hash for partition.
1886
1887         * NetworkProcess/cache/NetworkCacheKey.h:
1888         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1889         (WebKit::NetworkCache::makeSubresourcesKey):
1890         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
1891         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
1892         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1893         (WebKit::NetworkCache::makeSaltFilePath):
1894         (WebKit::NetworkCache::Storage::open):
1895
1896             Cache can't be opened if we can't read or persist a salt.
1897
1898         (WebKit::NetworkCache::traverseRecordsFiles):
1899         (WebKit::NetworkCache::Storage::Storage):
1900         (WebKit::NetworkCache::Storage::synchronize):
1901         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
1902
1903             Use the partition hash in the directory name instead of a plain text name.
1904
1905         (WebKit::NetworkCache::decodeRecordHeader):
1906         (WebKit::NetworkCache::Storage::readRecord):
1907         (WebKit::NetworkCache::Storage::encodeRecord):
1908         (WebKit::NetworkCache::Storage::traverse):
1909         (WebKit::NetworkCache::Storage::clear):
1910         * NetworkProcess/cache/NetworkCacheStorage.h:
1911         (WebKit::NetworkCache::Storage::salt):
1912
1913 2016-12-08  Eric Carlson  <eric.carlson@apple.com>
1914
1915         Fix the EFL build.
1916
1917         * UIProcess/WebPageProxy.cpp:
1918         (WebKit::WebPageProxy::isPlayingMediaDidChange): Add another ENABLE(MEDIA_STREAM) guard.
1919
1920 2016-12-08  Tomas Popela  <tpopela@redhat.com>
1921
1922         [GTK] Process accelerated compositing env variables only if they are really enabled
1923         https://bugs.webkit.org/show_bug.cgi?id=165300
1924
1925         Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
1926         WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
1927         (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
1928
1929         Reviewed by Michael Catanzaro.
1930
1931         * UIProcess/gtk/WebPreferencesGtk.cpp:
1932         (WebKit::WebPreferences::platformInitializeStore):
1933
1934 2016-12-08  Alex Christensen  <achristensen@webkit.org>
1935
1936         Fix CMake build.
1937
1938         * CMakeLists.txt:
1939         Add the new NetworkProcess/capture include directory to find new headers from r209498.
1940         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
1941         (WebKit::NetworkCapture::Response::Response):
1942         (WebKit::NetworkCapture::Error::Error):
1943         The String constructor was ambiguous after r209498 because URL has an operator NSString* and String has an NSString constructor.
1944         We should get rid of operator NSString* and operator String on URL.
1945         * UIProcess/WebPageProxy.cpp:
1946         * UIProcess/WebPageProxy.h:
1947         Add some ENABLE(MEDIA_STREAM) macros to fix the build without it enabled after r209512.
1948
1949 2016-12-08  Alex Christensen  <achristensen@webkit.org>
1950
1951         Fix iOS debug build after r209498
1952         https://bugs.webkit.org/show_bug.cgi?id=164527
1953
1954         * NetworkProcess/capture/NetworkCaptureLogging.h:
1955         Logs were causing compile warnings/errors.  Disable logs for now.
1956
1957 2016-12-07  Dean Jackson  <dino@apple.com>
1958
1959         Remove runtime toggle for pointer-lock
1960         https://bugs.webkit.org/show_bug.cgi?id=165577
1961         <rdar://problems/29566996>
1962
1963         Reviewed by Jon Lee.
1964
1965         Remove any runtime calls to check if pointer-lock is enabled. It's
1966         either compiled in or out.
1967
1968         * Shared/WebPreferencesDefinitions.h:
1969         * UIProcess/API/C/WKPreferences.cpp:
1970         (WKPreferencesSetPointerLockEnabled): Deleted.
1971         (WKPreferencesGetPointerLockEnabled): Deleted.
1972         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1973         * WebProcess/WebPage/WebPage.cpp:
1974         (WebKit::WebPage::updatePreferences):
1975
1976 2016-12-07  Eric Carlson  <eric.carlson@apple.com>
1977
1978         [MediaStream][Mac] Revoke sandbox extensions when capture ends
1979         https://bugs.webkit.org/show_bug.cgi?id=165476
1980
1981         Reviewed by Brady Eidson.
1982
1983         Track media capture by process so it is possible to revoke the sandbox extensions issued to
1984         a web process when capture stops. Allocate WK2 user media permission manager lazily rather
1985         than every time a page is created as most pages won't need one.
1986
1987         * CMakeLists.txt: Add new files.
1988
1989         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1990         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
1991           with process manager.
1992         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1993         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox 
1994           extension code to the process manager.
1995         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
1996         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
1997           change to the process manager.
1998         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
1999         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2000
2001         * UIProcess/UserMediaProcessManager.cpp: Added.
2002         (WebKit::ProcessState::ProcessState):
2003         (WebKit::ProcessState::managers):
2004         (WebKit::ProcessState::sandboxExtensionsGranted):
2005         (WebKit::ProcessState::setSandboxExtensionsGranted):
2006         (WebKit::stateMap):
2007         (WebKit::processState):
2008         (WebKit::ProcessState::addRequestManager):
2009         (WebKit::ProcessState::removeRequestManager):
2010         (WebKit::UserMediaProcessManager::singleton):
2011         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
2012         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
2013         (WebKit::UserMediaProcessManager::willCreateMediaStream):
2014         (WebKit::UserMediaProcessManager::startedCaptureSession):
2015         (WebKit::UserMediaProcessManager::endedCaptureSession):
2016         * UIProcess/UserMediaProcessManager.h: Added.
2017
2018         * UIProcess/WebPageProxy.cpp:
2019         (WebKit::WebPageProxy::WebPageProxy): Don't allocate m_userMediaPermissionRequestManager.
2020         (WebKit::WebPageProxy::resetState): Set m_userMediaPermissionRequestManager to null.
2021         (WebKit::WebPageProxy::userMediaPermissionRequestManager): Allocate m_userMediaPermissionRequestManager
2022           lazily as most pages don't need it.
2023         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Call userMediaPermissionRequestManager().
2024         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): Ditto.
2025         (WebKit::WebPageProxy::clearUserMediaState): Ditto.
2026         (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
2027           manager proxy.
2028         * UIProcess/WebPageProxy.h:
2029
2030         * WebKit2.xcodeproj/project.pbxproj: Add new files.
2031
2032         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
2033         (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
2034         (WebKit::MediaDeviceSandboxExtensions::encode):
2035         (WebKit::MediaDeviceSandboxExtensions::decode):
2036         (WebKit::MediaDeviceSandboxExtensions::operator[]):
2037         (WebKit::MediaDeviceSandboxExtensions::size):
2038         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
2039
2040         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2041         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
2042           is now in a HashMap, not a Vector.
2043         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
2044           IDs with extensions so they can be revoked later.
2045         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
2046         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
2047         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2048
2049         * WebProcess/WebPage/WebPage.cpp:
2050         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
2051         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
2052         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
2053         * WebProcess/WebPage/WebPage.h:
2054         * WebProcess/WebPage/WebPage.messages.in:
2055
2056 2016-12-07  Jeremy Jones  <jeremyj@apple.com>
2057
2058         One esc to exit fullscreen and pointer lock
2059         https://bugs.webkit.org/show_bug.cgi?id=165416
2060         rdar://problem/29430711
2061
2062         Reviewed by Jer Noble.
2063
2064         Fix a crash when didLosePointerLock is not specified.
2065
2066         * UIProcess/API/C/WKPage.cpp:
2067         (WKPageSetPageUIClient):
2068
2069 2016-12-07  Keith Rollin  <krollin@apple.com>
2070
2071         Network event record/replay
2072         https://bugs.webkit.org/show_bug.cgi?id=164527
2073         <rdar://problem/29168157>
2074
2075         Reviewed by Alex Christensen.
2076
2077         Add WebKit2/NetworkProcess/capture/* for recording the network events
2078         that occur when loading a page and for replaying them later. Update
2079         NetworkLoad to invoke capture facilities. Add preferences for enabling
2080         record or replay.
2081
2082         * CMakeLists.txt:
2083         * NetworkProcess/NetworkLoad.cpp:
2084         (WebKit::NetworkLoad::NetworkLoad):
2085         (WebKit::NetworkLoad::initializeForRecord):
2086         (WebKit::NetworkLoad::initializeForReplay):
2087         (WebKit::NetworkLoad::initialize):
2088         (WebKit::NetworkLoad::setDefersLoading):
2089         (WebKit::NetworkLoad::continueWillSendRequest):
2090         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
2091         (WebKit::NetworkLoad::notifyDidReceiveResponse):
2092         (WebKit::NetworkLoad::didReceiveData):
2093         (WebKit::NetworkLoad::didCompleteWithError):
2094         * NetworkProcess/NetworkLoad.h:
2095         * NetworkProcess/NetworkProcess.cpp:
2096         (WebKit::NetworkProcess::initializeNetworkProcess):
2097         (WebKit::NetworkProcess::terminate):
2098         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2099         (WebKit::NetworkProcessCreationParameters::encode):
2100         (WebKit::NetworkProcessCreationParameters::decode):
2101         * NetworkProcess/NetworkProcessCreationParameters.h:
2102         * NetworkProcess/capture/NetworkCaptureEvent.cpp: Added.
2103         (WebKit::NetworkCapture::copyHeaders):
2104         (WebKit::NetworkCapture::KeyValuePair::KeyValuePair):
2105         (WebKit::NetworkCapture::ResourceRequest::ResourceRequest):
2106         (WebKit::NetworkCapture::ResourceRequest::operator WebCore::ResourceRequest):
2107         (WebKit::NetworkCapture::ResourceResponse::ResourceResponse):
2108         (WebKit::NetworkCapture::ResourceResponse::operator WebCore::ResourceResponse):
2109         (WebKit::NetworkCapture::ResourceError::ResourceError):
2110         (WebKit::NetworkCapture::ResourceError::operator WebCore::ResourceError):
2111         (WebKit::NetworkCapture::JSONCoder::encode):
2112         (WebKit::NetworkCapture::JSONCoder::decode):
2113         (WebKit::NetworkCapture::JSONCoder<String>::encode):
2114         (WebKit::NetworkCapture::JSONCoder<String>::decode):
2115         (WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::encode):
2116         (WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::decode):
2117         (WebKit::NetworkCapture::JSONCoder<KeyValuePair>::encode):
2118         (WebKit::NetworkCapture::JSONCoder<KeyValuePair>::decode):
2119         (WebKit::NetworkCapture::JSONCoder<Vector<T>>::encode):
2120         (WebKit::NetworkCapture::JSONCoder<Vector<T>>::decode):
2121         (WebKit::NetworkCapture::JSONCoder<ResourceRequest>::encode):
2122         (WebKit::NetworkCapture::JSONCoder<ResourceRequest>::decode):
2123         (WebKit::NetworkCapture::JSONCoder<ResourceResponse>::encode):
2124         (WebKit::NetworkCapture::JSONCoder<ResourceResponse>::decode):
2125         (WebKit::NetworkCapture::JSONCoder<ResourceError>::encode):
2126         (WebKit::NetworkCapture::JSONCoder<ResourceError>::decode):
2127         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::encode):
2128         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
2129         (WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::encode):
2130         (WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::decode):
2131         (WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::encode):
2132         (WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::decode):
2133         (WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::encode):
2134         (WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::decode):
2135         (WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::encode):
2136         (WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::decode):
2137         (WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::encode):
2138         (WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::decode):
2139         (WebKit::NetworkCapture::JSONCoder<FinishedEvent>::encode):
2140         (WebKit::NetworkCapture::JSONCoder<FinishedEvent>::decode):
2141         (WebKit::NetworkCapture::eventToString):
2142         (WebKit::NetworkCapture::stringToEvent):
2143         * NetworkProcess/capture/NetworkCaptureEvent.h: Added.
2144         (WebKit::NetworkCapture::TimedEvent::TimedEvent):
2145         * NetworkProcess/capture/NetworkCaptureLogging.h: Added.
2146         * NetworkProcess/capture/NetworkCaptureManager.cpp: Added.
2147         (WebKit::NetworkCapture::Manager::singleton):
2148         (WebKit::NetworkCapture::Manager::initialize):
2149         (WebKit::NetworkCapture::Manager::terminate):
2150         (WebKit::NetworkCapture::Manager::findMatch):
2151         (WebKit::NetworkCapture::Manager::findExactMatch):
2152         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
2153         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
2154         (WebKit::NetworkCapture::Manager::loadResources):
2155         (WebKit::NetworkCapture::Manager::reportLoadPath):
2156         (WebKit::NetworkCapture::Manager::reportRecordPath):
2157         (WebKit::NetworkCapture::Manager::reportReplayPath):
2158         (WebKit::NetworkCapture::Manager::requestToPath):
2159         (WebKit::NetworkCapture::Manager::stringToHash):
2160         (WebKit::NetworkCapture::Manager::hashToPath):
2161         (WebKit::NetworkCapture::Manager::logRecordedResource):
2162         (WebKit::NetworkCapture::Manager::logLoadedResource):
2163         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
2164         (WebKit::NetworkCapture::Manager::ensureFileHandle):
2165         (WebKit::NetworkCapture::Manager::openCacheFile):
2166         (WebKit::NetworkCapture::Manager::readFile):
2167         (WebKit::NetworkCapture::Manager::getLine):
2168         (WebKit::NetworkCapture::Manager::getWord):
2169         (WebKit::NetworkCapture::Manager::printToFile):
2170         * NetworkProcess/capture/NetworkCaptureManager.h: Added.
2171         (WebKit::NetworkCapture::Manager::isRecording):
2172         (WebKit::NetworkCapture::Manager::isReplaying):
2173         (WebKit::NetworkCapture::Manager::mode):
2174         * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Added.
2175         (WebKit::NetworkCapture::Recorder::recordRequestSent):
2176         (WebKit::NetworkCapture::Recorder::recordResponseReceived):
2177         (WebKit::NetworkCapture::Recorder::recordRedirectReceived):
2178         (WebKit::NetworkCapture::Recorder::recordRedirectSent):
2179         (WebKit::NetworkCapture::Recorder::recordDataReceived):
2180         (WebKit::NetworkCapture::Recorder::recordFinish):
2181         (WebKit::NetworkCapture::Recorder::writeEvents):
2182         * NetworkProcess/capture/NetworkCaptureRecorder.h: Added.
2183         (WebKit::NetworkCapture::Recorder::recordEvent):
2184         * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Added.
2185         (WebKit::NetworkCapture::Replayer::replayResource):
2186         * NetworkProcess/capture/NetworkCaptureReplayer.h: Added.
2187         * NetworkProcess/capture/NetworkCaptureResource.cpp: Added.
2188         (WebKit::NetworkCapture::Resource::Resource):
2189         (WebKit::NetworkCapture::Resource::url):
2190         (WebKit::NetworkCapture::Resource::baseURL):
2191         (WebKit::NetworkCapture::Resource::queryParameters):
2192         (WebKit::NetworkCapture::Resource::eventStream):
2193         (WebKit::NetworkCapture::Resource::EventStream::EventStream):
2194         (WebKit::NetworkCapture::Resource::EventStream::nextEvent):
2195         * NetworkProcess/capture/NetworkCaptureResource.h: Added.
2196         * NetworkProcess/capture/NetworkCaptureTypes.h: Added.
2197         (WebKit::NetworkCapture::TypeHolder::forEachTypeImpl):
2198         (WebKit::NetworkCapture::TypeHolder::forEachType):
2199         * NetworkProcess/capture/NetworkDataTaskReplay.cpp: Added.
2200         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
2201         (WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay):
2202         (WebKit::NetworkCapture::NetworkDataTaskReplay::resume):
2203         (WebKit::NetworkCapture::NetworkDataTaskReplay::suspend):
2204         (WebKit::NetworkCapture::NetworkDataTaskReplay::cancel):
2205         (WebKit::NetworkCapture::NetworkDataTaskReplay::complete):
2206         (WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel):
2207         (WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler):
2208         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent):
2209         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived):
2210         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived):
2211         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent):
2212         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived):
2213         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished):
2214         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
2215         (WebKit::NetworkCapture::NetworkDataTaskReplay::didFinish):
2216         * NetworkProcess/capture/NetworkDataTaskReplay.h: Added.
2217         (WebKit::NetworkCapture::NetworkDataTaskReplay::create):
2218         * NetworkProcess/capture/json.hpp: Added.
2219         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2220         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2221         * WebKit2.xcodeproj/project.pbxproj:
2222         * config.h:
2223
2224 2016-12-07  Anders Carlsson  <andersca@apple.com>
2225
2226         Fix build.
2227
2228         * Platform/IPC/mac/ConnectionMac.mm:
2229         (IPC::Connection::open):
2230
2231 2016-12-07  Anders Carlsson  <andersca@apple.com>
2232
2233         Rename the connection sources to better indicate what data direction they are used for
2234         https://bugs.webkit.org/show_bug.cgi?id=165548
2235
2236         Reviewed by Tim Horton.
2237
2238         * Platform/IPC/Connection.h:
2239         * Platform/IPC/mac/ConnectionMac.mm:
2240         (IPC::Connection::platformInvalidate):
2241         (IPC::Connection::platformInitialize):
2242         (IPC::createReceiveSource):
2243         (IPC::Connection::initializeSendSource):
2244         (IPC::Connection::receiveSourceEventHandler):
2245         (IPC::createDataAvailableSource): Deleted.
2246         (IPC::Connection::initializeDeadNameSource): Deleted.
2247         Rename m_deadNameSource to m_sendSource, and m_receivePortDataAvailableSource to m_receiveSource.
2248
2249         (IPC::Connection::open):
2250         Initialize the send source before we attempt to send a first message.
2251
2252 2016-12-07  Simon Fraser  <simon.fraser@apple.com>
2253
2254         Fix use of enum in a WK2 C SPI header.
2255         rdar://problem/28725583
2256
2257         Followup to correctly prefix the enum values.
2258
2259         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2260         (WKBundlePageSetEventThrottlingBehaviorOverride):
2261         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2262
2263 2016-12-07  Simon Fraser  <simon.fraser@apple.com>
2264
2265         Fix use of enum in a WK2 C SPI header.
2266         rdar://problem/28725583
2267
2268         Reviewed by Dan Bernstein.
2269
2270         Use correct enum style for a C SPI header and fix the callers.
2271
2272         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2273         (WKBundlePageSetEventThrottlingBehaviorOverride):
2274         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2275
2276 2016-12-07  Beth Dakin  <bdakin@apple.com>
2277
2278         Remove iCloud Pages and Keynote site-specific hacks
2279         https://bugs.webkit.org/show_bug.cgi?id=165544
2280         -and corresponding-
2281         rdar://problem/29082536
2282
2283         Reviewed by Wenson Hsieh.
2284
2285         * WebProcess/WebPage/WebPage.cpp:
2286         (WebKit::needsHiddenContentEditableQuirk):
2287         (WebKit::needsPlainTextQuirk):
2288
2289 2016-12-05  Ada Chan  <adachan@apple.com>
2290
2291         Add a getter for serverTrust in _WKObservablePageState
2292         https://bugs.webkit.org/show_bug.cgi?id=165433
2293
2294         Reviewed by Anders Carlsson.
2295
2296         * UIProcess/API/C/mac/WKPagePrivateMac.h:
2297         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
2298         (-[WKObservablePageState serverTrust]):
2299
2300 2016-12-07  Jer Noble  <jer.noble@apple.com>
2301
2302         Exiting Element Fullscreen mode loses focus on WKWebView.
2303         https://bugs.webkit.org/show_bug.cgi?id=165512
2304
2305         Reviewed by Eric Carlson.
2306
2307         Setting 'window.contentView.hidden = YES' will reset the first-responder (whereas
2308         previously setting 'window.contentView.layer.hidden = YES' did not). Grab the first-
2309         responder before doing so, so that it can be reset correctly when moving the WKWebView
2310         back to it's original window.
2311
2312         * UIProcess/mac/WKFullScreenWindowController.mm:
2313         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2314
2315 2016-12-07  Alex Christensen  <achristensen@webkit.org>
2316
2317         Fix CMake build after r209418.
2318         https://bugs.webkit.org/show_bug.cgi?id=165484
2319
2320         * PlatformMac.cmake:
2321
2322 2016-12-07  Philippe Normand  <pnormand@igalia.com>
2323
2324         Unreviewed, GTK build fix after r209407.
2325
2326         * Platform/IPC/unix/ConnectionUnix.cpp:
2327         (IPC::Connection::processMessage):
2328         * UIProcess/LegacySessionStateCodingNone.cpp:
2329         (WebKit::decodeLegacySessionState):
2330
2331 2016-12-06  Ryan Haddad  <ryanhaddad@apple.com>
2332
2333         Unreviewed, rolling out r209422.
2334
2335         This change caused assertion failures during API tests.
2336
2337         Reverted changeset:
2338
2339         "[MediaStream][Mac] Revoke sandbox extensions when capture
2340         ends"
2341         https://bugs.webkit.org/show_bug.cgi?id=165476
2342         http://trac.webkit.org/changeset/209422
2343
2344 2016-12-06  Dean Jackson  <dino@apple.com>
2345
2346         Include default value in Experimental Feature information
2347         https://bugs.webkit.org/show_bug.cgi?id=165509
2348         <rdar://problems/29547177>
2349
2350         Reviewed by Tim Horton.
2351
2352         Add a defaultValue member variable to experimental
2353         features, both the C++ and ObjC interfaces.
2354
2355         * UIProcess/API/APIExperimentalFeature.cpp:
2356         (API::ExperimentalFeature::create):
2357         (API::ExperimentalFeature::ExperimentalFeature):
2358         * UIProcess/API/APIExperimentalFeature.h:
2359         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
2360         * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
2361         (-[_WKExperimentalFeature description]):
2362         (-[_WKExperimentalFeature defaultValue]):
2363         * UIProcess/WebPreferences.cpp:
2364         (WebKit::createExperimentalFeaturesVector):
2365
2366 2016-12-06  Commit Queue  <commit-queue@webkit.org>
2367
2368         Unreviewed, rolling out r209391.
2369         https://bugs.webkit.org/show_bug.cgi?id=165501
2370
2371         requires explicit nullptr checks so missing env vars don't
2372         flip AC mode (Requested by mcatanzaro on #webkit).
2373
2374         Reverted changeset:
2375
2376         "[GTK] Process accelerated compositing env variables only if
2377         they are really enabled"
2378         https://bugs.webkit.org/show_bug.cgi?id=165300
2379         http://trac.webkit.org/changeset/209391
2380
2381 2016-12-06  Alexey Proskuryakov  <ap@apple.com>
2382
2383         Correct SDKROOT values in xcconfig files
2384         https://bugs.webkit.org/show_bug.cgi?id=165487
2385         rdar://problem/29539209
2386
2387         Reviewed by Dan Bernstein.
2388
2389         Fix suggested by Dan Bernstein.
2390
2391         * Configurations/DebugRelease.xcconfig:
2392
2393 2016-12-06  Andreas Kling  <akling@apple.com>
2394
2395         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
2396         <https://webkit.org/b/165375>
2397         <rdar://problem/29057243>
2398
2399         Reviewed by Darin Adler.
2400
2401         Follow-up to address two more review comments.
2402
2403         * WebProcess/cocoa/WebProcessCocoa.mm:
2404         (WebKit::WebProcess::registerWithStateDumper): Use adoptNS() instead of autorelease for NSStrings.
2405
2406 2016-12-06  Eric Carlson  <eric.carlson@apple.com>
2407
2408         [MediaStream][Mac] Revoke sandbox extensions when capture ends
2409         https://bugs.webkit.org/show_bug.cgi?id=165476
2410
2411         Reviewed by Brady Eidson.
2412         
2413         Track media capture by process so it is possible to revoke the sandbox extensions issued to
2414         a web process when capture stops.
2415
2416         * CMakeLists.txt: Add new files.
2417
2418         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2419         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
2420           with process manager.
2421         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
2422         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox 
2423           extension code to the process manager.
2424         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
2425         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
2426           change to the process manager.
2427         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
2428         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2429
2430         * UIProcess/UserMediaProcessManager.cpp: Added.
2431         (WebKit::ProcessState::ProcessState):
2432         (WebKit::ProcessState::managers):
2433         (WebKit::ProcessState::sandboxExtensionsGranted):
2434         (WebKit::ProcessState::setSandboxExtensionsGranted):
2435         (WebKit::stateMap):
2436         (WebKit::processState):
2437         (WebKit::ProcessState::addRequestManager):
2438         (WebKit::ProcessState::removeRequestManager):
2439         (WebKit::UserMediaProcessManager::singleton):
2440         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
2441         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
2442         (WebKit::UserMediaProcessManager::willCreateMediaStream):
2443         (WebKit::UserMediaProcessManager::startedCaptureSession):
2444         (WebKit::UserMediaProcessManager::endedCaptureSession):
2445         * UIProcess/UserMediaProcessManager.h: Added.
2446
2447         * UIProcess/WebPageProxy.cpp:
2448         (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
2449           manager proxy.
2450         * UIProcess/WebPageProxy.h:
2451
2452         * WebKit2.xcodeproj/project.pbxproj: Add new files.
2453
2454         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
2455         (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
2456         (WebKit::MediaDeviceSandboxExtensions::encode):
2457         (WebKit::MediaDeviceSandboxExtensions::decode):
2458         (WebKit::MediaDeviceSandboxExtensions::operator[]):
2459         (WebKit::MediaDeviceSandboxExtensions::size):
2460         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
2461
2462         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2463         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
2464           is now in a HashMap, not a Vector.
2465         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
2466           IDs with extensions so they can be revoked later.
2467         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
2468         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
2469         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2470
2471         * WebProcess/WebPage/WebPage.cpp:
2472         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
2473         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
2474         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
2475         * WebProcess/WebPage/WebPage.h:
2476         * WebProcess/WebPage/WebPage.messages.in:
2477
2478 2016-12-06  Anders Carlsson  <andersca@apple.com>
2479
2480         Add a new MachMessage class and use it for sending outgoing messages
2481         https://bugs.webkit.org/show_bug.cgi?id=165484
2482
2483         Reviewed by Sam Weinig.
2484
2485         * Platform/IPC/mac/ConnectionMac.mm:
2486         (IPC::Connection::sendOutgoingMessage):
2487         Instead of trying to randomly use memory from the stack as well as using mmap for the message data for out of line messages
2488         (which makes no sense at all, since the body data is already mmapped), just always create a MachMessage object and use it.
2489         
2490         (IPC::machMessageSize): Deleted.
2491         This has been moved to MachMessage::messageSize().
2492         
2493         * Platform/IPC/mac/MachMessage.cpp: Added.
2494         (IPC::MachMessage::create):
2495         Allocate extra memory to store the actual buffer.
2496
2497         (IPC::MachMessage::MachMessage):
2498         Initialize variables. m_size isn't really used right now, but will be in a subsequent patch.
2499
2500         (IPC::MachMessage::header):
2501         Return the header.
2502         
2503         * Platform/IPC/mac/MachMessage.h: Added.
2504         (IPC::MachMessage::length):
2505
2506         * WebKit2.xcodeproj/project.pbxproj:
2507         Add new files.
2508
2509 2016-12-06  Simon Fraser  <simon.fraser@apple.com>
2510
2511         Enable visual viewports by default on Mac, and iOS Wk2
2512         https://bugs.webkit.org/show_bug.cgi?id=165452
2513
2514         Reviewed by Zalan Bujtas.
2515
2516         Turn visual viewports on by default for WK2.
2517
2518         * Shared/WebPreferencesDefinitions.h:
2519
2520 2016-12-06  Daniel Bates  <dabates@apple.com>
2521
2522         WebKitTestRunner: Plugins are disabled in new windows
2523         https://bugs.webkit.org/show_bug.cgi?id=165410
2524
2525         Reviewed by Alex Christensen.
2526
2527         Remove SPI exposed to explicitly toggle plugins from WebKitTestRunner.
2528         Instead we will update WebKitTestRunner to make use of the SPI
2529         WKBundleOverrideBoolPreferenceForTestRunner() to toggle plugins in
2530         all windows.
2531
2532         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2533         (WKBundleSetPluginsEnabled): Deleted.
2534         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2535         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2536         (WebKit::InjectedBundle::setPluginsEnabled): Deleted.
2537
2538 2016-12-05  Anders Carlsson  <andersca@apple.com>
2539
2540         Don't memcpy out of line data
2541         https://bugs.webkit.org/show_bug.cgi?id=165434
2542
2543         Reviewed by Sam Weinig.
2544
2545         Change the Decoder constructor to take a buffer deallocator parameter. If the buffer deallocator is null, the
2546         data will be copied as before. Otherwise, the memory will be adopted by the Decoder object, and will be deallocated
2547         by invoking the data deallocator.
2548
2549         * Platform/IPC/Decoder.cpp:
2550         (IPC::copyBuffer):
2551         Add a new helper.
2552
2553         (IPC::Decoder::Decoder):
2554         Copy the buffer if the deallocator is null.
2555
2556         (IPC::Decoder::~Decoder):
2557         Invoke the deallocator or call fastFree if it is null.
2558
2559         (IPC::Decoder::unwrapForTesting):
2560         Update constructor.
2561         
2562         (IPC::roundUpToAlignment):
2563         (IPC::Decoder::alignBufferPosition):
2564         (IPC::Decoder::decodeVariableLengthByteArray):
2565         (IPC::decodeValueFromBuffer):
2566         Change all these to deal with const pointers.
2567
2568         * Platform/IPC/Decoder.h:
2569         Add new members.
2570
2571         * Platform/IPC/mac/ConnectionMac.mm:
2572         (IPC::createMessageDecoder):
2573         When we have out of line data, pass a deallocator that calls vm_deallocate, instead of copying the data
2574         and then immediately throwing the original away.
2575
2576 2016-12-06  Tim Horton  <timothy_horton@apple.com>
2577
2578         Almost half-second stall scrolling apple.com because of synchronous getPositionInformation
2579         https://bugs.webkit.org/show_bug.cgi?id=165403
2580         <rdar://problem/29493285>
2581
2582         Reviewed by Enrica Casucci.
2583
2584         When retrieving interaction information, we don't always need to do
2585         snapshots for 3D Touch or the action sheet, especially if we're
2586         synchronously blocking the UI process main thread waiting for the reply.
2587
2588         Add a new InteractionInformationRequest, which allows callers of
2589         getPositionInformation and requestPositionInformation to specify which
2590         optional pieces of information they would like to compute.
2591
2592         * Shared/AssistedNodeInformation.h:
2593         Fix a incorrect comment.
2594
2595         * Shared/ios/InteractionInformationRequest.cpp: Added.
2596         (WebKit::InteractionInformationRequest::encode):
2597         (WebKit::InteractionInformationRequest::decode):
2598         (WebKit::InteractionInformationRequest::isValidForRequest):
2599         * Shared/ios/InteractionInformationRequest.h: Added.
2600         (WebKit::InteractionInformationRequest::InteractionInformationRequest):
2601         * WebKit2.xcodeproj/project.pbxproj:
2602         Add InteractionInformationRequest, which encapsulates all of the
2603         parameters required to generate an InteractionInformationAtPosition.
2604         Previously, that was just a point, but now we have two new parameters:
2605         whether we should generate a snapshot of the element, and whether
2606         we should generate a TextIndicator if the element is a link.
2607
2608         * Shared/ios/InteractionInformationAtPosition.h:
2609         * Shared/ios/InteractionInformationAtPosition.mm:
2610         (WebKit::InteractionInformationAtPosition::encode):
2611         (WebKit::InteractionInformationAtPosition::decode):
2612         (WebKit::InteractionInformationAtPosition::mergeCompatibleOptionalInformation):
2613         Adopt InteractionInformationRequest.
2614
2615         * UIProcess/WebPageProxy.h:
2616         * UIProcess/ios/WebPageProxyIOS.mm:
2617         (WebKit::WebPageProxy::getPositionInformation):
2618         (WebKit::WebPageProxy::requestPositionInformation):
2619         * UIProcess/ios/WKActionSheetAssistant.mm:
2620         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
2621         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
2622         (-[WKActionSheetAssistant showImageSheet]):
2623         (-[WKActionSheetAssistant showLinkSheet]):
2624         * UIProcess/ios/WKPDFView.mm:
2625         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
2626         * WebProcess/WebPage/WebPage.h:
2627         * WebProcess/WebPage/WebPage.messages.in:
2628         Adopt InteractionInformationRequest.
2629         
2630         * UIProcess/ios/WKContentViewInteraction.h:
2631         * UIProcess/ios/WKContentViewInteraction.mm:
2632         (-[WKContentView _showAttachmentSheet]):
2633         (-[WKContentView ensurePositionInformationIsUpToDate:]):
2634         If we have a outstanding asynchronous position information request
2635         for the current point, instead of sending a second separate request,
2636         just wait for the async one to come in.
2637
2638         (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
2639         If asked to do an asynchronous request with more optional bits than
2640         the current otherwise-valid response's request, update the position information.
2641
2642         (-[WKContentView gestureRecognizerShouldBegin:]):
2643         The design of this mechanism is that during the highlight long press,
2644         we do an async position information update, and then when we actually
2645         begin a 3D Touch gesture, we hope to already have the requisite snapshots
2646         ready (so that we can avoid synchronously blocking for them, there).
2647         So, in the highlight long-press async request, ask for all the goodies.
2648
2649         (-[WKContentView hasSelectablePositionAtPoint:]):
2650         (-[WKContentView pointIsNearMarkedText:]):
2651         (-[WKContentView pointIsInAssistedNode:]):
2652         (-[WKContentView _didNotHandleTapAsClick:]):
2653         (-[WKContentView _positionInformationDidChange:]):
2654         If we get a position information update for the same point, but with less
2655         goodies attached (the snapshot/link indicator), copy them over from the old
2656         position information, so that we never accidentally "downgrade" our info.
2657
2658         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
2659         (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
2660         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2661         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2662         (-[WKContentView _presentedViewControllerForPreviewItemController:]):        
2663         More adoption.
2664         
2665         * WebProcess/WebPage/ios/WebPageIOS.mm:
2666         (WebKit::WebPage::handleTap):
2667         (WebKit::WebPage::handleTwoFingerTapAtPoint):
2668         (WebKit::WebPage::commitPotentialTap):
2669         Adopt InteractionInformationRequest.
2670
2671         (WebKit::WebPage::getPositionInformation):
2672         (WebKit::WebPage::requestPositionInformation):
2673         Copy the request into the response.
2674         Only snapshot if the request wants a snapshot.
2675         Only make a link indicator if the request wants one.
2676
2677 2016-12-06  Daniel Bates  <dabates@apple.com>
2678
2679         Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
2680         https://bugs.webkit.org/show_bug.cgi?id=165451
2681
2682         Reviewed by Alex Christensen.
2683
2684         * NetworkProcess/NetworkDataTask.cpp:
2685         (WebKit::NetworkDataTask::didReceiveResponse):
2686
2687 2016-12-06  Daniel Bates  <dabates@apple.com>
2688
2689         Remove unused InjectedBundle::overrideXSSAuditorEnabledForTestRunner()
2690         https://bugs.webkit.org/show_bug.cgi?id=165408
2691
2692         Reviewed by Alex Christensen.
2693
2694         InjectedBundle::overrideXSSAuditorEnabledForTestRunner() is unused. This function was only
2695         called by WKBundleOverrideXSSAuditorEnabledForTestRunner(), which was removed in r106005.
2696
2697         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2698         (WebKit::InjectedBundle::overrideXSSAuditorEnabledForTestRunner): Deleted.
2699         * WebProcess/InjectedBundle/InjectedBundle.h:
2700
2701 2016-12-04  Darin Adler  <darin@apple.com>
2702
2703         Use ASCIICType more, and improve it a little bit
2704         https://bugs.webkit.org/show_bug.cgi?id=165360
2705
2706         Reviewed by Sam Weinig.
2707
2708         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2709         (WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
2710
2711 2016-12-06  Dave Hyatt  <hyatt@apple.com>
2712
2713         [CSS Parser] Turn on the new CSS parser
2714         https://bugs.webkit.org/show_bug.cgi?id=165213
2715
2716         Reviewed by Zalan Bujtas.
2717
2718         * Shared/WebPreferencesDefinitions.h:
2719
2720 2016-12-06  Tomas Popela  <tpopela@redhat.com>
2721
2722         [GTK] Process accelerated compositing env variables only if they are really enabled
2723         https://bugs.webkit.org/show_bug.cgi?id=165300
2724
2725         Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
2726         WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
2727         (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
2728
2729         Reviewed by Michael Catanzaro.
2730
2731         * UIProcess/gtk/WebPreferencesGtk.cpp:
2732         (WebKit::WebPreferences::platformInitializeStore):
2733
2734 2016-12-06  Sam Weinig  <sam@webkit.org>
2735
2736         [WebIDL] Add support for converting dictionaries to JS
2737         https://bugs.webkit.org/show_bug.cgi?id=165367
2738
2739         Reviewed by Darin Adler and Alex Christensen.
2740
2741         * CMakeLists.txt:
2742         Add missing directories to look in for headers.
2743
2744 2016-12-05  Tim Horton  <timothy_horton@apple.com>
2745
2746         Try to fix the iOS Simulator build.
2747
2748         * UIProcess/mac/RemoteLayerTreeHost.mm:
2749         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
2750
2751 2016-12-03  Simon Fraser  <simon.fraser@apple.com>
2752
2753         Minor reformat and renames in -didUpdateVisibleRect:
2754         https://bugs.webkit.org/show_bug.cgi?id=165365
2755
2756         Reviewed by Dave Hyatt.
2757         
2758         didUpdateVisibleRect:... has lots of parameters. Put one on each line.
2759
2760         Rename the rects to make it clear they are "content" rects (i.e. in document coordinates).
2761
2762         * UIProcess/ios/WKContentView.h:
2763         * UIProcess/ios/WKContentView.mm:
2764         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2765
2766 2016-12-05  Tim Horton  <timothy_horton@apple.com>
2767
2768         Adopt CAMachPort-as-layer-contents
2769         https://bugs.webkit.org/show_bug.cgi?id=141687
2770         <rdar://problem/19393233>
2771
2772         Reviewed by Darin Adler.
2773
2774         * Shared/mac/RemoteLayerBackingStore.h:
2775         * Shared/mac/RemoteLayerBackingStore.mm:
2776         (WebKit::RemoteLayerBackingStore::decode):
2777         On the UI process side, instead of actually looking up the surface,
2778         just keep the MachSendRight around, to later be turned into a CAMachPort.
2779
2780         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
2781         Make a CAMachPort and leak our send right into it. CAMachPort
2782         will adopt the port and destroy it when needed.
2783
2784         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
2785         Tiny style fix.
2786
2787         * Shared/mac/RemoteLayerTreePropertyApplier.h:
2788         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2789         (WebKit::applyPropertiesToLayer):
2790         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
2791         * UIProcess/DrawingAreaProxy.h:
2792         (WebKit::DrawingAreaProxy::prepareForAppSuspension):
2793         * UIProcess/ios/WebPageProxyIOS.mm:
2794         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
2795         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2796         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2797         (WebKit::RemoteLayerTreeDrawingAreaProxy::prepareForAppSuspension):
2798         * UIProcess/mac/RemoteLayerTreeHost.h:
2799         * UIProcess/mac/RemoteLayerTreeHost.mm:
2800         (WebKit::RemoteLayerTreeHost::updateLayerTree):
2801         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
2802         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2803         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2804         Two supporting changes in order to fix the two regressions that this
2805         caused when we tried to land it two years ago:
2806
2807         When an app is being suspended, resolve all CAMachPort backing store
2808         into actual IOSurfaces. Otherwise, any live CAMachPorts will keep a
2809         +1 on their respective IOSurface's use count, causing us to fail to
2810         mark them volatile, keeping the app alive for more time (re-trying the
2811         volatility change), and increasing the likelihood of background jetsam.
2812
2813         If the debugging tile map is enabled, do not use CAMachPort, because
2814         we don't have a great way to plumb the same CAMachPort to two layers
2815         (and it doesn't seem to work even if you do). Instead, just map the
2816         IOSurface into the UI process like we used to.
2817
2818 2016-12-05  Dean Jackson  <dino@apple.com>
2819
2820         pointer lock needs to be feature detectable
2821         https://bugs.webkit.org/show_bug.cgi?id=165426
2822         <rdar://problem/29486715>
2823
2824         Reviewed by Antoine Quint.
2825
2826         Set the RuntimeEnabledFeature as preferences
2827         change.
2828
2829         * UIProcess/API/C/WKPreferences.cpp:
2830         (WKPreferencesSetPointerLockEnabled):
2831         (WKPreferencesGetPointerLockEnabled):
2832         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2833         * WebProcess/WebPage/WebPage.cpp:
2834         (WebKit::WebPage::updatePreferences):
2835
2836 2016-12-05  Andreas Kling  <akling@apple.com>
2837
2838         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
2839         <https://webkit.org/b/165375>
2840         <rdar://problem/29057243>
2841
2842         Reviewed by Darin Adler.
2843
2844         Add two new entries to the sysdiagnose state dumps for WebContent processes:
2845         "Memory Usage Stats" and "JavaScript Object Counts".
2846
2847         The first category contains all the interesting stuff from task_info()
2848         along with some WebCore and JavaScriptCore object/memory counters.
2849
2850         The second category contains a list of all the JS object types currently live
2851         on the heap, along with a count.
2852
2853         * WebProcess/cocoa/WebProcessCocoa.mm:
2854         (WebKit::WebProcess::registerWithStateDumper): Add two new entries to the
2855         state dictionary: "Memory Usage Stats" and "JavaScript Object Counts".
2856
2857 2016-12-05  Csaba Osztrogonác  <ossy@webkit.org>
2858
2859         Unreviewed cmake buildfix after r209307.
2860
2861         * PlatformMac.cmake:
2862
2863 2016-12-03  Dan Bernstein  <mitz@apple.com>
2864
2865         [Cocoa] Expose InjectedBundlePageEditorClient via the Objective-C bundle SPI
2866         https://bugs.webkit.org/show_bug.cgi?id=165276
2867         <rdar://problem/29467040>
2868
2869         Reviewed by Darin Adler.
2870
2871         Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegate.mm
2872
2873         * Shared/Cocoa/APIObject.mm:
2874         (API::Object::newObject): Wrap InjectedBundleRangeHandle in WKWebProcessPlugInRangeHandle.
2875
2876         * WebKit2.xcodeproj/project.pbxproj: Added references to new files, making
2877           WKWebProcessPlugInEditingDelegate.h and WKWebProcessPlugInRangeHandle.h private headers.
2878
2879         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: Added. An base class
2880           based on InjectedBundlePageEditorClient.
2881         (API::InjectedBundle::EditorClient::~EditorClient):
2882         (API::InjectedBundle::EditorClient::shouldBeginEditing):
2883         (API::InjectedBundle::EditorClient::shouldEndEditing):
2884         (API::InjectedBundle::EditorClient::shouldInsertNode):
2885         (API::InjectedBundle::EditorClient::shouldInsertText):
2886         (API::InjectedBundle::EditorClient::shouldDeleteRange):
2887         (API::InjectedBundle::EditorClient::shouldChangeSelectedRange):
2888         (API::InjectedBundle::EditorClient::shouldApplyStyle):
2889         (API::InjectedBundle::EditorClient::didBeginEditing):
2890         (API::InjectedBundle::EditorClient::didEndEditing):
2891         (API::InjectedBundle::EditorClient::didChange):
2892         (API::InjectedBundle::EditorClient::didChangeSelection):
2893         (API::InjectedBundle::EditorClient::willWriteToPasteboard):
2894         (API::InjectedBundle::EditorClient::getPasteboardDataForRange):
2895         (API::InjectedBundle::EditorClient::didWriteToPasteboard):
2896
2897         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Added. Declares
2898           the new delegate protocol, currently comprising three methods corresponding to
2899           willWriteToPasteboard, getPasteboardDataForRange, and didWriteToPasteboard.
2900
2901         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
2902         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
2903         (-[WKWebProcessPlugInFrame jsRangeForRangeHandle:inWorld:]): Added. Gets the JS wrapper for
2904           the specified range handle.
2905
2906         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: Added.
2907         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: Added.
2908         (-[WKWebProcessPlugInRangeHandle dealloc]): Call the InjectedBundleRangeHandle destructor.
2909         (+[WKWebProcessPlugInRangeHandle rangeHandleWithJSValue:inContext:]): Get or create an
2910           InjectedBundleRangeHandle for the specified object.
2911         (-[WKWebProcessPlugInRangeHandle frame]): Return the range’s owner document’s frame.
2912         (-[WKWebProcessPlugInRangeHandle _rangeHandle]): Return the InjectedBundleRangeHandle.
2913         (-[WKWebProcessPlugInRangeHandle _apiObject]): Ditto.
2914
2915         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h: Added.
2916         (WebKit::wrapper):
2917
2918         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2919         (WKBundlePageSetEditorClient): Updated for WebPage change.
2920
2921         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2922         (-[WKWebProcessPlugInBrowserContextController _editingDelegate]): Added. Returns the
2923           delegate.
2924         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Added. Defines a
2925           Client class, which derives from API::InjectedBundle::EditorClient, and invokes the
2926           delegate methods. Instantiates a Client and sets it on the WebPage.
2927
2928         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2929           Declared new _editingDelegate property.
2930
2931         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2932         (WebKit::InjectedBundleRangeHandle::document): Added. Returns an InjectedBundleNodeHandle
2933           for the range’s owner document.
2934         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
2935
2936         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2937         (WebKit::InjectedBundlePageEditorClient::InjectedBundlePageEditorClient): Added. Calls
2938           initialize().
2939         (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing): Updated for type change.
2940         (WebKit::InjectedBundlePageEditorClient::shouldEndEditing): Ditto.
2941         (WebKit::InjectedBundlePageEditorClient::shouldInsertNode): Ditto.
2942         (WebKit::InjectedBundlePageEditorClient::shouldInsertText): Ditto.
2943         (WebKit::InjectedBundlePageEditorClient::shouldDeleteRange): Ditto.
2944         (WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange): Ditto.
2945         (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle): Ditto.
2946         (WebKit::InjectedBundlePageEditorClient::didBeginEditing): Ditto.
2947         (WebKit::InjectedBundlePageEditorClient::didEndEditing): Ditto.
2948         (WebKit::InjectedBundlePageEditorClient::didChange): Ditto.
2949         (WebKit::InjectedBundlePageEditorClient::didChangeSelection): Ditto.
2950         (WebKit::InjectedBundlePageEditorClient::willWriteToPasteboard): Ditto.
2951         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): Ditto.
2952         (WebKit::InjectedBundlePageEditorClient::didWriteToPasteboard): Ditto.
2953         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: Now derives from
2954           API::InjectedBundle::EditorClient.
2955
2956         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2957         (WebKit::WebEditorClient::shouldDeleteRange): Ditto.
2958         (WebKit::WebEditorClient::shouldBeginEditing): Ditto.
2959         (WebKit::WebEditorClient::shouldEndEditing): Ditto.
2960         (WebKit::WebEditorClient::shouldInsertNode): Ditto.
2961         (WebKit::WebEditorClient::shouldInsertText): Ditto.
2962         (WebKit::WebEditorClient::shouldChangeSelectedRange): Ditto.
2963         (WebKit::WebEditorClient::shouldApplyStyle): Ditto.
2964         (WebKit::WebEditorClient::didBeginEditing): Ditto.
2965         (WebKit::WebEditorClient::respondToChangedContents): Ditto.
2966         (WebKit::WebEditorClient::respondToChangedSelection): Ditto.
2967         (WebKit::WebEditorClient::didEndEditing): Ditto.
2968         (WebKit::WebEditorClient::didWriteSelectionToPasteboard): Ditto.
2969         (WebKit::WebEditorClient::willWriteSelectionToPasteboard): Ditto.
2970         (WebKit::WebEditorClient::getClientPasteboardDataForRange): Ditto.
2971
2972         * WebProcess/WebPage/WebPage.cpp:
2973         (WebKit::WebPage::WebPage): Initialize m_editorClient.
2974         (WebKit::WebPage::setInjectedBundleEditorClient): Replaces
2975           initializeInjectedBundleEditorClient and just sets m_editorClient.
2976         (WebKit::WebPage::close): Resets m_editorClient.
2977
2978         * WebProcess/WebPage/WebPage.h: Changed m_editorClient to a unique_ptr.
2979
2980 2016-12-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
2981
2982         [iOS] Add a WebView private configuration for changing the WebContent update frequency
2983         https://bugs.webkit.org/show_bug.cgi?id=165289
2984         <rdar://problem/29472577>
2985
2986         Reviewed by Tim Horton.
2987         
2988         Expose a preference which allows us to control the fps of web content updates.
2989
2990         * UIProcess/API/APIPageConfiguration.h:
2991         (API::PageConfiguration::contentUpdateFrequency):
2992         (API::PageConfiguration::setContentUpdateFrequency):
2993         * UIProcess/API/Cocoa/WKWebView.mm:
2994         (-[WKWebView _initializeWithConfiguration:]):
2995         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2996         (-[WKWebViewConfiguration copyWithZone:]):
2997         (-[WKWebViewConfiguration _contentUpdateFrequency]):
2998         (-[WKWebViewConfiguration _setContentUpdateFrequency:]):
2999         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3000         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3001         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3002         (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
3003         (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency):
3004
3005 2016-12-02  Andy Estes  <aestes@apple.com>
3006
3007         [Cocoa] Adopt the PRODUCT_BUNDLE_IDENTIFIER build setting
3008         https://bugs.webkit.org/show_bug.cgi?id=164492
3009
3010         Reviewed by Dan Bernstein.
3011
3012         * Configurations/DatabaseService.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
3013         $(PRODUCT_NAME).
3014         * Configurations/NetworkService.xcconfig: Ditto.
3015         * Configurations/PluginService.32.xcconfig: Ditto.
3016         * Configurations/PluginService.64.xcconfig: Ditto.
3017         * Configurations/WebContentService.xcconfig: Ditto.
3018         * Configurations/WebKit.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
3019         com.apple.$(PRODUCT_NAME:rfc1034identifier).
3020         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist: Changed
3021         CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
3022         * Info.plist: Changed CFBundleIdentifier's value from com.apple.${PRODUCT_NAME} to
3023         ${PRODUCT_BUNDLE_IDENTIFIER}.
3024         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Changed
3025         CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
3026         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: Ditto.
3027         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: Ditto.
3028         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto.
3029         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Ditto.
3030         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Ditto.
3031         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Ditto.
3032         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto.
3033
3034 2016-12-02  Brent Fulgham  <bfulgham@apple.com>
3035
3036         [Mac] Update sandbox profiles to use modern syntax and avoid duplication
3037         https://bugs.webkit.org/show_bug.cgi?id=165332
3038         <rdar://problem/26898991>
3039
3040         Reviewed by Anders Carlsson.
3041
3042         Update the Mac sandbox profiles to reflect that modern Cocoa applications
3043         communicate with cfprefsd, rather than plists on disk (and have done so
3044         for the past several releases).
3045
3046         Get rid of some duplicated rules, as well as old compatibility rules that
3047         are never triggered under supported operating systems.
3048
3049         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
3050         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3051         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3052         * WebProcess/com.apple.WebProcess.sb.in:
3053
3054 2016-12-02  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
3055
3056         Fix build break when disabling some features.
3057         https://bugs.webkit.org/show_bug.cgi?id=165254
3058
3059         The EFL port was broken if SPELLCHECK was disabled or
3060         PLUGIN_ARCHITECTURE is not x11.
3061
3062         Reviewed by Michael Catanzaro.
3063
3064         * UIProcess/efl/TextCheckerEfl.cpp:
3065         (WebKit::TextChecker::checkTextOfParagraph):
3066         (WebKit::TextChecker::checkSpellingOfString):
3067         Fix UNUSED_PARAM() usage if SPELLCHECK is disabled.
3068         * UIProcess/efl/WebPageProxyEfl.cpp:
3069         Isolate methods within #if PLUGIN_ARCHITECTURE(X11).
3070
3071 2016-12-01  Jiewen Tan  <jiewen_tan@apple.com>
3072
3073         Add a runtime flag for SubtleCrypto
3074         https://bugs.webkit.org/show_bug.cgi?id=164982
3075
3076         Reviewed by Brent Fulgham.
3077
3078         * Shared/WebPreferencesDefinitions.h:
3079         * UIProcess/API/C/WKPreferences.cpp:
3080         (WKPreferencesSetSubtleCryptoEnabled):
3081         (WKPreferencesGetSubtleCryptoEnabled):
3082         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3083         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3084         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3085         * WebProcess/WebPage/WebPage.cpp:
3086         (WebKit::WebPage::updatePreferences):
3087
3088 2016-12-01  Saam Barati  <sbarati@apple.com>
3089
3090         Rename CallFrame::callee() to CallFrame::jsCallee()
3091         https://bugs.webkit.org/show_bug.cgi?id=165293
3092
3093         Reviewed by Keith Miller.
3094
3095         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3096         (WebKit::callMethod):
3097         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3098         (WebKit::callNPJSObject):
3099         (WebKit::constructWithConstructor):
3100
3101 2016-12-01  Chris Dumez  <cdumez@apple.com>
3102
3103         [iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp
3104         https://bugs.webkit.org/show_bug.cgi?id=165270
3105         <rdar://problem/29224355>
3106
3107         Reviewed by Simon Fraser.
3108
3109         Tapping an element generates a 'click' event that has 0 as timeStamp
3110         instead of having a proper timeStamp value. This is breaking some
3111         sites.
3112
3113         * WebProcess/WebPage/ios/WebPageIOS.mm:
3114         (WebKit::WebPage::handleSyntheticClick):
3115         (WebKit::WebPage::completeSyntheticClick):
3116
3117 2016-12-01  Tim Horton  <timothy_horton@apple.com>
3118
3119         Try to fix the EFL/Gtk build
3120
3121         * UIProcess/efl/WebProcessPoolEfl.cpp:
3122         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
3123         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3124         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
3125
3126 2016-12-01  Tim Horton  <timothy_horton@apple.com>
3127
3128         Every WKWebView initialization spends a few milliseconds hitting the disk
3129         https://bugs.webkit.org/show_bug.cgi?id=165268
3130         <rdar://problem/29010113>
3131
3132         Reviewed by Brady Eidson.
3133
3134         Every WKWebView init currently involves doing directory creation and
3135         symlink resolution for a number of paths (to create sandbox extensions
3136         for all of our storage directories), which means touching the disk a
3137         lot during init. All of these paths are immutable per-WebProcessPool,
3138         so, instead, cache them on WebProcessPool and create sandbox extensions
3139         from the already-resolved paths. This is a sizable (~4x) speedup when
3140         initializing subsequent web views.
3141
3142         * Shared/SandboxExtension.h:
3143         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
3144         Add createHandleWithoutResolvingPath, which makes a sandbox extension
3145         handle without doing symlink resolution.
3146
3147         (WebKit::resolvePathForSandboxExtension):
3148         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
3149         Add two functions that do the same resolution that SandboxExtension::createHandle
3150         and ::createHandleForReadWriteDirectory do, but just return the paths,
3151         for later use with createHandleWithoutResolvingPath.
3152
3153         * Shared/mac/SandboxExtensionMac.mm:
3154         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
3155         (WebKit::resolvePathForSandboxExtension):
3156         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
3157         (WebKit::SandboxExtension::createHandle):
3158         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
3159         Implement the aforementioned functions, and reimplement the existing
3160         createHandle{ForReadWriteDirectory} functions in terms of them.
3161
3162         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3163         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
3164         Stop wasting time generating and resolving a platform default icon
3165         database path, since we don't actually use it for anything anymore except
3166         to determine whether the icon database is enabled, and we only want to
3167         enable it if the client has provided a path.
3168
3169         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
3170         (WebKit::WebProcessPool::platformInitializeWebProcess):
3171         * UIProcess/WebProcessPool.cpp:
3172         (WebKit::m_hiddenPageThrottlingTimer):
3173         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
3174         (WebKit::WebProcessPool::createNewWebProcess):
3175         * UIProcess/WebProcessPool.h:
3176         Resolve paths in resolvePathsForSandboxExtensions, and use the resolved
3177         paths along with createHandleWithoutResolvingPath in order to effectively
3178         cache the resolution operation.
3179
3180 2016-12-01  Antti Koivisto  <antti@apple.com>
3181
3182         Revert r208931
3183         https://bugs.webkit.org/show_bug.cgi?id=164924
3184
3185         PLT regression.
3186
3187         * NetworkProcess/cache/NetworkCache.cpp:
3188         (WebKit::NetworkCache::makeCacheKey):
3189         (WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
3190         * NetworkProcess/cache/NetworkCache.h:
3191         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3192         (WebKit::NetworkCache::BlobStorage::BlobStorage):
3193         (WebKit::NetworkCache::BlobStorage::add):
3194         (WebKit::NetworkCache::BlobStorage::get):
3195         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
3196         * NetworkProcess/cache/NetworkCacheData.cpp:
3197         (WebKit::NetworkCache::computeSHA1):
3198         (WebKit::NetworkCache::makeSalt): Deleted.
3199         (WebKit::NetworkCache::readOrMakeSalt): Deleted.
3200         * NetworkProcess/cache/NetworkCacheData.h:
3201         * NetworkProcess/cache/NetworkCacheKey.cpp:
3202         (WebKit::NetworkCache::noPartitionString):
3203         (WebKit::NetworkCache::Key::Key):
3204         (WebKit::NetworkCache::Key::hasPartition):
3205         (WebKit::NetworkCache::Key::computeHash):
3206         (WebKit::NetworkCache::Key::hashAsString):
3207         (WebKit::NetworkCache::Key::computePartitionHash): Deleted.
3208         * NetworkProcess/cache/NetworkCacheKey.h:
3209         (WebKit::NetworkCache::Key::hash):
3210         (WebKit::NetworkCache::Key::partitionHash): Deleted.
3211         (WebKit::NetworkCache::Key::hashAsString): Deleted.
3212         (WebKit::NetworkCache::Key::partitionHashAsString): Deleted.
3213         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3214         (WebKit::NetworkCache::makeSubresourcesKey):
3215         (WebKit::NetworkCache::constructRevalidationRequest):
3216         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
3217         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
3218         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3219         (WebKit::NetworkCache::Storage::open):
3220         (WebKit::NetworkCache::traverseRecordsFiles):
3221         (WebKit::NetworkCache::Storage::Storage):
3222         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
3223         (WebKit::NetworkCache::decodeRecordHeader):
3224         (WebKit::NetworkCache::Storage::readRecord):
3225         (WebKit::NetworkCache::Storage::encodeRecord):
3226         (WebKit::NetworkCache::Storage::traverse):
3227         (WebKit::NetworkCache::makeSaltFilePath): Deleted.
3228         * NetworkProcess/cache/NetworkCacheStorage.h:
3229         (WebKit::NetworkCache::Storage::salt): Deleted.
3230
3231 2016-11-30  Sam Weinig  <sam@webkit.org>
3232
3233         [WebIDL] Remove custom bindings for File and Blob constructors
3234         https://bugs.webkit.org/show_bug.cgi?id=165218
3235
3236         Reviewed by Darin Adler.
3237
3238         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3239         (WebKit::NetworkBlobRegistry::registerBlobURL):
3240         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3241         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3242         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3243         * NetworkProcess/NetworkConnectionToWebProcess.h:
3244         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3245         (WebKit::BlobRegistryProxy::registerBlobURL):
3246         * WebProcess/FileAPI/BlobRegistryProxy.h:
3247         Avoid copies of the BlobPart Vector.
3248
3249 2016-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
3250
3251         [GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
3252         https://bugs.webkit.org/show_bug.cgi?id=164911
3253
3254         Reviewed by Michael Catanzaro.
3255
3256         The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an
3257         image. We only use the buffer to get the image size, so we could save the image size when the image is created,
3258         and then we don't need to care about the buffer anymore.
3259
3260         * UIProcess/gtk/WaylandCompositor.cpp:
3261         (WebKit::WaylandCompositor::Surface::prepareTextureForPainting):
3262         (WebKit::WaylandCompositor::Surface::commit):
3263         * UIProcess/gtk/WaylandCompositor.h:
3264
3265 2016-11-30  Antoine Quint  <graouts@apple.com>
3266
3267         [Modern Media Controls] Add an HTML comment flag to turn the feature on
3268         https://bugs.webkit.org/show_bug.cgi?id=165226
3269
3270         Reviewed by Dean Jackson.
3271
3272         Add new methods to set the Modern Media Controls preference.
3273
3274         * UIProcess/API/C/WKPreferences.cpp:
3275         (WKPreferencesSetModernMediaControlsEnabled):
3276         (WKPreferencesGetModernMediaControlsEnabled):
3277         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3278
3279 2016-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
3280
3281         Add separate settings and preferences to enable/disable async decoding for large images and animated images
3282         https://bugs.webkit.org/show_bug.cgi?id=165177
3283
3284         Reviewed by Simon Fraser.
3285         
3286         Hook up the async image decoding settings for WebKit2.
3287
3288         * Shared/WebPreferencesDefinitions.h:
3289         * UIProcess/API/Cocoa/WKPreferences.mm:
3290         (-[WKPreferences _largeImageAsyncDecodingEnabled]):
3291         (-[WKPreferences _setLargeImageAsyncDecodingEnabled:]):
3292         (-[WKPreferences _animatedImageAsyncDecodingEnabled]):
3293         (-[WKPreferences _setAnimatedImageAsyncDecodingEnabled:]):
3294         (-[WKPreferences _asyncImageDecodingEnabled]): Deleted.
3295         (-[WKPreferences _setAsyncImageDecodingEnabled:]): Deleted.
3296         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3297         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3298         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3299         * WebProcess/WebPage/WebPage.cpp:
3300         (WebKit::WebPage::updatePreferences):
3301
3302 2016-11-30  Chris Dumez  <cdumez@apple.com>
3303
3304         [iOS][WK2] Turn on HTML interactive form validation feature
3305         https://bugs.webkit.org/show_bug.cgi?id=165212
3306         <rdar://problem/29444356>
3307
3308         Reviewed by Simon Fraser.
3309
3310         Turn on HTML interactive form validation feature on iOS WK2
3311         now that we have a native UI.
3312
3313         * Shared/WebPreferencesDefinitions.h:
3314
3315 2016-11-30  Brent Fulgham  <bfulgham@apple.com>
3316
3317         Correct plugin sandbox after r208611
3318         https://bugs.webkit.org/show_bug.cgi?id=165187
3319         <rdar://problem/29431165>
3320
3321         Reviewed by Alex Christensen.
3322
3323         In r208611 I removed the 'else' clause of a Scheme conditional
3324         that was needed to properly run plugins (such as Flash Player).
3325
3326         This change retains the relevant current sandbox content, while
3327         still stripping out the old code that is no longer needed.
3328
3329         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3330
3331 2016-11-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3332
3333         [GTK] Database process should not initialize gtk
3334         https://bugs.webkit.org/show_bug.cgi?id=165138
3335
3336         Reviewed by Sergio Villar Senin.
3337
3338         It doesn't use GTK+ at all.
3339
3340         * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp:
3341         (WebKit::DatabaseProcessMainUnix):
3342         (): Deleted.
3343
3344 2016-11-29  Gavin Barraclough  <barraclough@apple.com>
3345
3346         Remove WebPage::SetPageSuppressed
3347         https://bugs.webkit.org/show_bug.cgi?id=165158
3348
3349         Unreviewed revert accidental change.
3350
3351         * WebProcess/WebPage/WebPage.cpp:
3352         (WebKit::WebPage::setActivityState):
3353
3354 2016-11-29  Gavin Barraclough  <barraclough@apple.com>
3355
3356         Remove WebPage::SetPageSuppressed
3357         https://bugs.webkit.org/show_bug.cgi?id=165158
3358
3359         Reviewed by Tim Horton.
3360
3361         This was scaffolding. We've now refactored to the point that the information driving throttling originates
3362         from the UI process (so UI and web processes can have a consistent view of what should throttle), but we
3363         don't need a separate message to handle this - necessary state to determine is provided in ActivityState.
3364
3365         * UIProcess/WebPageProxy.cpp:
3366         (WebKit::WebPageProxy::updateThrottleState):
3367             - used to send SetPageSuppressed; no longer does.
3368         * UIProcess/WebPageProxy.h:
3369             - removed m_pageSuppressed (was used to avoid duplicated messages).
3370         * WebProcess/WebPage/WebPage.cpp:
3371         (WebKit::WebPage::updateThrottleState):
3372             - compute throttle state based on m_activityState.
3373         (WebKit::WebPage::setActivityState):
3374             - update throttle state whenever activity state changes.
3375         (WebKit::WebPage::updatePreferences):
3376             - update throttle state whenever preferences change (throttling can be disabled via preference).
3377         (WebKit::WebPage::setPageSuppressed): Deleted.
3378             - Removed WebPage::SetPageSuppressed.
3379         * WebProcess/WebPage/WebPage.h:
3380             - Removed WebPage::SetPageSuppressed.
3381             - Added m_processSuppressionEnabled, to cache preference state.
3382         * WebProcess/WebPage/WebPage.messages.in:
3383             - Removed WebPage::SetPageSuppressed.
3384
3385 2016-11-29  Andy Estes  <aestes@apple.com>
3386
3387         [Cocoa] Enable two clang warnings recommended by Xcode
3388         https://bugs.webkit.org/show_bug.cgi?id=164498
3389
3390         Reviewed by Mark Lam.
3391
3392         * Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.
3393
3394 2016-11-29  Eric Carlson  <eric.carlson@apple.com>
3395
3396         [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
3397         https://bugs.webkit.org/show_bug.cgi?id=164760
3398         <rdar://problem/29261266>
3399
3400         Reviewed by Youenn Fablet.
3401
3402         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3403         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
3404         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
3405         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
3406         (WebKit::FrameAuthorizationState::reset):
3407         (WebKit::FrameAuthorizationState::securityOriginsAreEqual):
3408         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
3409         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
3410         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
3411         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
3412         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
3413         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3414         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3415         (WebKit::FrameAuthorizationState::~FrameAuthorizationState):
3416         (WebKit::FrameAuthorizationState::frameID):
3417         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3418         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
3419         * UIProcess/UserMediaPermissionRequestProxy.h:
3420         (WebKit::UserMediaPermissionRequestProxy::create):
3421         (WebKit::UserMediaPermissionRequestProxy::frameID):
3422         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
3423         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
3424         * UIProcess/WebPageProxy.cpp:
3425         (WebKit::WebPageProxy::didCommitLoadForFrame):
3426         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3427         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
3428
3429 2016-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3430
3431         Scroll snapping on Mac should use AppKit animations
3432         https://bugs.webkit.org/show_bug.cgi?id=147261
3433         <rdar://problem/29395293>
3434
3435         Reviewed by Brent Fulgham.
3436
3437         Add some logic to plumb filtered wheel velocity over to WebCore in the case of mainframe scrolling. See
3438         WebCore/ChangeLog for more details.
3439
3440         * WebProcess/WebPage/EventDispatcher.cpp:
3441         (WebKit::EventDispatcher::wheelEvent):
3442
3443 2016-11-21  Brian Burg  <bburg@apple.com>
3444
3445         Web Automation: add ObjC SPI to set whether a page is controlled by automation
3446         https://bugs.webkit.org/show_bug.cgi?id=165001
3447         <rdar://problem/29350432>
3448
3449         Reviewed by Dan Bernstein.
3450
3451         Add SPI property to WKWebViewConfiguration and plumb it through to
3452         initialize WebPageProxy::m_controlledByAutomation. This is propagated
3453         to the WebProcess on creation via WebPageCreationParameters.
3454
3455         * UIProcess/API/APIPageConfiguration.cpp:
3456         (API::PageConfiguration::copy):
3457         * UIProcess/API/APIPageConfiguration.h:
3458         (API::PageConfiguration::isControlledByAutomation):
3459         (API::PageConfiguration::setControlledByAutomation):
3460         * UIProcess/API/Cocoa/WKWebView.mm:
3461         (-[WKWebView _initializeWithConfiguration:]):
3462         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3463         (-[WKWebViewConfiguration init]):