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