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