1 2017-07-20 Chris Dumez <cdumez@apple.com>
3 Regression(ITP): May get frequently logged out of wsj.com
4 https://bugs.webkit.org/show_bug.cgi?id=174661
5 <rdar://problem/32343256>
7 Reviewed by Geoffrey Garen.
9 Bump statistics file version to blow away old statistics on disk since those do not
10 take into account associated domains.
12 * UIProcess/WebResourceLoadStatisticsStore.cpp:
14 2017-07-20 Chris Dumez <cdumez@apple.com>
16 Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
17 https://bugs.webkit.org/show_bug.cgi?id=174660
19 Reviewed by Geoffrey Garen.
21 Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
22 This essentially replaces a branch to figure out if the new size is less or greater than the
23 current size by an assertion.
25 * Platform/IPC/ArgumentCoders.h:
26 * UIProcess/Gamepad/UIGamepadProvider.cpp:
27 (WebKit::UIGamepadProvider::platformGamepadConnected):
28 * UIProcess/WebProcessPool.cpp:
29 (WebKit::WebProcessPool::setInitialConnectedGamepads):
30 * WebProcess/Network/WebLoaderStrategy.cpp:
31 (WebKit::WebLoaderStrategy::loadResourceSynchronously):
32 * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
33 (WebKit::WebPasteboardOverrides::getDataForOverride):
34 * WebProcess/WebPage/ios/WebPageIOS.mm:
35 (WebKit::WebPage::requestAutocorrectionData):
37 2017-07-20 Chris Dumez <cdumez@apple.com>
39 Regression(ITP): Can no longer log in on abc.go.com
40 https://bugs.webkit.org/show_bug.cgi?id=174533
41 <rdar://problem/33325881>
43 Reviewed by Geoffrey Garen.
45 Bump statistics database version to blow away any existing statistics. Without this, SSO providers
46 for which we added a quirk may already be in the database and identified as trackers. The quirk
47 merely prevents the specified SSO providers from being identified as trackers.
49 * UIProcess/WebResourceLoadStatisticsStore.cpp:
51 2017-07-19 Simon Fraser <simon.fraser@apple.com>
53 getBoundingClientRects not updated for programmatic scrolls
54 https://bugs.webkit.org/show_bug.cgi?id=174538
55 rdar://problem/33049012
57 Reviewed by Tim Horton.
59 Feed ViewportRectStability and ScrollingLayerPositionAction into reconcileScrollingState().
61 * WebProcess/WebPage/ios/WebPageIOS.mm:
62 (WebKit::WebPage::updateVisibleContentRects):
64 2017-07-19 Brady Eidson <beidson@apple.com>
66 iBooks sometimes crashes when closing a book.
67 <rdar://problem/31180331> and https://bugs.webkit.org/show_bug.cgi?id=174658
69 Reviewed by Oliver Hunt.
71 - LegacyCustomProtocolManagerProxy should not reference a WebProcessPool directly.
72 - LegacyCustomProtocolManagerProxy should invalidate in its destructor.
74 * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp:
75 (WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy):
76 (WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy):
77 (WebKit::LegacyCustomProtocolManagerProxy::startLoading):
78 (WebKit::LegacyCustomProtocolManagerProxy::stopLoading):
79 (WebKit::LegacyCustomProtocolManagerProxy::invalidate):
80 (WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest):
81 (WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse):
82 (WebKit::LegacyCustomProtocolManagerProxy::didLoadData):
83 (WebKit::LegacyCustomProtocolManagerProxy::didFailWithError):
84 (WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading):
85 (WebKit::LegacyCustomProtocolManagerProxy::processDidClose): Deleted.
86 * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h:
88 * UIProcess/Network/NetworkProcessProxy.cpp:
89 (WebKit::NetworkProcessProxy::NetworkProcessProxy):
90 (WebKit::NetworkProcessProxy::didClose):
91 * UIProcess/Network/NetworkProcessProxy.h:
92 (WebKit::NetworkProcessProxy::processPool):
94 2017-07-19 Yusuke Suzuki <utatane.tea@gmail.com>
96 [WTF] Implement WTF::ThreadGroup
97 https://bugs.webkit.org/show_bug.cgi?id=174081
101 * Shared/AsyncRequest.h:
103 2017-07-18 Carlos Garcia Campos <cgarcia@igalia.com>
105 WebDriver: handle invalid selector errors
106 https://bugs.webkit.org/show_bug.cgi?id=174619
108 Reviewed by Brian Burg.
110 We are currently handling only XPathException and only when it's an invalid expression. In the xpath case, the
111 spec also says "If any item in result is not an element return an error with error code invalid selector.", so
112 we should also handle TYPE_ERR (The expression could not be converted to return the specified type.). However,
113 since the spec says "or other error", I think we can simplify this and simply throw InvalidSelector inside the
114 catch, without checking any specific error. This is causing 14 failures in selenium tests.
116 ยง12. Element Retrieval. Step 6: If a DOMException, SyntaxError, XPathException, or other error occurs during the
117 execution of the element location strategy, return error invalid selector.
118 https://www.w3.org/TR/webdriver/#dfn-find
120 * UIProcess/Automation/Automation.json: Add InvalidSelector error.
121 * UIProcess/Automation/atoms/FindNodes.js:
122 (tryToFindNode): Raise InvalidSelector in case of error.
123 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
124 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidSelector exceptions.
126 2017-07-18 Carlos Garcia Campos <cgarcia@igalia.com>
128 Web Automation: error details not passed to DidEvaluateJavaScriptFunction message when callback was not called before page unload
129 https://bugs.webkit.org/show_bug.cgi?id=174624
131 Reviewed by Brian Burg.
133 There's a variable errorMessage, but it's unused.
135 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
136 (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): Pass errorMessage instead of String() to DidEvaluateJavaScriptFunction.
138 2017-07-18 Carlos Garcia Campos <cgarcia@igalia.com>
140 Web Automation: evaluateJavaScriptFunction should always notify the web process before returning early
141 https://bugs.webkit.org/show_bug.cgi?id=174623
143 Reviewed by Brian Burg.
145 It currently returns early if page, frame or scriptObject are nullptr, in which cases the UI process is not
146 notified. This causes test testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs to hang, because message
147 DidEvaluateJavaScriptFunction is never sent when the given frame no longer exists. We should send
148 DidEvaluateJavaScriptFunction with WindowNotFound in case of page is nullptr and FrameNotFound if the frame is
149 nullptr. The scriptObject early return is actually wrong, because scriptObjectForFrame creates a new script if
150 there's isn't one for the given frame.
152 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
153 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
155 2017-07-18 Carlos Garcia Campos <cgarcia@igalia.com>
157 Web Automation: pending evaluate script callbacks are stored with the wrong frame ID when using the default main frame
158 https://bugs.webkit.org/show_bug.cgi?id=174622
160 Reviewed by Brian Burg.
162 The frameHandle argument is optional in evaluateJavaScriptFunction(), when not provided we pass 0 to the web
163 process. The proxy gets the web page main frame when received frame ID is 0, but the given frameID is
164 still used as key of m_webFramePendingEvaluateJavaScriptCallbacksMap and also passed to the javascript function
165 as argument. I think r203442 was actually a workaround to this bug, making it even more hidden. Both
166 m_webFrameScriptObjectMap and m_webFramePendingEvaluateJavaScriptCallbacksMap should never have 0 as a
167 key, since they always use a frame ID, and the frame identifier counter starts at 1. This is causing test
168 testShouldDetectPageLoadsWhileWaitingOnAnAsyncScriptAndReturnAnError to hang, because when the page is unloaded
169 and didClearWindowObjectForFrame is called, we try to get the pending callbacks of frame 1, but they were stored
170 as frame 0 so DidEvaluateJavaScriptFunction message is never sent to the UI process.
172 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
173 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use always the actual frameID from the WebFrame
175 * WebProcess/Automation/WebAutomationSessionProxy.h: Do not allow 0 as a key of
176 m_webFramePendingEvaluateJavaScriptCallbacksMap and m_webFrameScriptObjectMap.
178 2017-07-18 Andy Estes <aestes@apple.com>
180 [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
181 https://bugs.webkit.org/show_bug.cgi?id=174631
183 Reviewed by Tim Horton.
185 * Configurations/Base.xcconfig:
186 * Shared/API/APIArray.cpp:
187 (API::Array::toStringVector):
188 * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
189 (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray):
190 * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
191 (WebKit::WebUserContentControllerProxy::addProcess):
192 (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
193 (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
194 * UIProcess/ios/forms/WKFileUploadPanel.mm:
195 (-[WKFileUploadPanel presentWithParameters:resultListener:]):
196 * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
197 (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
199 2017-07-18 Andy Estes <aestes@apple.com>
201 [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
202 https://bugs.webkit.org/show_bug.cgi?id=174631
204 Reviewed by Sam Weinig.
206 * Configurations/Base.xcconfig:
208 2017-07-18 Andy Estes <aestes@apple.com>
210 [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
211 https://bugs.webkit.org/show_bug.cgi?id=174631
213 Reviewed by Dan Bernstein.
215 * Configurations/Base.xcconfig:
217 2017-07-18 Matt Lewis <jlewis3@apple.com>
219 Unreviewed, rolling out r219610.
221 This caused an api failure on all platforms for the test
222 SnapshotImageLargeAsyncDecoding
226 "Async image decoding for large images should be disabled
227 after the first time a tile is painted"
228 https://bugs.webkit.org/show_bug.cgi?id=174451
229 http://trac.webkit.org/changeset/219610
231 2017-07-18 Andy Estes <aestes@apple.com>
233 [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
234 https://bugs.webkit.org/show_bug.cgi?id=174631
236 Reviewed by Darin Adler.
238 * Configurations/Base.xcconfig:
240 2017-07-18 Said Abou-Hallawa <sabouhallawa@apple.com>
242 Async image decoding for large images should be disabled after the first time a tile is painted
243 https://bugs.webkit.org/show_bug.cgi?id=174451
245 Reviewed by Simon Fraser.
247 * Shared/mac/RemoteLayerBackingStore.mm:
248 (WebKit::RemoteLayerBackingStore::drawInContext):
249 * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
250 (WebKit::CompositingCoordinator::paintContents):
251 * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
253 2017-07-17 Carlos Garcia Campos <cgarcia@igalia.com>
255 Web Automation: link and partial link queries don't work if text link contains trailing or leading whitespaces
256 https://bugs.webkit.org/show_bug.cgi?id=174499
258 Reviewed by Brian Burg.
260 This is causing test test_Driver_Can_Get_Link_By_Link_Test_Ignoring_Trailing_Whitespace to fail.
262 * UIProcess/Automation/atoms/FindNodes.js:
263 (switch): Use normalize-space() in in the links xpath expressions.
265 2017-07-17 Darin Adler <darin@apple.com>
267 Improve use of NeverDestroyed
268 https://bugs.webkit.org/show_bug.cgi?id=174348
270 Reviewed by Sam Weinig.
272 * DatabaseProcess/DatabaseProcess.h: Removed unneeded include of
274 * NetworkProcess/cache/NetworkCacheKey.cpp: Ditto.
276 * NetworkProcess/capture/NetworkCaptureManager.cpp: Moved include of
277 NeverDestroyed.h here ...
278 * NetworkProcess/capture/NetworkCaptureManager.h: ... from here.
280 * PluginProcess/PluginProcess.cpp: Moved include of NeverDestroyed.h
282 * PluginProcess/PluginProcess.h: ... from here.
284 * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
285 (isContainerClass): Removed trivial inefficient use of
286 LazyNeverDestroyed<HashSet> to check against two classes.
287 Instead wrote out the boolean expression.
289 * Shared/mac/SecItemShim.cpp: Removed unneeded include of
292 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
293 (WebKit::WebProcessPool::platformInitialize): Call
294 installMemoryPressureHandler instead of WebMemoryPressureHandler::singleton.
296 * UIProcess/Gamepad/UIGamepadProvider.h: Removed unneeded include
299 * UIProcess/Plugins/PluginProcessManager.cpp: Moved include of
300 NeverDestroyed.h here ...
301 * UIProcess/Plugins/PluginProcessManager.h: ... from here.
303 * UIProcess/WebInspectorProxy.cpp: Removed unneeded include
306 * UIProcess/WebPageProxy.h: Added now-needed include of
307 MediaPlaybackTargetContext.h.
309 * UIProcess/WebPasteboardProxy.cpp: Moved include of
310 NeverDestroyed.h here ...
311 * UIProcess/WebPasteboardProxy.h: ... from here.
313 * UIProcess/ios/WebMemoryPressureHandlerIOS.h: Removed the
314 WebMemoryPressureHandler class from this header. Callers don't need to
315 know if there is a class. They simply indicate when it's time to install
316 the handler. Another way to put it is that this class had no functions
317 other than the singleton function.
319 * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
320 (WebKit::installMemoryPressureHandler): Replaced the class with this function.
321 It creates a dispatch source and then resumes it. To avoid having the source
322 look like a leak, we keep it in a global variable.
324 * WebProcess/Gamepad/WebGamepadProvider.h: Include Forward.h instead of
327 * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Moved include of
328 NeverDestroyed.h here ...
329 * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: ... from here.
331 * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Removed unneeded
332 include of NeverDestroyed.h.
334 2017-07-17 Timothy Horton <timothy_horton@apple.com>
336 Page using safe area constant properties jumps to correct layout after resize
337 https://bugs.webkit.org/show_bug.cgi?id=174598
338 <rdar://problem/33364275>
340 Reviewed by Simon Fraser.
342 Test: fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html
344 * UIProcess/API/Cocoa/WKWebView.mm:
345 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
346 * UIProcess/WebPageProxy.h:
347 * UIProcess/ios/WebPageProxyIOS.mm:
348 (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
349 * WebProcess/WebPage/WebPage.h:
350 * WebProcess/WebPage/WebPage.messages.in:
351 * WebProcess/WebPage/ios/WebPageIOS.mm:
352 (WebKit::WebPage::dynamicViewportSizeUpdate):
353 Plumb unobscured safe area insets through in the dynamicViewportSizeUpdate,
354 like we do in VisibleContentRectUpdate (once again sad that these aren't
355 more similar), so that it will be correct in the during-rotation snapshot,
356 instead of only becoming correct in the first visible content rect update
359 2017-07-17 Chris Dumez <cdumez@apple.com>
361 UserMediaPermissionRequestManagerProxy should not use WebCore::Timer
362 https://bugs.webkit.org/show_bug.cgi?id=174599
363 <rdar://problem/33362600>
365 Reviewed by Tim Horton.
367 UserMediaPermissionRequestManagerProxy should not use WebCore::Timer since it runs in the
368 UIProcess. Switch to using RunLoop::Timer instead.
370 * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
371 (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
372 * UIProcess/UserMediaPermissionRequestManagerProxy.h:
374 2017-07-17 Chris Dumez <cdumez@apple.com>
376 NETWORK_SESSION does not need didReceiveAuthenticationChallenge(uint64_t, uint64_t, const AuthenticationChallenge&)
377 https://bugs.webkit.org/show_bug.cgi?id=174595
379 Reviewed by Alex Christensen.
381 * Shared/Authentication/AuthenticationManager.cpp:
382 (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
383 * Shared/Authentication/AuthenticationManager.h:
385 2017-07-17 Wenson Hsieh <wenson_hsieh@apple.com>
387 [iOS DnD] Web process uses too much memory when beginning a drag on a very large image
388 https://bugs.webkit.org/show_bug.cgi?id=174585
389 <rdar://problem/33302541>
391 Reviewed by Tim Horton.
393 Add IPC support for serializing/deserializing the size of an image written to the pasteboard. See WebCore
394 ChangeLogs for more details.
396 * Shared/WebCoreArgumentCoders.cpp:
397 (IPC::ArgumentCoder<PasteboardImage>::encode):
398 (IPC::ArgumentCoder<PasteboardImage>::decode):
400 2017-07-17 Konstantin Tokarev <annulen@yandex.ru>
402 Unreviewed attempt to fix Mac cmake build
404 * PlatformMac.cmake: Remove reference to file which is gone since r219025
406 2017-07-17 Michael Catanzaro <mcatanzaro@igalia.com>
408 [CMake] Include most CMake modules from WebKitCommon.cmake
409 https://bugs.webkit.org/show_bug.cgi?id=174546
411 Reviewed by Konstantin Tokarev.
415 2017-07-17 Michael Catanzaro <mcatanzaro@igalia.com>
417 [CMake] Macros in WebKitMacros.cmake should be prefixed with WEBKIT_ namespace
418 https://bugs.webkit.org/show_bug.cgi?id=174547
420 Reviewed by Alex Christensen.
424 2017-07-17 Alex Christensen <achristensen@webkit.org>
426 Modernize content extension code
427 https://bugs.webkit.org/show_bug.cgi?id=174588
429 Reviewed by Sam Weinig.
431 * WebProcess/UserContent/WebUserContentController.cpp:
432 (WebKit::WebUserContentController::addContentRuleLists):
434 2017-07-17 Jeremy Jones <jeremyj@apple.com>
436 Add video fullscreen transition logging.
437 https://bugs.webkit.org/show_bug.cgi?id=174474
439 Reviewed by Jer Noble.
441 No functional change. Just adds logging.
443 * Platform/Logging.h:
444 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
445 (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
446 (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
447 (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
448 (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
449 (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
450 (WebKit::WebVideoFullscreenManager::didExitFullscreen):
451 (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
452 (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
454 2017-07-17 Konstantin Tokarev <annulen@yandex.ru>
456 [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
457 https://bugs.webkit.org/show_bug.cgi?id=174557
459 Reviewed by Michael Catanzaro.
463 2017-07-17 Carlos Garcia Campos <cgarcia@igalia.com>
465 Web Automation: link and partial link queries don't work if the link contains formatting tags
466 https://bugs.webkit.org/show_bug.cgi?id=174498
468 Reviewed by Brian Burg.
470 So, for example, if we find links with text "Foo" and there's a link like <a href=""><bA>Foo</b></a> we fail
471 with no such element error. This causes test test_Link_With_Formatting_Tags to fail.
473 * UIProcess/Automation/atoms/FindNodes.js:
474 (switch): Use descendant-or-self::text() instead of just text() in the links xpath expressions.
476 2017-07-16 Carlos Garcia Campos <cgarcia@igalia.com>
478 Web Automation: FindNodes should throw an error in case of invalid strategy
479 https://bugs.webkit.org/show_bug.cgi?id=174497
481 Reviewed by Brian Burg.
483 We are currently returning null or empty list. According to the spec in 12.2 Find Element and 12.3 Find
484 Elements, step 4: "If location strategy is not present as a keyword in the table of location strategies, return
485 error with error code invalid argument.".
486 https://www.w3.org/TR/webdriver/#find-element.
488 This is causing test test_should_throw_an_error_if_user_passes_in_invalid_by_when_find_elements to fail.
490 * UIProcess/Automation/atoms/FindNodes.js:
491 (switch): Throw an error in case of unknown strategy.
492 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
493 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidParameter exceptions.
495 2017-07-16 Brady Eidson <beidson@apple.com>
497 Crash when a WKHTTPCookieStore outlives its owning WKWebsiteDataStore.
498 <rdar://problem/33341730> and https://bugs.webkit.org/show_bug.cgi?id=174574
500 Reviewed by Tim Horton.
502 Instead of holding a weak reference to its owning API::WebsiteDataStore,
503 API::HTTPCookieStore can hold a strong reference to the owner's implementation
504 WebKit::WebsiteDataStore.
506 * UIProcess/API/APIHTTPCookieStore.cpp:
507 (API::HTTPCookieStore::HTTPCookieStore):
508 (API::HTTPCookieStore::cookies):
509 (API::HTTPCookieStore::setCookie):
510 (API::HTTPCookieStore::deleteCookie):
511 (API::HTTPCookieStore::registerObserver):
512 (API::HTTPCookieStore::unregisterObserver):
513 (API::HTTPCookieStore::cookieManagerDestroyed):
514 (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
515 * UIProcess/API/APIHTTPCookieStore.h:
517 2017-07-15 Brady Eidson <beidson@apple.com>
519 Make sure all CFHTTPCookieStorageRefs we create are scheduled.
520 <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
522 Reviewed by Tim Horton.
524 Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
525 We need to schedule it on the appropriate RunLoop.
527 This patch also cleans up the creation of the identifying data itself.
529 * NetworkProcess/mac/RemoteNetworkingContext.mm:
530 (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
532 * Shared/cf/CookieStorageUtilsCF.h: Added.
533 * Shared/cf/CookieStorageUtilsCF.mm: Added.
534 (WebKit::cookieStorageFromIdentifyingData):
535 (WebKit::identifyingDataFromCookieStorage):
537 * Shared/mac/ChildProcessMac.mm:
538 (WebKit::ChildProcess::setSharedHTTPCookieStorage):
540 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
541 (WebKit::WebProcessPool::platformInitializeWebProcess):
542 (WebKit::WebProcessPool::platformInitializeNetworkProcess):
544 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
545 (WebKit::WebsiteDataStore::parameters):
547 * WebKit.xcodeproj/project.pbxproj:
549 * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
550 (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
552 2017-07-15 Wenson Hsieh <wenson_hsieh@apple.com>
554 [iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating
555 https://bugs.webkit.org/show_bug.cgi?id=174539
556 <rdar://problem/33307395>
558 Reviewed by Darin Adler.
560 Small tweak to avoid presenting at the element rect or text rect if the interaction information failed to
561 capture valid bounds for the element. We instead fall back to presenting at the touch location. This addresses
562 problems when presenting the action sheet popover on image maps on iPad, where GetPositionInformation fails to
563 capture correct data about for the <area>.
565 * UIProcess/ios/WKActionSheetAssistant.mm:
566 (presentationStyleForView):
568 2017-07-14 Jonathan Bedard <jbedard@apple.com>
571 https://bugs.webkit.org/show_bug.cgi?id=174430
572 <rdar://problem/33269288>
574 Reviewed by Tim Horton.
576 * Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11.
577 * UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h.
579 2017-07-14 Jeff Miller <jeffm@apple.com>
581 -[WKWebProcessBundleParameters setParametersForKeyWithDictionary:] passing wrong parameters to -setParameter:forKey
582 https://bugs.webkit.org/show_bug.cgi?id=174524
584 Reviewed by Sam Weinig.
586 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
587 (-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:]):
588 Pass the dictionary key and value in the correct order.
590 2017-07-14 Brent Fulgham <bfulgham@apple.com>
592 Monitor directory for new statistics files after a delete operation
593 https://bugs.webkit.org/show_bug.cgi?id=174521
594 <rdar://problem/33322189>
596 Reviewed by Chris Dumez.
598 Create a FileMonitor to watch the data directory when the statistics file is
599 deleted by an external process. If it sees the file get created externally, merge
600 those data into the in-memory store.
602 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
603 (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): Added.
604 (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
605 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
607 2017-07-14 Matt Lewis <jlewis3@apple.com>
609 Unreviewed, rolling out r219516.
611 This caused an API failure on macOS.
615 "Make sure all CFHTTPCookieStorageRefs we create are
617 https://bugs.webkit.org/show_bug.cgi?id=174513
618 http://trac.webkit.org/changeset/219516
620 2017-07-14 Daniel Bates <dabates@apple.com>
622 REGRESSION (r219013): Compute source frame info for frameless document
623 https://bugs.webkit.org/show_bug.cgi?id=174385
624 <rdar://problem/33217736>
626 Reviewed by Brady Eidson.
628 Fixes an issue where we would crash in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
629 when computing the frame info for a now-frameless document. One way this can happen is when the frame
630 that contains the document that initiated the navigation is removed from the page.
632 * UIProcess/WebPageProxy.cpp:
633 (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check that we have a valid page ID before
634 looking up the WebPage object corresponding to it.
635 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
636 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Compute a FrameInfoData
637 object from the source document directly as opposed to using WebFrame::info() as the latter requires
638 that we have a valid WebCore frame and the source document may not have a frame.
640 2017-07-14 Jer Noble <jer.noble@apple.com>
642 Allow clients to override their own hardware media requirements where no fallback media exists.
643 https://bugs.webkit.org/show_bug.cgi?id=174426
644 <rdar://problem/32537704>
646 Reviewed by Eric Carlson.
648 Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both to control
649 WebCore's new allowMediaContentTypesRequiringHardwareSupportAsFallback setting.
651 * Shared/WebPreferencesDefinitions.h:
652 * UIProcess/API/C/WKPreferences.cpp:
653 (WKPreferencesGetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
654 (WKPreferencesSetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
655 * UIProcess/API/C/WKPreferencesRef.h:
656 * UIProcess/API/Cocoa/WKWebView.mm:
657 (-[WKWebView _initializeWithConfiguration:]):
658 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
659 (-[WKWebViewConfiguration init]):
660 (-[WKWebViewConfiguration copyWithZone:]):
661 (-[WKWebViewConfiguration _setAllowMediaContentTypesRequiringHardwareSupportAsFallback:]):
662 (-[WKWebViewConfiguration _allowMediaContentTypesRequiringHardwareSupportAsFallback]):
663 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
664 * WebProcess/WebPage/WebPage.cpp:
665 (WebKit::WebPage::updatePreferences):
667 2017-07-14 Chris Dumez <cdumez@apple.com>
669 Possible crash under NetworkSocketStream::didFailSocketStream()
670 https://bugs.webkit.org/show_bug.cgi?id=174526
671 <rdar://problem/32831441>
673 Reviewed by Brent Fulgham.
675 For robustness, initialize the SocketStreamHandleImpl after the other
676 data members. We are passing |this| to the SocketStreamHandleImpl when
677 constructing it so it is unsafe to have uninitialized data members
680 * NetworkProcess/NetworkSocketStream.cpp:
681 (WebKit::NetworkSocketStream::NetworkSocketStream):
682 * NetworkProcess/NetworkSocketStream.h:
684 2017-07-14 Michael Catanzaro <mcatanzaro@igalia.com>
686 [CMake] Unclear distinction between WebKitHelpers and WebKitMacros
687 https://bugs.webkit.org/show_bug.cgi?id=153189
689 Reviewed by Antonio Gomes.
691 New location for macros that are exclusively needed here.
695 2017-07-14 Brady Eidson <beidson@apple.com>
697 Make sure all CFHTTPCookieStorageRefs we create are scheduled.
698 <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
700 Reviewed by Tim Horton.
702 Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
703 We need to schedule it on a RunLoop.
705 This patch also cleans up the creation of the identifying data itself.
707 * NetworkProcess/mac/RemoteNetworkingContext.mm:
708 (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
710 * Shared/cf/CookieStorageUtilsCF.cpp: Added.
711 (WebKit::cookieStorageFromIdentifyingData):
712 (WebKit::identifyingDataFromCookieStorage):
713 * Shared/cf/CookieStorageUtilsCF.h: Added.
715 * Shared/mac/ChildProcessMac.mm:
716 (WebKit::ChildProcess::setSharedHTTPCookieStorage):
718 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
719 (WebKit::WebProcessPool::platformInitializeWebProcess):
720 (WebKit::WebProcessPool::platformInitializeNetworkProcess):
722 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
723 (WebKit::WebsiteDataStore::parameters):
725 * WebKit.xcodeproj/project.pbxproj:
727 * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
728 (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
730 2017-07-14 Chris Dumez <cdumez@apple.com>
732 Potential null-dereference under NetworkRTCProvider::resolvedName()
733 https://bugs.webkit.org/show_bug.cgi?id=174507
734 <rdar://problem/32597868>
736 Reviewed by Youenn Fablet.
738 NetworkRTCProvider::resolvedName() could do a null dereference of m_connection
739 because m_connection is nullified in NetworkRTCProvider::close() but resolvers
740 were only closed later on in the NetworkRTCProvider destructor.
742 To address the issue, we now stop DNS resolvers earlier, in NetworkRTCProvider::close().
743 Also fix unsafe modification of m_resolvers HashMap when iterating over it.
745 * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
746 (WebKit::NetworkRTCProvider::~NetworkRTCProvider):
747 (WebKit::NetworkRTCProvider::close):
748 (WebKit::NetworkRTCProvider::Resolver::~Resolver):
749 (WebKit::NetworkRTCProvider::stopResolver):
751 2017-07-14 Youenn Fablet <youenn@apple.com>
753 Report CoreAudioCaptureSource failure in case shared unit stops working properly
754 https://bugs.webkit.org/show_bug.cgi?id=174494
756 Reviewed by Eric Carlson.
758 In case of capture failure, send a CaptureFailure message so that the
759 correct behavior happens in the Web process.
761 * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
762 * WebProcess/cocoa/UserMediaCaptureManager.cpp:
763 (WebKit::UserMediaCaptureManager::captureFailed):
764 * WebProcess/cocoa/UserMediaCaptureManager.h:
765 * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
767 2017-07-13 Chris Dumez <cdumez@apple.com>
769 Better deal with changes to the ResourceLoadStatisticsStore file on disk
770 https://bugs.webkit.org/show_bug.cgi?id=174487
772 Reviewed by Brent Fulgham.
774 Rename WebResourceLoadStatisticsStore's resetDataFromDecoder() to mergeWithDataFromDecoder()
775 and update it so that it actual merges the data from the disk with the one we have in memory,
776 instead of replacing it. This avoid data loss.
778 We leverage the existing WebResourceLoadStatisticsStore::mergeStatistics() to merge the
781 To faciliate merging the operating dates, they are now represented as OperatingDate objects
782 instead of WallTime objects. OperatingDate only include date precision, no time information.
783 As a result, the merge 2 vectors of OperatingDate objects, we can:
784 1. Merge the 2 sorted vectors (using std::merge())
785 2. Get rid of duplicates (easy because of date-level precision)
786 3. Drop old dates until the vector has at most 30 items.
788 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
789 (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
790 (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
791 * UIProcess/WebResourceLoadStatisticsStore.cpp:
792 (WebKit::OperatingDate::fromWallTime):
793 (WebKit::OperatingDate::today):
794 (WebKit::OperatingDate::secondsSinceEpoch):
795 (WebKit::OperatingDate::operator==):
796 (WebKit::OperatingDate::operator<):
797 (WebKit::OperatingDate::operator<=):
798 (WebKit::OperatingDate::OperatingDate):
799 (WebKit::mergeOperatingDates):
800 (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData):
801 (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
802 (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
803 (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
804 * UIProcess/WebResourceLoadStatisticsStore.h:
806 2017-07-13 Dan Bernstein <mitz@apple.com>
808 Removed empty project directories left behind after the rename
810 * WebKit2.xcodeproj: Removed.
812 2017-07-13 Matthew Hanson <matthew_hanson@apple.com>
814 Fix the cMake builds (GTK and WPE.)
815 https://bugs.webkit.org/show_bug.cgi?id=174164
816 rdar://problem/33137595
818 Reviewed by Dan Bernstein.
820 * Scripts/generate-forwarding-headers.pl:
821 (collectFrameworkHeaderPaths):
822 (createForwardingHeadersForFramework):
824 2017-07-13 Matthew Hanson <matthew_hanson@apple.com>
826 Rename WebKit2.xcodeproj to WebKit.xcodeproj.
827 https://bugs.webkit.org/show_bug.cgi?id=174164
828 rdar://problem/33137595
830 Reviewed by Dan Bernstein.
832 * WebKit.xcodeproj/project.pbxproj: Renamed from Source/WebKit/WebKit2.xcodeproj/project.pbxproj.
834 2017-07-13 Matthew Hanson <matthew_hanson@apple.com>
836 Update tools and configurations after renaming Source/WebKit2 to Source/WebKit.
837 https://bugs.webkit.org/show_bug.cgi?id=174164
838 rdar://problem/33137595
840 Reviewed by Dan Bernstein.
843 * Shared/API/c/wpe/WebKit.h:
845 2017-07-13 Michael Catanzaro <mcatanzaro@igalia.com>
847 Fix compiler warnings when building with GCC 7
848 https://bugs.webkit.org/show_bug.cgi?id=174463
850 Reviewed by Darin Adler.
852 * Platform/IPC/unix/ConnectionUnix.cpp:
853 (IPC::Connection::sendOutputMessage):
855 2017-07-13 Chris Dumez <cdumez@apple.com>
857 Moved filesystem code out of WebResourceLoadStatisticsStore class
858 https://bugs.webkit.org/show_bug.cgi?id=174435
860 Reviewed by Brent Fulgham.
862 Moved filesystem code out of WebResourceLoadStatisticsStore class and into
863 a new ResourceLoadStatisticsPersistentStorage class to decrease complexity.
866 * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
867 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added.
868 (WebKit::hasFileChangedSince):
869 (WebKit::createDecoderForFile):
870 (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
871 (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
872 (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath):
873 (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath):
874 (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
875 (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk):
876 (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
877 (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
878 (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
879 (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
880 (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
881 (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
882 (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
883 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added.
884 * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added.
885 (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
886 * UIProcess/WebResourceLoadStatisticsStore.cpp:
887 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
888 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
889 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
890 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
891 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
892 (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder):
893 * UIProcess/WebResourceLoadStatisticsStore.h:
894 * WebKit2.xcodeproj/project.pbxproj:
896 2017-07-13 Chris Dumez <cdumez@apple.com>
898 Unreviewed, rolling out r219453.
900 Seems to cause some crashes on the bots
904 "Moved filesystem code out of WebResourceLoadStatisticsStore
906 https://bugs.webkit.org/show_bug.cgi?id=174435
907 http://trac.webkit.org/changeset/219453
909 2017-07-13 Jeremy Jones <jeremyj@apple.com>
911 Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
912 https://bugs.webkit.org/show_bug.cgi?id=174448
914 Reviewed by Eric Carlson.
918 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
919 * WebProcess/cocoa/WebVideoFullscreenManager.h:
921 2017-07-13 Jeremy Jones <jeremyj@apple.com>
923 Style fix. Replace strongThis with protectedThis.
924 https://bugs.webkit.org/show_bug.cgi?id=174444
926 Reviewed by Eric Carlson.
928 Rename, no behavior change.
930 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
931 (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
932 (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
933 (WebKit::WebVideoFullscreenManager::didExitFullscreen):
934 (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
936 2017-07-13 Chris Dumez <cdumez@apple.com>
938 Moved filesystem code out of WebResourceLoadStatisticsStore class
939 https://bugs.webkit.org/show_bug.cgi?id=174435
941 Reviewed by Brent Fulgham.
943 Moved filesystem code out of WebResourceLoadStatisticsStore class and into
944 a new ResourceLoadStatisticsPersistentStorage class to decrease complexity.
947 * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
948 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added.
949 (WebKit::hasFileChangedSince):
950 (WebKit::createDecoderForFile):
951 (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
952 (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
953 (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath):
954 (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath):
955 (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
956 (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk):
957 (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
958 (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
959 (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
960 (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
961 (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
962 (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
963 (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
964 * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added.
965 * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added.
966 (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
967 * UIProcess/WebResourceLoadStatisticsStore.cpp:
968 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
969 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
970 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
971 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
972 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
973 (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder):
974 * UIProcess/WebResourceLoadStatisticsStore.h:
975 * WebKit2.xcodeproj/project.pbxproj:
977 2017-07-12 Carlos Garcia Campos <cgarcia@igalia.com>
979 Web Automation: evaluateJavaScriptFunction should start the callback timeout after the function is applied
980 https://bugs.webkit.org/show_bug.cgi?id=174421
982 Reviewed by Brian Burg.
984 This is causing selenium test testShouldNotTimeoutIfScriptCallsbackInsideAZeroTimeout to fail, because
985 JavaScriptTimeout error is generated unexpectedly. When no script timeout is specified, 0 is used by default,
986 which means we do a setTimeout with 0 and then the script does another setTimeout with 0, but ours is dispatched
987 before and reportTimeoutError is called. We should start our timeout after applying the function, and only if
988 the result hasn't been reported yet.
990 * WebProcess/Automation/WebAutomationSessionProxy.js:
991 (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction):
993 2017-07-12 Wenson Hsieh <wenson_hsieh@apple.com>
995 [iOS DnD] [WK2] Add SPI to enable, disable, or follow default behavior for DnD on a WKWebView
996 https://bugs.webkit.org/show_bug.cgi?id=174440
997 <rdar://problem/33272627>
999 Reviewed by Beth Dakin.
1001 Adds a new _dragInteractionPolicy property to WKWebView, which an internal client may use to always allow
1002 dragging out of the web view (_WKDragInteractionPolicyAlwaysEnable), never allow
1003 (_WKDragInteractionPolicyAlwaysDisable) or just use the default device-dependent behavior
1004 (_WKDragInteractionPolicyDefault).
1006 Also removes an extraneous class from WKContentViewInteraction.mm that is no longer used anywhere.
1008 * UIProcess/API/Cocoa/WKWebView.mm:
1009 (-[WKWebView _initializeWithConfiguration:]):
1011 Set _dragInteractionPolicy to _WKDragInteractionPolicyDefault upon initialization.
1013 (-[WKWebView _dragInteractionPolicy]):
1014 (-[WKWebView _setDragInteractionPolicy:]):
1015 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1016 * UIProcess/ios/WKContentViewInteraction.h:
1017 * UIProcess/ios/WKContentViewInteraction.mm:
1018 (shouldEnableDragInteractionForPolicy):
1019 (-[WKContentView _didChangeDragInteractionPolicy]):
1021 Called by the WKWebView when its _dragInteractionPolicy changes. The content view updates its
1022 UIDragInteraction's -enabled property here in response.
1024 (-[WKContentView setupDataInteractionDelegates]):
1026 2017-07-12 Said Abou-Hallawa <sabouhallawa@apple.com>
1028 Async image decoding for large images should be disabled by default
1029 https://bugs.webkit.org/show_bug.cgi?id=174432
1031 Reviewed by Simon Fraser.
1033 -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by
1034 GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None
1035 by AllowAsyncImageDecoding.
1036 -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir
1037 by resetting the bit PaintBehaviorAllowAsyncImageDecoding.
1039 * Shared/mac/RemoteLayerBackingStore.mm:
1040 (WebKit::RemoteLayerBackingStore::drawInContext):
1041 * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1042 (WebKit::imageForRect):
1043 * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1044 (WebKit::InjectedBundleRangeHandle::renderedImage):
1046 2017-07-12 Eric Carlson <eric.carlson@apple.com>
1048 [MediaStream] a capture source failure should end the MediaStreamTrack
1049 https://bugs.webkit.org/show_bug.cgi?id=174375
1051 Reviewed by Youenn Fablet.
1053 * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1054 (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Consolidate start/end.
1055 (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): Deleted.
1056 (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Deleted.
1057 * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1059 * UIProcess/WebPageProxy.cpp:
1060 (WebKit::WebPageProxy::isPlayingMediaDidChange): Call captureStateChanged if the capture
1061 state changes. Consider interrupted flags.
1063 2017-07-12 Daniel Bates <dabates@apple.com>
1065 NavigationAction should track whether the navigation was initiated by the main frame
1066 https://bugs.webkit.org/show_bug.cgi?id=174386
1067 <rdar://problem/33245267>
1069 Reviewed by Brady Eidson.
1071 * WebProcess/WebPage/WebInspector.cpp:
1072 (WebKit::WebInspector::openInNewTab): Pass whether the load was initiated by the main frame
1073 when instantiating the NavigationAction.
1075 2017-07-12 Daniel Bates <dabates@apple.com>
1077 Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame
1078 https://bugs.webkit.org/show_bug.cgi?id=174427
1080 Rubber-stamped by Brady Eidson.
1082 * WebProcess/Plugins/PluginView.cpp:
1083 (WebKit::PluginView::loadURL):
1084 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1085 (WebKit::WebFrameLoaderClient::dispatchCreatePage):
1086 * WebProcess/WebPage/WebInspector.cpp:
1087 (WebKit::WebInspector::openInNewTab):
1089 2017-07-12 Matt Lewis <jlewis3@apple.com>
1091 Unreviewed, rolling out r219401.
1093 This revision rolled out the previous patch, but after talking
1094 with reviewer, a rebaseline is what was needed.Rolling back in
1099 "Unreviewed, rolling out r219379."
1100 https://bugs.webkit.org/show_bug.cgi?id=174400
1101 http://trac.webkit.org/changeset/219401
1103 2017-07-12 Daniel Bates <dabates@apple.com>
1105 Update description of Secure Contexts experimental flag
1106 https://bugs.webkit.org/show_bug.cgi?id=174401
1108 Reviewed by Simon Fraser.
1110 Change the description of the Secure Contexts experimental flag from "isSecureContext attribute"
1111 to "Secure Contexts API".
1113 * Shared/WebPreferencesDefinitions.h:
1115 2017-07-12 Matt Lewis <jlewis3@apple.com>
1117 Unreviewed, rolling out r219379.
1119 This revision caused a consistent failure in the test
1120 fast/dom/Window/property-access-on-cached-window-after-frame-
1125 "Remove NAVIGATOR_HWCONCURRENCY"
1126 https://bugs.webkit.org/show_bug.cgi?id=174400
1127 http://trac.webkit.org/changeset/219379
1129 2017-07-12 Zan Dobersek <zdobersek@igalia.com>
1132 https://bugs.webkit.org/show_bug.cgi?id=172104
1134 Reviewed by Michael Catanzaro.
1136 * PlatformWPE.cmake: Drop the EGL_INCLUDE_DIRS compilation flags.
1137 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1138 Include <epoxy/gl.h> when compiling with libepoxy usage enabled.
1140 2017-07-12 Carlos Garcia Campos <cgarcia@igalia.com>
1142 Web Automation: upstream safaridriver's JavaScript atom implementations
1143 https://bugs.webkit.org/show_bug.cgi?id=172060
1144 <rdar://problem/32168187>
1146 Reviewed by Brian Burg.
1148 * UIProcess/Automation/atoms/ElementAttribute.js: Added.
1149 * UIProcess/Automation/atoms/ElementDisplayed.js: Added.
1150 * UIProcess/Automation/atoms/FindNodes.js: Added.
1151 * UIProcess/Automation/atoms/FormElementClear.js: Added.
1152 * UIProcess/Automation/atoms/FormSubmit.js: Added.
1154 2017-07-11 Dean Jackson <dino@apple.com>
1156 Remove NAVIGATOR_HWCONCURRENCY
1157 https://bugs.webkit.org/show_bug.cgi?id=174400
1159 Reviewed by Sam Weinig.
1161 * Configurations/FeatureDefines.xcconfig:
1163 2017-07-11 Ansh Shukla <ansh_shukla@apple.com>
1165 WKWindowFeatures needs to expose scrollbar, fullscreen, and dialog configuration properties
1166 https://bugs.webkit.org/show_bug.cgi?id=174239
1168 Reviewed by Brady Eidson.
1170 Add a new private header to expose getters for window feature properties already available
1171 in the TFB APIWindowFeatures class. These properties are necessary for Safari to adopt more
1174 * UIProcess/API/Cocoa/WKWindowFeatures.mm:
1175 (-[WKWindowFeatures _locationBarVisibility]):
1176 (-[WKWindowFeatures _scrollbarsVisibility]):
1177 (-[WKWindowFeatures _fullscreenDisplay]):
1178 (-[WKWindowFeatures _dialogDisplay]):
1179 * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: Expose some window features as read-only
1181 * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
1182 * WebKit2.xcodeproj/project.pbxproj:
1184 2017-07-11 Chris Dumez <cdumez@apple.com>
1186 Avoid duplicating default parameter values in [WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]
1187 https://bugs.webkit.org/show_bug.cgi?id=174402
1189 Reviewed by Brent Fulgham.
1191 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1192 (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
1193 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1194 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1195 (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1196 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1197 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1198 (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1199 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1200 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
1201 (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
1202 (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
1203 (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
1204 (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies):
1205 (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
1206 (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
1207 (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
1208 (WebKit::WebResourceLoadStatisticsStore::pruneStatisticsIfNeeded):
1209 (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
1210 * UIProcess/WebResourceLoadStatisticsStore.h:
1212 2017-07-11 Dean Jackson <dino@apple.com>
1214 Rolling out r219372.
1216 * Configurations/FeatureDefines.xcconfig:
1218 2017-07-11 Dean Jackson <dino@apple.com>
1220 Remove NAVIGATOR_HWCONCURRENCY
1221 https://bugs.webkit.org/show_bug.cgi?id=174400
1223 Reviewed by Sam Weinig.
1225 * Configurations/FeatureDefines.xcconfig:
1227 2017-07-11 Dean Jackson <dino@apple.com>
1229 Viewport fit experimental feature should be always on by default
1230 https://bugs.webkit.org/show_bug.cgi?id=174398
1231 <rdar://problem/33248920>
1233 Reviewed by Simon Fraser.
1235 Even though this is experimental, it should be enabled by default, and
1236 not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
1238 * Shared/WebPreferencesDefinitions.h:
1240 2017-07-11 Adrian Perez de Castro <aperez@igalia.com>
1242 Fix typo: ContentRuleListStore::nonLegacyDdefaultStore()
1243 https://bugs.webkit.org/show_bug.cgi?id=174387
1245 Reviewed by Michael Catanzaro.
1247 Rename nonLegacyDdefaultStore() to nonLegacyDefaultStore().
1249 * UIProcess/API/APIContentRuleListStore.cpp:
1250 (API::ContentRuleListStore::nonLegacyDefaultStore):
1251 (API::ContentRuleListStore::defaultStore):
1252 * UIProcess/API/APIContentRuleListStore.h:
1254 2017-07-11 Chris Dumez <cdumez@apple.com>
1256 Simplify primary domain lambda captures in WebResourceLoadStatisticsStore
1257 https://bugs.webkit.org/show_bug.cgi?id=174381
1259 Reviewed by Brent Fulgham.
1261 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1262 (WebKit::isolatedPrimaryDomain):
1263 (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1264 (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1265 (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1266 (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1267 (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1268 (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1269 (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1270 (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1271 (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1272 (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1273 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1274 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1275 (WebKit::primaryDomain): Deleted.
1277 2017-07-11 Timothy Hatcher <timothy@hatcher.name>
1279 Fix a build failure in WebDragClient when !PLATFORM(COCOA) && !PLATFORM(GTK).
1280 https://bugs.webkit.org/show_bug.cgi?id=174372
1282 Reviewed by Beth Dakin.
1284 * WebProcess/WebCoreSupport/WebDragClient.cpp:
1285 (WebKit::WebDragClient::didConcludeEditDrag): Added empty method.
1287 2017-07-11 Brent Fulgham <bfulgham@apple.com>
1289 Reset cookie partitioning state after network process crashes
1290 https://bugs.webkit.org/show_bug.cgi?id=174306
1291 <rdar://problem/33171605>
1293 Reviewed by Chris Dumez.
1295 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1296 (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): Move cookie
1297 partioning state code to helper function.
1298 (WebKit::ResourceLoadStatisticsStore::resetPartitionCookiesState): Added.
1299 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
1300 * UIProcess/WebProcessPool.cpp:
1301 (WebKit::WebProcessPool::ensureNetworkProcess): Inform the statistics store that
1302 the network process crashed.
1303 (WebKit::WebProcessPool::terminateNetworkProcess): Mark network process as crashed.
1304 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1305 (WebKit::WebResourceLoadStatisticsStore::networkProcessDidCrash): Reset the cookie
1306 partitioning state after a crash.
1307 * UIProcess/WebResourceLoadStatisticsStore.h:
1308 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1309 (WebKit::WebsiteDataStore::notifyResourceLoadStatisticsNetworkProcessDidCrash): Relay
1310 information to the statistics store.
1311 * UIProcess/WebsiteData/WebsiteDataStore.h:
1313 2017-07-11 Timothy Hatcher <timothy@hatcher.name>
1315 Fix broken build when !ENABLE(INDEXED_DATABASE)
1316 https://bugs.webkit.org/show_bug.cgi?id=174370
1318 Reviewed by Alex Christensen.
1320 * UIProcess/WebProcessPool.cpp:
1321 (WebKit::WebProcessPool::pageAddedToProcess):
1323 2017-07-11 Youenn Fablet <youenn@apple.com>
1325 Changing the web page muted state for playing audio should not disable other tabs capture
1326 https://bugs.webkit.org/show_bug.cgi?id=174349
1330 * UIProcess/WebPageProxy.cpp:
1331 (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Fixes non MEDIA_STREAM builds.
1333 2017-07-11 Wenson Hsieh <wenson_hsieh@apple.com>
1335 Address post-review feedback after http://trac.webkit.org/r219310
1336 https://bugs.webkit.org/show_bug.cgi?id=174300
1337 <rdar://problem/33030639>
1339 Reviewed by Simon Fraser.
1341 Removes plumbing introduced in r219310 for telling WKContentView when the user has finished panning or zooming.
1342 This was previously used to reset allowing asynchronous touch event after preventing the web touch events
1343 gesture recognizer from firing.
1345 However, a far simpler (and much less fragile) solution is to just set _canSendTouchEventsAsynchronously to NO
1346 at the beginning of the gesture, before the first `touchstart` event is dispatched. This way, we always ensure
1347 that _canSendTouchEventsAsynchronously is NO when beginning to process a touch event. This approach is correct
1348 because the only place where we query _canSendTouchEventsAsynchronously is in -_webTouchEventsRecognized:, where
1349 (when we are beginning a new gesture) we are guaranteed that -gestureRecognizer:shouldIgnoreWebTouchWithEvent:
1350 has already been called and _canSendTouchEventsAsynchronously is NO.
1352 Confirmed that the LayoutTests added in r219310 still pass.
1354 * UIProcess/API/Cocoa/WKWebView.mm:
1355 (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
1356 (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1357 * UIProcess/PageClient.h:
1358 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1359 * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1360 (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
1361 * UIProcess/Scrolling/RemoteScrollingTree.h:
1362 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1363 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1364 (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
1365 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture): Deleted.
1366 * UIProcess/WebPageProxy.h:
1367 * UIProcess/ios/PageClientImplIOS.h:
1368 * UIProcess/ios/PageClientImplIOS.mm:
1369 (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture): Deleted.
1370 * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1371 (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture): Deleted.
1372 * UIProcess/ios/WKContentViewInteraction.h:
1373 * UIProcess/ios/WKContentViewInteraction.mm:
1374 (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
1375 (-[WKContentView scrollViewDidEndPanOrPinchGesture]): Deleted.
1376 * UIProcess/ios/WebPageProxyIOS.mm:
1377 (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture): Deleted.
1379 2017-07-11 Brent Fulgham <bfulgham@apple.com>
1381 Unreviewed clean-up after r219323
1383 Simplify algorithm slightly based on a suggestion Chris Dumez made in the review.
1385 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1386 (WebKit::pruneResources): Don't create a second variable to track the pruning operation.
1388 2017-07-11 Alex Christensen <achristensen@webkit.org>
1390 SharedBuffer::size should return a size_t
1391 https://bugs.webkit.org/show_bug.cgi?id=174328
1393 Reviewed by Andreas Kling.
1395 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1396 (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1398 2017-07-11 Youenn Fablet <youenn@apple.com>
1400 We should do ICE candidate filtering at the Document level
1401 https://bugs.webkit.org/show_bug.cgi?id=173861
1402 <rdar://problem/33122058>
1404 Reviewed by Eric Carlson.
1406 Removing ICE candidate filtering handling at UIProcess level.
1407 ICE candidate filtering is now disabled at UserMediaRequest level.
1408 WebPage forwards the ICE candidate filtering option to the page so as to set
1409 the default option correctly for every document of the page.
1411 * UIProcess/UserMediaProcessManager.cpp:
1412 (WebKit::UserMediaProcessManager::willCreateMediaStream):
1413 (WebKit::UserMediaProcessManager::endedCaptureSession):
1414 * WebProcess/WebPage/WebPage.cpp:
1415 (WebKit::WebPage::disableICECandidateFiltering):
1416 (WebKit::WebPage::enableICECandidateFiltering):
1418 2017-07-11 Youenn Fablet <youenn@apple.com>
1420 Changing the web page muted state for playing audio should not disable other tabs capture
1421 https://bugs.webkit.org/show_bug.cgi?id=174349
1422 rdar://problem/33223988
1424 Reviewed by Eric Carlson.
1426 Make sure to mute capturing streams of any other tab if the current tab will start capturing or will unmute existing capturing streams.
1427 Manually tested by having a tab doing capture and another tab playing a video.
1428 Muting or unmuting the tab playing video should not change the capture tab.
1430 * UIProcess/WebPageProxy.cpp:
1431 (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
1432 (WebKit::WebPageProxy::setMuted):
1433 * UIProcess/WebPageProxy.h:
1434 (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
1436 2017-07-11 Youenn Fablet <youenn@apple.com>
1438 NetworkProcess should close listening WebRTC sockets when being suspended
1439 https://bugs.webkit.org/show_bug.cgi?id=174270
1440 rdar://problem/33139844
1442 Reviewed by Chris Dumez.
1444 To prevent potential spinning of the NetworkProcess, NetworkProcess will now close listening sockets when being notified that it will be suspended.
1445 When the network process is being suspended, it will stop creating listening sockets, until it resumes.
1446 Future additional efforts might be to improve select/cancel so that we can stop listening sockets at resume time,
1447 or to reimplement part of the stack using CFStream.
1449 Tested through manual testing by going to a website doing WebRTC, homing out so that the network process is suspended and reopening Safari.
1451 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1452 (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension):
1453 Proxying call to clean for suspension to rtc provider so that it will
1454 close listening sockets.
1455 (WebKit::NetworkConnectionToWebProcess::resumeFromSuspension): Authorizing back listening sockets.
1456 * NetworkProcess/NetworkConnectionToWebProcess.h:
1457 (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension):
1458 Clean-up is done asynchronously as it can happen in background threads.
1459 Hence why passing a callback as parameter.
1460 * NetworkProcess/NetworkProcess.cpp:
1461 (WebKit::NetworkProcess::notifyProcessReadyToSuspend): Helper routine
1462 to notify UI process that network process clean up is done.
1463 (WebKit::TaskCounter::TaskCounter): Helper class to call notifyProcessReadyToSuspend when sded.
1464 (WebKit::TaskCounter::~TaskCounter):
1465 (WebKit::NetworkProcess::actualPrepareToSuspend): Doing the clean-up for each connection that needs it.
1466 Making sure to notify UI process of clean-up being completed once all connections are cleaned.
1467 (WebKit::NetworkProcess::processWillSuspendImminently):
1468 (WebKit::NetworkProcess::prepareToSuspend):
1469 (WebKit::NetworkProcess::processDidResume): Reenable listening sockets.
1470 * NetworkProcess/NetworkProcess.h:
1471 * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
1472 (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
1473 * NetworkProcess/webrtc/LibWebRTCSocketClient.h: Adding type getter and making close public.
1474 Used by NetworkRTCProvider to identifiy listening sockets and close them.
1475 * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1476 (WebKit::NetworkRTCProvider::closeListeningSockets): We close the webrtc socket
1477 and we also notify the Web Process that the socket is closed so that it can take actions to recreate some if needed.
1478 (WebKit::NetworkRTCProvider::finishClosingListeningSockets):
1479 * NetworkProcess/webrtc/NetworkRTCProvider.h:
1480 (WebKit::NetworkRTCProvider::authorizeListeningSockets): Authorize creation of listening sockets.
1482 2017-07-10 Brent Fulgham <bfulgham@apple.com>
1484 Resource Load Statistics: Prune statistics in orders of importance
1485 https://bugs.webkit.org/show_bug.cgi?id=174215
1486 <rdar://problem/33164403>
1488 Unreviewed test correction.
1490 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1491 (WebKit::pruneResources): The revised algorithm did not update the remaining
1492 count to be pruned, causing a test failure.
1494 2017-07-10 John Wilander <wilander@apple.com>
1496 Resource Load Statistics: Prune statistics in orders of importance
1497 https://bugs.webkit.org/show_bug.cgi?id=174215
1498 <rdar://problem/33164403>
1500 Reviewed by Chris Dumez.
1502 New functionality. Prunes statistics in this order:
1503 1. Non-prevalent resources without user interaction.
1504 2. Prevalent resources without user interaction.
1505 3. Non-prevalent resources with user interaction.
1506 4. Prevalent resources with user interaction.
1508 * Shared/WebCoreArgumentCoders.cpp:
1509 (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1510 (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1511 Added timestamp field lastSeen.
1512 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1513 (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]):
1514 (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]):
1515 (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]):
1516 (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
1517 Test infrastructure.
1518 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1519 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1520 (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries):
1521 Test infrastructure.
1522 (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo):
1523 Test infrastructure.
1524 (WebKit::sortAndPrune):
1525 Convenience function.
1526 (WebKit::ResourceLoadStatisticsStore::pruneStatisticsIfNeeded):
1527 The new pruning function.
1528 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
1529 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1530 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1531 Now calls ResourceLoadStatisticsStore::pruneStatisticsIfNeeded().
1532 (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1533 Test infrastructure.
1534 (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
1535 Test infrastructure.
1536 (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
1537 Test infrastructure.
1538 * UIProcess/WebResourceLoadStatisticsStore.h:
1540 2017-07-10 Dean Jackson <dino@apple.com>
1542 const() experimental feature should always be on by default
1543 https://bugs.webkit.org/show_bug.cgi?id=174341
1544 <rdar://problem/33228603>
1546 Reviewed by Simon Fraser.
1548 Even though this is experimental, it should be enabled by default, and
1549 not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
1551 * Shared/WebPreferencesDefinitions.h:
1553 2017-07-10 Chris Dumez <cdumez@apple.com>
1555 [iOS] _didCommitLayerTree should avoid calling [scrollView setZoomScale] unnecessarily
1556 https://bugs.webkit.org/show_bug.cgi?id=174326
1557 <rdar://problem/33150490>
1559 Reviewed by Simon Fraser.
1561 Only call [scrollView setZoomScale] if the new zoom scale is actually different to
1562 avoid doing unnecessary work in UIKit.
1564 * UIProcess/API/Cocoa/WKWebView.mm:
1565 (-[WKWebView _didCommitLayerTree:]):
1567 2017-07-10 Chris Dumez <cdumez@apple.com>
1569 Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore
1570 https://bugs.webkit.org/show_bug.cgi?id=174203
1572 Reviewed by Brent Fulgham.
1574 Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore. The 2 classes
1575 have a similar purpose and there is no clean separation between the 2. It makes more
1576 sense to have a single store class for resource load statistics.
1578 If we want to simplify the WebResourceLoadStatisticsStore class, I think it'd make
1579 more sense to split the file system I/O code out. This code adds quite a bit of
1583 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1584 (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
1585 (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
1586 (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
1587 (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
1588 (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
1589 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: Removed.
1590 * UIProcess/Storage/ResourceLoadStatisticsStore.h: Removed.
1591 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1592 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1593 (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1594 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1595 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1596 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1597 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
1598 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
1599 (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
1600 (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
1601 (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1602 (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
1603 (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1604 (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1605 (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1606 (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1607 (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1608 (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1609 (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1610 (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1611 (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1612 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1613 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1614 (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
1615 (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
1616 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
1617 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1618 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1619 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
1620 (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
1621 (WebKit::WebResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
1622 (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData):
1623 (WebKit::WebResourceLoadStatisticsStore::populateFromDecoder):
1624 (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
1625 (WebKit::WebResourceLoadStatisticsStore::mergeStatistics):
1626 (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies):
1627 (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1628 (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1629 (WebKit::WebResourceLoadStatisticsStore::processStatistics):
1630 (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction):
1631 (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
1632 (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
1633 (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
1634 * UIProcess/WebResourceLoadStatisticsStore.h:
1635 * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1636 (WebKit::sortedPrevalentResourceTelemetry):
1637 (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1638 * UIProcess/WebResourceLoadStatisticsTelemetry.h:
1639 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1640 (WebKit::WebsiteDataStore::removeData):
1641 * WebKit2.xcodeproj/project.pbxproj:
1643 2017-07-10 Wenson Hsieh <wenson_hsieh@apple.com>
1645 [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
1646 https://bugs.webkit.org/show_bug.cgi?id=174300
1647 <rdar://problem/33030639>
1649 Reviewed by Simon Fraser.
1651 Adds support for immediately failing WKContentView's UIWebTouchEventsGestureRecognizer if any touch interrupts
1652 scroll view deceleration. Covered by 3 new LayoutTests (see Source/WebCore/ChangeLog).
1654 * Platform/spi/ios/UIKitSPI.h:
1655 * UIProcess/API/Cocoa/WKWebView.mm:
1656 (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
1657 (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1658 * UIProcess/PageClient.h:
1659 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1660 * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1661 (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture):
1662 * UIProcess/Scrolling/RemoteScrollingTree.h:
1663 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1664 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1665 (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
1666 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture):
1668 Adds plumbing in the UI process to alert the WKContentView when scroll view dragging has ended in an overflow
1669 momentum scrolling region (tracked by an overflow scrolling tree node). This parallels UI process plumbing for
1670 ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture.
1672 * UIProcess/WebPageProxy.h:
1673 * UIProcess/ios/PageClientImplIOS.h:
1674 * UIProcess/ios/PageClientImplIOS.mm:
1675 (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture):
1676 * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1677 (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture):
1678 * UIProcess/ios/WKContentViewInteraction.h:
1679 * UIProcess/ios/WKContentViewInteraction.mm:
1680 (-[WKContentView scrollViewDidEndPanOrPinchGesture]):
1682 When the dragging phase of a scroll gesture ends, ensure that _canSendTouchEventsAsynchronously is reset to NO.
1683 When touches are not being prevented, this flag is set to YES in -scrollViewWillStartPanOrPinchGesture: and
1684 normally reset to NO in -_webTouchEventsRecognized: after all touch points have been released. However, in the
1685 case where we've prematurely failed the web touch events gesture recognizer after -touchesBegan:,
1686 -_webTouchEventsRecognized: will not be called again in a state where all touches have been released. Thus, we
1687 also need to bookend the place where we begin allowing async touch event dispatch in
1688 -scrollViewWillStartPanOrPinchGesture by disallowing async touch event dispatch in
1689 -scrollViewDidEndPanOrPinchGesture.
1691 This has no impact in the normal case where the user scrolls without momentum, since
1692 -scrollViewDidEndPanOrPinchGesture will fire after async touch events have already been disallowed in
1693 -_webTouchEventsRecognized:, and in the case where the page prevents default on touches, scrolling doesn't
1694 happen anyways, so neither scrollViewWillStartPanOrPinchGesture nor scrollViewDidEndPanOrPinchGesture will be
1697 (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
1699 Implements a new SPI hook in UIKit. This serves an identical purpose as -shouldIgnoreWebTouch, but additionally
1700 passes the triggering UIEvent, as well as the gesture recognizer itself (following standard convention for
1701 Objective C delegate methods). Here, we return YES in the case where one or more of the touches recognized by
1702 the gesture is currently interrupting scroll deceleration.
1704 * UIProcess/ios/WebPageProxyIOS.mm:
1705 (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture):
1707 2017-07-10 Brent Fulgham <bfulgham@apple.com>
1709 [WK2][macOS] Allow access to com.apple.cfnetwork.cfnetworkagent in the Network Process
1710 https://bugs.webkit.org/show_bug.cgi?id=174320
1711 <rdar://problem/33191856>
1713 Reviewed by Geoffrey Garen.
1715 * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1717 2017-07-10 Megan Gardner <megan_gardner@apple.com>
1719 Add location to NavigationActionData
1720 https://bugs.webkit.org/show_bug.cgi?id=174233
1721 <rdar://problem/29165518>
1723 Reviewed by Simon Fraser.
1725 Add the root view location of a tap to a NavigationAction to vend to Safari.
1727 * Shared/NavigationActionData.cpp:
1728 (WebKit::NavigationActionData::encode):
1729 (WebKit::NavigationActionData::decode):
1730 * Shared/NavigationActionData.h:
1731 * UIProcess/API/APINavigationAction.h:
1732 * UIProcess/API/Cocoa/WKNavigationAction.mm:
1733 (-[WKNavigationAction description]):
1734 (-[WKNavigationAction _clickLocationInRootViewCoordinates]):
1735 * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1736 * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1737 (WebKit::clickLocationInRootViewCoordinatesForMouseEvent):
1738 (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
1739 (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
1740 * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
1741 (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinates):
1742 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1743 (WebKit::WebChromeClient::createWindow):
1744 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1745 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1746 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1748 2017-07-03 Brian Burg <bburg@apple.com>
1750 Web Replay: remove some unused code
1751 https://bugs.webkit.org/show_bug.cgi?id=173903
1753 Rubber-stamped by Joseph Pecoraro.
1755 * Configurations/FeatureDefines.xcconfig:
1756 * WebProcess/WebPage/WebPage.cpp:
1757 (WebKit::WebPage::tryClose):
1758 (WebKit::WebPage::loadRequest):
1759 (WebKit::WebPage::stopLoadingFrame):
1760 (WebKit::WebPage::stopLoading):
1761 (WebKit::WebPage::reload):
1762 (WebKit::WebPage::contextMenuAtPointInWindow):
1763 (WebKit::handleContextMenuEvent):
1764 (WebKit::handleMouseEvent):
1765 (WebKit::handleWheelEvent):
1766 (WebKit::handleKeyEvent):
1767 (WebKit::WebPage::scroll):
1768 (WebKit::WebPage::logicalScroll):
1770 2017-07-10 Chris Dumez <cdumez@apple.com>
1772 Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up
1773 https://bugs.webkit.org/show_bug.cgi?id=174301
1775 Reviewed by Brent Fulgham.
1777 General clean up and various simplifications / optimizations to WebResourceLoadStatisticsStore
1778 and ResourceLoadStatisticsStore classes.
1780 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1781 (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
1782 (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
1783 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1784 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1785 (WebKit::ResourceLoadStatisticsStore::create):
1786 (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
1787 (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
1788 (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
1789 (WebKit::ResourceLoadStatisticsStore::populateFromDecoder):
1790 (WebKit::ResourceLoadStatisticsStore::clearInMemory):
1791 (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
1792 (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioning):
1793 (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1794 (WebKit::ResourceLoadStatisticsStore::processStatistics):
1795 (WebKit::ResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction):
1796 (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
1797 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
1798 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1799 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1800 (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
1801 (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1802 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1803 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1804 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1805 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
1806 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
1807 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
1808 (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath):
1809 (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
1810 (WebKit::WebResourceLoadStatisticsStore::scheduleOrWriteStoreToDisk):
1811 (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1812 (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
1813 (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup):
1814 (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk):
1815 (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1816 (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1817 (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1818 (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1819 (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1820 (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
1821 (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent):
1822 (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
1823 (WebKit::WebResourceLoadStatisticsStore::setDataRecordsBeingRemoved):
1824 * UIProcess/WebResourceLoadStatisticsStore.h:
1825 * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1826 (WebKit::sortedPrevalentResourceTelemetry):
1827 (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1828 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1829 (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains):
1830 (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
1831 * UIProcess/WebsiteData/WebsiteDataStore.h:
1833 2017-07-10 Michael Catanzaro <mcatanzaro@igalia.com>
1835 [SOUP] Remove WebKitSoupCookieJarSqlite
1836 https://bugs.webkit.org/show_bug.cgi?id=174310
1838 Reviewed by Carlos Garcia Campos.
1840 It seems WebKitSoupCookieJarSqlite uses exactly the same database format as the upstream
1841 SoupCookieJarDb class. WebKitSoupCookieJarSqlite is a copy of SoupCookieJarSqlite that uses
1842 WebCore's SQLite wrapper and WTF stuff. WebKitSoupCookieJarSqlite exists only because
1843 SoupCookieJarDb is relatively new, and the older SoupCookieJarSqlite class existed only in
1844 libsoup-gnome rather than libsoup proper. The advantage of continuing to use our
1845 WebKitSoupCookieJarSqlite class, besides that we already know it works, is that it utilizes
1846 the same SQLiteDatabase class that is used elsewhere in WebKit. But that's not really any
1847 reason to keep the class around, when SoupCookieJarDb does exactly the same thing. It was
1848 introduced in libsoup 2.42 and that is already our minimum required version, so we can
1851 This passes a quick sanity-check of Epiphany's cookies dialog and also TestCookieManager.
1853 * PlatformGTK.cmake:
1854 * PlatformWPE.cmake:
1855 * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1856 (WebKit::WebCookieManager::setCookiePersistentStorage):
1857 * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp: Removed.
1858 * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.h: Removed.
1860 2017-07-10 Myles C. Maxfield <mmaxfield@apple.com>
1862 REGRESSION(r213590): UI process updates the visible content rects more often than it did in iOS 10
1863 https://bugs.webkit.org/show_bug.cgi?id=174282
1864 <rdar://problem/33144344>
1866 Reviewed by Simon Fraser.
1868 In r213590, we accidentally refactored -[WKWebView _didCommitLayerTree:] to call _scheduleVisibleContentRectUpdate
1869 more often. Instead, this should be triggered from inside the "if" statements.
1871 No tests because there is no behavior change. Performance change is tested in MotionMark.
1873 * UIProcess/API/Cocoa/WKWebView.mm:
1874 (-[WKWebView _isShowingVideoPictureInPicture]):
1875 (-[WKWebView _initializeWithConfiguration:]):
1876 (-[WKWebView goBack]):
1877 (-[WKWebView _didCommitLayerTree:]):
1878 (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
1879 (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
1880 (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
1881 (-[WKWebView scrollViewDidScroll:]):
1882 (-[WKWebView _visibleContentRect]):
1883 (-[WKWebView _frameOrBoundsChanged]):
1884 (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
1885 (-[WKWebView _updateVisibleContentRects]):
1886 (-[WKWebView _navigationGestureDidBegin]):
1887 (-[WKWebView _reloadWithoutContentBlockers]):
1888 (-[WKWebView _reloadExpiredOnly]):
1889 (-[WKWebView _setObscuredInsets:]):
1890 (-[WKWebView _setUnobscuredSafeAreaInsets:]):
1891 (-[WKWebView _endAnimatedResize]):
1892 (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1893 (-[WKWebView _clearOverrideLayoutParameters]):
1894 (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
1895 (-[WKWebView _propertiesOfLayerWithID:]):
1897 2017-07-10 Carlos Garcia Campos <cgarcia@igalia.com>
1899 [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
1900 https://bugs.webkit.org/show_bug.cgi?id=166029
1902 Reviewed by Michael Catanzaro.
1904 Clear the SoupNetworkSession and cookie storage after the main loop quits.
1906 * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
1907 (WebKit::NetworkProcessMainUnix):
1909 2017-07-10 Wenson Hsieh <wenson_hsieh@apple.com>
1911 [WK2] Action sheets for links fail to present in WebKit2 PDF view
1912 https://bugs.webkit.org/show_bug.cgi?id=174307
1913 <rdar://problem/31412128>
1915 Reviewed by Tim Horton.
1917 Currently, presenting an action sheet for a link always uses the WKActionSheetPresentAtClosestIndicatorRect
1918 codepath, which requires text indicator data for the link. However, when showing an action sheet for a link via
1919 WKPDFView, a text indicator for the link is not included, so the popover rect ends up being an empty rect at the
1920 origin, which causes us to bail from presenting the popover.
1922 To address this, we tweak our heuristic for determining which action sheet presentation style to use, so that we
1923 only use the closest indicator rect for a link if the text indicator data is also present (otherwise, we fall
1924 back to using the element rect). All other behavior is the same.
1926 * UIProcess/ios/WKActionSheetAssistant.mm:
1927 (-[WKActionSheetAssistant showImageSheet]):
1928 (presentationStyleForView):
1930 Refactor _shouldPresentAtTouchLocationForElementRect into presentationStyleForView, a static function that
1931 returns a WKActionSheetPresentationStyle.
1933 (-[WKActionSheetAssistant showLinkSheet]):
1934 (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]): Deleted.
1936 2017-07-09 Brady Eidson <beidson@apple.com>
1938 Remove some obsolete WebKitVersionChecks.
1939 https://bugs.webkit.org/show_bug.cgi?id=174294
1941 Reviewed by Dan Bernstein.
1943 * WebProcess/WebPage/WebPage.cpp:
1944 (WebKit::WebPage::updatePreferences):
1946 2017-07-08 Chris Dumez <cdumez@apple.com>
1948 Simplify WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore
1949 https://bugs.webkit.org/show_bug.cgi?id=174290
1951 Reviewed by Brent Fulgham.
1953 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1954 (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]):
1955 (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]):
1956 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1957 Rename a couple of functions in the Cocoa SPI for clarity and to match the name
1958 of their internal implementation.
1960 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1961 (WebKit::ResourceLoadStatisticsStore::create):
1962 (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
1965 (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
1968 (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
1969 Use HashMap::add() instead of HashMap::set(). There is not supposed to have any duplicate
1970 keys so add() is sufficient and more efficient.
1972 (WebKit::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Removed.
1973 clearInMemoryAndPersistent() was only called from WebResourceLoadStatisticsStore and
1974 the m_deletePersistentStoreHandler / m_grandfatherExistingWebsiteDataHandler were both
1975 set by the WebResourceLoadStatisticsStore as well. Therefore, we don't really need this
1976 function, WebResourceLoadStatisticsStore now calls ResourceLoadStatisticsStore::clearInMemory()
1977 instead and takes care of doing what the m_deletePersistentStoreHandler /
1978 m_grandfatherExistingWebsiteDataHandler handlers were doing on its side.
1980 (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
1981 Pass Vector as rvalue reference, as a preparation for a future optimization. Added FIXME
1982 comment about the optimization.
1984 (WebKit::ResourceLoadStatisticsStore::setNotificationCallback): Removed.
1985 (WebKit::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback): Removed.
1986 (WebKit::ResourceLoadStatisticsStore::setDeletePersistentStoreCallback): Removed.
1987 (WebKit::ResourceLoadStatisticsStore::setFireTelemetryCallback): Removed.
1988 Drop those callback setters. WebResourceLoadStatisticsStore is the only client of
1989 ResourceLoadStatisticsStore and those callbacks were always called as a result of
1990 an operation requested by the WebResourceLoadStatisticsStore. Therefore, those are
1991 not needed. WebResourceLoadStatisticsStore can take care of doing what those
1992 callbacks were doing on its side.
1994 (WebKit::ResourceLoadStatisticsStore::processStatistics):
1995 Pass parameter by const reference since we clearly do not intend to transfer ownership of it.
1997 (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
1998 (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
1999 (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
2002 (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords): Removed.
2003 (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): Removed.
2004 (WebKit::ResourceLoadStatisticsStore::dataRecordsWereRemoved): Removed.
2005 Those were moved to WebResourceLoadStatisticsStore since they do not require
2006 any access to the statistics, and are only used by WebResourceLoadStatisticsStore.
2008 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2010 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2011 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2012 Store registering most callbacks on the coreStore. Instead, the logic of those
2013 callbacks is now inlined in the few methods in WebResourceLoadStatisticsStore
2014 that were causing these callbacks to be called.
2016 (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2017 Access some methods on WebResourceLoadStatisticsStore instead of the coreStore
2018 since those were moved.
2020 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2021 Drop unnecessary mutable for lambda.
2023 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2024 Pass parameter as rvalue reference as a preparation for a future optimization.
2026 (WebKit::WebResourceLoadStatisticsStore::hasStatisticsFileChangedSinceLastSync):
2029 (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
2030 Add assertion to make sure this is called on the main thread.
2032 (WebKit::WebResourceLoadStatisticsStore::fireDataModificationHandler): Removed.
2033 This was dispatching to a background queue to call fireDataModificationHandler()
2034 on the ResourceLoadStatisticsStore. The coreStore would then dispatch back on the
2035 main thread to call the WebResourceLoadStatisticsStore's modification handler.
2036 This modification handler was merely calling processStatisticsAndDataRecords().
2037 Therefore, callers of WebResourceLoadStatisticsStore::fireDataModificationHandler()
2038 can call WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() directly
2041 (WebKit::WebResourceLoadStatisticsStore::fireTelemetryHandler): Removed.
2042 This was calling ResourceLoadStatisticsStore::fireTelemetryHandler(), which was
2043 calling back WebResourceLoadStatisticsStore's fireTelemetryHandler. The handler
2044 in question was merely calling submitTelemetry(). Therefore, callers of
2045 WebResourceLoadStatisticsStore::fireTelemetryHandler() can call
2046 WebResourceLoadStatisticsStore::submitTelemetry() directly instead.
2048 (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent):
2049 Call ResourceLoadStatisticsStore::clearInMemory() instead of clearInMemoryAndPersistent(),
2050 which was removed. ResourceLoadStatisticsStore::clearInMemoryAndPersistent() was calling
2051 clearInMemory() and then 2 of WebResourceLoadStatisticsStore's handlers. Instead, we now
2052 call the functions that those handlers were calling directly, thus eliminating the need
2055 (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
2056 Set m_minimumTimeBetweenDataRecordsRemoval directly as it is now store on this class
2057 instead of the coreStore.
2059 (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
2060 (WebKit::WebResourceLoadStatisticsStore::dataRecordsBeingRemoved):
2061 (WebKit::WebResourceLoadStatisticsStore::dataRecordsWereRemoved):
2062 Those were merely moved from the ResourceLoadStatisticsStore.
2064 * UIProcess/WebResourceLoadStatisticsStore.h:
2066 * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
2067 (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
2068 Check for sortedPrevalentResources.isEmpty() instead of checking if the size
2069 if less than minimumPrevalentResourcesForTelemetry.
2070 ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry() either returns
2071 an empty vector or a vector with more than minimumPrevalentResourcesForTelemetry
2072 items. Therefore, there is no need to expose minimumPrevalentResourcesForTelemetry.
2074 2017-07-08 Yusuke Suzuki <utatane.tea@gmail.com>
2076 Drop NOSNIFF compile flag
2077 https://bugs.webkit.org/show_bug.cgi?id=174289
2079 Reviewed by Michael Catanzaro.
2081 * Configurations/FeatureDefines.xcconfig:
2083 2017-07-07 Chris Dumez <cdumez@apple.com>
2085 [WK2] Use a rolling 30-day uptime for processing statistics
2086 https://bugs.webkit.org/show_bug.cgi?id=174235
2087 <rdar://problem/33164381>
2089 Reviewed by Brent Fulgham.
2091 Follow-up fix for r219274 because it caused this test to time out:
2092 http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html
2094 The test sets TimeToLiveUserInteraction to 0 so our implementation cannot use
2095 0 as magic value to see if it was set. Instead, use std::optional.
2097 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2098 (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
2099 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2100 (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2101 (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired):
2102 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2103 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2104 (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2105 * UIProcess/WebResourceLoadStatisticsStore.h:
2107 2017-07-07 Brent Fulgham <bfulgham@apple.com>
2109 [WK2] Use a rolling 30-day uptime for processing statistics
2110 https://bugs.webkit.org/show_bug.cgi?id=174235
2111 <rdar://problem/33164381>
2113 Reviewed by Chris Dumez.
2115 * UIProcess/API/Cocoa/WKWebsiteDataStore.cpp:
2116 (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsResetToConsistentState): Initialize time-to-live to zero by default.
2117 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2118 (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): Write out vector
2120 (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): Read in vector of
2122 (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): Check new
2124 (WebKit::ResourceLoadStatisticsStore::markTodayAsOperatingDate): Added.
2125 (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired): Added.
2126 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2127 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2128 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): When reading
2129 a new data file, update the current operating date (if needed).
2130 (WebKit::WebResourceLoadStatisticsStore::handleDailyTasks): Roll uptime dates as
2131 needed, then handle telemetry.
2132 * UIProcess/WebResourceLoadStatisticsStore.h:
2134 2017-07-07 Wenson Hsieh <wenson_hsieh@apple.com>
2136 [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
2137 https://bugs.webkit.org/show_bug.cgi?id=174219
2138 <rdar://problem/32083177>
2140 Reviewed by Ryosuke Niwa.
2142 Tweak some testing SPI to return a drop operation flag instead of whether or not the drop operation was not
2143 UIDropOperationCancel.
2145 * UIProcess/API/Cocoa/WKWebView.mm:
2146 (-[WKWebView _simulateDataInteractionUpdated:]):
2147 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2148 * UIProcess/ios/WKContentViewInteraction.h:
2149 * UIProcess/ios/WKContentViewInteraction.mm:
2150 (-[WKContentView _simulateDataInteractionUpdated:]):
2152 2017-07-07 Commit Queue <commit-queue@webkit.org>
2154 Unreviewed, rolling out r219238, r219239, and r219241.
2155 https://bugs.webkit.org/show_bug.cgi?id=174265
2157 "fast/workers/dedicated-worker-lifecycle.html is flaky"
2158 (Requested by yusukesuzuki on #webkit).
2160 Reverted changesets:
2162 "[WTF] Implement WTF::ThreadGroup"
2163 https://bugs.webkit.org/show_bug.cgi?id=174081
2164 http://trac.webkit.org/changeset/219238
2166 "Unreviewed, build fix after r219238"
2167 https://bugs.webkit.org/show_bug.cgi?id=174081
2168 http://trac.webkit.org/changeset/219239
2170 "Unreviewed, CLoop build fix after r219238"
2171 https://bugs.webkit.org/show_bug.cgi?id=174081
2172 http://trac.webkit.org/changeset/219241
2174 2017-07-07 Antti Koivisto <antti@apple.com>
2176 WKWebSiteDataStore.removeDataOfTypes should wait until disk cache files are actually removed before invoking completion handler
2177 https://bugs.webkit.org/show_bug.cgi?id=174224
2178 <rdar://problem/33067545>
2180 Reviewed by Sam Weinig.
2182 Currently we dispatch file deletion operations to a background queue and call the completion
2183 handler without waiting for the I/O to complete.
2185 * NetworkProcess/NetworkProcess.cpp:
2186 (WebKit::clearDiskCacheEntries):
2188 Call a new version of NetworkCache::remove() for bulk deletion.
2189 Note that it is fine to call this with an empty vector.
2191 * NetworkProcess/cache/NetworkCache.cpp:
2192 (WebKit::NetworkCache::Cache::remove):
2194 Bulk deletion with a completion handler.
2196 (WebKit::NetworkCache::Cache::deleteFiles): Added.
2198 Factor to a helper function.
2200 * NetworkProcess/cache/NetworkCache.h:
2201 * NetworkProcess/cache/NetworkCacheStorage.cpp:
2202 (WebKit::NetworkCache::Storage::remove):
2204 Remove files for all the provided keys in a queue and invoke the completion handler in the main thread when done.
2206 * NetworkProcess/cache/NetworkCacheStorage.h:
2208 2017-07-06 Chris Dumez <cdumez@apple.com>
2210 Fix bad usage of static variables in ResourceLoadStatisticsStore
2211 https://bugs.webkit.org/show_bug.cgi?id=174237
2213 Reviewed by Brent Fulgham.
2215 Fix bad usage of static variables in ResourceLoadStatisticsStore. Those can be set via
2216 member functions on ResourceLoadStatisticsStore so they should be data members. The
2217 API to set them is associated to a particular store and there can in theory be several
2220 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2221 (WebKit::ResourceLoadStatisticsStore::shouldPartitionCookies):
2222 (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2223 (WebKit::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
2224 (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
2225 (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime):
2226 (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
2227 (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
2228 (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
2229 (WebKit::shouldPartitionCookies): Deleted.
2230 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2232 2017-07-05 Yusuke Suzuki <utatane.tea@gmail.com>
2234 [WTF] Implement WTF::ThreadGroup
2235 https://bugs.webkit.org/show_bug.cgi?id=174081
2237 Reviewed by Mark Lam.
2239 * Shared/AsyncRequest.h:
2240 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2242 2017-07-06 Chris Dumez <cdumez@apple.com>
2244 Drop unused ResourceLoadStatistics members
2245 https://bugs.webkit.org/show_bug.cgi?id=174226
2247 Reviewed by Brent Fulgham.
2249 * Shared/WebCoreArgumentCoders.cpp:
2250 (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2251 (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2252 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2253 (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
2255 2017-07-06 Wenson Hsieh <wenson_hsieh@apple.com>
2257 Unreviewed, fix the internal iOS 11 build
2259 It turns out, our internal bots are still on an older version of the iOS 11 SDK that's missing _UIDataOwner in
2260 <UIKit/NSItemProvider+UIKitAdditions_Private.h>. To ensure that we can build on both current and slightly older
2261 versions of the iOS 11 SDK, fall back to using NSInteger instead of _UIDataOwner.
2263 * Platform/spi/ios/UIKitSPI.h:
2264 * UIProcess/ios/WKContentViewInteraction.mm:
2265 (-[WKContentView _dragInteraction:dataOwnerForSession:]):
2266 (-[WKContentView _dropInteraction:dataOwnerForSession:]):
2268 2017-07-06 Wenson Hsieh <wenson_hsieh@apple.com>
2270 [iOS DnD] [WK2] Add delegate hooks for specifying the data owner for a drag or drop session
2271 https://bugs.webkit.org/show_bug.cgi?id=174139
2272 <rdar://problem/33126212>
2274 Reviewed by Beth Dakin.
2276 Add hooks to query the UI delegate for a _UIDataOwner on both drag and drop sides.
2278 * Platform/spi/ios/UIKitSPI.h:
2279 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2280 * UIProcess/ios/WKContentViewInteraction.mm:
2281 (-[WKContentView _dragInteraction:dataOwnerForSession:]):
2282 (-[WKContentView _dropInteraction:dataOwnerForSession:]):
2284 2017-07-06 Brent Fulgham <bfulgham@apple.com>
2286 [WK2] ResourceLoadStatistics should batch its writes
2287 https://bugs.webkit.org/show_bug.cgi?id=174111
2288 <rdar://problem/33115894>
2290 Reviewed by Chris Dumez.
2292 Revise the data writing operation to only write on a specific interval (currently
2295 Also make 'writeStoreToDisk' simpler to use by moving the deleting (before write) and
2296 creating (after write) of the FileMonitor into the method, rather than requiring this
2297 knowledge in multiple places.
2299 Make sure that we write our statistics file out before exiting so that we do not
2300 lose any data if we exit before the five-minute window has elapsed.
2302 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2303 (WebKit::ResourceLoadStatisticsStore::setWritePersistentStoreCallback): Deleted.
2304 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2305 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Remove the stop
2306 and start monitoring into 'writeStoreToDisk'. Also check if enough time has elapsed since
2307 the last write to commit to disk.
2308 (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Remove the
2309 stop and start monitoring into 'writeStoreToDisk'.
2310 (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Add the stop and start monitoring
2311 commands here, so callers don't have to know to do so.
2313 2017-07-06 Chris Dumez <cdumez@apple.com>
2315 FileMonitor should not be ref counted
2316 https://bugs.webkit.org/show_bug.cgi?id=174166
2318 Reviewed by Brent Fulgham.
2320 Update code using FileMonitor to reflect API change.
2322 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2323 (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
2324 (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage):
2325 * UIProcess/WebResourceLoadStatisticsStore.h:
2327 2017-07-06 Matt Rajca <mrajca@apple.com>
2329 Fix build with VIDEO support disabled.
2330 https://bugs.webkit.org/show_bug.cgi?id=174217
2332 Unreviewed build fix.
2334 * WebProcess/WebPage/WebPage.cpp:
2335 (WebKit::WebPage::updateWebsitePolicies):
2337 2017-07-06 Chris Dumez <cdumez@apple.com>
2339 Crash under WebResourceLoadStatisticsStore::persistentStoragePath(WTF::String const&)
2340 https://bugs.webkit.org/show_bug.cgi?id=174205
2341 <rdar://problem/33093552>
2343 Reviewed by Brent Fulgham.
2345 Make sure we isolateCopy() m_statisticsStoragePath before using it from the background
2348 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2349 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2350 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
2351 (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath):
2352 (WebKit::WebResourceLoadStatisticsStore::statisticsFilePath):
2353 (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
2354 (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
2355 (WebKit::WebResourceLoadStatisticsStore::deleteStoreFromDisk):
2356 (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
2357 (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded):
2358 (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Deleted.
2359 * UIProcess/WebResourceLoadStatisticsStore.h:
2361 2017-07-06 Alex Christensen <achristensen@webkit.org>
2363 Fix CFURLRequestRef serialization after r207330
2364 https://bugs.webkit.org/show_bug.cgi?id=163332
2366 * Shared/mac/WebCoreArgumentCodersMac.mm:
2367 (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2368 The CFURLConnection code was not updated.
2369 We did not catch this because nobody uses the WebKit2 CFURLConnection code, but I need to use it to debug something.
2371 2017-07-06 Chris Dumez <cdumez@apple.com>
2373 Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver
2374 https://bugs.webkit.org/show_bug.cgi?id=174194
2376 Reviewed by Brent Fulgham.
2378 Move ResourceLoadObserver notification throttling logic from WebProcess class to
2379 ResourceLoadObserver. This makes more sense and decreases the complexity of the
2382 * WebProcess/WebProcess.cpp:
2383 (WebKit::m_webSQLiteDatabaseTracker):
2384 (WebKit::WebProcess::statisticsChangedTimerFired): Deleted.
2385 * WebProcess/WebProcess.h:
2387 2017-07-06 Chris Dumez <cdumez@apple.com>
2389 WebResourceLoadStatisticsStore should only be constructed when the feature is enabled
2390 https://bugs.webkit.org/show_bug.cgi?id=174189
2392 Reviewed by Brent Fulgham.
2394 Delay the construction of the WebResourceLoadStatisticsStore until the feature gets
2395 enabled via WebsiteDataStore::setResourceLoadStatisticsEnabled(). Previously, we would
2396 always construct a store and then have a boolean on the store to indicate if it is
2399 Also simplify the initialization process of the WebResourceLoadStatisticsStore, we
2401 1. WebResourceLoadStatisticsStore constructor
2402 2. WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
2403 3. WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled(true)
2405 All 3 steps are now taken care of by the WebResourceLoadStatisticsStore constructor.
2407 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2408 (WebKit::WebProcessPool::platformInitialize):
2409 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2410 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2411 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2412 * UIProcess/WebResourceLoadStatisticsStore.h:
2413 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2414 (WebKit::WebsiteDataStore::platformInitialize):
2415 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2416 (WebKit::WebsiteDataStore::WebsiteDataStore):
2417 (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled):
2418 (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2419 * UIProcess/WebsiteData/WebsiteDataStore.h:
2420 (WebKit::WebsiteDataStore::resourceLoadStatistics):
2421 * UIProcess/wpe/WebProcessPoolWPE.cpp:
2422 (WebKit::WebProcessPool::platformInitialize):
2424 2017-07-06 Claudio Saavedra <csaavedra@igalia.com>
2426 [GTK] It should process MouseMoved events when the parent window is not active
2427 https://bugs.webkit.org/show_bug.cgi?id=116691
2429 Reviewed by Michael Catanzaro.
2431 From reading the comments in the related code, only in Safari it
2432 is desired that MouseMoved events are not processed when the
2433 parent window is not active. In other ports, in particular those
2434 targeting Linux, these events should be processed for consistency
2435 with other browsers.
2437 * UIProcess/WebPageProxy.cpp:
2438 (WebKit::WebPageProxy::setCursor):
2439 * UIProcess/mac/PageClientImpl.mm:
2440 (WebKit::PageClientImpl::setCursor):
2441 * WebProcess/WebPage/WebPage.cpp:
2442 (WebKit::handleMouseEvent):
2443 (WebKit::WebPage::mouseEvent): No need to always pass a boolean
2444 parameter that is only checked for one type of event. Do the check
2445 internally in handleMouseEvent() only when needed and only in Cocoa.
2447 2017-07-05 Don Olmstead <don.olmstead@sony.com>
2449 [WTF] Move SoftLinking.h into WTF
2450 https://bugs.webkit.org/show_bug.cgi?id=174000
2452 Reviewed by Alex Christensen.
2454 * Platform/mac/StringUtilities.mm:
2455 * Platform/spi/ios/ManagedConfigurationSPI.h:
2456 * Shared/Cocoa/DataDetectionResult.mm:
2457 * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2458 * Shared/ios/InteractionInformationAtPosition.mm:
2459 * Shared/ios/WebIconUtilities.mm:
2460 * Shared/mac/CookieStorageShim.mm:
2461 * Shared/mac/WebCoreArgumentCodersMac.mm:
2462 * UIProcess/API/Cocoa/_WKElementAction.mm:
2463 * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2464 * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2465 * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2466 * UIProcess/Cocoa/UIDelegate.mm:
2467 * UIProcess/Cocoa/WebViewImpl.mm:
2468 * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2469 * UIProcess/ios/WKActionSheetAssistant.mm:
2470 * UIProcess/ios/WKContentViewInteraction.mm:
2471 * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2472 * UIProcess/ios/forms/WKFileUploadPanel.mm:
2473 * UIProcess/mac/WKImmediateActionController.mm:
2474 * UIProcess/mac/WebInspectorProxyMac.mm:
2475 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2476 * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
2477 * WebProcess/cocoa/WebProcessCocoa.mm:
2479 2017-07-05 Brady Eidson <beidson@apple.com>
2481 Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow".
2482 <rdar://problem/22485589> and https://bugs.webkit.org/show_bug.cgi?id=174178
2484 Reviewed by Alex Christensen.
2486 Adopt to the new constructor for FrameLoadRequest.
2488 * WebProcess/Plugins/PluginView.cpp:
2489 (WebKit::PluginView::loadURL):
2490 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2491 (WebKit::WebFrameLoaderClient::dispatchCreatePage):
2492 * WebProcess/WebPage/WebInspector.cpp:
2493 (WebKit::WebInspector::openInNewTab):
2495 2017-07-05 Ryosuke Niwa <rniwa@webkit.org>
2497 Remove unnecessary forward declartions now that we include Foundation.h
2499 * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2501 2017-07-05 Ryosuke Niwa <rniwa@webkit.org>
2503 Make WebKit's public headers on Mac and iOS C++ module safe
2504 https://bugs.webkit.org/show_bug.cgi?id=174175
2506 Reviewed by Alex Christensen.
2508 Fixed the header files.
2510 * UIProcess/API/Cocoa/WKContentRuleList.h:
2511 * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2512 * UIProcess/API/Cocoa/WKUIDelegate.h:
2514 2017-07-05 Chris Dumez <cdumez@apple.com>
2516 [WK2] WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with
2517 https://bugs.webkit.org/show_bug.cgi?id=174174
2519 Reviewed by Brent Fulgham.
2521 WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with.
2522 Fix this by iterating over WebsiteDataStore::processPools() instead of WebProcessPool::allProcessPools().
2524 Also rename shouldPartitionCookiesForTopPrivatelyOwnedDomains methods / IPC messages to
2525 updateCookiePartitioningForTopPrivatelyOwnedDomains since this is a setter, not a getter.
2527 Finally, drop ShouldPartitionCookiesForTopPrivatelyOwnedDomains IPC message to the NetworkProcessProxy
2528 as well as corresponding methods as those appear to be unused.
2530 * NetworkProcess/NetworkProcess.cpp:
2531 (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains):
2532 (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted.
2533 * NetworkProcess/NetworkProcess.h:
2534 * NetworkProcess/NetworkProcess.messages.in:
2535 * UIProcess/Network/NetworkProcessProxy.cpp:
2536 (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted.
2537 * UIProcess/Network/NetworkProcessProxy.h:
2538 * UIProcess/Network/NetworkProcessProxy.messages.in:
2539 * UIProcess/WebProcessPool.cpp:
2540 (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
2541 * UIProcess/WebProcessPool.h:
2542 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2543 (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains):
2544 (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2545 (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
2546 (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted.
2547 * UIProcess/WebsiteData/WebsiteDataStore.h:
2549 2017-07-05 Tim Horton <timothy_horton@apple.com>
2551 Async Image Decoding: Image flashes away briefly when tapping on tab in iPad tab picker
2552 https://bugs.webkit.org/show_bug.cgi?id=174173
2553 <rdar://problem/32431952>
2555 Reviewed by Geoffrey Garen.
2557 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2558 (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
2559 When a client uses e.g. doAfterNextPresentationUpdate (or internally,
2560 dispatchAfterEnsuringDrawing), they're doing so in the hopes that the
2561 callback is called after the page is well-painted -- for example, to
2562 remove a snapshot (in the tab picker case, as well as for navigation
2563 gestures), or to *take* a snapshot. In all of these cases, it is
2564 preferable to do a synchronous decode, to ensure that the image does
2565 not flash away temporarily.
2567 Use the existing mechanism that was implemented for the synchronous
2568 activity state change flush to also force synchronous image decoding
2569 any time there is a post-commit transaction callback.
2571 2017-07-05 Wenson Hsieh <wenson_hsieh@apple.com>
2573 [iOS DnD] [WK2] 3D touch fails to recognize when UIDragInteraction is enabled on phone
2574 https://bugs.webkit.org/show_bug.cgi?id=174171
2575 <rdar://problem/32956929>
2577 Reviewed by Tim Horton.
2579 By default, UIKit defers all competing long press gesture recognizers if dragging is enabled. However, this
2580 would cause 3D touch to be prevented, due to UIKit asking us whether or not we can proceed with the 3D touch
2581 gesture in -_interactionShouldBeginFromPreviewItemController:forPosition:, while the highlight long press
2582 gesture recognizer is being deferred. To address this, we use SPI on UIDragInteraction to allow the highlight
2583 long press gesture recognizer to recognize alongside the drag lift gesture. We then (already) manually cancel
2584 the highlight long press gesture in _dragInteraction:prepareForSession:completion:.
2586 * UIProcess/ios/WKContentViewInteraction.mm:
2587 (-[WKContentView _dragInteraction:shouldDelayCompetingGestureRecognizer:]):
2589 2017-07-03 Myles C. Maxfield <mmaxfield@apple.com>
2591 Remove copy of ICU headers from WebKit
2592 https://bugs.webkit.org/show_bug.cgi?id=116407
2594 Reviewed by Alex Christensen.
2596 * Configurations/BaseTarget.xcconfig:
2598 2017-07-05 Chris Dumez <cdumez@apple.com>
2600 Regression(r218821): Bad cast to WebKit::DiagnosticLoggingClient in WKWebView's _setDiagnosticLoggingDelegate
2601 https://bugs.webkit.org/show_bug.cgi?id=174163
2602 <rdar://problem/33067518>
2604 Reviewed by Alex Christensen.
2606 After r218821, WebPageProxy::setDiagnosticLoggingClient() would no longer set the client in
2607 private session. This is an issue because there is code in WKWebView which expects the
2608 DiagnosticLoggingClient to be set and of a specific type. This would lead to bad casts in
2609 WKWebView's _diagnosticLoggingDelegate / _setDiagnosticLoggingDelegate.
2611 To avoid the issue, we now unconditionally update the client in
2612 WebPageProxy::setDiagnosticLoggingClient(). Instead, we implement the logic for disabling
2613 logging in private session in the logging methods themselves, via the
2614 WebPageProxy::effectiveDiagnosticLoggingClient() helper instead.
2616 I also added null checks in WKWebView's _diagnosticLoggingDelegate /
2617 _setDiagnosticLoggingDelegate. Even though the WKWebView sets itself as the diagnostic
2618 logging client, WebPageProxy::diagnosticLoggingClient() can still return null after
2619 calling WebPageProxy::close(). Previously, we would have done a bad cast if the WKWebView's
2620 client would have used this API after calling 'close' as well.
2622 * UIProcess/API/APIDiagnosticLoggingClient.h:
2623 * UIProcess/API/Cocoa/WKWebView.mm:
2624 (-[WKWebView _diagnosticLoggingDelegate]):
2625 (-[WKWebView _setDiagnosticLoggingDelegate:]):
2626 * UIProcess/WebPageProxy.cpp:
2627 (WebKit::WebPageProxy::WebPageProxy):
2628 (WebKit::WebPageProxy::setDiagnosticLoggingClient):
2629 (WebKit::WebPageProxy::close):
2630 (WebKit::WebPageProxy::effectiveDiagnosticLoggingClient):
2631 (WebKit::WebPageProxy::logDiagnosticMessage):
2632 (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
2633 (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
2634 (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy):
2635 * UIProcess/WebPageProxy.h:
2636 (WebKit::WebPageProxy::diagnosticLoggingClient):
2638 2017-07-05 Daniel Bates <dabates@apple.com>
2640 Do not pass API::FrameInfo for source frame or clear out page of target frame on
2642 https://bugs.webkit.org/show_bug.cgi?id=174170
2643 <rdar://problem/33140328>
2645 Reviewed by Brady Eidson.
2647 As a step towards making it straightforward for an embedding client to determine whether
2648 a WebPageProxy::decidePolicyForNavigationAction() callback was initiated from API we
2649 should not pass frame info for the source frame and should not nullify the page pointer
2650 in the target frame info.
2652 Currently we always pass frame info for the source frame and nullify the page pointer
2653 in both the source frame info and target frame info if the navigation was initiated from
2654 API. This seems subtle and error prone. Instead we should not pass frame info for
2655 the source frame and not nullify the page pointer in the target frame info as a step
2656 towards making using this API less error-prone.
2658 * UIProcess/WebPageProxy.cpp:
2659 (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2661 2017-07-05 Chris Dumez <cdumez@apple.com>
2663 Add a few more WebKit2 owners
2664 https://bugs.webkit.org/show_bug.cgi?id=174169
2666 Reviewed by Brady Eidson.
2670 2017-07-05 Brent Fulgham <bfulgham@apple.com>
2672 [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events
2673 https://bugs.webkit.org/show_bug.cgi?id=174062\
2674 <rdar://problem/33086744>
2676 Reviewed by Chris Dumez.
2678 ResourceLoadStatistics was triggering periods of high CPU use due to a cascade of read/write
2680 (1) The 'makeRefPtr' call in FileMonitor::startMonitoring was capturing a reference to itself, preventing
2681 the FileMonitor from being destroyed. This caused the file modification handler to fire in response
2682 to our own write events, creating a ridiculous read/write cycle. This problem was addressed in
2683 the short term by stopping the file monitor in WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage,
2684 rather than relying on the destructor to shut things down. This will be improved in a
2686 (2) 'syncWithExistingStatisticsStorageIfNeeded' was creating a FileMonitor during the write operation,
2687 which exacerbated the chain of read/writes already present due to the self-reference described above.
2688 (3) Because VNODE dispatch sources are low level, they do not offer a means of filtering out operations
2689 triggered by the current process. To avoid this, I added code to track the file modification time, so
2690 that we don't bother reading a file that holds data that is older than the in-memory data, even though
2691 we receive a file modification dispatch. Writes seem to trigger a chain of notification events in rapid
2692 succession. Once we've responded to the first of these events, we don't need to to further reads until
2693 the data on disk changes again.
2695 We also shouldn't allow the ResourceLoadStatistics worker thread to consume high CPU resources. Run it
2696 as utility QoS, avoiding using the CPU when other work is going on.
2698 Drive-by fix: The closure in setWritePersistentStoreCallback() should stop monitoring before writing
2699 data, and should start monitoring after the write completes.
2701 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2702 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Run our worker queue
2703 as a utility-level process.
2704 (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Stop checking for
2705 updates before writing, and begin checking again once the write is complete.
2706 (WebKit::WebResourceLoadStatisticsStore::statisticsFileModificationTime): Added.
2707 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Avoid reading the file if it
2708 was last modified on (or before) the time we last read the file.
2709 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): Ditto.
2710 (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage): Explicitly stop file
2711 monitoring so that the active file modification handler will terminate.
2712 (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): Do not begin
2713 monitoring the file after syncing, since this is only used as part of an ongoing write operation.
2715 2017-07-05 Jonathan Bedard <jbedard@apple.com>
2717 Add WebKitPrivateFrameworkStubs for iOS 11
2718 https://bugs.webkit.org/show_bug.cgi?id=173988
2720 Reviewed by David Kilzer.
2722 * Configurations/BaseTarget.xcconfig: iphoneos and iphonesimulator should use the
2723 same directory for private framework stubs.
2725 2017-07-05 Andy Estes <aestes@apple.com>
2727 [iOS] WKActionSheetAssistants can outlive their host views
2728 https://bugs.webkit.org/show_bug.cgi?id=174160
2729 <rdar://problem/20638607>
2731 Reviewed by Tim Horton.
2733 WKActionSheetAssistant keeps a raw pointer to its host UIView, and nothing clears it when
2734 the host view is deallocated. If the assistant outlives the view, we can end up accessing a
2735 pointer to a deallocated UIView and crashing.
2737 I don't know how to reproduce such a crash, but this patch guards against it by doing the
2740 1. Make _view a WeakObjCPtr in WKActionSheetAssistant to ensure it gets set to nil when the
2741 UIView is deallocated.
2742 2. Call -[WKActionSheetAssistant cleanupSheet] when a WKContentView or WKPDFView is
2743 deallocated, or when the Web process crashes. This will ensure the action sheet is
2744 dismissed and prevent the user from tapping on an action that's no longer valid.
2746 * UIProcess/ios/WKActionSheetAssistant.mm:
2747 (-[WKActionSheetAssistant superviewForSheet]):
2748 (-[WKActionSheetAssistant _presentationRectForSheetGivenPoint:inHostView:]):
2749 (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
2750 (-[WKActionSheetAssistant presentationRectForIndicatedElement]):
2751 (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]):
2752 * UIProcess/ios/WKContentViewInteraction.mm:
2753 (-[WKContentView cleanupInteraction]):
2754 * UIProcess/ios/WKPDFView.mm:
2755 (-[WKPDFView dealloc]):
2757 2017-07-05 Frederic Wang <fwang@igalia.com>
2759 Move ScrolledContentsLayer property to ScrollingStateScrollingNode
2760 https://bugs.webkit.org/show_bug.cgi?id=174134
2762 Reviewed by Simon Fraser.
2764 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2765 (ArgumentCoder<ScrollingStateScrollingNode>::encode): Add encoding for scrolled contents
2767 (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): Remove encoding for scrolled
2769 (ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode): Ditto.
2770 (ArgumentCoder<ScrollingStateScrollingNode>::decode): Add decoding for scrolled contents
2772 (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode): Remove decoding for scrolled
2774 (ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode): Ditto.
2775 (WebKit::dump): Move dumping of scrolled contents layer from overflow/frame nodes to
2777 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2778 (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Adjust enum value to use
2779 ScrollingStateScrollingNode::ScrolledContentsLayer.
2780 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2781 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto.
2782 * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2783 (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Ditto.
2785 2017-07-05 Ada Chan <adachan@apple.com>
2787 Fix crash in UIKit: +[UIViewController _viewControllerForFullScreenPresentationFromView:]
2788 https://bugs.webkit.org/show_bug.cgi?id=174143
2789 <rdar://problem/28384582>
2791 Reviewed by Wenson Hsieh.
2793 In -[WKActionSheet willRotate], we can't guarantee that the action sheet belongs
2794 in a window, and passing nil to +[UIViewController _viewControllerForFullScreenPresentationFromView:]
2795 throws an exception. To fix this, bail early if the result from -hostViewForSheet is nil.
2797 * UIProcess/ios/WKActionSheet.mm:
2798 (-[WKActionSheet willRotate]):
2800 2017-07-05 Eric Carlson <eric.carlson@apple.com>
2802 [MediaStream] Protect request and web view during gUM client callback
2803 https://bugs.webkit.org/show_bug.cgi?id=174096
2804 <rdar://problem/32833102>
2806 Reviewed by Youenn Fablet.
2808 Retain the message and WebView during asynchronous calls so they won't be
2809 released if a navigation happens during a call to the UA for getUserMedia
2810 or enumerateMediaDevices.
2812 * UIProcess/Cocoa/UIDelegate.mm:
2813 (WebKit::requestUserMediaAuthorizationForDevices):
2814 (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2815 (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2817 2017-07-05 Matt Lewis <jlewis3@apple.com>
2819 Unreviewed, rolling out r219128.
2821 Spoke with engineer who originally submitted, Patch for APi
2826 "Unreviewed, rolling out r219070."
2827 https://bugs.webkit.org/show_bug.cgi?id=174082
2828 http://trac.webkit.org/changeset/219128
2830 2017-07-05 Matt Lewis <jlewis3@apple.com>
2832 Unreviewed, rolling out r219070.
2834 This revision caused consistent failures of the API test
2835 UIPasteboardTests.DoNotPastePlainTextAsURL on iOS.
2839 "Pasting single words copied to UIPasteboard inserts URLs in
2841 https://bugs.webkit.org/show_bug.cgi?id=174082
2842 http://trac.webkit.org/changeset/219070
2844 2017-07-05 Zan Dobersek <zdobersek@igalia.com>
2846 [GLib] Incorrect <glib/gi18n.h> include in WebKitWebsiteData
2847 https://bugs.webkit.org/show_bug.cgi?id=174093
2849 Reviewed by Michael Catanzaro.
2851 * UIProcess/API/glib/WebKitWebsiteData.cpp: Include <glib/gi18n-lib.h>
2852 rather than <glib/gi18n.h>, since the former has to be included in a
2853 library while the latter should only be included in a standalone application.
2855 2017-07-04 Joseph Pecoraro <pecoraro@apple.com>
2857 Cleanup some StringBuilder use
2858 https://bugs.webkit.org/show_bug.cgi?id=174118
2860 Reviewed by Andreas Kling.
2862 * NetworkProcess/capture/NetworkCaptureManager.cpp:
2863 (WebKit::NetworkCapture::Manager::hashToPath):
2864 * UIProcess/WebPageProxy.cpp:
2866 2017-07-03 Wenson Hsieh <wenson_hsieh@apple.com>
2868 [iOS DnD] [WK2] Callout bar should reappear after dragging ends for a text selection
2869 https://bugs.webkit.org/show_bug.cgi?id=174116
2870 <rdar://problem/33017845>
2872 Reviewed by Ryosuke Niwa.
2874 -willStartScrollingOverflow -didEndScrollingOverflow are helper methods on both the UIWKTextInteractionAssistant
2875 and UIWebSelectionAssistant that handle hiding selection and callout bar UI during overflow scrolling and making
2876 it reappear after scrolling ends. However, these hooks do not contain logic specific to scrolling, and simply
2877 tell the inner UIWebSelectionView to either show or hide and are safe to invoke outside of the context of
2880 This patch invokes these hooks when beginning a drag on a selection, and when a dragging ends, if it called
2881 -willStartScrollingOverflow to begin with. We should rename these in the future to be something along the lines
2882 of -hideSelectionViewAndControls and -showSelectionViewAndControls, respectively, and adopt these new names in
2883 WebKit. We also move logic to hide the callout out of -itemsForBeginningSession: and into
2884 -willAnimateLiftWithAnimator:, when the lift actually begins.
2886 * UIProcess/ios/WKContentViewInteraction.h:
2887 * UIProcess/ios/WKContentViewInteraction.mm:
2888 (-[WKContentView cleanUpDragSourceSessionState]):
2889 (-[WKContentView _restoreCalloutBarIfNeeded]):
2890 (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2891 (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2892 (-[WKContentView dragInteraction:session:didEndWithOperation:]):
2894 2017-07-03 Matt Rajca <mrajca@apple.com>
2896 Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called
2897 https://bugs.webkit.org/show_bug.cgi?id=174103
2899 Reviewed by Alex Christensen.
2901 Currently, when -[WKWebView evaluateJavaScript:completionHandler:] is invoked, we end up simulating
2902 a user gesture unconditionally. This is not desireable for some tests, so I added a private variant
2903 of this method that takes a boolean that is ultimately passed to `executeScript` for the
2904 `forceUserGesture` parameter (instead of unconditionally passing `true`).
2906 * UIProcess/API/C/WKPage.cpp:
2907 (WKPageRunJavaScriptInMainFrame):
2908 * UIProcess/API/Cocoa/WKWebView.mm:
2909 (-[WKWebView evaluateJavaScript:completionHandler:]):
2910 (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]):
2911 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2912 * UIProcess/WebPageProxy.cpp:
2913 (WebKit::WebPageProxy::runJavaScriptInMainFrame):
2914 * UIProcess/WebPageProxy.h:
2915 * WebProcess/WebPage/WebPage.cpp:
2916 (WebKit::WebPage::runJavaScriptInMainFrame):
2917 (WebKit::WebPage::updateWebsitePolicies): Update behavior restrictions on any existing media elements.
2918 * WebProcess/WebPage/WebPage.h:
2919 * WebProcess/WebPage/WebPage.messages.in:
2921 2017-07-03 Matt Lewis <jlewis3@apple.com>
2923 Unreviewed, rolling out r219103.
2925 Caused multiple build failures.
2929 "Remove copy of ICU headers from WebKit"
2930 https://bugs.webkit.org/show_bug.cgi?id=116407
2931 http://trac.webkit.org/changeset/219103
2933 2017-07-03 Myles C. Maxfield <mmaxfield@apple.com>
2935 Remove copy of ICU headers from WebKit
2936 https://bugs.webkit.org/show_bug.cgi?id=116407
2938 Reviewed by Alex Christensen.
2940 Use WTF's copy of ICU headers.
2942 * Configurations/BaseTarget.xcconfig:
2944 2017-07-03 Brady Eidson <beidson@apple.com>
2946 Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism.
2947 https://bugs.webkit.org/show_bug.cgi?id=174073
2949 Reviewed by Andy Estes.
2951 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2952 (WebKit::WebFrameLoaderClient::getLoadDecisionForIcons):
2953 (WebKit::WebFrameLoaderClient::dispatchDidReceiveIcon): Deleted.
2954 (WebKit::WebFrameLoaderClient::registerForIconNotification): Deleted.
2955 (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted.
2956 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2958 2017-07-03 Sam Weinig <sam@webkit.org>
2960 [WebIDL] Remove more unnecessary uses of the preprocessor in idl files
2961 https://bugs.webkit.org/show_bug.cgi?id=174083
2963 Reviewed by Alex Christensen.
2965 * Configurations/FeatureDefines.xcconfig:
2966 Add ENABLE_NAVIGATOR_STANDALONE.
2968 2017-07-03 Matt Lewis <jlewis3@apple.com>
2970 Unreviewed, rolling out r219083.
2972 The revision caused an API failure on all testing platforms.
2976 "[MediaStream] Protect request and web view during gUM client
2978 https://bugs.webkit.org/show_bug.cgi?id=174096
2979 http://trac.webkit.org/changeset/219083
2981 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
2983 WebContent processes crash when the network process crashes with pending connection requests
2984 https://bugs.webkit.org/show_bug.cgi?id=174065
2985 <rdar://problem/30359835>
2987 Reviewed by Tim Horton.
2989 The bug was caused by the UI process clearing away pending network connection requests whenever the existing
2990 network process crashed. This resulted in WebContent process killing itself inside ensureNetworkProcessConnection.
2992 Fixed the bug by re-launching a new network process when this happens. We don't try to re-launch a new process
2993 if the previous attempt to launch a network process had failed.
2995 This patch splits NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch into networkProcessFailedToLaunch
2996 and networkProcessCrashed to differentiate those two cases, and invoke the respective callbacks in WebProcessPool.
2998 * UIProcess/API/Cocoa/WKProcessPool.mm:
2999 (-[WKProcessPool _networkProcessIdentifier]): Added.
3000 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3001 * UIProcess/Network/NetworkProcessProxy.cpp:
3002 (WebKit::NetworkProcessProxy::networkProcessCrashed): Added.
3003 (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch): Split into the two following functions.
3004 (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch): Extracted from networkProcessCrashedOrFailedToLaunch.
3005 (WebKit::NetworkProcessProxy::clearCallbackStates): Extracted from networkProcessCrashedOrFailedToLaunch
3006 (WebKit::NetworkProcessProxy::didClose): Call networkProcessCrashed.
3007 (WebKit::NetworkProcessProxy::didFinishLaunching): Call networkProcessFailedToLaunch.
3008 * UIProcess/Network/NetworkProcessProxy.h:
3009 * UIProcess/WebProcessPool.cpp:
3010 (WebKit::WebProcessPool::networkProcessCrashed): Start a new network process when there are pending connection
3011 requests the crached network failed to fullfil.
3012 (WebKit::WebProcessPool::networkProcessFailedToLaunch):
3013 * UIProcess/WebProcessPool.h:
3015 2017-07-03 Eric Carlson <eric.carlson@apple.com>
3017 [MediaStream] Protect request and web view during gUM client callback
3018 https://bugs.webkit.org/show_bug.cgi?id=174096
3019 <rdar://problem/32833102>
3021 Reviewed by Youenn Fablet.
3023 Retain the message and WebView during asynchronous calls so they won't be
3024 released if a navigation happens during a call to the UA for getUserMedia
3025 or enumerateMediaDevices.
3027 * UIProcess/Cocoa/UIDelegate.mm:
3028 (WebKit::requestUserMediaAuthorizationForDevices):
3029 (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
3030 (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
3032 2017-07-03 Andy Estes <aestes@apple.com>
3034 [Xcode] Add an experimental setting to build with ccache
3035 https://bugs.webkit.org/show_bug.cgi?id=173875
3037 Reviewed by Tim Horton.
3039 * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
3041 2017-07-03 Chris Dumez <cdumez@apple.com>
3043 Drop ResourceLoadStatisticsStore's statisticsLock
3044 https://bugs.webkit.org/show_bug.cgi?id=174080
3046 Reviewed by Brent Fulgham.
3048 Drop ResourceLoadStatisticsStore's statisticsLock. It added complexity and was only needed
3049 do that the SPI exposed to WebKitTestRunner would query the store synchronously from the
3050 main thread. Instead, I made the SPI asynchronous and make sure we always access the store
3051 from the same background thread. As a result, there is no longer any need for locking.
3053 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3054 (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]):
3055 (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]):
3056 (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]):
3057 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3058 * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
3059 (WebKit::ResourceLoadStatisticsStore::isPrevalentResource):
3060 (WebKit::ResourceLoadStatisticsStore::isGrandFathered):
3061 (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
3062 (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
3063 (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
3064 (WebKit::ResourceLoadStatisticsStore::clearInMemory):
3065 (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
3066 (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
3067 (WebKit::ResourceLoadStatisticsStore::processStatistics):
3068 (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
3069 (WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
3070 (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
3071 (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
3072 * UIProcess/Storage/ResourceLoadStatisticsStore.h:
3073 * UIProcess/WebResourceLoadStatisticsStore.cpp:
3074 (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3075 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
3076 (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
3077 (WebKit::WebResourceLoadStatisticsStore::clearInMemoryData):
3078 (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
3079 (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3080 (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
3081 (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3082 (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3083 (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
3084 (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
3085 (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
3086 (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
3087 (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3088 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3089 (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3090 * UIProcess/WebResourceLoadStatisticsStore.h:
3092 2017-07-03 Wenson Hsieh <wenson_hsieh@apple.com>
3094 Pasting single words copied to UIPasteboard inserts URLs in editable areas
3095 https://bugs.webkit.org/show_bug.cgi?id=174082
3096 <rdar://problem/33046992>
3098 Reviewed by Tim Horton.
3100 Add a hook to WKPreferences to allow programatic pasting.
3102 * UIProcess/API/Cocoa/WKPreferences.mm:
3103 (-[WKPreferences _setDOMPasteAllowed:]):
3104 (-[WKPreferences _domPasteAllowed]):
3105 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3107 2017-07-03 Zan Dobersek <zdobersek@igalia.com>
3109 Unreviewed GTK+ and WPE build fix when building with GCC 4.9.
3111 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3112 (WebKit::CoordinatedLayerTreeHost::renderNextFrame): Don't use brace-list
3113 initialization to override the m_forceRepaintAsync struct. Instead, manually
3114 assign the OptionalCallbackID() value to the m_forceRepaintAsync.callbackID
3115 member variable, and override the m_forceRepaintAsync.needsFreshFlush member
3116 variable with `false`.
3118 2017-07-03 Zan Dobersek <zdobersek@igalia.com>
3120 [ThreadedCompositor] Update and retrieve scene attributes under a Lock
3121 https://bugs.webkit.org/show_bug.cgi?id=173762
3123 Reviewed by Carlos Garcia Campos.
3125 Instead of dispatching separate tasks on the composition run loop, update
3126 various scene attributes by locking a common lock object and updating the
3127 appropriate attribute.
3129 In ThreadedCompositor::renderLayerTree(), where these attributes are used
3130 in scene composition, the lock is again obtained and the attributes copied
3131 into local variables, releasing the lock afterwards. The attribute values
3132 in local copies are then used for that renderLayerTree() invocation.
3134 This approach is more efficient than dispatching separate tasks that can
3135 race against renderLayerTree() dispatches.
3137 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3138 (WebKit::ThreadedCompositor::ThreadedCompositor):
3139 (WebKit::m_displayRefreshMonitor):
3140 (WebKit::ThreadedCompositor::setScaleFactor):
3141 (WebKit::ThreadedCompositor::setScrollPosition):
3142 (WebKit::ThreadedCompositor::setViewportSize):
3143 (WebKit::ThreadedCompositor::setDrawsBackground):
3144 (WebKit::ThreadedCompositor::renderLayerTree):
3145 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3147 2017-07-01 Dan Bernstein <mitz@apple.com>
3149 [iOS] Remove code only needed when building for iOS 9.x
3150 https://bugs.webkit.org/show_bug.cgi?id=174068
3152 Reviewed by Tim Horton.
3154 * Configurations/FeatureDefines.xcconfig:
3155 * Configurations/WebKit.xcconfig:
3156 * Platform/spi/ios/UIKitSPI.h:
3157 * UIProcess/API/Cocoa/WKWebView.mm:
3158 (-[WKWebView dealloc]):
3159 * UIProcess/ios/WKContentViewInteraction.mm:
3160 (-[WKFormInputSession setSuggestions:]):
3161 (-[WKFormInputSession invalidate]):
3162 (-[WKContentView insertTextSuggestion:]):
3163 (contentTypeFromFieldName):
3164 (-[WKContentView textInputTraits]):
3165 (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3166 * WebProcess/WebPage/ios/WebPageIOS.mm:
3167 (WebKit::WebPage::getPositionInformation):
3170 2017-07-01 Brady Eidson <beidson@apple.com>
3172 When setting a custom cookie storage location on a WKWebsiteDataStore, cookies aren't actually removed.
3173 <rdar://problem/32410662> and https://bugs.webkit.org/show_bug.cgi?id=174035
3175 Reviewed by Alex Christensen.
3177 * UIProcess/API/Cocoa/WKProcessPool.mm:
3178 (-[WKProcessPool _terminateNetworkProcess]):
3179 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3181 * UIProcess/WebProcessPool.cpp:
3182 (WebKit::WebProcessPool::ensureNetworkProcess): Take an optional WebsiteDataStore. If one is passed in,
3183 send it to either the existing or new network process.
3184 * UIProcess/WebProcessPool.h:
3186 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3187 (WebKit::WebsiteDataStore::parameters): Resolve paths first.
3189 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3190 (WebKit::WebsiteDataStore::fetchDataAndApply):
3191 (WebKit::WebsiteDataStore::removeData):
3193 2017-07-01 Ryosuke Niwa <rniwa@webkit.org>
3195 Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
3196 https://bugs.webkit.org/show_bug.cgi?id=174004
3198 Reviewed by Simon Fraser.
3200 * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3201 * WebProcess/WebPage/WebInspector.cpp:
3203 2017-07-01 Dan Bernstein <mitz@apple.com>
3205 [macOS] Remove code only needed when building for OS X Yosemite
3206 https://bugs.webkit.org/show_bug.cgi?id=174067
3208 Reviewed by Tim Horton.
3210 * Configurations/Base.xcconfig:
3211 * Configurations/BaseTarget.xcconfig:
3212 * Configurations/BaseXPCService.xcconfig:
3213 * Configurations/DebugRelease.xcconfig:
3214 * Configurations/FeatureDefines.xcconfig:
3215 * Configurations/NetworkService.xcconfig:
3216 * Configurations/PluginService.32.xcconfig:
3217 * Configurations/PluginService.64.xcconfig:
3218 * Configurations/Version.xcconfig:
3219 * Configurations/WebContentService.xcconfig:
3220 * Configurations/WebKit.xcconfig:
3221 * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
3222 * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Removed.
3223 * NetworkProcess/NetworkProcessCreationParameters.cpp:
3224 (WebKit::NetworkProcessCreationParameters::encode):
3225 (WebKit::NetworkProcessCreationParameters::decode):
3226 * NetworkProcess/NetworkProcessCreationParameters.h:
3227 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3228 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3229 * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3230 * Platform/IPC/Connection.h:
3231 * Platform/IPC/mac/ConnectionMac.mm:
3232 (IPC::Connection::platformInvalidate):
3233 (IPC::Connection::platformInitialize):
3234 (IPC::Connection::open):
3235 (IPC::Connection::exceptionSourceEventHandler): Deleted.
3236 (IPC::Connection::setShouldCloseConnectionOnMachExceptions): Deleted.
3237 * Platform/mac/LayerHostingContext.h:
3238 * Platform/mac/LayerHostingContext.mm:
3239 (WebKit::LayerHostingContext::createFencePort):
3240 * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Removed.
3241 * PluginProcess/mac/PluginControllerProxyMac.mm:
3242 (WebKit::PluginControllerProxy::updateLayerHostingContext):
3243 * PluginProcess/mac/PluginProcessShim.mm:
3244 * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3245 * Shared/ChildProcess.h:
3246 * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3247 (WebKit::getPluginInfoFromPropertyLists):
3248 (WebKit::NetscapePluginModule::getPluginInfo):
3249 (WebKit::contentsOfPropertyListAtURL): Deleted.
3250 (WebKit::getMIMETypesFromPluginBundle): Deleted.
3251 * Shared/Plugins/PluginProcessCreationParameters.cpp:
3252 (WebKit::PluginProcessCreationParameters::encode):
3253 (WebKit::PluginProcessCreationParameters::decode):
3254 * Shared/Plugins/PluginProcessCreationParameters.h:
3255 * Shared/WebProcessCreationParameters.cpp:
3256 (WebKit::WebProcessCreationParameters::encode):
3257 (WebKit::WebProcessCreationParameters::decode):
3258 * Shared/WebProcessCreationParameters.h:
3259 * Shared/mac/ChildProcessMac.mm:
3260 (WebKit::ChildProcess::setSharedHTTPCookieStorage):
3261 * UIProcess/API/C/WKPage.cpp:
3262 (WKPageSetPageUIClient):
3263 (fixUpBotchedPageUIClient): Deleted.
3264 * UIProcess/ChildProcessProxy.cpp:
3265 (WebKit::ChildProcessProxy::didFinishLaunching):
3266 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3267 (WebKit::WebProcessPool::platformInitializeWebProcess):
3268 (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3269 (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate):
3270 * UIProcess/Cocoa/WebViewImpl.h:
3271 * UIProcess/Cocoa/WebViewImpl.mm:
3272 (WebKit::WebViewImpl::updateLayer):
3273 (WebKit::WebViewImpl::startWindowDrag):
3274 * UIProcess/DrawingAreaProxy.h:
3275 (WebKit::DrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted.
3276 * UIProcess/Plugins/PluginProcessProxy.cpp:
3277 (WebKit::PluginProcessProxy::didFinishLaunching):
3278 * UIProcess/Plugins/PluginProcessProxy.h:
3279 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3280 (WebKit::PluginProcessProxy::platformInitializePluginProcess):
3281 (WebKit::PluginProcessProxy::createPropertyListFile): Deleted.
3282 * UIProcess/WebPageProxy.cpp:
3283 (WebKit::WebPageProxy::setTopContentInset):
3284 * UIProcess/mac/PageClientImpl.mm:
3285 (WebKit::PageClientImpl::rootViewToWindow):
3286 (WebKit::PageClientImpl::startWindowDrag):
3287 * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3288 (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
3289 * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3290 * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3291 (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
3292 (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted.
3293 * UIProcess/mac/WebInspectorProxyMac.mm:
3294 (WebKit::WebInspectorProxy::createFrontendWindow):
3295 (WebKit::WebInspectorProxy::platformStartWindowDrag):
3296 * UIProcess/mac/WebPopupMenuProxyMac.mm:
3297 (WebKit::WebPopupMenuProxyMac::showPopupMenu):
3298 * WebKit2.xcodeproj/project.pbxproj:
3299 * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Removed.
3300 * WebProcess/WebPage/WebPage.cpp:
3301 * WebProcess/WebPage/WebPage.h:
3302 * WebProcess/WebPage/WebPage.messages.in:
3303 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3304 (WebKit::addAnimationToLayer):
3305 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3306 (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3307 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3308 (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3309 (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
3310 * WebProcess/cocoa/WebProcessCocoa.mm:
3311 (WebKit::WebProcess::platformInitializeWebProcess):
3312 * WebProcess/com.apple.WebProcess.sb.in:
3314 2017-07-01 Chris Dumez <cdumez@apple.com>
3316 Replace ResourceLoadStatisticsStore C API with Cocoa SPI
3317 https://bugs.webkit.org/show_bug.cgi?id=174060
3319 Reviewed by Brent Fulgham.
3321 Replace ResourceLoadStatisticsStore C API by Cocoa SPI. The new Cocoa SPI is on
3322 WKWebsiteDataStore, which allows us to get rid of the WebResourceLoadStatisticsManager
3323 singleton as the SPI can now interact directly with the WebResourceLoadStatisticsStore.
3325 * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: Removed.
3326 * UIProcess/API/C/WKResourceLoadStatisticsManager.h: Removed.
3329 * UIProcess/WebResourceLoadStatisticsManager.cpp: Removed.
3330 * UIProcess/WebResourceLoadStatisticsManager.h: Removed.
3331 Drop WebResourceLoadStatisticsManager singleton which was only required by the
3332 C API. This is because the C API was global, rather than working on a specific
3335 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3336 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3337 Add new Cocoa SPI on WKWebsiteDataStore. This is only used for testing.
3339 * UIProcess/WebResourceLoadStatisticsStore.cpp:
3340 (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
3341 Stop registering the store with the WebResourceLoadStatisticsManager singleton,
3342 as this singleton is gone.
3344 * UIProcess/WebsiteData/WebsiteDataStore.h:
3345 (WebKit::WebsiteDataStore::resourceLoadStatistics):
3346 Add new getter to retrieve the WebResourceLoadStatisticsStore from the
3347 WebsiteDataStore. This is needed by the new Cocoa SPI.
3349 * WebKit2.xcodeproj/project.pbxproj:
3352 2017-06-30 Megan Gardner <megan_gardner@apple.com>
3354 Unreviewed mac build fix.
3356 * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
3357 * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
3359 2017-06-30 Megan Gardner <megan_gardner@apple.com>
3361 Add API to get WKActivatedElementInfo
3362 https://bugs.webkit.org/show_bug.cgi?id=174001
3363 <rdar://problem/29165518>
3365 Adding a way to get a WKActivatedElementInfo for a point on a WKWebView.
3367 Reviewed by Tim Horton.
3369 * UIProcess/API/Cocoa/WKWebView.mm:
3370 (-[WKWebView requestActivatedElementAtPosition:completionBlock:]):
3371 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3372 * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
3373 (+[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]):
3374 (-[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]):
3375 * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
3377 2017-06-30 Tim Horton <timothy_horton@apple.com>
3379 Use API instead of SPI for content inset adjustment behavior
3380 https://bugs.webkit.org/show_bug.cgi?id=174050
3382 Reviewed by Sam Weinig.
3384 * Platform/spi/ios/UIKitSPI.h:
3385 * UIProcess/ios/WKScrollView.mm:
3386 (-[WKScrollView initWithFrame:]):
3387 (-[WKScrollView setContentInsetAdjustmentBehavior:]):
3388 (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]):
3389 (-[WKScrollView _setContentInsetAdjustmentBehavior:]): Deleted.
3390 Switch over to the API. The old SPI calls the API internally, so our
3391 override will now cover all callers.
3393 2017-06-30 Chris Dumez <cdumez@apple.com>
3395 Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore
3396 https://bugs.webkit.org/show_bug.cgi?id=174038
3398 Reviewed by Brent Fulgham.
3400 Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore.
3401 WebResourceLoadStatisticsManager is now essentially a proxy to the
3402 WebResourceLoadStatisticsStore to support the current C API.
3404 In a follow-up, I plan to to replace the C API with a Cocoa SPI which works on a
3405 WebResourceLoadStatisticsStore directly instead of requiring a
3406 WebResourceLoadStatisticsManager singleton.
3408 * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
3409 (WKResourceLoadStatisticsManagerSetMinimumTimeBetweenDataRecordsRemoval):
3410 (WKResourceLoadStatisticsManagerResetToConsistentState):
3411 * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
3412 * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Removed.
3413 * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3414 (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3415 * UIProcess/WebResourceLoadStatisticsManager.cpp:
3416 (WebKit::WebResourceLoadStatisticsManager::WebResourceLoadStatisticsManager):
3417 (WebKit::WebResourceLoadStatisticsManager::~WebResourceLoadStatisticsManager):
3418 (WebKit::WebResourceLoadStatisticsManager::setStatisticsStore):
3419 (WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore):
3420 (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
3421 (WebKit::WebResourceLoadStatisticsManager::logUserInteraction):
3422 (WebKit::WebResourceLoadStatisticsManager::clearUserInteraction):
3423 (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction):
3424 (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource):
3425 (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource):
3426 (WebKit::WebResourceLoadStatisticsManager::clearPrevalentResource):
3427 (WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
3428 (WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
3429 (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
3430 (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
3431 (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
3432 (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
3433 (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
3434 (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweenDataRecordsRemoval):
3435 (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
3436 (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler):
3437 (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
3438 (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler):