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