1 2017-07-20 Chris Dumez <cdumez@apple.com>
3 Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords()
4 https://bugs.webkit.org/show_bug.cgi?id=174686
6 Reviewed by Geoffrey Garen.
8 Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords(). The most common
9 call site is already on the right thread.
11 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
12 (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]):
13 * UIProcess/WebResourceLoadStatisticsStore.cpp:
14 (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
15 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
16 * UIProcess/WebResourceLoadStatisticsStore.h:
18 2017-07-20 Chris Dumez <cdumez@apple.com>
20 Regression(ITP): May get frequently logged out of wsj.com
21 https://bugs.webkit.org/show_bug.cgi?id=174661
22 <rdar://problem/32343256>
24 Reviewed by Geoffrey Garen.
26 Bump statistics file version to blow away old statistics on disk since those do not
27 take into account associated domains.
29 * UIProcess/WebResourceLoadStatisticsStore.cpp:
31 2017-07-20 Chris Dumez <cdumez@apple.com>
33 Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
34 https://bugs.webkit.org/show_bug.cgi?id=174660
36 Reviewed by Geoffrey Garen.
38 Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
39 This essentially replaces a branch to figure out if the new size is less or greater than the
40 current size by an assertion.
42 * Platform/IPC/ArgumentCoders.h:
43 * UIProcess/Gamepad/UIGamepadProvider.cpp:
44 (WebKit::UIGamepadProvider::platformGamepadConnected):
45 * UIProcess/WebProcessPool.cpp:
46 (WebKit::WebProcessPool::setInitialConnectedGamepads):
47 * WebProcess/Network/WebLoaderStrategy.cpp:
48 (WebKit::WebLoaderStrategy::loadResourceSynchronously):
49 * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
50 (WebKit::WebPasteboardOverrides::getDataForOverride):
51 * WebProcess/WebPage/ios/WebPageIOS.mm:
52 (WebKit::WebPage::requestAutocorrectionData):
54 2017-07-20 Chris Dumez <cdumez@apple.com>
56 Regression(ITP): Can no longer log in on abc.go.com
57 https://bugs.webkit.org/show_bug.cgi?id=174533
58 <rdar://problem/33325881>
60 Reviewed by Geoffrey Garen.
62 Bump statistics database version to blow away any existing statistics. Without this, SSO providers
63 for which we added a quirk may already be in the database and identified as trackers. The quirk
64 merely prevents the specified SSO providers from being identified as trackers.
66 * UIProcess/WebResourceLoadStatisticsStore.cpp:
68 2017-07-19 Simon Fraser <simon.fraser@apple.com>
70 getBoundingClientRects not updated for programmatic scrolls
71 https://bugs.webkit.org/show_bug.cgi?id=174538
72 rdar://problem/33049012
74 Reviewed by Tim Horton.
76 Feed ViewportRectStability and ScrollingLayerPositionAction into reconcileScrollingState().
78 * WebProcess/WebPage/ios/WebPageIOS.mm:
79 (WebKit::WebPage::updateVisibleContentRects):
81 2017-07-19 Brady Eidson <beidson@apple.com>
83 iBooks sometimes crashes when closing a book.
84 <rdar://problem/31180331> and https://bugs.webkit.org/show_bug.cgi?id=174658
86 Reviewed by Oliver Hunt.
88 - LegacyCustomProtocolManagerProxy should not reference a WebProcessPool directly.
89 - LegacyCustomProtocolManagerProxy should invalidate in its destructor.
91 * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp:
92 (WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy):
93 (WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy):
94 (WebKit::LegacyCustomProtocolManagerProxy::startLoading):
95 (WebKit::LegacyCustomProtocolManagerProxy::stopLoading):
96 (WebKit::LegacyCustomProtocolManagerProxy::invalidate):
97 (WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest):
98 (WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse):
99 (WebKit::LegacyCustomProtocolManagerProxy::didLoadData):
100 (WebKit::LegacyCustomProtocolManagerProxy::didFailWithError):
101 (WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading):
102 (WebKit::LegacyCustomProtocolManagerProxy::processDidClose): Deleted.
103 * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h:
105 * UIProcess/Network/NetworkProcessProxy.cpp:
106 (WebKit::NetworkProcessProxy::NetworkProcessProxy):
107 (WebKit::NetworkProcessProxy::didClose):
108 * UIProcess/Network/NetworkProcessProxy.h:
109 (WebKit::NetworkProcessProxy::processPool):
111 2017-07-19 Yusuke Suzuki <utatane.tea@gmail.com>
113 [WTF] Implement WTF::ThreadGroup
114 https://bugs.webkit.org/show_bug.cgi?id=174081
116 Reviewed by Mark Lam.
118 * Shared/AsyncRequest.h:
120 2017-07-18 Carlos Garcia Campos <cgarcia@igalia.com>
122 WebDriver: handle invalid selector errors
123 https://bugs.webkit.org/show_bug.cgi?id=174619
125 Reviewed by Brian Burg.
127 We are currently handling only XPathException and only when it's an invalid expression. In the xpath case, the
128 spec also says "If any item in result is not an element return an error with error code invalid selector.", so
129 we should also handle TYPE_ERR (The expression could not be converted to return the specified type.). However,
130 since the spec says "or other error", I think we can simplify this and simply throw InvalidSelector inside the
131 catch, without checking any specific error. This is causing 14 failures in selenium tests.
133 ยง12. Element Retrieval. Step 6: If a DOMException, SyntaxError, XPathException, or other error occurs during the
134 execution of the element location strategy, return error invalid selector.
135 https://www.w3.org/TR/webdriver/#dfn-find
137 * UIProcess/Automation/Automation.json: Add InvalidSelector error.
138 * UIProcess/Automation/atoms/FindNodes.js:
139 (tryToFindNode): Raise InvalidSelector in case of error.
140 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
141 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidSelector exceptions.
143 2017-07-18 Carlos Garcia Campos <cgarcia@igalia.com>
145 Web Automation: error details not passed to DidEvaluateJavaScriptFunction message when callback was not called before page unload
146 https://bugs.webkit.org/show_bug.cgi?id=174624
148 Reviewed by Brian Burg.
150 There's a variable errorMessage, but it's unused.
152 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
153 (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): Pass errorMessage instead of String() to DidEvaluateJavaScriptFunction.
155 2017-07-18 Carlos Garcia Campos <cgarcia@igalia.com>
157 Web Automation: evaluateJavaScriptFunction should always notify the web process before returning early
158 https://bugs.webkit.org/show_bug.cgi?id=174623
160 Reviewed by Brian Burg.
162 It currently returns early if page, frame or scriptObject are nullptr, in which cases the UI process is not
163 notified. This causes test testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs to hang, because message
164 DidEvaluateJavaScriptFunction is never sent when the given frame no longer exists. We should send
165 DidEvaluateJavaScriptFunction with WindowNotFound in case of page is nullptr and FrameNotFound if the frame is
166 nullptr. The scriptObject early return is actually wrong, because scriptObjectForFrame creates a new script if
167 there's isn't one for the given frame.
169 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
170 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
172 2017-07-18 Carlos Garcia Campos <cgarcia@igalia.com>
174 Web Automation: pending evaluate script callbacks are stored with the wrong frame ID when using the default main frame
175 https://bugs.webkit.org/show_bug.cgi?id=174622
177 Reviewed by Brian Burg.
179 The frameHandle argument is optional in evaluateJavaScriptFunction(), when not provided we pass 0 to the web
180 process. The proxy gets the web page main frame when received frame ID is 0, but the given frameID is
181 still used as key of m_webFramePendingEvaluateJavaScriptCallbacksMap and also passed to the javascript function
182 as argument. I think r203442 was actually a workaround to this bug, making it even more hidden. Both
183 m_webFrameScriptObjectMap and m_webFramePendingEvaluateJavaScriptCallbacksMap should never have 0 as a
184 key, since they always use a frame ID, and the frame identifier counter starts at 1. This is causing test
185 testShouldDetectPageLoadsWhileWaitingOnAnAsyncScriptAndReturnAnError to hang, because when the page is unloaded
186 and didClearWindowObjectForFrame is called, we try to get the pending callbacks of frame 1, but they were stored
187 as frame 0 so DidEvaluateJavaScriptFunction message is never sent to the UI process.
189 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
190 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use always the actual frameID from the WebFrame
192 * WebProcess/Automation/WebAutomationSessionProxy.h: Do not allow 0 as a key of
193 m_webFramePendingEvaluateJavaScriptCallbacksMap and m_webFrameScriptObjectMap.
195 2017-07-18 Andy Estes <aestes@apple.com>
197 [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
198 https://bugs.webkit.org/show_bug.cgi?id=174631
200 Reviewed by Tim Horton.
202 * Configurations/Base.xcconfig:
203 * Shared/API/APIArray.cpp:
204 (API::Array::toStringVector):
205 * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
206 (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray):
207 * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
208 (WebKit::WebUserContentControllerProxy::addProcess):
209 (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
210 (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
211 * UIProcess/ios/forms/WKFileUploadPanel.mm:
212 (-[WKFileUploadPanel presentWithParameters:resultListener:]):
213 * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
214 (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
216 2017-07-18 Andy Estes <aestes@apple.com>
218 [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
219 https://bugs.webkit.org/show_bug.cgi?id=174631
221 Reviewed by Sam Weinig.
223 * Configurations/Base.xcconfig:
225 2017-07-18 Andy Estes <aestes@apple.com>
227 [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
228 https://bugs.webkit.org/show_bug.cgi?id=174631
230 Reviewed by Dan Bernstein.
232 * Configurations/Base.xcconfig:
234 2017-07-18 Matt Lewis <jlewis3@apple.com>
236 Unreviewed, rolling out r219610.
238 This caused an api failure on all platforms for the test
239 SnapshotImageLargeAsyncDecoding
243 "Async image decoding for large images should be disabled
244 after the first time a tile is painted"
245 https://bugs.webkit.org/show_bug.cgi?id=174451
246 http://trac.webkit.org/changeset/219610
248 2017-07-18 Andy Estes <aestes@apple.com>
250 [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
251 https://bugs.webkit.org/show_bug.cgi?id=174631
253 Reviewed by Darin Adler.
255 * Configurations/Base.xcconfig:
257 2017-07-18 Said Abou-Hallawa <sabouhallawa@apple.com>
259 Async image decoding for large images should be disabled after the first time a tile is painted
260 https://bugs.webkit.org/show_bug.cgi?id=174451
262 Reviewed by Simon Fraser.
264 * Shared/mac/RemoteLayerBackingStore.mm:
265 (WebKit::RemoteLayerBackingStore::drawInContext):
266 * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
267 (WebKit::CompositingCoordinator::paintContents):
268 * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
270 2017-07-17 Carlos Garcia Campos <cgarcia@igalia.com>
272 Web Automation: link and partial link queries don't work if text link contains trailing or leading whitespaces
273 https://bugs.webkit.org/show_bug.cgi?id=174499
275 Reviewed by Brian Burg.
277 This is causing test test_Driver_Can_Get_Link_By_Link_Test_Ignoring_Trailing_Whitespace to fail.
279 * UIProcess/Automation/atoms/FindNodes.js:
280 (switch): Use normalize-space() in in the links xpath expressions.
282 2017-07-17 Darin Adler <darin@apple.com>
284 Improve use of NeverDestroyed
285 https://bugs.webkit.org/show_bug.cgi?id=174348
287 Reviewed by Sam Weinig.
289 * DatabaseProcess/DatabaseProcess.h: Removed unneeded include of
291 * NetworkProcess/cache/NetworkCacheKey.cpp: Ditto.
293 * NetworkProcess/capture/NetworkCaptureManager.cpp: Moved include of
294 NeverDestroyed.h here ...
295 * NetworkProcess/capture/NetworkCaptureManager.h: ... from here.
297 * PluginProcess/PluginProcess.cpp: Moved include of NeverDestroyed.h
299 * PluginProcess/PluginProcess.h: ... from here.
301 * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
302 (isContainerClass): Removed trivial inefficient use of
303 LazyNeverDestroyed<HashSet> to check against two classes.
304 Instead wrote out the boolean expression.
306 * Shared/mac/SecItemShim.cpp: Removed unneeded include of
309 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
310 (WebKit::WebProcessPool::platformInitialize): Call
311 installMemoryPressureHandler instead of WebMemoryPressureHandler::singleton.
313 * UIProcess/Gamepad/UIGamepadProvider.h: Removed unneeded include
316 * UIProcess/Plugins/PluginProcessManager.cpp: Moved include of
317 NeverDestroyed.h here ...
318 * UIProcess/Plugins/PluginProcessManager.h: ... from here.
320 * UIProcess/WebInspectorProxy.cpp: Removed unneeded include
323 * UIProcess/WebPageProxy.h: Added now-needed include of
324 MediaPlaybackTargetContext.h.
326 * UIProcess/WebPasteboardProxy.cpp: Moved include of
327 NeverDestroyed.h here ...
328 * UIProcess/WebPasteboardProxy.h: ... from here.
330 * UIProcess/ios/WebMemoryPressureHandlerIOS.h: Removed the
331 WebMemoryPressureHandler class from this header. Callers don't need to
332 know if there is a class. They simply indicate when it's time to install
333 the handler. Another way to put it is that this class had no functions
334 other than the singleton function.
336 * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
337 (WebKit::installMemoryPressureHandler): Replaced the class with this function.
338 It creates a dispatch source and then resumes it. To avoid having the source
339 look like a leak, we keep it in a global variable.
341 * WebProcess/Gamepad/WebGamepadProvider.h: Include Forward.h instead of
344 * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Moved include of
345 NeverDestroyed.h here ...
346 * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: ... from here.
348 * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Removed unneeded
349 include of NeverDestroyed.h.
351 2017-07-17 Timothy Horton <timothy_horton@apple.com>
353 Page using safe area constant properties jumps to correct layout after resize
354 https://bugs.webkit.org/show_bug.cgi?id=174598
355 <rdar://problem/33364275>
357 Reviewed by Simon Fraser.
359 Test: fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html
361 * UIProcess/API/Cocoa/WKWebView.mm:
362 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
363 * UIProcess/WebPageProxy.h:
364 * UIProcess/ios/WebPageProxyIOS.mm:
365 (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
366 * WebProcess/WebPage/WebPage.h:
367 * WebProcess/WebPage/WebPage.messages.in:
368 * WebProcess/WebPage/ios/WebPageIOS.mm:
369 (WebKit::WebPage::dynamicViewportSizeUpdate):
370 Plumb unobscured safe area insets through in the dynamicViewportSizeUpdate,
371 like we do in VisibleContentRectUpdate (once again sad that these aren't
372 more similar), so that it will be correct in the during-rotation snapshot,
373 instead of only becoming correct in the first visible content rect update
376 2017-07-17 Chris Dumez <cdumez@apple.com>
378 UserMediaPermissionRequestManagerProxy should not use WebCore::Timer
379 https://bugs.webkit.org/show_bug.cgi?id=174599
380 <rdar://problem/33362600>
382 Reviewed by Tim Horton.
384 UserMediaPermissionRequestManagerProxy should not use WebCore::Timer since it runs in the
385 UIProcess. Switch to using RunLoop::Timer instead.
387 * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
388 (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
389 * UIProcess/UserMediaPermissionRequestManagerProxy.h:
391 2017-07-17 Chris Dumez <cdumez@apple.com>
393 NETWORK_SESSION does not need didReceiveAuthenticationChallenge(uint64_t, uint64_t, const AuthenticationChallenge&)
394 https://bugs.webkit.org/show_bug.cgi?id=174595
396 Reviewed by Alex Christensen.
398 * Shared/Authentication/AuthenticationManager.cpp:
399 (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
400 * Shared/Authentication/AuthenticationManager.h:
402 2017-07-17 Wenson Hsieh <wenson_hsieh@apple.com>
404 [iOS DnD] Web process uses too much memory when beginning a drag on a very large image
405 https://bugs.webkit.org/show_bug.cgi?id=174585
406 <rdar://problem/33302541>
408 Reviewed by Tim Horton.
410 Add IPC support for serializing/deserializing the size of an image written to the pasteboard. See WebCore
411 ChangeLogs for more details.
413 * Shared/WebCoreArgumentCoders.cpp:
414 (IPC::ArgumentCoder<PasteboardImage>::encode):
415 (IPC::ArgumentCoder<PasteboardImage>::decode):
417 2017-07-17 Konstantin Tokarev <annulen@yandex.ru>
419 Unreviewed attempt to fix Mac cmake build
421 * PlatformMac.cmake: Remove reference to file which is gone since r219025
423 2017-07-17 Michael Catanzaro <mcatanzaro@igalia.com>
425 [CMake] Include most CMake modules from WebKitCommon.cmake
426 https://bugs.webkit.org/show_bug.cgi?id=174546
428 Reviewed by Konstantin Tokarev.
432 2017-07-17 Michael Catanzaro <mcatanzaro@igalia.com>
434 [CMake] Macros in WebKitMacros.cmake should be prefixed with WEBKIT_ namespace
435 https://bugs.webkit.org/show_bug.cgi?id=174547
437 Reviewed by Alex Christensen.
441 2017-07-17 Alex Christensen <achristensen@webkit.org>
443 Modernize content extension code
444 https://bugs.webkit.org/show_bug.cgi?id=174588
446 Reviewed by Sam Weinig.
448 * WebProcess/UserContent/WebUserContentController.cpp:
449 (WebKit::WebUserContentController::addContentRuleLists):
451 2017-07-17 Jeremy Jones <jeremyj@apple.com>
453 Add video fullscreen transition logging.
454 https://bugs.webkit.org/show_bug.cgi?id=174474
456 Reviewed by Jer Noble.
458 No functional change. Just adds logging.
460 * Platform/Logging.h:
461 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
462 (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
463 (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
464 (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
465 (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
466 (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
467 (WebKit::WebVideoFullscreenManager::didExitFullscreen):
468 (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
469 (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
471 2017-07-17 Konstantin Tokarev <annulen@yandex.ru>
473 [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
474 https://bugs.webkit.org/show_bug.cgi?id=174557
476 Reviewed by Michael Catanzaro.
480 2017-07-17 Carlos Garcia Campos <cgarcia@igalia.com>
482 Web Automation: link and partial link queries don't work if the link contains formatting tags
483 https://bugs.webkit.org/show_bug.cgi?id=174498
485 Reviewed by Brian Burg.
487 So, for example, if we find links with text "Foo" and there's a link like <a href=""><bA>Foo</b></a> we fail
488 with no such element error. This causes test test_Link_With_Formatting_Tags to fail.
490 * UIProcess/Automation/atoms/FindNodes.js:
491 (switch): Use descendant-or-self::text() instead of just text() in the links xpath expressions.
493 2017-07-16 Carlos Garcia Campos <cgarcia@igalia.com>
495 Web Automation: FindNodes should throw an error in case of invalid strategy
496 https://bugs.webkit.org/show_bug.cgi?id=174497
498 Reviewed by Brian Burg.
500 We are currently returning null or empty list. According to the spec in 12.2 Find Element and 12.3 Find
501 Elements, step 4: "If location strategy is not present as a keyword in the table of location strategies, return
502 error with error code invalid argument.".
503 https://www.w3.org/TR/webdriver/#find-element.
505 This is causing test test_should_throw_an_error_if_user_passes_in_invalid_by_when_find_elements to fail.
507 * UIProcess/Automation/atoms/FindNodes.js:
508 (switch): Throw an error in case of unknown strategy.
509 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
510 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidParameter exceptions.
512 2017-07-16 Brady Eidson <beidson@apple.com>
514 Crash when a WKHTTPCookieStore outlives its owning WKWebsiteDataStore.
515 <rdar://problem/33341730> and https://bugs.webkit.org/show_bug.cgi?id=174574
517 Reviewed by Tim Horton.
519 Instead of holding a weak reference to its owning API::WebsiteDataStore,
520 API::HTTPCookieStore can hold a strong reference to the owner's implementation
521 WebKit::WebsiteDataStore.
523 * UIProcess/API/APIHTTPCookieStore.cpp:
524 (API::HTTPCookieStore::HTTPCookieStore):
525 (API::HTTPCookieStore::cookies):
526 (API::HTTPCookieStore::setCookie):
527 (API::HTTPCookieStore::deleteCookie):
528 (API::HTTPCookieStore::registerObserver):
529 (API::HTTPCookieStore::unregisterObserver):
530 (API::HTTPCookieStore::cookieManagerDestroyed):
531 (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
532 * UIProcess/API/APIHTTPCookieStore.h:
534 2017-07-15 Brady Eidson <beidson@apple.com>
536 Make sure all CFHTTPCookieStorageRefs we create are scheduled.
537 <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
539 Reviewed by Tim Horton.
541 Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
542 We need to schedule it on the appropriate RunLoop.
544 This patch also cleans up the creation of the identifying data itself.
546 * NetworkProcess/mac/RemoteNetworkingContext.mm:
547 (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
549 * Shared/cf/CookieStorageUtilsCF.h: Added.
550 * Shared/cf/CookieStorageUtilsCF.mm: Added.
551 (WebKit::cookieStorageFromIdentifyingData):
552 (WebKit::identifyingDataFromCookieStorage):
554 * Shared/mac/ChildProcessMac.mm:
555 (WebKit::ChildProcess::setSharedHTTPCookieStorage):
557 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
558 (WebKit::WebProcessPool::platformInitializeWebProcess):
559 (WebKit::WebProcessPool::platformInitializeNetworkProcess):
561 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
562 (WebKit::WebsiteDataStore::parameters):
564 * WebKit.xcodeproj/project.pbxproj:
566 * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
567 (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
569 2017-07-15 Wenson Hsieh <wenson_hsieh@apple.com>
571 [iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating
572 https://bugs.webkit.org/show_bug.cgi?id=174539
573 <rdar://problem/33307395>
575 Reviewed by Darin Adler.
577 Small tweak to avoid presenting at the element rect or text rect if the interaction information failed to
578 capture valid bounds for the element. We instead fall back to presenting at the touch location. This addresses
579 problems when presenting the action sheet popover on image maps on iPad, where GetPositionInformation fails to
580 capture correct data about for the <area>.
582 * UIProcess/ios/WKActionSheetAssistant.mm:
583 (presentationStyleForView):
585 2017-07-14 Jonathan Bedard <jbedard@apple.com>
588 https://bugs.webkit.org/show_bug.cgi?id=174430
589 <rdar://problem/33269288>
591 Reviewed by Tim Horton.
593 * Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11.
594 * UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h.
596 2017-07-14 Jeff Miller <jeffm@apple.com>
598 -[WKWebProcessBundleParameters setParametersForKeyWithDictionary:] passing wrong parameters to -setParameter:forKey
599 https://bugs.webkit.org/show_bug.cgi?id=174524
601 Reviewed by Sam Weinig.
603 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
604 (-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:]):
605 Pass the dictionary key and value in the correct order.
607 2017-07-14 Brent Fulgham <bfulgham@apple.com>
609 Monitor directory for new statistics files after a delete operation
610 https://bugs.webkit.org/show_bug.cgi?id=174521
611 <rdar://problem/33322189>
613 Reviewed by Chris Dumez.
615 Create a FileMonitor to watch the data directory when the statistics file is
616 deleted by an external process. If it sees the file get created externally, merge
617 those data into the in-memory store.
619 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
620 (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): Added.
621 (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
622 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
624 2017-07-14 Matt Lewis <jlewis3@apple.com>
626 Unreviewed, rolling out r219516.
628 This caused an API failure on macOS.
632 "Make sure all CFHTTPCookieStorageRefs we create are
634 https://bugs.webkit.org/show_bug.cgi?id=174513
635 http://trac.webkit.org/changeset/219516
637 2017-07-14 Daniel Bates <dabates@apple.com>
639 REGRESSION (r219013): Compute source frame info for frameless document
640 https://bugs.webkit.org/show_bug.cgi?id=174385
641 <rdar://problem/33217736>
643 Reviewed by Brady Eidson.
645 Fixes an issue where we would crash in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
646 when computing the frame info for a now-frameless document. One way this can happen is when the frame
647 that contains the document that initiated the navigation is removed from the page.
649 * UIProcess/WebPageProxy.cpp:
650 (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check that we have a valid page ID before
651 looking up the WebPage object corresponding to it.
652 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
653 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Compute a FrameInfoData
654 object from the source document directly as opposed to using WebFrame::info() as the latter requires
655 that we have a valid WebCore frame and the source document may not have a frame.
657 2017-07-14 Jer Noble <jer.noble@apple.com>
659 Allow clients to override their own hardware media requirements where no fallback media exists.
660 https://bugs.webkit.org/show_bug.cgi?id=174426
661 <rdar://problem/32537704>
663 Reviewed by Eric Carlson.
665 Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both to control
666 WebCore's new allowMediaContentTypesRequiringHardwareSupportAsFallback setting.
668 * Shared/WebPreferencesDefinitions.h:
669 * UIProcess/API/C/WKPreferences.cpp:
670 (WKPreferencesGetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
671 (WKPreferencesSetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
672 * UIProcess/API/C/WKPreferencesRef.h:
673 * UIProcess/API/Cocoa/WKWebView.mm:
674 (-[WKWebView _initializeWithConfiguration:]):
675 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
676 (-[WKWebViewConfiguration init]):
677 (-[WKWebViewConfiguration copyWithZone:]):
678 (-[WKWebViewConfiguration _setAllowMediaContentTypesRequiringHardwareSupportAsFallback:]):
679 (-[WKWebViewConfiguration _allowMediaContentTypesRequiringHardwareSupportAsFallback]):
680 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
681 * WebProcess/WebPage/WebPage.cpp:
682 (WebKit::WebPage::updatePreferences):
684 2017-07-14 Chris Dumez <cdumez@apple.com>
686 Possible crash under NetworkSocketStream::didFailSocketStream()
687 https://bugs.webkit.org/show_bug.cgi?id=174526
688 <rdar://problem/32831441>
690 Reviewed by Brent Fulgham.
692 For robustness, initialize the SocketStreamHandleImpl after the other
693 data members. We are passing |this| to the SocketStreamHandleImpl when
694 constructing it so it is unsafe to have uninitialized data members
697 * NetworkProcess/NetworkSocketStream.cpp:
698 (WebKit::NetworkSocketStream::NetworkSocketStream):
699 * NetworkProcess/NetworkSocketStream.h:
701 2017-07-14 Michael Catanzaro <mcatanzaro@igalia.com>
703 [CMake] Unclear distinction between WebKitHelpers and WebKitMacros
704 https://bugs.webkit.org/show_bug.cgi?id=153189
706 Reviewed by Antonio Gomes.
708 New location for macros that are exclusively needed here.
712 2017-07-14 Brady Eidson <beidson@apple.com>
714 Make sure all CFHTTPCookieStorageRefs we create are scheduled.
715 <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
717 Reviewed by Tim Horton.
719 Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
720 We need to schedule it on a RunLoop.
722 This patch also cleans up the creation of the identifying data itself.
724 * NetworkProcess/mac/RemoteNetworkingContext.mm:
725 (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
727 * Shared/cf/CookieStorageUtilsCF.cpp: Added.
728 (WebKit::cookieStorageFromIdentifyingData):
729 (WebKit::identifyingDataFromCookieStorage):
730 * Shared/cf/CookieStorageUtilsCF.h: Added.
732 * Shared/mac/ChildProcessMac.mm:
733 (WebKit::ChildProcess::setSharedHTTPCookieStorage):
735 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
736 (WebKit::WebProcessPool::platformInitializeWebProcess):
737 (WebKit::WebProcessPool::platformInitializeNetworkProcess):
739 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
740 (WebKit::WebsiteDataStore::parameters):
742 * WebKit.xcodeproj/project.pbxproj:
744 * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
745 (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
747 2017-07-14 Chris Dumez <cdumez@apple.com>
749 Potential null-dereference under NetworkRTCProvider::resolvedName()
750 https://bugs.webkit.org/show_bug.cgi?id=174507
751 <rdar://problem/32597868>
753 Reviewed by Youenn Fablet.
755 NetworkRTCProvider::resolvedName() could do a null dereference of m_connection
756 because m_connection is nullified in NetworkRTCProvider::close() but resolvers
757 were only closed later on in the NetworkRTCProvider destructor.
759 To address the issue, we now stop DNS resolvers earlier, in NetworkRTCProvider::close().
760 Also fix unsafe modification of m_resolvers HashMap when iterating over it.
762 * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
763 (WebKit::NetworkRTCProvider::~NetworkRTCProvider):
764 (WebKit::NetworkRTCProvider::close):
765 (WebKit::NetworkRTCProvider::Resolver::~Resolver):
766 (WebKit::NetworkRTCProvider::stopResolver):
768 2017-07-14 Youenn Fablet <youenn@apple.com>
770 Report CoreAudioCaptureSource failure in case shared unit stops working properly
771 https://bugs.webkit.org/show_bug.cgi?id=174494
773 Reviewed by Eric Carlson.
775 In case of capture failure, send a CaptureFailure message so that the
776 correct behavior happens in the Web process.
778 * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
779 * WebProcess/cocoa/UserMediaCaptureManager.cpp:
780 (WebKit::UserMediaCaptureManager::captureFailed):
781 * WebProcess/cocoa/UserMediaCaptureManager.h:
782 * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
784 2017-07-13 Chris Dumez <cdumez@apple.com>
786 Better deal with changes to the ResourceLoadStatisticsStore file on disk
787 https://bugs.webkit.org/show_bug.cgi?id=174487
789 Reviewed by Brent Fulgham.
791 Rename WebResourceLoadStatisticsStore's resetDataFromDecoder() to mergeWithDataFromDecoder()
792 and update it so that it actual merges the data from the disk with the one we have in memory,
793 instead of replacing it. This avoid data loss.
795 We leverage the existing WebResourceLoadStatisticsStore::mergeStatistics() to merge the
798 To faciliate merging the operating dates, they are now represented as OperatingDate objects
799 instead of WallTime objects. OperatingDate only include date precision, no time information.
800 As a result, the merge 2 vectors of OperatingDate objects, we can:
801 1. Merge the 2 sorted vectors (using std::merge())
802 2. Get rid of duplicates (easy because of date-level precision)
803 3. Drop old dates until the vector has at most 30 items.
805 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
806 (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
807 (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
808 * UIProcess/WebResourceLoadStatisticsStore.cpp:
809 (WebKit::OperatingDate::fromWallTime):
810 (WebKit::OperatingDate::today):
811 (WebKit::OperatingDate::secondsSinceEpoch):
812 (WebKit::OperatingDate::operator==):
813 (WebKit::OperatingDate::operator<):
814 (WebKit::OperatingDate::operator<=):
815 (WebKit::OperatingDate::OperatingDate):
816 (WebKit::mergeOperatingDates):
817 (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData):
818 (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
819 (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
820 (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
821 * UIProcess/WebResourceLoadStatisticsStore.h:
823 2017-07-13 Dan Bernstein <mitz@apple.com>
825 Removed empty project directories left behind after the rename
827 * WebKit2.xcodeproj: Removed.
829 2017-07-13 Matthew Hanson <matthew_hanson@apple.com>
831 Fix the cMake builds (GTK and WPE.)
832 https://bugs.webkit.org/show_bug.cgi?id=174164
833 rdar://problem/33137595
835 Reviewed by Dan Bernstein.
837 * Scripts/generate-forwarding-headers.pl:
838 (collectFrameworkHeaderPaths):
839 (createForwardingHeadersForFramework):
841 2017-07-13 Matthew Hanson <matthew_hanson@apple.com>
843 Rename WebKit2.xcodeproj to WebKit.xcodeproj.
844 https://bugs.webkit.org/show_bug.cgi?id=174164
845 rdar://problem/33137595
847 Reviewed by Dan Bernstein.
849 * WebKit.xcodeproj/project.pbxproj: Renamed from Source/WebKit/WebKit2.xcodeproj/project.pbxproj.
851 2017-07-13 Matthew Hanson <matthew_hanson@apple.com>
853 Update tools and configurations after renaming Source/WebKit2 to Source/WebKit.
854 https://bugs.webkit.org/show_bug.cgi?id=174164
855 rdar://problem/33137595
857 Reviewed by Dan Bernstein.
860 * Shared/API/c/wpe/WebKit.h:
862 2017-07-13 Michael Catanzaro <mcatanzaro@igalia.com>
864 Fix compiler warnings when building with GCC 7
865 https://bugs.webkit.org/show_bug.cgi?id=174463
867 Reviewed by Darin Adler.
869 * Platform/IPC/unix/ConnectionUnix.cpp:
870 (IPC::Connection::sendOutputMessage):
872 2017-07-13 Chris Dumez <cdumez@apple.com>
874 Moved filesystem code out of WebResourceLoadStatisticsStore class
875 https://bugs.webkit.org/show_bug.cgi?id=174435
877 Reviewed by Brent Fulgham.
879 Moved filesystem code out of WebResourceLoadStatisticsStore class and into
880 a new ResourceLoadStatisticsPersistentStorage class to decrease complexity.
883 * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
884 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added.
885 (WebKit::hasFileChangedSince):
886 (WebKit::createDecoderForFile):
887 (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
888 (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
889 (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath):
890 (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath):
891 (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
892 (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk):
893 (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
894 (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
895 (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
896 (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
897 (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
898 (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
899 (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
900 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added.
901 * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added.
902 (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
903 * UIProcess/WebResourceLoadStatisticsStore.cpp:
904 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
905 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
906 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
907 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
908 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
909 (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder):
910 * UIProcess/WebResourceLoadStatisticsStore.h:
911 * WebKit2.xcodeproj/project.pbxproj:
913 2017-07-13 Chris Dumez <cdumez@apple.com>
915 Unreviewed, rolling out r219453.
917 Seems to cause some crashes on the bots
921 "Moved filesystem code out of WebResourceLoadStatisticsStore
923 https://bugs.webkit.org/show_bug.cgi?id=174435
924 http://trac.webkit.org/changeset/219453
926 2017-07-13 Jeremy Jones <jeremyj@apple.com>
928 Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
929 https://bugs.webkit.org/show_bug.cgi?id=174448
931 Reviewed by Eric Carlson.
935 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
936 * WebProcess/cocoa/WebVideoFullscreenManager.h:
938 2017-07-13 Jeremy Jones <jeremyj@apple.com>
940 Style fix. Replace strongThis with protectedThis.
941 https://bugs.webkit.org/show_bug.cgi?id=174444
943 Reviewed by Eric Carlson.
945 Rename, no behavior change.
947 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
948 (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
949 (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
950 (WebKit::WebVideoFullscreenManager::didExitFullscreen):
951 (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
953 2017-07-13 Chris Dumez <cdumez@apple.com>
955 Moved filesystem code out of WebResourceLoadStatisticsStore class
956 https://bugs.webkit.org/show_bug.cgi?id=174435
958 Reviewed by Brent Fulgham.
960 Moved filesystem code out of WebResourceLoadStatisticsStore class and into
961 a new ResourceLoadStatisticsPersistentStorage class to decrease complexity.
964 * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
965 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added.
966 (WebKit::hasFileChangedSince):
967 (WebKit::createDecoderForFile):
968 (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
969 (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
970 (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath):
971 (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath):
972 (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
973 (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk):
974 (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
975 (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
976 (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
977 (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
978 (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
979 (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
980 (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
981 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added.
982 * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added.
983 (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
984 * UIProcess/WebResourceLoadStatisticsStore.cpp:
985 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
986 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
987 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
988 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
989 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
990 (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder):
991 * UIProcess/WebResourceLoadStatisticsStore.h:
992 * WebKit2.xcodeproj/project.pbxproj:
994 2017-07-12 Carlos Garcia Campos <cgarcia@igalia.com>
996 Web Automation: evaluateJavaScriptFunction should start the callback timeout after the function is applied
997 https://bugs.webkit.org/show_bug.cgi?id=174421
999 Reviewed by Brian Burg.
1001 This is causing selenium test testShouldNotTimeoutIfScriptCallsbackInsideAZeroTimeout to fail, because
1002 JavaScriptTimeout error is generated unexpectedly. When no script timeout is specified, 0 is used by default,
1003 which means we do a setTimeout with 0 and then the script does another setTimeout with 0, but ours is dispatched
1004 before and reportTimeoutError is called. We should start our timeout after applying the function, and only if
1005 the result hasn't been reported yet.
1007 * WebProcess/Automation/WebAutomationSessionProxy.js:
1008 (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction):
1010 2017-07-12 Wenson Hsieh <wenson_hsieh@apple.com>
1012 [iOS DnD] [WK2] Add SPI to enable, disable, or follow default behavior for DnD on a WKWebView
1013 https://bugs.webkit.org/show_bug.cgi?id=174440
1014 <rdar://problem/33272627>
1016 Reviewed by Beth Dakin.
1018 Adds a new _dragInteractionPolicy property to WKWebView, which an internal client may use to always allow
1019 dragging out of the web view (_WKDragInteractionPolicyAlwaysEnable), never allow
1020 (_WKDragInteractionPolicyAlwaysDisable) or just use the default device-dependent behavior
1021 (_WKDragInteractionPolicyDefault).
1023 Also removes an extraneous class from WKContentViewInteraction.mm that is no longer used anywhere.
1025 * UIProcess/API/Cocoa/WKWebView.mm:
1026 (-[WKWebView _initializeWithConfiguration:]):
1028 Set _dragInteractionPolicy to _WKDragInteractionPolicyDefault upon initialization.
1030 (-[WKWebView _dragInteractionPolicy]):
1031 (-[WKWebView _setDragInteractionPolicy:]):
1032 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1033 * UIProcess/ios/WKContentViewInteraction.h:
1034 * UIProcess/ios/WKContentViewInteraction.mm:
1035 (shouldEnableDragInteractionForPolicy):
1036 (-[WKContentView _didChangeDragInteractionPolicy]):
1038 Called by the WKWebView when its _dragInteractionPolicy changes. The content view updates its
1039 UIDragInteraction's -enabled property here in response.
1041 (-[WKContentView setupDataInteractionDelegates]):
1043 2017-07-12 Said Abou-Hallawa <sabouhallawa@apple.com>
1045 Async image decoding for large images should be disabled by default
1046 https://bugs.webkit.org/show_bug.cgi?id=174432
1048 Reviewed by Simon Fraser.
1050 -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by
1051 GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None
1052 by AllowAsyncImageDecoding.
1053 -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir
1054 by resetting the bit PaintBehaviorAllowAsyncImageDecoding.
1056 * Shared/mac/RemoteLayerBackingStore.mm:
1057 (WebKit::RemoteLayerBackingStore::drawInContext):
1058 * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1059 (WebKit::imageForRect):
1060 * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1061 (WebKit::InjectedBundleRangeHandle::renderedImage):
1063 2017-07-12 Eric Carlson <eric.carlson@apple.com>
1065 [MediaStream] a capture source failure should end the MediaStreamTrack
1066 https://bugs.webkit.org/show_bug.cgi?id=174375
1068 Reviewed by Youenn Fablet.
1070 * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1071 (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Consolidate start/end.
1072 (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): Deleted.
1073 (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Deleted.
1074 * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1076 * UIProcess/WebPageProxy.cpp:
1077 (WebKit::WebPageProxy::isPlayingMediaDidChange): Call captureStateChanged if the capture
1078 state changes. Consider interrupted flags.
1080 2017-07-12 Daniel Bates <dabates@apple.com>
1082 NavigationAction should track whether the navigation was initiated by the main frame
1083 https://bugs.webkit.org/show_bug.cgi?id=174386
1084 <rdar://problem/33245267>
1086 Reviewed by Brady Eidson.
1088 * WebProcess/WebPage/WebInspector.cpp:
1089 (WebKit::WebInspector::openInNewTab): Pass whether the load was initiated by the main frame
1090 when instantiating the NavigationAction.
1092 2017-07-12 Daniel Bates <dabates@apple.com>
1094 Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame
1095 https://bugs.webkit.org/show_bug.cgi?id=174427
1097 Rubber-stamped by Brady Eidson.
1099 * WebProcess/Plugins/PluginView.cpp:
1100 (WebKit::PluginView::loadURL):
1101 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1102 (WebKit::WebFrameLoaderClient::dispatchCreatePage):
1103 * WebProcess/WebPage/WebInspector.cpp:
1104 (WebKit::WebInspector::openInNewTab):
1106 2017-07-12 Matt Lewis <jlewis3@apple.com>
1108 Unreviewed, rolling out r219401.
1110 This revision rolled out the previous patch, but after talking
1111 with reviewer, a rebaseline is what was needed.Rolling back in
1116 "Unreviewed, rolling out r219379."
1117 https://bugs.webkit.org/show_bug.cgi?id=174400
1118 http://trac.webkit.org/changeset/219401
1120 2017-07-12 Daniel Bates <dabates@apple.com>
1122 Update description of Secure Contexts experimental flag
1123 https://bugs.webkit.org/show_bug.cgi?id=174401
1125 Reviewed by Simon Fraser.
1127 Change the description of the Secure Contexts experimental flag from "isSecureContext attribute"
1128 to "Secure Contexts API".
1130 * Shared/WebPreferencesDefinitions.h:
1132 2017-07-12 Matt Lewis <jlewis3@apple.com>
1134 Unreviewed, rolling out r219379.
1136 This revision caused a consistent failure in the test
1137 fast/dom/Window/property-access-on-cached-window-after-frame-
1142 "Remove NAVIGATOR_HWCONCURRENCY"
1143 https://bugs.webkit.org/show_bug.cgi?id=174400
1144 http://trac.webkit.org/changeset/219379
1146 2017-07-12 Zan Dobersek <zdobersek@igalia.com>
1149 https://bugs.webkit.org/show_bug.cgi?id=172104
1151 Reviewed by Michael Catanzaro.
1153 * PlatformWPE.cmake: Drop the EGL_INCLUDE_DIRS compilation flags.
1154 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1155 Include <epoxy/gl.h> when compiling with libepoxy usage enabled.
1157 2017-07-12 Carlos Garcia Campos <cgarcia@igalia.com>
1159 Web Automation: upstream safaridriver's JavaScript atom implementations
1160 https://bugs.webkit.org/show_bug.cgi?id=172060
1161 <rdar://problem/32168187>
1163 Reviewed by Brian Burg.
1165 * UIProcess/Automation/atoms/ElementAttribute.js: Added.
1166 * UIProcess/Automation/atoms/ElementDisplayed.js: Added.
1167 * UIProcess/Automation/atoms/FindNodes.js: Added.
1168 * UIProcess/Automation/atoms/FormElementClear.js: Added.
1169 * UIProcess/Automation/atoms/FormSubmit.js: Added.
1171 2017-07-11 Dean Jackson <dino@apple.com>
1173 Remove NAVIGATOR_HWCONCURRENCY
1174 https://bugs.webkit.org/show_bug.cgi?id=174400
1176 Reviewed by Sam Weinig.
1178 * Configurations/FeatureDefines.xcconfig:
1180 2017-07-11 Ansh Shukla <ansh_shukla@apple.com>
1182 WKWindowFeatures needs to expose scrollbar, fullscreen, and dialog configuration properties
1183 https://bugs.webkit.org/show_bug.cgi?id=174239
1185 Reviewed by Brady Eidson.
1187 Add a new private header to expose getters for window feature properties already available
1188 in the TFB APIWindowFeatures class. These properties are necessary for Safari to adopt more
1191 * UIProcess/API/Cocoa/WKWindowFeatures.mm:
1192 (-[WKWindowFeatures _locationBarVisibility]):
1193 (-[WKWindowFeatures _scrollbarsVisibility]):
1194 (-[WKWindowFeatures _fullscreenDisplay]):
1195 (-[WKWindowFeatures _dialogDisplay]):
1196 * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: Expose some window features as read-only
1198 * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
1199 * WebKit2.xcodeproj/project.pbxproj:
1201 2017-07-11 Chris Dumez <cdumez@apple.com>
1203 Avoid duplicating default parameter values in [WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]
1204 https://bugs.webkit.org/show_bug.cgi?id=174402
1206 Reviewed by Brent Fulgham.
1208 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1209 (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
1210 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1211 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1212 (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1213 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1214 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1215 (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1216 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1217 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
1218 (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
1219 (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
1220 (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
1221 (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies):
1222 (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
1223 (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
1224 (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
1225 (WebKit::WebResourceLoadStatisticsStore::pruneStatisticsIfNeeded):
1226 (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
1227 * UIProcess/WebResourceLoadStatisticsStore.h:
1229 2017-07-11 Dean Jackson <dino@apple.com>
1231 Rolling out r219372.
1233 * Configurations/FeatureDefines.xcconfig:
1235 2017-07-11 Dean Jackson <dino@apple.com>
1237 Remove NAVIGATOR_HWCONCURRENCY
1238 https://bugs.webkit.org/show_bug.cgi?id=174400
1240 Reviewed by Sam Weinig.
1242 * Configurations/FeatureDefines.xcconfig:
1244 2017-07-11 Dean Jackson <dino@apple.com>
1246 Viewport fit experimental feature should be always on by default
1247 https://bugs.webkit.org/show_bug.cgi?id=174398
1248 <rdar://problem/33248920>
1250 Reviewed by Simon Fraser.
1252 Even though this is experimental, it should be enabled by default, and
1253 not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
1255 * Shared/WebPreferencesDefinitions.h:
1257 2017-07-11 Adrian Perez de Castro <aperez@igalia.com>
1259 Fix typo: ContentRuleListStore::nonLegacyDdefaultStore()
1260 https://bugs.webkit.org/show_bug.cgi?id=174387
1262 Reviewed by Michael Catanzaro.
1264 Rename nonLegacyDdefaultStore() to nonLegacyDefaultStore().
1266 * UIProcess/API/APIContentRuleListStore.cpp:
1267 (API::ContentRuleListStore::nonLegacyDefaultStore):
1268 (API::ContentRuleListStore::defaultStore):
1269 * UIProcess/API/APIContentRuleListStore.h:
1271 2017-07-11 Chris Dumez <cdumez@apple.com>
1273 Simplify primary domain lambda captures in WebResourceLoadStatisticsStore
1274 https://bugs.webkit.org/show_bug.cgi?id=174381
1276 Reviewed by Brent Fulgham.
1278 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1279 (WebKit::isolatedPrimaryDomain):
1280 (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1281 (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1282 (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1283 (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1284 (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1285 (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1286 (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1287 (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1288 (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1289 (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1290 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1291 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1292 (WebKit::primaryDomain): Deleted.
1294 2017-07-11 Timothy Hatcher <timothy@hatcher.name>
1296 Fix a build failure in WebDragClient when !PLATFORM(COCOA) && !PLATFORM(GTK).
1297 https://bugs.webkit.org/show_bug.cgi?id=174372
1299 Reviewed by Beth Dakin.
1301 * WebProcess/WebCoreSupport/WebDragClient.cpp:
1302 (WebKit::WebDragClient::didConcludeEditDrag): Added empty method.
1304 2017-07-11 Brent Fulgham <bfulgham@apple.com>
1306 Reset cookie partitioning state after network process crashes
1307 https://bugs.webkit.org/show_bug.cgi?id=174306
1308 <rdar://problem/33171605>
1310 Reviewed by Chris Dumez.
1312 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1313 (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): Move cookie
1314 partioning state code to helper function.
1315 (WebKit::ResourceLoadStatisticsStore::resetPartitionCookiesState): Added.
1316 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
1317 * UIProcess/WebProcessPool.cpp:
1318 (WebKit::WebProcessPool::ensureNetworkProcess): Inform the statistics store that
1319 the network process crashed.
1320 (WebKit::WebProcessPool::terminateNetworkProcess): Mark network process as crashed.
1321 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1322 (WebKit::WebResourceLoadStatisticsStore::networkProcessDidCrash): Reset the cookie
1323 partitioning state after a crash.
1324 * UIProcess/WebResourceLoadStatisticsStore.h:
1325 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1326 (WebKit::WebsiteDataStore::notifyResourceLoadStatisticsNetworkProcessDidCrash): Relay
1327 information to the statistics store.
1328 * UIProcess/WebsiteData/WebsiteDataStore.h:
1330 2017-07-11 Timothy Hatcher <timothy@hatcher.name>
1332 Fix broken build when !ENABLE(INDEXED_DATABASE)
1333 https://bugs.webkit.org/show_bug.cgi?id=174370
1335 Reviewed by Alex Christensen.
1337 * UIProcess/WebProcessPool.cpp:
1338 (WebKit::WebProcessPool::pageAddedToProcess):
1340 2017-07-11 Youenn Fablet <youenn@apple.com>
1342 Changing the web page muted state for playing audio should not disable other tabs capture
1343 https://bugs.webkit.org/show_bug.cgi?id=174349
1347 * UIProcess/WebPageProxy.cpp:
1348 (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Fixes non MEDIA_STREAM builds.
1350 2017-07-11 Wenson Hsieh <wenson_hsieh@apple.com>
1352 Address post-review feedback after http://trac.webkit.org/r219310
1353 https://bugs.webkit.org/show_bug.cgi?id=174300
1354 <rdar://problem/33030639>
1356 Reviewed by Simon Fraser.
1358 Removes plumbing introduced in r219310 for telling WKContentView when the user has finished panning or zooming.
1359 This was previously used to reset allowing asynchronous touch event after preventing the web touch events
1360 gesture recognizer from firing.
1362 However, a far simpler (and much less fragile) solution is to just set _canSendTouchEventsAsynchronously to NO
1363 at the beginning of the gesture, before the first `touchstart` event is dispatched. This way, we always ensure
1364 that _canSendTouchEventsAsynchronously is NO when beginning to process a touch event. This approach is correct
1365 because the only place where we query _canSendTouchEventsAsynchronously is in -_webTouchEventsRecognized:, where
1366 (when we are beginning a new gesture) we are guaranteed that -gestureRecognizer:shouldIgnoreWebTouchWithEvent:
1367 has already been called and _canSendTouchEventsAsynchronously is NO.
1369 Confirmed that the LayoutTests added in r219310 still pass.
1371 * UIProcess/API/Cocoa/WKWebView.mm:
1372 (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
1373 (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1374 * UIProcess/PageClient.h:
1375 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1376 * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1377 (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
1378 * UIProcess/Scrolling/RemoteScrollingTree.h:
1379 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1380 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1381 (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
1382 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture): Deleted.
1383 * UIProcess/WebPageProxy.h:
1384 * UIProcess/ios/PageClientImplIOS.h:
1385 * UIProcess/ios/PageClientImplIOS.mm:
1386 (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture): Deleted.
1387 * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1388 (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture): Deleted.
1389 * UIProcess/ios/WKContentViewInteraction.h:
1390 * UIProcess/ios/WKContentViewInteraction.mm:
1391 (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
1392 (-[WKContentView scrollViewDidEndPanOrPinchGesture]): Deleted.
1393 * UIProcess/ios/WebPageProxyIOS.mm:
1394 (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture): Deleted.
1396 2017-07-11 Brent Fulgham <bfulgham@apple.com>
1398 Unreviewed clean-up after r219323
1400 Simplify algorithm slightly based on a suggestion Chris Dumez made in the review.
1402 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1403 (WebKit::pruneResources): Don't create a second variable to track the pruning operation.
1405 2017-07-11 Alex Christensen <achristensen@webkit.org>
1407 SharedBuffer::size should return a size_t
1408 https://bugs.webkit.org/show_bug.cgi?id=174328
1410 Reviewed by Andreas Kling.
1412 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1413 (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1415 2017-07-11 Youenn Fablet <youenn@apple.com>
1417 We should do ICE candidate filtering at the Document level
1418 https://bugs.webkit.org/show_bug.cgi?id=173861
1419 <rdar://problem/33122058>
1421 Reviewed by Eric Carlson.
1423 Removing ICE candidate filtering handling at UIProcess level.
1424 ICE candidate filtering is now disabled at UserMediaRequest level.
1425 WebPage forwards the ICE candidate filtering option to the page so as to set
1426 the default option correctly for every document of the page.
1428 * UIProcess/UserMediaProcessManager.cpp:
1429 (WebKit::UserMediaProcessManager::willCreateMediaStream):
1430 (WebKit::UserMediaProcessManager::endedCaptureSession):
1431 * WebProcess/WebPage/WebPage.cpp:
1432 (WebKit::WebPage::disableICECandidateFiltering):
1433 (WebKit::WebPage::enableICECandidateFiltering):
1435 2017-07-11 Youenn Fablet <youenn@apple.com>
1437 Changing the web page muted state for playing audio should not disable other tabs capture
1438 https://bugs.webkit.org/show_bug.cgi?id=174349
1439 rdar://problem/33223988
1441 Reviewed by Eric Carlson.
1443 Make sure to mute capturing streams of any other tab if the current tab will start capturing or will unmute existing capturing streams.
1444 Manually tested by having a tab doing capture and another tab playing a video.
1445 Muting or unmuting the tab playing video should not change the capture tab.
1447 * UIProcess/WebPageProxy.cpp:
1448 (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
1449 (WebKit::WebPageProxy::setMuted):
1450 * UIProcess/WebPageProxy.h:
1451 (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
1453 2017-07-11 Youenn Fablet <youenn@apple.com>
1455 NetworkProcess should close listening WebRTC sockets when being suspended
1456 https://bugs.webkit.org/show_bug.cgi?id=174270
1457 rdar://problem/33139844
1459 Reviewed by Chris Dumez.
1461 To prevent potential spinning of the NetworkProcess, NetworkProcess will now close listening sockets when being notified that it will be suspended.
1462 When the network process is being suspended, it will stop creating listening sockets, until it resumes.
1463 Future additional efforts might be to improve select/cancel so that we can stop listening sockets at resume time,
1464 or to reimplement part of the stack using CFStream.
1466 Tested through manual testing by going to a website doing WebRTC, homing out so that the network process is suspended and reopening Safari.
1468 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1469 (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension):
1470 Proxying call to clean for suspension to rtc provider so that it will
1471 close listening sockets.
1472 (WebKit::NetworkConnectionToWebProcess::resumeFromSuspension): Authorizing back listening sockets.
1473 * NetworkProcess/NetworkConnectionToWebProcess.h:
1474 (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension):
1475 Clean-up is done asynchronously as it can happen in background threads.
1476 Hence why passing a callback as parameter.
1477 * NetworkProcess/NetworkProcess.cpp:
1478 (WebKit::NetworkProcess::notifyProcessReadyToSuspend): Helper routine
1479 to notify UI process that network process clean up is done.
1480 (WebKit::TaskCounter::TaskCounter): Helper class to call notifyProcessReadyToSuspend when sded.
1481 (WebKit::TaskCounter::~TaskCounter):
1482 (WebKit::NetworkProcess::actualPrepareToSuspend): Doing the clean-up for each connection that needs it.
1483 Making sure to notify UI process of clean-up being completed once all connections are cleaned.
1484 (WebKit::NetworkProcess::processWillSuspendImminently):
1485 (WebKit::NetworkProcess::prepareToSuspend):
1486 (WebKit::NetworkProcess::processDidResume): Reenable listening sockets.
1487 * NetworkProcess/NetworkProcess.h:
1488 * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
1489 (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
1490 * NetworkProcess/webrtc/LibWebRTCSocketClient.h: Adding type getter and making close public.
1491 Used by NetworkRTCProvider to identifiy listening sockets and close them.
1492 * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1493 (WebKit::NetworkRTCProvider::closeListeningSockets): We close the webrtc socket
1494 and we also notify the Web Process that the socket is closed so that it can take actions to recreate some if needed.
1495 (WebKit::NetworkRTCProvider::finishClosingListeningSockets):
1496 * NetworkProcess/webrtc/NetworkRTCProvider.h:
1497 (WebKit::NetworkRTCProvider::authorizeListeningSockets): Authorize creation of listening sockets.
1499 2017-07-10 Brent Fulgham <bfulgham@apple.com>
1501 Resource Load Statistics: Prune statistics in orders of importance
1502 https://bugs.webkit.org/show_bug.cgi?id=174215
1503 <rdar://problem/33164403>
1505 Unreviewed test correction.
1507 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1508 (WebKit::pruneResources): The revised algorithm did not update the remaining
1509 count to be pruned, causing a test failure.
1511 2017-07-10 John Wilander <wilander@apple.com>
1513 Resource Load Statistics: Prune statistics in orders of importance
1514 https://bugs.webkit.org/show_bug.cgi?id=174215
1515 <rdar://problem/33164403>
1517 Reviewed by Chris Dumez.
1519 New functionality. Prunes statistics in this order:
1520 1. Non-prevalent resources without user interaction.
1521 2. Prevalent resources without user interaction.
1522 3. Non-prevalent resources with user interaction.
1523 4. Prevalent resources with user interaction.
1525 * Shared/WebCoreArgumentCoders.cpp:
1526 (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1527 (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1528 Added timestamp field lastSeen.
1529 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1530 (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]):
1531 (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]):
1532 (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]):
1533 (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
1534 Test infrastructure.
1535 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1536 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1537 (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries):
1538 Test infrastructure.
1539 (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo):
1540 Test infrastructure.
1541 (WebKit::sortAndPrune):
1542 Convenience function.
1543 (WebKit::ResourceLoadStatisticsStore::pruneStatisticsIfNeeded):
1544 The new pruning function.
1545 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
1546 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1547 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1548 Now calls ResourceLoadStatisticsStore::pruneStatisticsIfNeeded().
1549 (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1550 Test infrastructure.
1551 (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
1552 Test infrastructure.
1553 (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
1554 Test infrastructure.
1555 * UIProcess/WebResourceLoadStatisticsStore.h:
1557 2017-07-10 Dean Jackson <dino@apple.com>
1559 const() experimental feature should always be on by default
1560 https://bugs.webkit.org/show_bug.cgi?id=174341
1561 <rdar://problem/33228603>
1563 Reviewed by Simon Fraser.
1565 Even though this is experimental, it should be enabled by default, and
1566 not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
1568 * Shared/WebPreferencesDefinitions.h:
1570 2017-07-10 Chris Dumez <cdumez@apple.com>
1572 [iOS] _didCommitLayerTree should avoid calling [scrollView setZoomScale] unnecessarily
1573 https://bugs.webkit.org/show_bug.cgi?id=174326
1574 <rdar://problem/33150490>
1576 Reviewed by Simon Fraser.
1578 Only call [scrollView setZoomScale] if the new zoom scale is actually different to
1579 avoid doing unnecessary work in UIKit.
1581 * UIProcess/API/Cocoa/WKWebView.mm:
1582 (-[WKWebView _didCommitLayerTree:]):
1584 2017-07-10 Chris Dumez <cdumez@apple.com>
1586 Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore
1587 https://bugs.webkit.org/show_bug.cgi?id=174203
1589 Reviewed by Brent Fulgham.
1591 Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore. The 2 classes
1592 have a similar purpose and there is no clean separation between the 2. It makes more
1593 sense to have a single store class for resource load statistics.
1595 If we want to simplify the WebResourceLoadStatisticsStore class, I think it'd make
1596 more sense to split the file system I/O code out. This code adds quite a bit of
1600 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1601 (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
1602 (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
1603 (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
1604 (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
1605 (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
1606 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: Removed.
1607 * UIProcess/Storage/ResourceLoadStatisticsStore.h: Removed.
1608 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1609 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1610 (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1611 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1612 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1613 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1614 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
1615 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
1616 (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
1617 (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
1618 (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1619 (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
1620 (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1621 (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1622 (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1623 (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1624 (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1625 (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1626 (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1627 (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1628 (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1629 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1630 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1631 (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
1632 (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
1633 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
1634 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1635 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1636 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
1637 (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
1638 (WebKit::WebResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
1639 (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData):
1640 (WebKit::WebResourceLoadStatisticsStore::populateFromDecoder):
1641 (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
1642 (WebKit::WebResourceLoadStatisticsStore::mergeStatistics):
1643 (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies):
1644 (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1645 (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1646 (WebKit::WebResourceLoadStatisticsStore::processStatistics):
1647 (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction):
1648 (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
1649 (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
1650 (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
1651 * UIProcess/WebResourceLoadStatisticsStore.h:
1652 * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1653 (WebKit::sortedPrevalentResourceTelemetry):
1654 (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1655 * UIProcess/WebResourceLoadStatisticsTelemetry.h:
1656 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1657 (WebKit::WebsiteDataStore::removeData):
1658 * WebKit2.xcodeproj/project.pbxproj:
1660 2017-07-10 Wenson Hsieh <wenson_hsieh@apple.com>
1662 [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
1663 https://bugs.webkit.org/show_bug.cgi?id=174300
1664 <rdar://problem/33030639>
1666 Reviewed by Simon Fraser.
1668 Adds support for immediately failing WKContentView's UIWebTouchEventsGestureRecognizer if any touch interrupts
1669 scroll view deceleration. Covered by 3 new LayoutTests (see Source/WebCore/ChangeLog).
1671 * Platform/spi/ios/UIKitSPI.h:
1672 * UIProcess/API/Cocoa/WKWebView.mm:
1673 (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
1674 (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1675 * UIProcess/PageClient.h:
1676 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1677 * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1678 (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture):
1679 * UIProcess/Scrolling/RemoteScrollingTree.h:
1680 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1681 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1682 (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
1683 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture):
1685 Adds plumbing in the UI process to alert the WKContentView when scroll view dragging has ended in an overflow
1686 momentum scrolling region (tracked by an overflow scrolling tree node). This parallels UI process plumbing for
1687 ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture.
1689 * UIProcess/WebPageProxy.h:
1690 * UIProcess/ios/PageClientImplIOS.h:
1691 * UIProcess/ios/PageClientImplIOS.mm:
1692 (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture):
1693 * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1694 (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture):
1695 * UIProcess/ios/WKContentViewInteraction.h:
1696 * UIProcess/ios/WKContentViewInteraction.mm:
1697 (-[WKContentView scrollViewDidEndPanOrPinchGesture]):
1699 When the dragging phase of a scroll gesture ends, ensure that _canSendTouchEventsAsynchronously is reset to NO.
1700 When touches are not being prevented, this flag is set to YES in -scrollViewWillStartPanOrPinchGesture: and
1701 normally reset to NO in -_webTouchEventsRecognized: after all touch points have been released. However, in the
1702 case where we've prematurely failed the web touch events gesture recognizer after -touchesBegan:,
1703 -_webTouchEventsRecognized: will not be called again in a state where all touches have been released. Thus, we
1704 also need to bookend the place where we begin allowing async touch event dispatch in
1705 -scrollViewWillStartPanOrPinchGesture by disallowing async touch event dispatch in
1706 -scrollViewDidEndPanOrPinchGesture.
1708 This has no impact in the normal case where the user scrolls without momentum, since
1709 -scrollViewDidEndPanOrPinchGesture will fire after async touch events have already been disallowed in
1710 -_webTouchEventsRecognized:, and in the case where the page prevents default on touches, scrolling doesn't
1711 happen anyways, so neither scrollViewWillStartPanOrPinchGesture nor scrollViewDidEndPanOrPinchGesture will be
1714 (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
1716 Implements a new SPI hook in UIKit. This serves an identical purpose as -shouldIgnoreWebTouch, but additionally
1717 passes the triggering UIEvent, as well as the gesture recognizer itself (following standard convention for
1718 Objective C delegate methods). Here, we return YES in the case where one or more of the touches recognized by
1719 the gesture is currently interrupting scroll deceleration.
1721 * UIProcess/ios/WebPageProxyIOS.mm:
1722 (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture):
1724 2017-07-10 Brent Fulgham <bfulgham@apple.com>
1726 [WK2][macOS] Allow access to com.apple.cfnetwork.cfnetworkagent in the Network Process
1727 https://bugs.webkit.org/show_bug.cgi?id=174320
1728 <rdar://problem/33191856>
1730 Reviewed by Geoffrey Garen.
1732 * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1734 2017-07-10 Megan Gardner <megan_gardner@apple.com>
1736 Add location to NavigationActionData
1737 https://bugs.webkit.org/show_bug.cgi?id=174233
1738 <rdar://problem/29165518>
1740 Reviewed by Simon Fraser.
1742 Add the root view location of a tap to a NavigationAction to vend to Safari.
1744 * Shared/NavigationActionData.cpp:
1745 (WebKit::NavigationActionData::encode):
1746 (WebKit::NavigationActionData::decode):
1747 * Shared/NavigationActionData.h:
1748 * UIProcess/API/APINavigationAction.h:
1749 * UIProcess/API/Cocoa/WKNavigationAction.mm:
1750 (-[WKNavigationAction description]):
1751 (-[WKNavigationAction _clickLocationInRootViewCoordinates]):
1752 * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1753 * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1754 (WebKit::clickLocationInRootViewCoordinatesForMouseEvent):
1755 (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
1756 (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
1757 * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
1758 (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinates):
1759 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1760 (WebKit::WebChromeClient::createWindow):
1761 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1762 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1763 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1765 2017-07-03 Brian Burg <bburg@apple.com>
1767 Web Replay: remove some unused code
1768 https://bugs.webkit.org/show_bug.cgi?id=173903
1770 Rubber-stamped by Joseph Pecoraro.
1772 * Configurations/FeatureDefines.xcconfig:
1773 * WebProcess/WebPage/WebPage.cpp:
1774 (WebKit::WebPage::tryClose):
1775 (WebKit::WebPage::loadRequest):
1776 (WebKit::WebPage::stopLoadingFrame):
1777 (WebKit::WebPage::stopLoading):
1778 (WebKit::WebPage::reload):
1779 (WebKit::WebPage::contextMenuAtPointInWindow):
1780 (WebKit::handleContextMenuEvent):
1781 (WebKit::handleMouseEvent):
1782 (WebKit::handleWheelEvent):
1783 (WebKit::handleKeyEvent):
1784 (WebKit::WebPage::scroll):
1785 (WebKit::WebPage::logicalScroll):
1787 2017-07-10 Chris Dumez <cdumez@apple.com>
1789 Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up
1790 https://bugs.webkit.org/show_bug.cgi?id=174301
1792 Reviewed by Brent Fulgham.
1794 General clean up and various simplifications / optimizations to WebResourceLoadStatisticsStore
1795 and ResourceLoadStatisticsStore classes.
1797 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1798 (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
1799 (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
1800 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1801 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1802 (WebKit::ResourceLoadStatisticsStore::create):
1803 (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
1804 (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
1805 (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
1806 (WebKit::ResourceLoadStatisticsStore::populateFromDecoder):
1807 (WebKit::ResourceLoadStatisticsStore::clearInMemory):
1808 (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
1809 (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioning):
1810 (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1811 (WebKit::ResourceLoadStatisticsStore::processStatistics):
1812 (WebKit::ResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction):
1813 (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
1814 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
1815 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1816 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1817 (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
1818 (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1819 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1820 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1821 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1822 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
1823 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
1824 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
1825 (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath):
1826 (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
1827 (WebKit::WebResourceLoadStatisticsStore::scheduleOrWriteStoreToDisk):
1828 (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1829 (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
1830 (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup):
1831 (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk):
1832 (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1833 (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1834 (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1835 (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1836 (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1837 (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
1838 (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent):
1839 (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
1840 (WebKit::WebResourceLoadStatisticsStore::setDataRecordsBeingRemoved):
1841 * UIProcess/WebResourceLoadStatisticsStore.h:
1842 * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1843 (WebKit::sortedPrevalentResourceTelemetry):
1844 (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1845 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1846 (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains):
1847 (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
1848 * UIProcess/WebsiteData/WebsiteDataStore.h:
1850 2017-07-10 Michael Catanzaro <mcatanzaro@igalia.com>
1852 [SOUP] Remove WebKitSoupCookieJarSqlite
1853 https://bugs.webkit.org/show_bug.cgi?id=174310
1855 Reviewed by Carlos Garcia Campos.
1857 It seems WebKitSoupCookieJarSqlite uses exactly the same database format as the upstream
1858 SoupCookieJarDb class. WebKitSoupCookieJarSqlite is a copy of SoupCookieJarSqlite that uses
1859 WebCore's SQLite wrapper and WTF stuff. WebKitSoupCookieJarSqlite exists only because
1860 SoupCookieJarDb is relatively new, and the older SoupCookieJarSqlite class existed only in
1861 libsoup-gnome rather than libsoup proper. The advantage of continuing to use our
1862 WebKitSoupCookieJarSqlite class, besides that we already know it works, is that it utilizes
1863 the same SQLiteDatabase class that is used elsewhere in WebKit. But that's not really any
1864 reason to keep the class around, when SoupCookieJarDb does exactly the same thing. It was
1865 introduced in libsoup 2.42 and that is already our minimum required version, so we can
1868 This passes a quick sanity-check of Epiphany's cookies dialog and also TestCookieManager.
1870 * PlatformGTK.cmake:
1871 * PlatformWPE.cmake:
1872 * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1873 (WebKit::WebCookieManager::setCookiePersistentStorage):
1874 * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp: Removed.
1875 * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.h: Removed.
1877 2017-07-10 Myles C. Maxfield <mmaxfield@apple.com>
1879 REGRESSION(r213590): UI process updates the visible content rects more often than it did in iOS 10
1880 https://bugs.webkit.org/show_bug.cgi?id=174282
1881 <rdar://problem/33144344>
1883 Reviewed by Simon Fraser.
1885 In r213590, we accidentally refactored -[WKWebView _didCommitLayerTree:] to call _scheduleVisibleContentRectUpdate
1886 more often. Instead, this should be triggered from inside the "if" statements.
1888 No tests because there is no behavior change. Performance change is tested in MotionMark.
1890 * UIProcess/API/Cocoa/WKWebView.mm:
1891 (-[WKWebView _isShowingVideoPictureInPicture]):
1892 (-[WKWebView _initializeWithConfiguration:]):
1893 (-[WKWebView goBack]):
1894 (-[WKWebView _didCommitLayerTree:]):
1895 (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
1896 (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
1897 (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
1898 (-[WKWebView scrollViewDidScroll:]):
1899 (-[WKWebView _visibleContentRect]):
1900 (-[WKWebView _frameOrBoundsChanged]):
1901 (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
1902 (-[WKWebView _updateVisibleContentRects]):
1903 (-[WKWebView _navigationGestureDidBegin]):
1904 (-[WKWebView _reloadWithoutContentBlockers]):
1905 (-[WKWebView _reloadExpiredOnly]):
1906 (-[WKWebView _setObscuredInsets:]):
1907 (-[WKWebView _setUnobscuredSafeAreaInsets:]):
1908 (-[WKWebView _endAnimatedResize]):
1909 (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1910 (-[WKWebView _clearOverrideLayoutParameters]):
1911 (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
1912 (-[WKWebView _propertiesOfLayerWithID:]):
1914 2017-07-10 Carlos Garcia Campos <cgarcia@igalia.com>
1916 [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
1917 https://bugs.webkit.org/show_bug.cgi?id=166029
1919 Reviewed by Michael Catanzaro.
1921 Clear the SoupNetworkSession and cookie storage after the main loop quits.
1923 * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
1924 (WebKit::NetworkProcessMainUnix):
1926 2017-07-10 Wenson Hsieh <wenson_hsieh@apple.com>
1928 [WK2] Action sheets for links fail to present in WebKit2 PDF view
1929 https://bugs.webkit.org/show_bug.cgi?id=174307
1930 <rdar://problem/31412128>
1932 Reviewed by Tim Horton.
1934 Currently, presenting an action sheet for a link always uses the WKActionSheetPresentAtClosestIndicatorRect
1935 codepath, which requires text indicator data for the link. However, when showing an action sheet for a link via
1936 WKPDFView, a text indicator for the link is not included, so the popover rect ends up being an empty rect at the
1937 origin, which causes us to bail from presenting the popover.
1939 To address this, we tweak our heuristic for determining which action sheet presentation style to use, so that we
1940 only use the closest indicator rect for a link if the text indicator data is also present (otherwise, we fall
1941 back to using the element rect). All other behavior is the same.
1943 * UIProcess/ios/WKActionSheetAssistant.mm:
1944 (-[WKActionSheetAssistant showImageSheet]):
1945 (presentationStyleForView):
1947 Refactor _shouldPresentAtTouchLocationForElementRect into presentationStyleForView, a static function that
1948 returns a WKActionSheetPresentationStyle.
1950 (-[WKActionSheetAssistant showLinkSheet]):
1951 (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]): Deleted.
1953 2017-07-09 Brady Eidson <beidson@apple.com>
1955 Remove some obsolete WebKitVersionChecks.
1956 https://bugs.webkit.org/show_bug.cgi?id=174294
1958 Reviewed by Dan Bernstein.
1960 * WebProcess/WebPage/WebPage.cpp:
1961 (WebKit::WebPage::updatePreferences):
1963 2017-07-08 Chris Dumez <cdumez@apple.com>
1965 Simplify WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore
1966 https://bugs.webkit.org/show_bug.cgi?id=174290
1968 Reviewed by Brent Fulgham.
1970 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1971 (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]):
1972 (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]):
1973 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1974 Rename a couple of functions in the Cocoa SPI for clarity and to match the name
1975 of their internal implementation.
1977 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1978 (WebKit::ResourceLoadStatisticsStore::create):
1979 (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
1982 (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
1985 (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
1986 Use HashMap::add() instead of HashMap::set(). There is not supposed to have any duplicate
1987 keys so add() is sufficient and more efficient.
1989 (WebKit::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Removed.
1990 clearInMemoryAndPersistent() was only called from WebResourceLoadStatisticsStore and
1991 the m_deletePersistentStoreHandler / m_grandfatherExistingWebsiteDataHandler were both
1992 set by the WebResourceLoadStatisticsStore as well. Therefore, we don't really need this
1993 function, WebResourceLoadStatisticsStore now calls ResourceLoadStatisticsStore::clearInMemory()
1994 instead and takes care of doing what the m_deletePersistentStoreHandler /
1995 m_grandfatherExistingWebsiteDataHandler handlers were doing on its side.
1997 (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
1998 Pass Vector as rvalue reference, as a preparation for a future optimization. Added FIXME
1999 comment about the optimization.
2001 (WebKit::ResourceLoadStatisticsStore::setNotificationCallback): Removed.
2002 (WebKit::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback): Removed.
2003 (WebKit::ResourceLoadStatisticsStore::setDeletePersistentStoreCallback): Removed.
2004 (WebKit::ResourceLoadStatisticsStore::setFireTelemetryCallback): Removed.
2005 Drop those callback setters. WebResourceLoadStatisticsStore is the only client of
2006 ResourceLoadStatisticsStore and those callbacks were always called as a result of
2007 an operation requested by the WebResourceLoadStatisticsStore. Therefore, those are
2008 not needed. WebResourceLoadStatisticsStore can take care of doing what those
2009 callbacks were doing on its side.
2011 (WebKit::ResourceLoadStatisticsStore::processStatistics):
2012 Pass parameter by const reference since we clearly do not intend to transfer ownership of it.
2014 (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
2015 (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
2016 (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
2019 (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords): Removed.
2020 (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): Removed.
2021 (WebKit::ResourceLoadStatisticsStore::dataRecordsWereRemoved): Removed.
2022 Those were moved to WebResourceLoadStatisticsStore since they do not require
2023 any access to the statistics, and are only used by WebResourceLoadStatisticsStore.
2025 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2027 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2028 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2029 Store registering most callbacks on the coreStore. Instead, the logic of those
2030 callbacks is now inlined in the few methods in WebResourceLoadStatisticsStore
2031 that were causing these callbacks to be called.
2033 (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2034 Access some methods on WebResourceLoadStatisticsStore instead of the coreStore
2035 since those were moved.
2037 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2038 Drop unnecessary mutable for lambda.
2040 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2041 Pass parameter as rvalue reference as a preparation for a future optimization.
2043 (WebKit::WebResourceLoadStatisticsStore::hasStatisticsFileChangedSinceLastSync):
2046 (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
2047 Add assertion to make sure this is called on the main thread.
2049 (WebKit::WebResourceLoadStatisticsStore::fireDataModificationHandler): Removed.
2050 This was dispatching to a background queue to call fireDataModificationHandler()
2051 on the ResourceLoadStatisticsStore. The coreStore would then dispatch back on the
2052 main thread to call the WebResourceLoadStatisticsStore's modification handler.
2053 This modification handler was merely calling processStatisticsAndDataRecords().
2054 Therefore, callers of WebResourceLoadStatisticsStore::fireDataModificationHandler()
2055 can call WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() directly
2058 (WebKit::WebResourceLoadStatisticsStore::fireTelemetryHandler): Removed.
2059 This was calling ResourceLoadStatisticsStore::fireTelemetryHandler(), which was
2060 calling back WebResourceLoadStatisticsStore's fireTelemetryHandler. The handler
2061 in question was merely calling submitTelemetry(). Therefore, callers of
2062 WebResourceLoadStatisticsStore::fireTelemetryHandler() can call
2063 WebResourceLoadStatisticsStore::submitTelemetry() directly instead.
2065 (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent):
2066 Call ResourceLoadStatisticsStore::clearInMemory() instead of clearInMemoryAndPersistent(),
2067 which was removed. ResourceLoadStatisticsStore::clearInMemoryAndPersistent() was calling
2068 clearInMemory() and then 2 of WebResourceLoadStatisticsStore's handlers. Instead, we now
2069 call the functions that those handlers were calling directly, thus eliminating the need
2072 (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
2073 Set m_minimumTimeBetweenDataRecordsRemoval directly as it is now store on this class
2074 instead of the coreStore.
2076 (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
2077 (WebKit::WebResourceLoadStatisticsStore::dataRecordsBeingRemoved):
2078 (WebKit::WebResourceLoadStatisticsStore::dataRecordsWereRemoved):
2079 Those were merely moved from the ResourceLoadStatisticsStore.
2081 * UIProcess/WebResourceLoadStatisticsStore.h:
2083 * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
2084 (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
2085 Check for sortedPrevalentResources.isEmpty() instead of checking if the size
2086 if less than minimumPrevalentResourcesForTelemetry.
2087 ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry() either returns
2088 an empty vector or a vector with more than minimumPrevalentResourcesForTelemetry
2089 items. Therefore, there is no need to expose minimumPrevalentResourcesForTelemetry.
2091 2017-07-08 Yusuke Suzuki <utatane.tea@gmail.com>
2093 Drop NOSNIFF compile flag
2094 https://bugs.webkit.org/show_bug.cgi?id=174289
2096 Reviewed by Michael Catanzaro.
2098 * Configurations/FeatureDefines.xcconfig:
2100 2017-07-07 Chris Dumez <cdumez@apple.com>
2102 [WK2] Use a rolling 30-day uptime for processing statistics
2103 https://bugs.webkit.org/show_bug.cgi?id=174235
2104 <rdar://problem/33164381>
2106 Reviewed by Brent Fulgham.
2108 Follow-up fix for r219274 because it caused this test to time out:
2109 http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html
2111 The test sets TimeToLiveUserInteraction to 0 so our implementation cannot use
2112 0 as magic value to see if it was set. Instead, use std::optional.
2114 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2115 (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
2116 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2117 (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2118 (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired):
2119 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2120 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2121 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2122 * UIProcess/WebResourceLoadStatisticsStore.h:
2124 2017-07-07 Brent Fulgham <bfulgham@apple.com>
2126 [WK2] Use a rolling 30-day uptime for processing statistics
2127 https://bugs.webkit.org/show_bug.cgi?id=174235
2128 <rdar://problem/33164381>
2130 Reviewed by Chris Dumez.
2132 * UIProcess/API/Cocoa/WKWebsiteDataStore.cpp:
2133 (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsResetToConsistentState): Initialize time-to-live to zero by default.
2134 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2135 (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): Write out vector
2137 (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): Read in vector of
2139 (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): Check new
2141 (WebKit::ResourceLoadStatisticsStore::markTodayAsOperatingDate): Added.
2142 (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired): Added.
2143 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2144 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2145 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): When reading
2146 a new data file, update the current operating date (if needed).
2147 (WebKit::WebResourceLoadStatisticsStore::handleDailyTasks): Roll uptime dates as
2148 needed, then handle telemetry.
2149 * UIProcess/WebResourceLoadStatisticsStore.h:
2151 2017-07-07 Wenson Hsieh <wenson_hsieh@apple.com>
2153 [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
2154 https://bugs.webkit.org/show_bug.cgi?id=174219
2155 <rdar://problem/32083177>
2157 Reviewed by Ryosuke Niwa.
2159 Tweak some testing SPI to return a drop operation flag instead of whether or not the drop operation was not
2160 UIDropOperationCancel.
2162 * UIProcess/API/Cocoa/WKWebView.mm:
2163 (-[WKWebView _simulateDataInteractionUpdated:]):
2164 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2165 * UIProcess/ios/WKContentViewInteraction.h:
2166 * UIProcess/ios/WKContentViewInteraction.mm:
2167 (-[WKContentView _simulateDataInteractionUpdated:]):
2169 2017-07-07 Commit Queue <commit-queue@webkit.org>
2171 Unreviewed, rolling out r219238, r219239, and r219241.
2172 https://bugs.webkit.org/show_bug.cgi?id=174265
2174 "fast/workers/dedicated-worker-lifecycle.html is flaky"
2175 (Requested by yusukesuzuki on #webkit).
2177 Reverted changesets:
2179 "[WTF] Implement WTF::ThreadGroup"
2180 https://bugs.webkit.org/show_bug.cgi?id=174081
2181 http://trac.webkit.org/changeset/219238
2183 "Unreviewed, build fix after r219238"
2184 https://bugs.webkit.org/show_bug.cgi?id=174081
2185 http://trac.webkit.org/changeset/219239
2187 "Unreviewed, CLoop build fix after r219238"
2188 https://bugs.webkit.org/show_bug.cgi?id=174081
2189 http://trac.webkit.org/changeset/219241
2191 2017-07-07 Antti Koivisto <antti@apple.com>
2193 WKWebSiteDataStore.removeDataOfTypes should wait until disk cache files are actually removed before invoking completion handler
2194 https://bugs.webkit.org/show_bug.cgi?id=174224
2195 <rdar://problem/33067545>
2197 Reviewed by Sam Weinig.
2199 Currently we dispatch file deletion operations to a background queue and call the completion
2200 handler without waiting for the I/O to complete.
2202 * NetworkProcess/NetworkProcess.cpp:
2203 (WebKit::clearDiskCacheEntries):
2205 Call a new version of NetworkCache::remove() for bulk deletion.
2206 Note that it is fine to call this with an empty vector.
2208 * NetworkProcess/cache/NetworkCache.cpp:
2209 (WebKit::NetworkCache::Cache::remove):
2211 Bulk deletion with a completion handler.
2213 (WebKit::NetworkCache::Cache::deleteFiles): Added.
2215 Factor to a helper function.
2217 * NetworkProcess/cache/NetworkCache.h:
2218 * NetworkProcess/cache/NetworkCacheStorage.cpp:
2219 (WebKit::NetworkCache::Storage::remove):
2221 Remove files for all the provided keys in a queue and invoke the completion handler in the main thread when done.
2223 * NetworkProcess/cache/NetworkCacheStorage.h:
2225 2017-07-06 Chris Dumez <cdumez@apple.com>
2227 Fix bad usage of static variables in ResourceLoadStatisticsStore
2228 https://bugs.webkit.org/show_bug.cgi?id=174237
2230 Reviewed by Brent Fulgham.
2232 Fix bad usage of static variables in ResourceLoadStatisticsStore. Those can be set via
2233 member functions on ResourceLoadStatisticsStore so they should be data members. The
2234 API to set them is associated to a particular store and there can in theory be several
2237 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2238 (WebKit::ResourceLoadStatisticsStore::shouldPartitionCookies):
2239 (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2240 (WebKit::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
2241 (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
2242 (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime):
2243 (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
2244 (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
2245 (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
2246 (WebKit::shouldPartitionCookies): Deleted.
2247 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2249 2017-07-05 Yusuke Suzuki <utatane.tea@gmail.com>
2251 [WTF] Implement WTF::ThreadGroup
2252 https://bugs.webkit.org/show_bug.cgi?id=174081
2254 Reviewed by Mark Lam.
2256 * Shared/AsyncRequest.h:
2257 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2259 2017-07-06 Chris Dumez <cdumez@apple.com>
2261 Drop unused ResourceLoadStatistics members
2262 https://bugs.webkit.org/show_bug.cgi?id=174226
2264 Reviewed by Brent Fulgham.
2266 * Shared/WebCoreArgumentCoders.cpp:
2267 (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2268 (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2269 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2270 (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
2272 2017-07-06 Wenson Hsieh <wenson_hsieh@apple.com>
2274 Unreviewed, fix the internal iOS 11 build
2276 It turns out, our internal bots are still on an older version of the iOS 11 SDK that's missing _UIDataOwner in
2277 <UIKit/NSItemProvider+UIKitAdditions_Private.h>. To ensure that we can build on both current and slightly older
2278 versions of the iOS 11 SDK, fall back to using NSInteger instead of _UIDataOwner.
2280 * Platform/spi/ios/UIKitSPI.h:
2281 * UIProcess/ios/WKContentViewInteraction.mm:
2282 (-[WKContentView _dragInteraction:dataOwnerForSession:]):
2283 (-[WKContentView _dropInteraction:dataOwnerForSession:]):
2285 2017-07-06 Wenson Hsieh <wenson_hsieh@apple.com>
2287 [iOS DnD] [WK2] Add delegate hooks for specifying the data owner for a drag or drop session
2288 https://bugs.webkit.org/show_bug.cgi?id=174139
2289 <rdar://problem/33126212>
2291 Reviewed by Beth Dakin.
2293 Add hooks to query the UI delegate for a _UIDataOwner on both drag and drop sides.
2295 * Platform/spi/ios/UIKitSPI.h:
2296 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2297 * UIProcess/ios/WKContentViewInteraction.mm:
2298 (-[WKContentView _dragInteraction:dataOwnerForSession:]):
2299 (-[WKContentView _dropInteraction:dataOwnerForSession:]):
2301 2017-07-06 Brent Fulgham <bfulgham@apple.com>
2303 [WK2] ResourceLoadStatistics should batch its writes
2304 https://bugs.webkit.org/show_bug.cgi?id=174111
2305 <rdar://problem/33115894>
2307 Reviewed by Chris Dumez.
2309 Revise the data writing operation to only write on a specific interval (currently
2312 Also make 'writeStoreToDisk' simpler to use by moving the deleting (before write) and
2313 creating (after write) of the FileMonitor into the method, rather than requiring this
2314 knowledge in multiple places.
2316 Make sure that we write our statistics file out before exiting so that we do not
2317 lose any data if we exit before the five-minute window has elapsed.
2319 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2320 (WebKit::ResourceLoadStatisticsStore::setWritePersistentStoreCallback): Deleted.
2321 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2322 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Remove the stop
2323 and start monitoring into 'writeStoreToDisk'. Also check if enough time has elapsed since
2324 the last write to commit to disk.
2325 (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Remove the
2326 stop and start monitoring into 'writeStoreToDisk'.
2327 (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Add the stop and start monitoring
2328 commands here, so callers don't have to know to do so.
2330 2017-07-06 Chris Dumez <cdumez@apple.com>
2332 FileMonitor should not be ref counted
2333 https://bugs.webkit.org/show_bug.cgi?id=174166
2335 Reviewed by Brent Fulgham.
2337 Update code using FileMonitor to reflect API change.
2339 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2340 (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
2341 (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage):
2342 * UIProcess/WebResourceLoadStatisticsStore.h:
2344 2017-07-06 Matt Rajca <mrajca@apple.com>
2346 Fix build with VIDEO support disabled.
2347 https://bugs.webkit.org/show_bug.cgi?id=174217
2349 Unreviewed build fix.
2351 * WebProcess/WebPage/WebPage.cpp:
2352 (WebKit::WebPage::updateWebsitePolicies):
2354 2017-07-06 Chris Dumez <cdumez@apple.com>
2356 Crash under WebResourceLoadStatisticsStore::persistentStoragePath(WTF::String const&)
2357 https://bugs.webkit.org/show_bug.cgi?id=174205
2358 <rdar://problem/33093552>
2360 Reviewed by Brent Fulgham.
2362 Make sure we isolateCopy() m_statisticsStoragePath before using it from the background
2365 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2366 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2367 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
2368 (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath):
2369 (WebKit::WebResourceLoadStatisticsStore::statisticsFilePath):
2370 (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
2371 (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
2372 (WebKit::WebResourceLoadStatisticsStore::deleteStoreFromDisk):
2373 (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
2374 (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded):
2375 (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Deleted.
2376 * UIProcess/WebResourceLoadStatisticsStore.h:
2378 2017-07-06 Alex Christensen <achristensen@webkit.org>
2380 Fix CFURLRequestRef serialization after r207330
2381 https://bugs.webkit.org/show_bug.cgi?id=163332
2383 * Shared/mac/WebCoreArgumentCodersMac.mm:
2384 (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2385 The CFURLConnection code was not updated.
2386 We did not catch this because nobody uses the WebKit2 CFURLConnection code, but I need to use it to debug something.
2388 2017-07-06 Chris Dumez <cdumez@apple.com>
2390 Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver
2391 https://bugs.webkit.org/show_bug.cgi?id=174194
2393 Reviewed by Brent Fulgham.
2395 Move ResourceLoadObserver notification throttling logic from WebProcess class to
2396 ResourceLoadObserver. This makes more sense and decreases the complexity of the
2399 * WebProcess/WebProcess.cpp:
2400 (WebKit::m_webSQLiteDatabaseTracker):
2401 (WebKit::WebProcess::statisticsChangedTimerFired): Deleted.
2402 * WebProcess/WebProcess.h:
2404 2017-07-06 Chris Dumez <cdumez@apple.com>
2406 WebResourceLoadStatisticsStore should only be constructed when the feature is enabled
2407 https://bugs.webkit.org/show_bug.cgi?id=174189
2409 Reviewed by Brent Fulgham.
2411 Delay the construction of the WebResourceLoadStatisticsStore until the feature gets
2412 enabled via WebsiteDataStore::setResourceLoadStatisticsEnabled(). Previously, we would
2413 always construct a store and then have a boolean on the store to indicate if it is
2416 Also simplify the initialization process of the WebResourceLoadStatisticsStore, we
2418 1. WebResourceLoadStatisticsStore constructor
2419 2. WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
2420 3. WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled(true)
2422 All 3 steps are now taken care of by the WebResourceLoadStatisticsStore constructor.
2424 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2425 (WebKit::WebProcessPool::platformInitialize):
2426 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2427 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2428 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2429 * UIProcess/WebResourceLoadStatisticsStore.h:
2430 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2431 (WebKit::WebsiteDataStore::platformInitialize):
2432 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2433 (WebKit::WebsiteDataStore::WebsiteDataStore):
2434 (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled):
2435 (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2436 * UIProcess/WebsiteData/WebsiteDataStore.h:
2437 (WebKit::WebsiteDataStore::resourceLoadStatistics):
2438 * UIProcess/wpe/WebProcessPoolWPE.cpp:
2439 (WebKit::WebProcessPool::platformInitialize):
2441 2017-07-06 Claudio Saavedra <csaavedra@igalia.com>
2443 [GTK] It should process MouseMoved events when the parent window is not active
2444 https://bugs.webkit.org/show_bug.cgi?id=116691
2446 Reviewed by Michael Catanzaro.
2448 From reading the comments in the related code, only in Safari it
2449 is desired that MouseMoved events are not processed when the
2450 parent window is not active. In other ports, in particular those
2451 targeting Linux, these events should be processed for consistency
2452 with other browsers.
2454 * UIProcess/WebPageProxy.cpp:
2455 (WebKit::WebPageProxy::setCursor):
2456 * UIProcess/mac/PageClientImpl.mm:
2457 (WebKit::PageClientImpl::setCursor):
2458 * WebProcess/WebPage/WebPage.cpp:
2459 (WebKit::handleMouseEvent):
2460 (WebKit::WebPage::mouseEvent): No need to always pass a boolean
2461 parameter that is only checked for one type of event. Do the check
2462 internally in handleMouseEvent() only when needed and only in Cocoa.
2464 2017-07-05 Don Olmstead <don.olmstead@sony.com>
2466 [WTF] Move SoftLinking.h into WTF
2467 https://bugs.webkit.org/show_bug.cgi?id=174000
2469 Reviewed by Alex Christensen.
2471 * Platform/mac/StringUtilities.mm:
2472 * Platform/spi/ios/ManagedConfigurationSPI.h:
2473 * Shared/Cocoa/DataDetectionResult.mm:
2474 * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2475 * Shared/ios/InteractionInformationAtPosition.mm:
2476 * Shared/ios/WebIconUtilities.mm:
2477 * Shared/mac/CookieStorageShim.mm:
2478 * Shared/mac/WebCoreArgumentCodersMac.mm:
2479 * UIProcess/API/Cocoa/_WKElementAction.mm:
2480 * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2481 * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2482 * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2483 * UIProcess/Cocoa/UIDelegate.mm:
2484 * UIProcess/Cocoa/WebViewImpl.mm:
2485 * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2486 * UIProcess/ios/WKActionSheetAssistant.mm:
2487 * UIProcess/ios/WKContentViewInteraction.mm:
2488 * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2489 * UIProcess/ios/forms/WKFileUploadPanel.mm:
2490 * UIProcess/mac/WKImmediateActionController.mm:
2491 * UIProcess/mac/WebInspectorProxyMac.mm:
2492 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2493 * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
2494 * WebProcess/cocoa/WebProcessCocoa.mm:
2496 2017-07-05 Brady Eidson <beidson@apple.com>
2498 Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow".
2499 <rdar://problem/22485589> and https://bugs.webkit.org/show_bug.cgi?id=174178
2501 Reviewed by Alex Christensen.
2503 Adopt to the new constructor for FrameLoadRequest.
2505 * WebProcess/Plugins/PluginView.cpp:
2506 (WebKit::PluginView::loadURL):
2507 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2508 (WebKit::WebFrameLoaderClient::dispatchCreatePage):
2509 * WebProcess/WebPage/WebInspector.cpp:
2510 (WebKit::WebInspector::openInNewTab):
2512 2017-07-05 Ryosuke Niwa <rniwa@webkit.org>
2514 Remove unnecessary forward declartions now that we include Foundation.h
2516 * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2518 2017-07-05 Ryosuke Niwa <rniwa@webkit.org>
2520 Make WebKit's public headers on Mac and iOS C++ module safe
2521 https://bugs.webkit.org/show_bug.cgi?id=174175
2523 Reviewed by Alex Christensen.
2525 Fixed the header files.
2527 * UIProcess/API/Cocoa/WKContentRuleList.h:
2528 * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2529 * UIProcess/API/Cocoa/WKUIDelegate.h:
2531 2017-07-05 Chris Dumez <cdumez@apple.com>
2533 [WK2] WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with
2534 https://bugs.webkit.org/show_bug.cgi?id=174174
2536 Reviewed by Brent Fulgham.
2538 WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with.
2539 Fix this by iterating over WebsiteDataStore::processPools() instead of WebProcessPool::allProcessPools().
2541 Also rename shouldPartitionCookiesForTopPrivatelyOwnedDomains methods / IPC messages to
2542 updateCookiePartitioningForTopPrivatelyOwnedDomains since this is a setter, not a getter.
2544 Finally, drop ShouldPartitionCookiesForTopPrivatelyOwnedDomains IPC message to the NetworkProcessProxy
2545 as well as corresponding methods as those appear to be unused.
2547 * NetworkProcess/NetworkProcess.cpp:
2548 (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains):
2549 (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted.
2550 * NetworkProcess/NetworkProcess.h:
2551 * NetworkProcess/NetworkProcess.messages.in:
2552 * UIProcess/Network/NetworkProcessProxy.cpp:
2553 (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted.
2554 * UIProcess/Network/NetworkProcessProxy.h:
2555 * UIProcess/Network/NetworkProcessProxy.messages.in:
2556 * UIProcess/WebProcessPool.cpp:
2557 (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
2558 * UIProcess/WebProcessPool.h:
2559 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2560 (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains):
2561 (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2562 (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
2563 (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted.
2564 * UIProcess/WebsiteData/WebsiteDataStore.h:
2566 2017-07-05 Tim Horton <timothy_horton@apple.com>
2568 Async Image Decoding: Image flashes away briefly when tapping on tab in iPad tab picker
2569 https://bugs.webkit.org/show_bug.cgi?id=174173
2570 <rdar://problem/32431952>
2572 Reviewed by Geoffrey Garen.
2574 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2575 (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
2576 When a client uses e.g. doAfterNextPresentationUpdate (or internally,
2577 dispatchAfterEnsuringDrawing), they're doing so in the hopes that the
2578 callback is called after the page is well-painted -- for example, to
2579 remove a snapshot (in the tab picker case, as well as for navigation
2580 gestures), or to *take* a snapshot. In all of these cases, it is
2581 preferable to do a synchronous decode, to ensure that the image does
2582 not flash away temporarily.
2584 Use the existing mechanism that was implemented for the synchronous
2585 activity state change flush to also force synchronous image decoding
2586 any time there is a post-commit transaction callback.
2588 2017-07-05 Wenson Hsieh <wenson_hsieh@apple.com>
2590 [iOS DnD] [WK2] 3D touch fails to recognize when UIDragInteraction is enabled on phone
2591 https://bugs.webkit.org/show_bug.cgi?id=174171
2592 <rdar://problem/32956929>
2594 Reviewed by Tim Horton.
2596 By default, UIKit defers all competing long press gesture recognizers if dragging is enabled. However, this
2597 would cause 3D touch to be prevented, due to UIKit asking us whether or not we can proceed with the 3D touch
2598 gesture in -_interactionShouldBeginFromPreviewItemController:forPosition:, while the highlight long press
2599 gesture recognizer is being deferred. To address this, we use SPI on UIDragInteraction to allow the highlight
2600 long press gesture recognizer to recognize alongside the drag lift gesture. We then (already) manually cancel
2601 the highlight long press gesture in _dragInteraction:prepareForSession:completion:.
2603 * UIProcess/ios/WKContentViewInteraction.mm:
2604 (-[WKContentView _dragInteraction:shouldDelayCompetingGestureRecognizer:]):
2606 2017-07-03 Myles C. Maxfield <mmaxfield@apple.com>
2608 Remove copy of ICU headers from WebKit
2609 https://bugs.webkit.org/show_bug.cgi?id=116407
2611 Reviewed by Alex Christensen.
2613 * Configurations/BaseTarget.xcconfig:
2615 2017-07-05 Chris Dumez <cdumez@apple.com>
2617 Regression(r218821): Bad cast to WebKit::DiagnosticLoggingClient in WKWebView's _setDiagnosticLoggingDelegate
2618 https://bugs.webkit.org/show_bug.cgi?id=174163
2619 <rdar://problem/33067518>
2621 Reviewed by Alex Christensen.
2623 After r218821, WebPageProxy::setDiagnosticLoggingClient() would no longer set the client in
2624 private session. This is an issue because there is code in WKWebView which expects the
2625 DiagnosticLoggingClient to be set and of a specific type. This would lead to bad casts in
2626 WKWebView's _diagnosticLoggingDelegate / _setDiagnosticLoggingDelegate.
2628 To avoid the issue, we now unconditionally update the client in
2629 WebPageProxy::setDiagnosticLoggingClient(). Instead, we implement the logic for disabling
2630 logging in private session in the logging methods themselves, via the
2631 WebPageProxy::effectiveDiagnosticLoggingClient() helper instead.
2633 I also added null checks in WKWebView's _diagnosticLoggingDelegate /
2634 _setDiagnosticLoggingDelegate. Even though the WKWebView sets itself as the diagnostic
2635 logging client, WebPageProxy::diagnosticLoggingClient() can still return null after
2636 calling WebPageProxy::close(). Previously, we would have done a bad cast if the WKWebView's
2637 client would have used this API after calling 'close' as well.
2639 * UIProcess/API/APIDiagnosticLoggingClient.h:
2640 * UIProcess/API/Cocoa/WKWebView.mm:
2641 (-[WKWebView _diagnosticLoggingDelegate]):
2642 (-[WKWebView _setDiagnosticLoggingDelegate:]):
2643 * UIProcess/WebPageProxy.cpp:
2644 (WebKit::WebPageProxy::WebPageProxy):
2645 (WebKit::WebPageProxy::setDiagnosticLoggingClient):
2646 (WebKit::WebPageProxy::close):
2647 (WebKit::WebPageProxy::effectiveDiagnosticLoggingClient):
2648 (WebKit::WebPageProxy::logDiagnosticMessage):
2649 (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
2650 (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
2651 (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy):
2652 * UIProcess/WebPageProxy.h:
2653 (WebKit::WebPageProxy::diagnosticLoggingClient):
2655 2017-07-05 Daniel Bates <dabates@apple.com>
2657 Do not pass API::FrameInfo for source frame or clear out page of target frame on
2659 https://bugs.webkit.org/show_bug.cgi?id=174170
2660 <rdar://problem/33140328>
2662 Reviewed by Brady Eidson.
2664 As a step towards making it straightforward for an embedding client to determine whether
2665 a WebPageProxy::decidePolicyForNavigationAction() callback was initiated from API we
2666 should not pass frame info for the source frame and should not nullify the page pointer
2667 in the target frame info.
2669 Currently we always pass frame info for the source frame and nullify the page pointer
2670 in both the source frame info and target frame info if the navigation was initiated from
2671 API. This seems subtle and error prone. Instead we should not pass frame info for
2672 the source frame and not nullify the page pointer in the target frame info as a step
2673 towards making using this API less error-prone.
2675 * UIProcess/WebPageProxy.cpp:
2676 (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2678 2017-07-05 Chris Dumez <cdumez@apple.com>
2680 Add a few more WebKit2 owners
2681 https://bugs.webkit.org/show_bug.cgi?id=174169
2683 Reviewed by Brady Eidson.
2687 2017-07-05 Brent Fulgham <bfulgham@apple.com>
2689 [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events
2690 https://bugs.webkit.org/show_bug.cgi?id=174062\
2691 <rdar://problem/33086744>
2693 Reviewed by Chris Dumez.
2695 ResourceLoadStatistics was triggering periods of high CPU use due to a cascade of read/write
2697 (1) The 'makeRefPtr' call in FileMonitor::startMonitoring was capturing a reference to itself, preventing
2698 the FileMonitor from being destroyed. This caused the file modification handler to fire in response
2699 to our own write events, creating a ridiculous read/write cycle. This problem was addressed in
2700 the short term by stopping the file monitor in WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage,
2701 rather than relying on the destructor to shut things down. This will be improved in a
2703 (2) 'syncWithExistingStatisticsStorageIfNeeded' was creating a FileMonitor during the write operation,
2704 which exacerbated the chain of read/writes already present due to the self-reference described above.
2705 (3) Because VNODE dispatch sources are low level, they do not offer a means of filtering out operations
2706 triggered by the current process. To avoid this, I added code to track the file modification time, so
2707 that we don't bother reading a file that holds data that is older than the in-memory data, even though
2708 we receive a file modification dispatch. Writes seem to trigger a chain of notification events in rapid
2709 succession. Once we've responded to the first of these events, we don't need to to further reads until
2710 the data on disk changes again.
2712 We also shouldn't allow the ResourceLoadStatistics worker thread to consume high CPU resources. Run it
2713 as utility QoS, avoiding using the CPU when other work is going on.
2715 Drive-by fix: The closure in setWritePersistentStoreCallback() should stop monitoring before writing
2716 data, and should start monitoring after the write completes.
2718 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2719 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Run our worker queue
2720 as a utility-level process.
2721 (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Stop checking for
2722 updates before writing, and begin checking again once the write is complete.
2723 (WebKit::WebResourceLoadStatisticsStore::statisticsFileModificationTime): Added.
2724 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Avoid reading the file if it
2725 was last modified on (or before) the time we last read the file.
2726 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): Ditto.
2727 (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage): Explicitly stop file
2728 monitoring so that the active file modification handler will terminate.
2729 (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): Do not begin
2730 monitoring the file after syncing, since this is only used as part of an ongoing write operation.
2732 2017-07-05 Jonathan Bedard <jbedard@apple.com>
2734 Add WebKitPrivateFrameworkStubs for iOS 11
2735 https://bugs.webkit.org/show_bug.cgi?id=173988
2737 Reviewed by David Kilzer.
2739 * Configurations/BaseTarget.xcconfig: iphoneos and iphonesimulator should use the
2740 same directory for private framework stubs.
2742 2017-07-05 Andy Estes <aestes@apple.com>
2744 [iOS] WKActionSheetAssistants can outlive their host views
2745 https://bugs.webkit.org/show_bug.cgi?id=174160
2746 <rdar://problem/20638607>
2748 Reviewed by Tim Horton.
2750 WKActionSheetAssistant keeps a raw pointer to its host UIView, and nothing clears it when
2751 the host view is deallocated. If the assistant outlives the view, we can end up accessing a
2752 pointer to a deallocated UIView and crashing.
2754 I don't know how to reproduce such a crash, but this patch guards against it by doing the
2757 1. Make _view a WeakObjCPtr in WKActionSheetAssistant to ensure it gets set to nil when the
2758 UIView is deallocated.
2759 2. Call -[WKActionSheetAssistant cleanupSheet] when a WKContentView or WKPDFView is
2760 deallocated, or when the Web process crashes. This will ensure the action sheet is
2761 dismissed and prevent the user from tapping on an action that's no longer valid.
2763 * UIProcess/ios/WKActionSheetAssistant.mm:
2764 (-[WKActionSheetAssistant superviewForSheet]):
2765 (-[WKActionSheetAssistant _presentationRectForSheetGivenPoint:inHostView:]):
2766 (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
2767 (-[WKActionSheetAssistant presentationRectForIndicatedElement]):
2768 (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]):
2769 * UIProcess/ios/WKContentViewInteraction.mm:
2770 (-[WKContentView cleanupInteraction]):
2771 * UIProcess/ios/WKPDFView.mm:
2772 (-[WKPDFView dealloc]):
2774 2017-07-05 Frederic Wang <fwang@igalia.com>
2776 Move ScrolledContentsLayer property to ScrollingStateScrollingNode
2777 https://bugs.webkit.org/show_bug.cgi?id=174134
2779 Reviewed by Simon Fraser.
2781 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2782 (ArgumentCoder<ScrollingStateScrollingNode>::encode): Add encoding for scrolled contents
2784 (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): Remove encoding for scrolled
2786 (ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode): Ditto.
2787 (ArgumentCoder<ScrollingStateScrollingNode>::decode): Add decoding for scrolled contents
2789 (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode): Remove decoding for scrolled
2791 (ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode): Ditto.
2792 (WebKit::dump): Move dumping of scrolled contents layer from overflow/frame nodes to
2794 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2795 (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Adjust enum value to use
2796 ScrollingStateScrollingNode::ScrolledContentsLayer.
2797 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2798 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto.
2799 * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2800 (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Ditto.
2802 2017-07-05 Ada Chan <adachan@apple.com>
2804 Fix crash in UIKit: +[UIViewController _viewControllerForFullScreenPresentationFromView:]
2805 https://bugs.webkit.org/show_bug.cgi?id=174143
2806 <rdar://problem/28384582>
2808 Reviewed by Wenson Hsieh.
2810 In -[WKActionSheet willRotate], we can't guarantee that the action sheet belongs
2811 in a window, and passing nil to +[UIViewController _viewControllerForFullScreenPresentationFromView:]
2812 throws an exception. To fix this, bail early if the result from -hostViewForSheet is nil.
2814 * UIProcess/ios/WKActionSheet.mm:
2815 (-[WKActionSheet willRotate]):
2817 2017-07-05 Eric Carlson <eric.carlson@apple.com>
2819 [MediaStream] Protect request and web view during gUM client callback
2820 https://bugs.webkit.org/show_bug.cgi?id=174096
2821 <rdar://problem/32833102>
2823 Reviewed by Youenn Fablet.
2825 Retain the message and WebView during asynchronous calls so they won't be
2826 released if a navigation happens during a call to the UA for getUserMedia
2827 or enumerateMediaDevices.
2829 * UIProcess/Cocoa/UIDelegate.mm:
2830 (WebKit::requestUserMediaAuthorizationForDevices):
2831 (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2832 (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2834 2017-07-05 Matt Lewis <jlewis3@apple.com>
2836 Unreviewed, rolling out r219128.
2838 Spoke with engineer who originally submitted, Patch for APi
2843 "Unreviewed, rolling out r219070."
2844 https://bugs.webkit.org/show_bug.cgi?id=174082
2845 http://trac.webkit.org/changeset/219128
2847 2017-07-05 Matt Lewis <jlewis3@apple.com>
2849 Unreviewed, rolling out r219070.
2851 This revision caused consistent failures of the API test
2852 UIPasteboardTests.DoNotPastePlainTextAsURL on iOS.
2856 "Pasting single words copied to UIPasteboard inserts URLs in
2858 https://bugs.webkit.org/show_bug.cgi?id=174082
2859 http://trac.webkit.org/changeset/219070
2861 2017-07-05 Zan Dobersek <zdobersek@igalia.com>
2863 [GLib] Incorrect <glib/gi18n.h> include in WebKitWebsiteData
2864 https://bugs.webkit.org/show_bug.cgi?id=174093
2866 Reviewed by Michael Catanzaro.
2868 * UIProcess/API/glib/WebKitWebsiteData.cpp: Include <glib/gi18n-lib.h>
2869 rather than <glib/gi18n.h>, since the former has to be included in a
2870 library while the latter should only be included in a standalone application.
2872 2017-07-04 Joseph Pecoraro <pecoraro@apple.com>
2874 Cleanup some StringBuilder use
2875 https://bugs.webkit.org/show_bug.cgi?id=174118
2877 Reviewed by Andreas Kling.
2879 * NetworkProcess/capture/NetworkCaptureManager.cpp:
2880 (WebKit::NetworkCapture::Manager::hashToPath):
2881 * UIProcess/WebPageProxy.cpp:
2883 2017-07-03 Wenson Hsieh <wenson_hsieh@apple.com>
2885 [iOS DnD] [WK2] Callout bar should reappear after dragging ends for a text selection
2886 https://bugs.webkit.org/show_bug.cgi?id=174116
2887 <rdar://problem/33017845>
2889 Reviewed by Ryosuke Niwa.
2891 -willStartScrollingOverflow -didEndScrollingOverflow are helper methods on both the UIWKTextInteractionAssistant
2892 and UIWebSelectionAssistant that handle hiding selection and callout bar UI during overflow scrolling and making
2893 it reappear after scrolling ends. However, these hooks do not contain logic specific to scrolling, and simply
2894 tell the inner UIWebSelectionView to either show or hide and are safe to invoke outside of the context of
2897 This patch invokes these hooks when beginning a drag on a selection, and when a dragging ends, if it called
2898 -willStartScrollingOverflow to begin with. We should rename these in the future to be something along the lines
2899 of -hideSelectionViewAndControls and -showSelectionViewAndControls, respectively, and adopt these new names in
2900 WebKit. We also move logic to hide the callout out of -itemsForBeginningSession: and into
2901 -willAnimateLiftWithAnimator:, when the lift actually begins.
2903 * UIProcess/ios/WKContentViewInteraction.h:
2904 * UIProcess/ios/WKContentViewInteraction.mm:
2905 (-[WKContentView cleanUpDragSourceSessionState]):
2906 (-[WKContentView _restoreCalloutBarIfNeeded]):
2907 (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2908 (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2909 (-[WKContentView dragInteraction:session:didEndWithOperation:]):
2911 2017-07-03 Matt Rajca <mrajca@apple.com>
2913 Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called
2914 https://bugs.webkit.org/show_bug.cgi?id=174103
2916 Reviewed by Alex Christensen.
2918 Currently, when -[WKWebView evaluateJavaScript:completionHandler:] is invoked, we end up simulating
2919 a user gesture unconditionally. This is not desireable for some tests, so I added a private variant
2920 of this method that takes a boolean that is ultimately passed to `executeScript` for the
2921 `forceUserGesture` parameter (instead of unconditionally passing `true`).
2923 * UIProcess/API/C/WKPage.cpp:
2924 (WKPageRunJavaScriptInMainFrame):
2925 * UIProcess/API/Cocoa/WKWebView.mm:
2926 (-[WKWebView evaluateJavaScript:completionHandler:]):
2927 (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]):
2928 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2929 * UIProcess/WebPageProxy.cpp:
2930 (WebKit::WebPageProxy::runJavaScriptInMainFrame):
2931 * UIProcess/WebPageProxy.h:
2932 * WebProcess/WebPage/WebPage.cpp:
2933 (WebKit::WebPage::runJavaScriptInMainFrame):
2934 (WebKit::WebPage::updateWebsitePolicies): Update behavior restrictions on any existing media elements.
2935 * WebProcess/WebPage/WebPage.h:
2936 * WebProcess/WebPage/WebPage.messages.in:
2938 2017-07-03 Matt Lewis <jlewis3@apple.com>
2940 Unreviewed, rolling out r219103.
2942 Caused multiple build failures.
2946 "Remove copy of ICU headers from WebKit"
2947 https://bugs.webkit.org/show_bug.cgi?id=116407
2948 http://trac.webkit.org/changeset/219103
2950 2017-07-03 Myles C. Maxfield <mmaxfield@apple.com>
2952 Remove copy of ICU headers from WebKit
2953 https://bugs.webkit.org/show_bug.cgi?id=116407
2955 Reviewed by Alex Christensen.
2957 Use WTF's copy of ICU headers.
2959 * Configurations/BaseTarget.xcconfig:
2961 2017-07-03 Brady Eidson <beidson@apple.com>
2963 Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism.
2964 https://bugs.webkit.org/show_bug.cgi?id=174073
2966 Reviewed by Andy Estes.
2968 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2969 (WebKit::WebFrameLoaderClient::getLoadDecisionForIcons):
2970 (WebKit::WebFrameLoaderClient::dispatchDidReceiveIcon): Deleted.
2971 (WebKit::WebFrameLoaderClient::registerForIconNotification): Deleted.
2972 (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted.
2973 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2975 2017-07-03 Sam Weinig <sam@webkit.org>
2977 [WebIDL] Remove more unnecessary uses of the preprocessor in idl files
2978 https://bugs.webkit.org/show_bug.cgi?id=174083
2980 Reviewed by Alex Christensen.
2982 * Configurations/FeatureDefines.xcconfig:
2983 Add ENABLE_NAVIGATOR_STANDALONE.
2985 2017-07-03 Matt Lewis <jlewis3@apple.com>
2987 Unreviewed, rolling out r219083.
2989 The revision caused an API failure on all testing platforms.
2993 "[MediaStream] Protect request and web view during gUM client
2995 https://bugs.webkit.org/show_bug.cgi?id=174096
2996 http://trac.webkit.org/changeset/219083
2998 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
3000 WebContent processes crash when the network process crashes with pending connection requests
3001 https://bugs.webkit.org/show_bug.cgi?id=174065
3002 <rdar://problem/30359835>
3004 Reviewed by Tim Horton.
3006 The bug was caused by the UI process clearing away pending network connection requests whenever the existing
3007 network process crashed. This resulted in WebContent process killing itself inside ensureNetworkProcessConnection.
3009 Fixed the bug by re-launching a new network process when this happens. We don't try to re-launch a new process
3010 if the previous attempt to launch a network process had failed.
3012 This patch splits NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch into networkProcessFailedToLaunch
3013 and networkProcessCrashed to differentiate those two cases, and invoke the respective callbacks in WebProcessPool.
3015 * UIProcess/API/Cocoa/WKProcessPool.mm:
3016 (-[WKProcessPool _networkProcessIdentifier]): Added.
3017 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3018 * UIProcess/Network/NetworkProcessProxy.cpp:
3019 (WebKit::NetworkProcessProxy::networkProcessCrashed): Added.
3020 (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch): Split into the two following functions.
3021 (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch): Extracted from networkProcessCrashedOrFailedToLaunch.
3022 (WebKit::NetworkProcessProxy::clearCallbackStates): Extracted from networkProcessCrashedOrFailedToLaunch
3023 (WebKit::NetworkProcessProxy::didClose): Call networkProcessCrashed.
3024 (WebKit::NetworkProcessProxy::didFinishLaunching): Call networkProcessFailedToLaunch.
3025 * UIProcess/Network/NetworkProcessProxy.h:
3026 * UIProcess/WebProcessPool.cpp:
3027 (WebKit::WebProcessPool::networkProcessCrashed): Start a new network process when there are pending connection
3028 requests the crached network failed to fullfil.
3029 (WebKit::WebProcessPool::networkProcessFailedToLaunch):
3030 * UIProcess/WebProcessPool.h:
3032 2017-07-03 Eric Carlson <eric.carlson@apple.com>
3034 [MediaStream] Protect request and web view during gUM client callback
3035 https://bugs.webkit.org/show_bug.cgi?id=174096
3036 <rdar://problem/32833102>
3038 Reviewed by Youenn Fablet.
3040 Retain the message and WebView during asynchronous calls so they won't be
3041 released if a navigation happens during a call to the UA for getUserMedia
3042 or enumerateMediaDevices.
3044 * UIProcess/Cocoa/UIDelegate.mm:
3045 (WebKit::requestUserMediaAuthorizationForDevices):
3046 (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
3047 (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
3049 2017-07-03 Andy Estes <aestes@apple.com>
3051 [Xcode] Add an experimental setting to build with ccache
3052 https://bugs.webkit.org/show_bug.cgi?id=173875
3054 Reviewed by Tim Horton.
3056 * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
3058 2017-07-03 Chris Dumez <cdumez@apple.com>
3060 Drop ResourceLoadStatisticsStore's statisticsLock
3061 https://bugs.webkit.org/show_bug.cgi?id=174080
3063 Reviewed by Brent Fulgham.
3065 Drop ResourceLoadStatisticsStore's statisticsLock. It added complexity and was only needed
3066 do that the SPI exposed to WebKitTestRunner would query the store synchronously from the
3067 main thread. Instead, I made the SPI asynchronous and make sure we always access the store
3068 from the same background thread. As a result, there is no longer any need for locking.
3070 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3071 (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]):
3072 (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]):
3073 (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]):
3074 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3075 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
3076 (WebKit::ResourceLoadStatisticsStore::isPrevalentResource):
3077 (WebKit::ResourceLoadStatisticsStore::isGrandFathered):
3078 (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
3079 (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
3080 (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
3081 (WebKit::ResourceLoadStatisticsStore::clearInMemory):
3082 (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
3083 (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
3084 (WebKit::ResourceLoadStatisticsStore::processStatistics):
3085 (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
3086 (WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
3087 (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
3088 (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
3089 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
3090 * UIProcess/WebResourceLoadStatisticsStore.cpp:
3091 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3092 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
3093 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
3094 (WebKit::WebResourceLoadStatisticsStore::clearInMemoryData):
3095 (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
3096 (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3097 (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
3098 (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3099 (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3100 (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
3101 (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
3102 (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
3103 (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
3104 (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3105 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3106 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3107 * UIProcess/WebResourceLoadStatisticsStore.h:
3109 2017-07-03 Wenson Hsieh <wenson_hsieh@apple.com>
3111 Pasting single words copied to UIPasteboard inserts URLs in editable areas
3112 https://bugs.webkit.org/show_bug.cgi?id=174082
3113 <rdar://problem/33046992>
3115 Reviewed by Tim Horton.
3117 Add a hook to WKPreferences to allow programatic pasting.
3119 * UIProcess/API/Cocoa/WKPreferences.mm:
3120 (-[WKPreferences _setDOMPasteAllowed:]):
3121 (-[WKPreferences _domPasteAllowed]):
3122 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3124 2017-07-03 Zan Dobersek <zdobersek@igalia.com>
3126 Unreviewed GTK+ and WPE build fix when building with GCC 4.9.
3128 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3129 (WebKit::CoordinatedLayerTreeHost::renderNextFrame): Don't use brace-list
3130 initialization to override the m_forceRepaintAsync struct. Instead, manually
3131 assign the OptionalCallbackID() value to the m_forceRepaintAsync.callbackID
3132 member variable, and override the m_forceRepaintAsync.needsFreshFlush member
3133 variable with `false`.
3135 2017-07-03 Zan Dobersek <zdobersek@igalia.com>
3137 [ThreadedCompositor] Update and retrieve scene attributes under a Lock
3138 https://bugs.webkit.org/show_bug.cgi?id=173762
3140 Reviewed by Carlos Garcia Campos.
3142 Instead of dispatching separate tasks on the composition run loop, update
3143 various scene attributes by locking a common lock object and updating the
3144 appropriate attribute.
3146 In ThreadedCompositor::renderLayerTree(), where these attributes are used
3147 in scene composition, the lock is again obtained and the attributes copied
3148 into local variables, releasing the lock afterwards. The attribute values
3149 in local copies are then used for that renderLayerTree() invocation.
3151 This approach is more efficient than dispatching separate tasks that can
3152 race against renderLayerTree() dispatches.
3154 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3155 (WebKit::ThreadedCompositor::ThreadedCompositor):
3156 (WebKit::m_displayRefreshMonitor):
3157 (WebKit::ThreadedCompositor::setScaleFactor):
3158 (WebKit::ThreadedCompositor::setScrollPosition):
3159 (WebKit::ThreadedCompositor::setViewportSize):
3160 (WebKit::ThreadedCompositor::setDrawsBackground):
3161 (WebKit::ThreadedCompositor::renderLayerTree):
3162 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3164 2017-07-01 Dan Bernstein <mitz@apple.com>
3166 [iOS] Remove code only needed when building for iOS 9.x
3167 https://bugs.webkit.org/show_bug.cgi?id=174068
3169 Reviewed by Tim Horton.
3171 * Configurations/FeatureDefines.xcconfig:
3172 * Configurations/WebKit.xcconfig:
3173 * Platform/spi/ios/UIKitSPI.h:
3174 * UIProcess/API/Cocoa/WKWebView.mm:
3175 (-[WKWebView dealloc]):
3176 * UIProcess/ios/WKContentViewInteraction.mm:
3177 (-[WKFormInputSession setSuggestions:]):
3178 (-[WKFormInputSession invalidate]):
3179 (-[WKContentView insertTextSuggestion:]):
3180 (contentTypeFromFieldName):
3181 (-[WKContentView textInputTraits]):
3182 (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3183 * WebProcess/WebPage/ios/WebPageIOS.mm:
3184 (WebKit::WebPage::getPositionInformation):
3187 2017-07-01 Brady Eidson <beidson@apple.com>
3189 When setting a custom cookie storage location on a WKWebsiteDataStore, cookies aren't actually removed.
3190 <rdar://problem/32410662> and https://bugs.webkit.org/show_bug.cgi?id=174035
3192 Reviewed by Alex Christensen.
3194 * UIProcess/API/Cocoa/WKProcessPool.mm:
3195 (-[WKProcessPool _terminateNetworkProcess]):
3196 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3198 * UIProcess/WebProcessPool.cpp:
3199 (WebKit::WebProcessPool::ensureNetworkProcess): Take an optional WebsiteDataStore. If one is passed in,
3200 send it to either the existing or new network process.
3201 * UIProcess/WebProcessPool.h:
3203 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3204 (WebKit::WebsiteDataStore::parameters): Resolve paths first.
3206 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3207 (WebKit::WebsiteDataStore::fetchDataAndApply):
3208 (WebKit::WebsiteDataStore::removeData):
3210 2017-07-01 Ryosuke Niwa <rniwa@webkit.org>
3212 Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
3213 https://bugs.webkit.org/show_bug.cgi?id=174004
3215 Reviewed by Simon Fraser.
3217 * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3218 * WebProcess/WebPage/WebInspector.cpp:
3220 2017-07-01 Dan Bernstein <mitz@apple.com>
3222 [macOS] Remove code only needed when building for OS X Yosemite
3223 https://bugs.webkit.org/show_bug.cgi?id=174067
3225 Reviewed by Tim Horton.
3227 * Configurations/Base.xcconfig:
3228 * Configurations/BaseTarget.xcconfig:
3229 * Configurations/BaseXPCService.xcconfig:
3230 * Configurations/DebugRelease.xcconfig:
3231 * Configurations/FeatureDefines.xcconfig:
3232 * Configurations/NetworkService.xcconfig:
3233 * Configurations/PluginService.32.xcconfig:
3234 * Configurations/PluginService.64.xcconfig:
3235 * Configurations/Version.xcconfig:
3236 * Configurations/WebContentService.xcconfig:
3237 * Configurations/WebKit.xcconfig:
3238 * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
3239 * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Removed.
3240 * NetworkProcess/NetworkProcessCreationParameters.cpp:
3241 (WebKit::NetworkProcessCreationParameters::encode):
3242 (WebKit::NetworkProcessCreationParameters::decode):
3243 * NetworkProcess/NetworkProcessCreationParameters.h:
3244 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3245 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3246 * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3247 * Platform/IPC/Connection.h:
3248 * Platform/IPC/mac/ConnectionMac.mm:
3249 (IPC::Connection::platformInvalidate):
3250 (IPC::Connection::platformInitialize):
3251 (IPC::Connection::open):
3252 (IPC::Connection::exceptionSourceEventHandler): Deleted.
3253 (IPC::Connection::setShouldCloseConnectionOnMachExceptions): Deleted.
3254 * Platform/mac/LayerHostingContext.h:
3255 * Platform/mac/LayerHostingContext.mm:
3256 (WebKit::LayerHostingContext::createFencePort):
3257 * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Removed.
3258 * PluginProcess/mac/PluginControllerProxyMac.mm:
3259 (WebKit::PluginControllerProxy::updateLayerHostingContext):
3260 * PluginProcess/mac/PluginProcessShim.mm:
3261 * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3262 * Shared/ChildProcess.h:
3263 * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3264 (WebKit::getPluginInfoFromPropertyLists):
3265 (WebKit::NetscapePluginModule::getPluginInfo):
3266 (WebKit::contentsOfPropertyListAtURL): Deleted.
3267 (WebKit::getMIMETypesFromPluginBundle): Deleted.
3268 * Shared/Plugins/PluginProcessCreationParameters.cpp:
3269 (WebKit::PluginProcessCreationParameters::encode):
3270 (WebKit::PluginProcessCreationParameters::decode):
3271 * Shared/Plugins/PluginProcessCreationParameters.h:
3272 * Shared/WebProcessCreationParameters.cpp:
3273 (WebKit::WebProcessCreationParameters::encode):
3274 (WebKit::WebProcessCreationParameters::decode):
3275 * Shared/WebProcessCreationParameters.h:
3276 * Shared/mac/ChildProcessMac.mm:
3277 (WebKit::ChildProcess::setSharedHTTPCookieStorage):
3278 * UIProcess/API/C/WKPage.cpp:
3279 (WKPageSetPageUIClient):
3280 (fixUpBotchedPageUIClient): Deleted.
3281 * UIProcess/ChildProcessProxy.cpp:
3282 (WebKit::ChildProcessProxy::didFinishLaunching):
3283 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3284 (WebKit::WebProcessPool::platformInitializeWebProcess):
3285 (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3286 (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate):
3287 * UIProcess/Cocoa/WebViewImpl.h:
3288 * UIProcess/Cocoa/WebViewImpl.mm:
3289 (WebKit::WebViewImpl::updateLayer):
3290 (WebKit::WebViewImpl::startWindowDrag):
3291 * UIProcess/DrawingAreaProxy.h:
3292 (WebKit::DrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted.
3293 * UIProcess/Plugins/PluginProcessProxy.cpp:
3294 (WebKit::PluginProcessProxy::didFinishLaunching):
3295 * UIProcess/Plugins/PluginProcessProxy.h:
3296 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3297 (WebKit::PluginProcessProxy::platformInitializePluginProcess):
3298 (WebKit::PluginProcessProxy::createPropertyListFile): Deleted.
3299 * UIProcess/WebPageProxy.cpp:
3300 (WebKit::WebPageProxy::setTopContentInset):
3301 * UIProcess/mac/PageClientImpl.mm:
3302 (WebKit::PageClientImpl::rootViewToWindow):
3303 (WebKit::PageClientImpl::startWindowDrag):
3304 * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3305 (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
3306 * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3307 * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3308 (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
3309 (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted.
3310 * UIProcess/mac/WebInspectorProxyMac.mm:
3311 (WebKit::WebInspectorProxy::createFrontendWindow):
3312 (WebKit::WebInspectorProxy::platformStartWindowDrag):
3313 * UIProcess/mac/WebPopupMenuProxyMac.mm:
3314 (WebKit::WebPopupMenuProxyMac::showPopupMenu):
3315 * WebKit2.xcodeproj/project.pbxproj:
3316 * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Removed.
3317 * WebProcess/WebPage/WebPage.cpp:
3318 * WebProcess/WebPage/WebPage.h:
3319 * WebProcess/WebPage/WebPage.messages.in:
3320 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3321 (WebKit::addAnimationToLayer):
3322 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3323 (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3324 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3325 (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3326 (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
3327 * WebProcess/cocoa/WebProcessCocoa.mm:
3328 (WebKit::WebProcess::platformInitializeWebProcess):
3329 * WebProcess/com.apple.WebProcess.sb.in:
3331 2017-07-01 Chris Dumez <cdumez@apple.com>
3333 Replace ResourceLoadStatisticsStore C API with Cocoa SPI
3334 https://bugs.webkit.org/show_bug.cgi?id=174060
3336 Reviewed by Brent Fulgham.
3338 Replace ResourceLoadStatisticsStore C API by Cocoa SPI. The new Cocoa SPI is on
3339 WKWebsiteDataStore, which allows us to get rid of the WebResourceLoadStatisticsManager
3340 singleton as the SPI can now interact directly with the WebResourceLoadStatisticsStore.
3342 * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: Removed.
3343 * UIProcess/API/C/WKResourceLoadStatisticsManager.h: Removed.
3346 * UIProcess/WebResourceLoadStatisticsManager.cpp: Removed.
3347 * UIProcess/WebResourceLoadStatisticsManager.h: Removed.
3348 Drop WebResourceLoadStatisticsManager singleton which was only required by the
3349 C API. This is because the C API was global, rather than working on a specific
3352 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3353 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3354 Add new Cocoa SPI on WKWebsiteDataStore. This is only used for testing.
3356 * UIProcess/WebResourceLoadStatisticsStore.cpp:
3357 (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
3358 Stop registering the store with the WebResourceLoadStatisticsManager singleton,
3359 as this singleton is gone.
3361 * UIProcess/WebsiteData/WebsiteDataStore.h:
3362 (WebKit::WebsiteDataStore::resourceLoadStatistics):
3363 Add new getter to retrieve the WebResourceLoadStatisticsStore from the
3364 WebsiteDataStore. This is needed by the new Cocoa SPI.
3366 * WebKit2.xcodeproj/project.pbxproj:
3369 2017-06-30 Megan Gardner <megan_gardner@apple.com>
3371 Unreviewed mac build fix.
3373 * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
3374 * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
3376 2017-06-30 Megan Gardner <megan_gardner@apple.com>
3378 Add API to get WKActivatedElementInfo
3379 https://bugs.webkit.org/show_bug.cgi?id=174001
3380 <rdar://problem/29165518>
3382 Adding a way to get a WKActivatedElementInfo for a point on a WKWebView.
3384 Reviewed by Tim Horton.
3386 * UIProcess/API/Cocoa/WKWebView.mm:
3387 (-[WKWebView requestActivatedElementAtPosition:completionBlock:]):
3388 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3389 * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
3390 (+[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]):
3391 (-[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]):
3392 * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
3394 2017-06-30 Tim Horton <timothy_horton@apple.com>
3396 Use API instead of SPI for content inset adjustment behavior
3397 https://bugs.webkit.org/show_bug.cgi?id=174050
3399 Reviewed by Sam Weinig.
3401 * Platform/spi/ios/UIKitSPI.h:
3402 * UIProcess/ios/WKScrollView.mm:
3403 (-[WKScrollView initWithFrame:]):
3404 (-[WKScrollView setContentInsetAdjustmentBehavior:]):
3405 (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]):
3406 (-[WKScrollView _setContentInsetAdjustmentBehavior:]): Deleted.
3407 Switch over to the API. The old SPI calls the API internally, so our
3408 override will now cover all callers.
3410 2017-06-30 Chris Dumez <cdumez@apple.com>
3412 Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore
3413 https://bugs.webkit.org/show_bug.cgi?id=174038
3415 Reviewed by Brent Fulgham.
3417 Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore.
3418 WebResourceLoadStatisticsManager is now essentially a proxy to the
3419 WebResourceLoadStatisticsStore to support the current C API.
3421 In a follow-up, I plan to to replace the C API with a Cocoa SPI which works on a
3422 WebResourceLoadStatisticsStore directly instead of requiring a
3423 WebResourceLoadStatisticsManager singleton.
3425 * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
3426 (WKResourceLoadStatisticsManagerSetMinimumTimeBetweenDataRecordsRemoval):
3427 (WKResourceLoadStatisticsManagerResetToConsistentState):
3428 * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
3429 * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Removed.
3430 * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3431 (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3432 * UIProcess/WebResourceLoadStatisticsManager.cpp:
3433 (WebKit::WebResourceLoadStatisticsManager::WebResourceLoadStatisticsManager):
3434 (WebKit::WebResourceLoadStatisticsManager::~WebResourceLoadStatisticsManager):
3435 (WebKit::WebResourceLoadStatisticsManager::setStatisticsStore):
3436 (WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore):
3437 (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):