1 2016-03-16 Beth Dakin <bdakin@apple.com>
3 Provide NSSpellChecker spellChecking methods with the current insertion point
4 https://bugs.webkit.org/show_bug.cgi?id=155532
6 rdar://problem/24066952
8 Reviewed by Simon Fraser.
10 Pass the insertionPoint to the UIProcess
11 * UIProcess/TextChecker.h:
12 * UIProcess/WebPageProxy.cpp:
13 (WebKit::WebPageProxy::checkTextOfParagraph):
14 (WebKit::WebPageProxy::getGuessesForWord):
15 (WebKit::WebPageProxy::requestCheckingOfString):
16 * UIProcess/WebPageProxy.h:
17 * UIProcess/WebPageProxy.messages.in:
18 * UIProcess/efl/TextCheckerEfl.cpp:
19 (WebKit::TextChecker::checkTextOfParagraph):
20 (WebKit::TextChecker::getGuessesForWord):
21 (WebKit::TextChecker::requestCheckingOfString):
22 * UIProcess/gtk/TextCheckerGtk.cpp:
23 (WebKit::TextChecker::getGuessesForWord):
24 (WebKit::TextChecker::requestCheckingOfString):
25 (WebKit::TextChecker::checkTextOfParagraph):
26 * UIProcess/ios/TextCheckerIOS.mm:
27 (WebKit::TextChecker::checkTextOfParagraph):
28 (WebKit::TextChecker::getGuessesForWord):
29 (WebKit::TextChecker::requestCheckingOfString):
30 * UIProcess/mac/TextCheckerMac.mm:
31 (WebKit::TextChecker::checkTextOfParagraph):
32 (WebKit::TextChecker::getGuessesForWord):
33 (WebKit::TextChecker::ignoreWord):
34 (WebKit::TextChecker::requestCheckingOfString):
36 Extract the insertion point from the VisibleSelection that WebCore has
38 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
39 (WebKit::insertionPointFromCurrentSelection):
40 (WebKit::WebEditorClient::checkTextOfParagraph):
41 (WebKit::WebEditorClient::getGuessesForWord):
42 (WebKit::WebEditorClient::requestCheckingOfString):
43 * WebProcess/WebCoreSupport/WebEditorClient.h:
45 2016-03-16 Tim Horton <timothy_horton@apple.com>
47 REGRESSION (r192184): CleanMyDrive 2's tutorial window is blank
48 https://bugs.webkit.org/show_bug.cgi?id=155550
49 <rdar://problem/24250689>
51 Reviewed by Dan Bernstein.
53 * UIProcess/API/Cocoa/WKWebView.mm:
54 (-[WKWebView _setDrawsTransparentBackground:]):
55 The app is using this SPI via key-value coding, so just keeping the implementation
56 is sufficient to make AppKit stop throwing an undefined key exception.
57 Log once that this is deprecated (... it's also SPI) and then forward to setDrawsBackground.
59 2016-03-16 Daniel Bates <dabates@apple.com>
61 <video> and <audio> elements do not obey Content Security Policy on redirect
62 https://bugs.webkit.org/show_bug.cgi?id=155509
63 <rdar://problem/10234844>
65 Reviewed by Alex Christensen.
67 Use 0ms as the maximum buffering time for media resource just as we do currently.
69 * WebProcess/Network/WebLoaderStrategy.cpp:
70 (WebKit::maximumBufferingTime):
72 2016-03-16 Chris Dumez <cdumez@apple.com>
74 Unreviewed, rolling out r198235, r198240, r198241, and
77 Causing crashes on ARM
81 "Remove compile time define for SEPARATED_HEAP"
82 https://bugs.webkit.org/show_bug.cgi?id=155508
83 http://trac.webkit.org/changeset/198235
85 "Gardening: build fix after r198235."
86 http://trac.webkit.org/changeset/198240
89 http://trac.webkit.org/changeset/198241
91 "Rename performJITMemcpy to something more inline with our
92 normal webkit function names"
93 https://bugs.webkit.org/show_bug.cgi?id=155525
94 http://trac.webkit.org/changeset/198252
96 2016-03-16 Commit Queue <commit-queue@webkit.org>
98 Unreviewed, rolling out r196803.
99 https://bugs.webkit.org/show_bug.cgi?id=155534
101 Introduced several rendering issues in popular websites
102 (Requested by KaL on #webkit).
106 "[GTK] Limit the number of tiles according to the visible
108 https://bugs.webkit.org/show_bug.cgi?id=126122
109 http://trac.webkit.org/changeset/196803
111 2016-03-15 Enrica Casucci <enrica@apple.com>
113 Follow up to r195769.
114 https://bugs.webkit.org/show_bug.cgi?id=155519
115 rdar://problem/25146483
117 Reviewed by Tim Horton.
119 There are two code paths that lead to calling handleSyntheticClick()
120 where we need to check if the default action can be performed on the
122 Only one was covered in r195769 and this patch addresses the missing one.
123 I've also discovered that the point reported in DidNotHandleTapAsClick was
124 incorrectly always (0, 0) and I've fixed it.
126 * WebProcess/WebPage/ios/WebPageIOS.mm:
127 (WebKit::WebPage::handleTap):
129 2016-03-15 Ryan Haddad <ryanhaddad@apple.com>
131 Unreviewed, rolling out r198230.
133 This change caused LayoutTests to fail on Mac
137 "REGRESSION (r194660): Navigating to HTTPS sites may fail with
139 https://bugs.webkit.org/show_bug.cgi?id=155455
140 http://trac.webkit.org/changeset/198230
142 2016-03-15 Oliver Hunt <oliver@apple.com>
144 Remove compile time define for SEPARATED_HEAP
145 https://bugs.webkit.org/show_bug.cgi?id=155508
147 Reviewed by Mark Lam.
149 Remove the feature define.
151 * Configurations/FeatureDefines.xcconfig:
153 2016-03-15 Daniel Bates <dabates@apple.com>
155 REGRESSION (r194660): Navigating to HTTPS sites may fail with error
156 https://bugs.webkit.org/show_bug.cgi?id=155455
157 <rdar://problem/24308793>
159 Reviewed by Alexey Proskuryakov.
161 Fixes an issue where navigating to an HTTPS site may fail because the Security Framework uses
162 a cache directory that it does not have permission to use.
164 * Shared/mac/ChildProcessMac.mm:
165 (WebKit::codeSigningIdentifierForProcess): Queries the Security Framework for the code signed
166 bundle identifier/code signing identifier.
167 (WebKit::ChildProcess::initializeSandbox): Use the client identifier as part of the user directory
168 suffix. Verify that the client identifier matches the code signed bundled identifier/code
169 signing identifier for the code signed app/tool. Fix minor code style issue; use a C++-style cast
170 instead of a C-style cast when casting an OSStatus to a long.
171 (WebKit::findSecCodeForProcess): Deleted; incorporated logic into WebKit::codeSigningIdentifierForProcess().
173 2016-03-15 Antti Koivisto <antti@apple.com>
175 Add Antti to WebKit2 Owners file
176 https://bugs.webkit.org/show_bug.cgi?id=155504
178 Reviewed by Anders Carlsson and Sam Weinig.
182 2016-03-15 Gyuyoung Kim <gyuyoung.kim@webkit.org>
184 EFL build has been broken since r198180
185 https://bugs.webkit.org/show_bug.cgi?id=155488
187 Unreviewed build fix.
189 * WebProcess/UserContent/WebUserContentController.h: Use ENABLE(USER_MESSAGE_HANDLERS) guard.
191 2016-03-15 Chris Dumez <cdumez@apple.com>
193 Regression(r197939): ASSERTION FAILED: url.containsOnlyASCII() in URL.cpp
194 https://bugs.webkit.org/show_bug.cgi?id=155449
195 <rdar://problem/25134826>
197 Reviewed by Carlos Garcia Campos.
199 Bump WK2 Network Disk Cache version after r197939 as the new cache format
200 is not compatible with the old one and leads to assertions being hit when
201 browsing in Debug builds.
203 SubresourceInfo used to only contain a boolean and would therefore be
204 serialized as "0" / "1". However, after r197939, a URL field was added
205 and when trying to decode old cache entries with the new format, we
206 would try to construct a URL from the String "0" or "1". This would
207 assert because these are not valid URLs.
209 * NetworkProcess/cache/NetworkCacheStorage.h:
211 2016-03-14 Chris Dumez <cdumez@apple.com>
213 Unreviewed, rolling out r197981.
215 Caused a massive PLT regression on Mac.
219 "Font antialiasing (smoothing) changes when elements are
220 rendered into compositing layers"
221 https://bugs.webkit.org/show_bug.cgi?id=23364
222 http://trac.webkit.org/changeset/197981
224 2016-03-14 Sam Weinig <sam@webkit.org>
226 Add a baseURL parameter to _WKUserStyleSheet
227 https://bugs.webkit.org/show_bug.cgi?id=155219
229 Reviewed by Tim Horton.
231 - Moves to a model for user content where instead of using a WebCore::UserContentController
232 object, we implement the new WebCore::UserContentProvider interface (on the existing
233 WebUserContentController object).
234 - Uses this to maintain maps of UserStylesSheets and UserScripts along with their identifiers,
235 freeing up the URL, which had been acting as the identifier, to be used as the baseURL which
236 was what it was intended for.
237 - Adds a baseURL property to _WKUserStyleSheet.
239 * WebKit2.xcodeproj/project.pbxproj:
242 * Scripts/webkit/messages.py:
244 Add support for sending WebUserContentControllerDataTypes.
246 * Shared/WebUserContentControllerDataTypes.cpp: Added.
247 (WebKit::WebUserScriptData::encode):
248 (WebKit::WebUserScriptData::decode):
249 (WebKit::WebUserStyleSheetData::encode):
250 (WebKit::WebUserStyleSheetData::decode):
251 * Shared/WebUserContentControllerDataTypes.h: Added.
252 Add helper types for sending user content over IPC.
254 * UIProcess/API/APIUserScript.cpp:
255 (API::UserScript::generateUniqueURL):
256 (API::UserScript::UserScript):
257 * UIProcess/API/APIUserScript.h:
258 * UIProcess/API/APIUserStyleSheet.cpp:
259 (API::UserStyleSheet::generateUniqueURL):
260 (API::UserStyleSheet::UserStyleSheet):
261 * UIProcess/API/APIUserStyleSheet.h:
262 Add identifiers for tracking across processes.
264 * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
265 * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
266 (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
267 (-[_WKUserStyleSheet baseURL]):
268 Add new initializer which takes a baseURL as well as an accessor for the baseURL.
270 * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
271 (WebKit::WebUserContentControllerProxy::addProcess):
272 (WebKit::WebUserContentControllerProxy::addUserScript):
273 (WebKit::WebUserContentControllerProxy::removeUserScript):
274 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
275 (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
276 Pass identifiers as well as user content.
278 * WebProcess/InjectedBundle/InjectedBundle.cpp:
279 (WebKit::InjectedBundle::addUserScript):
280 (WebKit::InjectedBundle::addUserStyleSheet):
281 Move user content in via move semantics rather than using a unique_ptr.
283 (WebKit::InjectedBundle::removeUserScript):
284 (WebKit::InjectedBundle::removeUserStyleSheet):
285 (WebKit::InjectedBundle::removeUserScripts):
286 (WebKit::InjectedBundle::removeUserStyleSheets):
287 (WebKit::InjectedBundle::removeAllUserContent):
288 Update for new function signatures.
290 * WebProcess/UserContent/WebUserContentController.cpp:
291 (WebKit::WebUserContentController::WebUserContentController):
292 (WebKit::WebUserContentController::~WebUserContentController):
293 (WebKit::WebUserContentController::addUserContentWorlds):
294 (WebKit::WebUserContentController::removeUserContentWorlds):
295 (WebKit::WebUserContentController::addUserScripts):
296 (WebKit::WebUserContentController::removeUserScript):
297 (WebKit::WebUserContentController::removeAllUserScripts):
298 (WebKit::WebUserContentController::addUserStyleSheets):
299 (WebKit::WebUserContentController::removeUserStyleSheet):
300 (WebKit::WebUserContentController::removeAllUserStyleSheets):
301 (WebKit::WebUserContentController::addUserScriptMessageHandlers):
302 (WebKit::WebUserContentController::removeUserScriptMessageHandler):
303 (WebKit::WebUserContentController::addUserContentExtensions):
304 (WebKit::WebUserContentController::removeUserContentExtension):
305 (WebKit::WebUserContentController::removeAllUserContentExtensions):
306 (WebKit::WebUserContentController::addUserScriptInternal):
307 (WebKit::WebUserContentController::addUserScript):
308 (WebKit::WebUserContentController::removeUserScriptWithURL):
309 (WebKit::WebUserContentController::removeUserScriptInternal):
310 (WebKit::WebUserContentController::removeUserScripts):
311 (WebKit::WebUserContentController::addUserStyleSheetInternal):
312 (WebKit::WebUserContentController::addUserStyleSheet):
313 (WebKit::WebUserContentController::removeUserStyleSheetWithURL):
314 (WebKit::WebUserContentController::removeUserStyleSheetInternal):
315 (WebKit::WebUserContentController::removeUserStyleSheets):
316 (WebKit::WebUserContentController::removeAllUserContent):
317 (WebKit::WebUserContentController::forEachUserScript):
318 (WebKit::WebUserContentController::forEachUserStyleSheet):
319 * WebProcess/UserContent/WebUserContentController.h:
320 * WebProcess/UserContent/WebUserContentController.messages.in:
321 Convert to inheriting from UserContentProvider, rather than containing a UserContentController.
322 This means adding the storage for the user content, which has been simplified to avoid using
325 * WebProcess/WebPage/WebPage.cpp:
326 (WebKit::WebPage::addUserScript):
327 (WebKit::WebPage::addUserStyleSheet):
328 (WebKit::WebPage::removeAllUserContent):
329 Update to call the WebUserContentController, rather than going to the UserContentController, which
332 * WebProcess/WebPage/WebPageGroupProxy.cpp:
333 (WebKit::WebPageGroupProxy::userContentController):
334 * WebProcess/WebPage/WebPageGroupProxy.h:
335 Return the WebUserContentController rather than old UserContentController.
337 2016-03-14 Joonghun Park <jh718.park@samsung.com>
339 Purge PassRefPtr from ArrayBuffer, ArchiveResource, Pasteboard, LegacyWebArchive and DataObjectGtk
340 https://bugs.webkit.org/show_bug.cgi?id=150497
342 Reviewed by Darin Adler.
344 * Shared/APIWebArchive.mm:
345 (API::WebArchive::WebArchive):
346 * Shared/APIWebArchiveResource.mm:
347 (API::WebArchiveResource::data):
348 * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
349 (WebKit::PDFPlugin::addArchiveResource):
350 * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
351 (WebKit::WebPlatformStrategies::bufferForType):
352 (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
353 * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
354 * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
355 (WebKit::WebEditorClient::documentFragmentFromAttributedString):
356 * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
357 (WebKit::WebDragClient::declareAndWriteDragImage):
358 * WebProcess/WebPage/WebFrame.cpp:
359 (WebKit::WebFrame::webArchiveData):
360 * WebProcess/WebPage/WebPage.cpp:
361 (WebKit::resourceDataForFrame):
363 2016-03-14 Oliver Hunt <oliver@apple.com>
365 Temporarily disable the separated heap.
366 https://bugs.webkit.org/show_bug.cgi?id=155472
368 Reviewed by Geoffrey Garen.
370 Temporarily disable this.
372 * Configurations/FeatureDefines.xcconfig:
374 2016-03-14 Beth Dakin <bdakin@apple.com>
376 [iOS] WKPreviewAction conforms to NSCopying but doesn’t override -
378 https://bugs.webkit.org/show_bug.cgi?id=155395
380 Reviewed by Sam Weinig.
382 * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
383 (-[WKPreviewAction copyWithZone:]):
385 2016-03-14 Anders Carlsson <andersca@apple.com>
387 Remove usage of -[UIGestureRecognizer requireOtherGestureToFail:]
388 https://bugs.webkit.org/show_bug.cgi?id=155461
389 rdar://problem/25143282
391 Reviewed by Beth Dakin.
393 Use -[UIGestureRecognizer requireGestureRecognizerToFail:] instead, which has been API ever since UIGestureRecognizer was added.
395 * Platform/spi/ios/UIKitSPI.h:
396 * UIProcess/ios/WKContentViewInteraction.mm:
397 (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
399 2016-03-14 Anders Carlsson <andersca@apple.com>
401 REGRESSION (r191691): Can't Share Selected Text
402 https://bugs.webkit.org/show_bug.cgi?id=155459
403 rdar://problem/24893625
405 Reviewed by Tim Horton.
407 Add the selected text as well. Somehow this got lost in the refactoring.
409 * UIProcess/mac/WebContextMenuProxyMac.mm:
410 (WebKit::WebContextMenuProxyMac::createShareMenuItem):
412 2016-03-14 Tim Horton <timothy_horton@apple.com>
414 Revert r194125 and r194186: We're going to fix this a different way.
416 * Shared/NativeWebGestureEvent.h:
417 * Shared/mac/NativeWebGestureEventMac.mm:
418 (WebKit::pointForEvent):
419 (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
420 (WebKit::distanceForTouches): Deleted.
421 * UIProcess/API/Cocoa/WKWebView.mm:
422 (-[WKWebView selectFindMatch:completionHandler:]):
423 (-[WKWebView _web_superInputContext]):
424 (-[WKWebView touchesBeganWithEvent:]): Deleted.
425 (-[WKWebView touchesMovedWithEvent:]): Deleted.
426 (-[WKWebView touchesEndedWithEvent:]): Deleted.
427 (-[WKWebView touchesCancelledWithEvent:]): Deleted.
428 * UIProcess/API/mac/WKView.mm:
429 (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
430 (-[WKView initWithFrame:processPool:configuration:webView:]):
431 (-[WKView touchesBeganWithEvent:]): Deleted.
432 (-[WKView touchesMovedWithEvent:]): Deleted.
433 (-[WKView touchesEndedWithEvent:]): Deleted.
434 (-[WKView touchesCancelledWithEvent:]): Deleted.
435 * UIProcess/Cocoa/WebViewImpl.h:
436 * UIProcess/Cocoa/WebViewImpl.mm:
437 (WebKit::WebViewImpl::WebViewImpl):
438 (WebKit::WebViewImpl::magnifyWithEvent):
439 (WebKit::WebViewImpl::smartMagnifyWithEvent):
440 (WebKit::WebViewImpl::rotateWithEvent):
441 (WebKit::WebViewImpl::touchesOrderedByAge): Deleted.
442 (WebKit::WebViewImpl::touchesBeganWithEvent): Deleted.
443 (WebKit::WebViewImpl::touchesMovedWithEvent): Deleted.
444 (WebKit::WebViewImpl::touchesEndedWithEvent): Deleted.
445 (WebKit::WebViewImpl::touchesCancelledWithEvent): Deleted.
447 2016-03-14 Anders Carlsson <andersca@apple.com>
451 Create an empty PDF selection.
453 * Shared/mac/PDFKitImports.h:
454 * Shared/mac/PDFKitImports.mm:
455 (WebKit::pdfSelectionClass):
456 * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
457 (WebKit::PDFPlugin::nextMatchForString):
459 2016-03-14 Beth Dakin <bdakin@apple.com>
461 Unable to commit previews in Mobile Safari
462 https://bugs.webkit.org/show_bug.cgi?id=155450
464 rdar://problem/25135529
466 Reviewed by Tim Horton.
468 _uiDelegateProvidedPreviewingViewController was being consulted before
469 invoking the old SPI, which was always wrong. It should have been consulted
470 before calling the new API! But also, it doesn’t seem to be necessary at all
471 since [WKContentView _previewItemController:commitPreview:] is only invoked
472 when a custom view controller has been provided.
474 * UIProcess/ios/WKContentViewInteraction.h:
475 * UIProcess/ios/WKContentViewInteraction.mm:
476 (-[WKContentView _registerPreview]):
477 (-[WKContentView _unregisterPreview]):
478 (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
479 (-[WKContentView _presentedViewControllerForPreviewItemController:]):
480 (-[WKContentView _previewItemController:commitPreview:]):
482 2016-03-14 Brent Fulgham <bfulgham@apple.com>
484 PingHandle delete's itself but pointer is still used by handleDataURL
485 https://bugs.webkit.org/show_bug.cgi?id=154752
486 <rdar://problem/24872347>
488 Reviewed by Alex Christensen.
490 When a PingLoad is destroyed, we should tell its client so that the client can clear the pointer it
491 holds to the element to avoid accidentally attempting to use deallocated memory.
493 * NetworkProcess/PingLoad.h:
494 (WebKit::PingLoad::~PingLoad): Notify the client we are being destroyed.
496 2016-03-14 Carlos Garcia Campos <cgarcia@igalia.com>
498 Unreviewed. Fix the GTK+ build after r198124.
500 WebsiteDataTypes is now an OptionSet.
502 * UIProcess/API/gtk/WebKitWebContext.cpp:
503 (webkit_web_context_clear_cache):
505 2016-03-14 Carlos Garcia Campos <cgarcia@igalia.com>
507 [GTK] Reimplement webkit_web_context_clear_cache functionality.
508 https://bugs.webkit.org/show_bug.cgi?id=146041
510 Reviewed by Michael Catanzaro.
512 * UIProcess/API/gtk/WebKitWebContext.cpp:
513 (webkit_web_context_clear_cache):
515 2016-03-14 Jeremy Huddleston Sequoia <jeremyhu@apple.com>
517 Install WebKit2 WebProcess NetworkProcess on OSX when not building the Mac PORT
518 https://bugs.webkit.org/show_bug.cgi?id=152651
520 Reviewed by Philippe Normand.
524 2016-03-13 Joseph Pecoraro <pecoraro@apple.com>
526 Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
527 https://bugs.webkit.org/show_bug.cgi?id=155417
529 Reviewed by Yusuke Suzuki.
531 * Configurations/FeatureDefines.xcconfig:
533 2016-03-13 Dan Bernstein <mitz@apple.com>
535 [Mac] Injected bundle in relocatable WebContent service can’t use XPC services from other relocatable frameworks
536 https://bugs.webkit.org/show_bug.cgi?id=155414
537 <rdar://problem/24428418>
539 Reviewed by Sam Weinig.
541 * Configurations/DebugRelease.xcconfig:
542 Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to NO, because
543 engineering builds are ad-hoc signed and therefore can’t have a private entitlement.
545 * Configurations/WebContent-OSX.entitlements: Added. Includes the XPC domain extension
548 * Configurations/WebContentService.xcconfig:
549 Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to YES if not already set
550 and the framework is relocatable. Set CODE_SIGN_ENTITLEMENTS to the new entitlements file
551 if the domain extension entitlement is needed.
553 * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
555 2016-03-13 Dean Jackson <dino@apple.com>
557 <attachment> should be a runtime-enabled feature
558 https://bugs.webkit.org/show_bug.cgi?id=155413
559 <rdar://problem/25120753>
561 Reviewed by Sam Weinig and Anders Carlsson.
563 Add an internal setting on WKWebViewConfiguration
564 to enable the <attachment> element support.
566 * Shared/WebPreferencesDefinitions.h:
567 * UIProcess/API/Cocoa/WKWebView.mm:
568 (-[WKWebView _initializeWithConfiguration:]):
569 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
570 (-[WKWebViewConfiguration init]):
571 (-[WKWebViewConfiguration copyWithZone:]):
572 (-[WKWebViewConfiguration _attachmentElementEnabled]):
573 (-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
574 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
575 * WebProcess/WebPage/WebPage.cpp:
576 (WebKit::WebPage::updatePreferences):
578 2016-03-12 Sam Weinig <sam@webkit.org>
580 WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
581 <rdar://problem/25129946>
582 https://bugs.webkit.org/show_bug.cgi?id=155401
584 Reviewed by Alex Christensen.
586 The issue was that NSURLSessionDataTasks can continue to invoke their NSURLSession's delegate methods
587 after -[NSURLSession invalidateAndCancel] is called. So, when the NetworkSession was destroyed, and
588 still had outstanding data tasks, the session delegate would get called, try to use the session, and
589 crash. To fix this I:
591 - Made NetworkSession RefCounted.
592 - Gave NetworkSession two delegates, one for each NSURLSession.
593 - Made each delegate have a strong reference to the NetworkSession that gets cleared out in the
594 newly implemented URLSession:didBecomeInvalidWithError: method.
595 - Changed from simply destroying the NetworkSession in SessionTracker::destroySession(), to derefing
596 it and explicitly calling invalidateAndCancel on the two associated NSURLSessions (which in turn
597 eventually cause the URLSession:didBecomeInvalidWithError: to fire).
598 - To ensure the correct lifetime of the WebCore::NetworkStorageSession, I made it a member of the
599 NetworkSession. This also allowed some simplification inside SessionTracker.
601 * NetworkProcess/NetworkDataTask.h:
602 (WebKit::NetworkDataTask::setPendingDownload):
603 (WebKit::NetworkDataTask::pendingDownloadLocation):
604 * NetworkProcess/NetworkLoad.cpp:
605 (WebKit::NetworkLoad::NetworkLoad):
606 * NetworkProcess/NetworkSession.h:
607 (WebKit::NetworkSession::sessionID):
608 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
609 (WebKit::NetworkDataTask::NetworkDataTask):
610 (WebKit::NetworkDataTask::~NetworkDataTask):
611 (WebKit::NetworkDataTask::willPerformHTTPRedirection):
612 (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
613 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
614 (-[WKNetworkSessionDelegate initWithNetworkSession:]):
615 (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
616 (WebKit::NetworkSession::setCustomProtocolManager):
617 (WebKit::NetworkSession::create):
618 (WebKit::NetworkSession::defaultSession):
619 (WebKit::NetworkSession::NetworkSession):
620 (WebKit::NetworkSession::~NetworkSession):
621 (WebKit::NetworkSession::invalidateAndCancel):
622 (WebKit::NetworkSession::networkStorageSession):
623 (WebKit::NetworkSession::clearCredentials):
624 * NetworkProcess/mac/RemoteNetworkingContext.mm:
625 (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
626 * Shared/SessionTracker.cpp:
627 (WebKit::identifierBase):
628 (WebKit::SessionTracker::getIdentifierBase):
629 (WebKit::SessionTracker::setIdentifierBase):
630 (WebKit::staticSessionMap):
631 (WebKit::SessionTracker::networkSession):
632 (WebKit::SessionTracker::storageSession):
633 (WebKit::staticStorageSessionMap):
634 (WebKit::SessionTracker::sessionID):
635 (WebKit::SessionTracker::setSession):
636 (WebKit::SessionTracker::destroySession):
637 (WebKit::SessionTracker::forEachNetworkStorageSession):
638 (WebKit::storageSessionToID): Deleted.
639 (WebKit::SessionTracker::storageSessionMap): Deleted.
640 * Shared/SessionTracker.h:
641 * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
642 (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
643 (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
644 (WebKit::WebFrameNetworkingContext::localFileContentSniffingEnabled):
645 (WebKit::WebFrameNetworkingContext::scheduledRunLoopPairs):
646 * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
647 (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
648 (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
649 (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
651 2016-03-12 Myles C. Maxfield <mmaxfield@apple.com>
653 Delete dead SVG Font code
654 https://bugs.webkit.org/show_bug.cgi?id=154718
656 Reviewed by Antti Koivisto.
658 * Configurations/FeatureDefines.xcconfig:
660 2016-03-12 Beth Dakin <bdakin@apple.com>
662 Make preview inline navigation work API
663 https://bugs.webkit.org/show_bug.cgi?id=155383
665 rdar://problem/25117985
667 Reviewed by Dan Bernstein.
670 _WKElementInfo is now WKElementInfo in file and class names. Header is now
673 _WKPreviewElementInfo is now WKPreviewElementInfo in file and class names.
674 Header is now public.
676 _WKPreviewAction is now WKPreviewActionItem in filenames (header is now
677 public), the protocol _WKPreviewActionItem is now WKPreviewActionItem, and
678 the _WKPreviewAction class is now WKPreviewAction. (The internal header is
679 still project, of course.)
681 WKPreviewActionIdentifiersPrivate.h/mm is now
682 WKPreviewActionItemIdentifiers.h/mm and all the the identifiers have been
683 updated. Header is now public.
685 * Shared/API/Cocoa/WebKit.h:
686 * UIProcess/API/Cocoa/WKElementInfo.h: Copied from UIProcess/API/Cocoa/_WKElementInfo.h.
687 * UIProcess/API/Cocoa/WKElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKElementInfo.mm.
688 (-[WKElementInfo copyWithZone:]):
689 (-[_WKElementInfo copyWithZone:]): Deleted.
690 * UIProcess/API/Cocoa/WKElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKElementInfoInternal.h.
691 * UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h: Removed.
692 * UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm: Removed.
693 * UIProcess/API/Cocoa/WKPreviewActionItem.h: Copied from UIProcess/API/Cocoa/_WKPreviewAction.h.
694 * UIProcess/API/Cocoa/WKPreviewActionItem.mm: Copied from UIProcess/API/Cocoa/_WKPreviewAction.mm.
695 * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h.
696 * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm.
697 * UIProcess/API/Cocoa/WKPreviewActionItemInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewActionInternal.h.
698 * UIProcess/API/Cocoa/WKPreviewElementInfo.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.h.
699 * UIProcess/API/Cocoa/WKPreviewElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.mm.
700 (-[WKPreviewElementInfo _initWithLinkURL:]):
701 (-[_WKPreviewElementInfo _initWithLinkURL:]): Deleted.
702 * UIProcess/API/Cocoa/WKPreviewElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h.
703 * UIProcess/API/Cocoa/WKUIDelegate.h:
704 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
705 * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
706 * UIProcess/API/Cocoa/_WKElementInfo.h: Removed.
707 * UIProcess/API/Cocoa/_WKElementInfo.mm: Removed.
708 * UIProcess/API/Cocoa/_WKElementInfoInternal.h: Removed.
709 * UIProcess/API/Cocoa/_WKPreviewAction.h: Removed.
710 * UIProcess/API/Cocoa/_WKPreviewAction.mm: Removed.
711 * UIProcess/API/Cocoa/_WKPreviewActionInternal.h: Removed.
712 * UIProcess/API/Cocoa/_WKPreviewElementInfo.h: Removed.
713 * UIProcess/API/Cocoa/_WKPreviewElementInfo.mm: Removed.
714 * UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h: Removed.
715 * UIProcess/ios/WKContentViewInteraction.mm:
716 (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
717 (previewIdentifierForElementAction):
718 (-[WKContentView _presentedViewControllerForPreviewItemController:]):
719 (-[WKContentView _previewItemController:commitPreview:]):
720 * WebKit2.xcodeproj/project.pbxproj:
722 2016-03-12 Jeremy Huddleston Sequoia <jeremyhu@apple.com>
724 [GTK][Mac] Use DYLD_LIBRARY_PATH on OSX rather then LD_LIBRARY_PATH
725 https://bugs.webkit.org/show_bug.cgi?id=152650
727 Reviewed by Carlos Garcia Campos.
731 2016-03-11 John Wilander <wilander@apple.com>
733 Move prevalent resource classifier from WebCore to WebKit.
734 https://bugs.webkit.org/show_bug.cgi?id=155242
735 <rdar://problem/24913272>
737 Reviewed by Andy Estes.
739 * UIProcess/WebResourceLoadStatisticsStore.cpp:
740 (WebKit::WebResourceLoadStatisticsStore::create):
741 (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
742 (WebKit::hasPrevalentResourceCharacteristics):
743 (WebKit::classifyPrevalentResources):
744 - Moved these two functions from WebCore.
745 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
746 - Calls processStatistics with a lamda function to classify prevalent resources.
747 * WebKit2.xcodeproj/project.pbxproj:
748 - Fixed the ordering of source files.
750 2016-03-11 Sam Weinig <sam@webkit.org>
752 WebKit needs a new sandbox profile addition for DataDetectors
753 <rdar://problem/25091102>
755 Reviewed by Brent Fulgham.
757 * WebProcess/com.apple.WebProcess.sb.in:
759 2016-03-11 Chris Dumez <cdumez@apple.com>
761 Regression(r198040): WebKit2.DocumentStartUserScriptAlertCrashTest API test is crashing in debug
762 https://bugs.webkit.org/show_bug.cgi?id=155382
764 Reviewed by Alexey Proskuryakov.
766 r198040 introduced an assertion to make sure we never call
767 applicationBundleIsEqualTo() before setApplicationBundleIdentifier()
768 is called. This new assertion found a bug as it turns out we were
769 calling setApplicationBundleIdentifier() too late during the
770 WebProcess initialization and some runtime applications checks were
771 already done by then.
773 To address the problem, this patch moves the
774 setApplicationBundleIdentifier() call as early as possible during
775 the WebProcess and the NetworkProcess initialization. It also moves
776 it to the Cocoa specific files for clarity.
778 * NetworkProcess/NetworkProcess.cpp:
779 (WebKit::NetworkProcess::initializeNetworkProcess):
780 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
781 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
782 * WebProcess/WebProcess.cpp:
783 (WebKit::WebProcess::initializeWebProcess):
784 * WebProcess/cocoa/WebProcessCocoa.mm:
785 (WebKit::WebProcess::platformInitializeWebProcess):
787 2016-03-11 Enrica Casucci <enrica@apple.com>
789 Use only selected text for Look up.
790 https://bugs.webkit.org/show_bug.cgi?id=155380
792 Reviewed by Tim Horton.
794 The corresponding piece that uses the extended context for Look up
795 is not ready yet. For the moment default to retrieving the selected text.
797 * UIProcess/ios/WKContentViewInteraction.mm:
798 (-[WKContentView _lookup:]):
800 2016-03-11 Chelsea Pugh <cpugh@apple.com>
802 [iOS] Allow clients to specify text suggestions to be used for a form input session
803 https://bugs.webkit.org/show_bug.cgi?id=155343
805 Reviewed by Dan Bernstein.
807 * UIProcess/API/Cocoa/_WKFormInputSession.h:
808 * UIProcess/API/Cocoa/_WKInputDelegate.h:
809 * UIProcess/ios/WKContentViewInteraction.mm:
810 (-[WKFormInputSession suggestions]): Add a getter for suggestions.
811 (-[WKFormInputSession setSuggestions:]): Add a setter, which calls setSuggestions with our suggestions on the input delegate.
812 (-[WKContentView insertTextSuggestion:]): Call _webView:insertTextSuggestion:inInputSession: on our input delegate so clients know
813 a text suggestion was tapped.
815 2016-03-11 Anders Carlsson <andersca@apple.com>
817 Creating and releasing a WKBackForwardListItem crashes
818 https://bugs.webkit.org/show_bug.cgi?id=155376
819 rdar://problem/17377712
821 Reviewed by Dan Bernstein.
823 Make init unavailable.
825 * UIProcess/API/Cocoa/WKBackForwardListItem.h:
827 2016-03-11 Beth Dakin <bdakin@apple.com>
831 _WKPreviewAction should be in an internal header
832 https://bugs.webkit.org/show_bug.cgi?id=155370
834 Rubber-stamped by Dan Bernstein.
836 * UIProcess/API/Cocoa/_WKPreviewActionInternal.h:
838 2016-03-11 Beth Dakin <bdakin@apple.com>
840 _WKPreviewAction should be in an internal header
841 https://bugs.webkit.org/show_bug.cgi?id=155370
843 Reviewed by Tim Horton.
845 Move _WKPreviewAction to an Internal header since only the protocol needs to
847 * UIProcess/API/Cocoa/_WKPreviewAction.h:
848 * UIProcess/API/Cocoa/_WKPreviewAction.mm:
849 * UIProcess/API/Cocoa/_WKPreviewActionInternal.h: Added.
850 * UIProcess/ios/WKContentViewInteraction.mm:
851 * WebKit2.xcodeproj/project.pbxproj:
853 2016-03-11 Yusuke Suzuki <utatane.tea@gmail.com>
855 [ES6] Implement Reflect.set without receiver support
856 https://bugs.webkit.org/show_bug.cgi?id=155024
858 Reviewed by Geoffrey Garen.
860 NPJSObject::setProperty may call `methodTable()->put` operation, but we intentionally do not propagate it to the caller's ::put.
861 In the current implementation, we just use the result of ::setProperty call.
862 This is `true` when ::setProperty attempts to call `methodTable()->put`.
863 In ::setProperty, after calling `methodTable()->put`, ::setProperty function clears the exception state.
864 So this is not the same semantics to the simple data property store. Rather, this is like the accessor.
865 In ECMA262 [[Set]], it returns true if there is a setter. So we just use the returned value of ::setProperty.
866 This indicates that there is a setter for the given [[Set]] operation.
868 * WebProcess/Plugins/Netscape/JSNPObject.cpp:
869 (WebKit::JSNPObject::put):
870 * WebProcess/Plugins/Netscape/JSNPObject.h:
872 2016-03-10 David Kilzer <ddkilzer@apple.com>
874 REGRESSION (r197986): Don't try to link to undefined $(WEBKIT_SYSTEM_INTERFACE_LIBRARY)
876 Follow-up build fix for:
877 AX: Force allow user zoom
878 <https://bugs.webkit.org/show_bug.cgi?id=155056>
880 Fixes the following build failure:
881 ld: library not found for -l-lAccessibility
882 clang: error: linker command failed with exit code 1 (use -v to see invocation)
884 * Configurations/WebKit.xcconfig: Remove
885 "-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)" from OTHER_LDFLAGS since
886 that macro is not defined, and there is no need to link to
887 libWebKitSystemInterface.a.
889 2016-03-10 Jeremy Jones <jeremyj@apple.com>
891 Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
892 https://bugs.webkit.org/show_bug.cgi?id=155117
893 rdar://problem/6802240
895 Reviewed by Simon Fraser.
897 Make AVAsset AVURLAssetUsesNoPersistentCacheKey match !m_websiteDataStore->isPersistent()
898 This will prevent persistent media caches when webkit is using in-memory caching.
900 * Shared/WebPageCreationParameters.cpp: Add mediaShouldUsePersistentCache.
901 (WebKit::WebPageCreationParameters::encode):
902 (WebKit::WebPageCreationParameters::decode):
903 * Shared/WebPageCreationParameters.h:
904 * UIProcess/WebPageProxy.cpp:
905 (WebKit::WebPageProxy::creationParameters): Add mediaShouldUsePersistentCache.
906 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
907 (WebKit::WebChromeClient::mediaShouldUsePersistentCache): Added.
908 * WebProcess/WebCoreSupport/WebChromeClient.h:
909 * WebProcess/WebPage/WebPage.cpp:
910 (WebKit::m_mediaUsesPersistentCache): Added.
911 * WebProcess/WebPage/WebPage.h:
912 (WebKit::WebPage::mediaShouldUsePersistentCache): Added.
914 2016-03-10 Nan Wang <n_wang@apple.com>
916 AX: Force allow user zoom
917 https://bugs.webkit.org/show_bug.cgi?id=155056
919 Reviewed by Simon Fraser.
921 Linked libAccessibility library so that we can observe the accessibility
922 setting change for the force always user scalable feature.
924 * Configurations/WebKit.xcconfig:
925 * UIProcess/API/Cocoa/WKWebView.mm:
926 (shouldAllowPictureInPictureMediaPlayback):
927 (forceAlwaysUserScalableChangedCallback):
928 (-[WKWebView _initializeWithConfiguration:]):
929 (-[WKWebView dealloc]):
930 (-[WKWebView _navigationGestureDidEnd]):
931 (-[WKWebView _updateForceAlwaysUserScalable]):
932 * UIProcess/API/Cocoa/WKWebViewInternal.h:
933 * UIProcess/WebPageProxy.h:
934 * UIProcess/ios/WebPageProxyIOS.mm:
935 (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
936 (WebKit::WebPageProxy::updateForceAlwaysUserScalable):
937 (WebKit::WebPageProxy::setMaximumUnobscuredSize):
938 * WebProcess/WebPage/WebPage.cpp:
939 (WebKit::WebPage::updatePreferences):
940 * WebProcess/WebPage/WebPage.h:
941 * WebProcess/WebPage/WebPage.messages.in:
942 * WebProcess/WebPage/ios/WebPageIOS.mm:
943 (WebKit::WebPage::disableInspectorNodeSearch):
944 (WebKit::WebPage::updateForceAlwaysUserScalable):
945 (WebKit::innerFrameQuad):
947 2016-03-10 Simon Fraser <simon.fraser@apple.com>
949 Font antialiasing (smoothing) changes when elements are rendered into compositing layers
950 https://bugs.webkit.org/show_bug.cgi?id=23364
952 Reviewed by Tim Horton.
954 Send the ContentsFormat to the UI process (but nothing happens to it there yet).
956 Allow internal clients to turn off smoothed layer text, so that WebKitTestRunner
959 * Shared/WebProcessCreationParameters.cpp:
960 (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
961 (WebKit::WebProcessCreationParameters::encode):
962 (WebKit::WebProcessCreationParameters::decode):
963 * Shared/WebProcessCreationParameters.h:
964 * Shared/mac/RemoteLayerTreeTransaction.h:
965 * Shared/mac/RemoteLayerTreeTransaction.mm:
966 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
967 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
968 * UIProcess/API/C/WKContext.cpp:
969 (WKContextEnableSmoothedLayerText):
970 * UIProcess/API/C/WKContextPrivate.h:
971 * UIProcess/WebProcessPool.cpp:
972 (WebKit::WebProcessPool::createNewWebProcess):
973 (WebKit::WebProcessPool::enableSmoothedLayerText):
974 (WebKit::WebProcessPool::WebProcessPool): Deleted.
975 * UIProcess/WebProcessPool.h:
976 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
977 (WebKit::PlatformCALayerRemote::setContentsFormat):
978 (WebKit::PlatformCALayerRemote::contentsFormat):
979 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
980 * WebProcess/WebProcess.cpp:
981 (WebKit::WebProcess::initializeWebProcess):
982 (WebKit::WebProcess::enableSmoothedLayerText):
983 * WebProcess/WebProcess.h:
984 * WebProcess/WebProcess.messages.in:
986 2016-03-10 Enrica Casucci <enrica@apple.com>
988 Expose additional WKDataDetectorTypes.
989 https://bugs.webkit.org/show_bug.cgi?id=155331
990 rdar://problem/24175813
992 Reviewed by Tim Horton.
994 Adding API to enable data detection of tracking numbers,
995 flight number and spotlight suggestions.
997 * UIProcess/API/Cocoa/WKWebView.mm:
998 (fromWKDataDetectorTypes):
999 * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1001 2016-03-10 Beth Dakin <bdakin@apple.com>
1003 defaultActions in UIDelegate method
1004 _webView:previewingViewControllerForElement:defaultActions: need to be
1005 use-able by a client
1006 https://bugs.webkit.org/show_bug.cgi?id=155304
1008 rdar://problem/24269296
1010 Reviewed by Anders Carlsson.
1012 This patch adds a new protocol, WKPreviewActionItem, which is a sub-protocol
1013 of UIPreviewActionItem. The new protocol adds an identifier so that clients
1014 can identify which of our default actions they want to use. In order for a
1015 client to use our default action items, they need to return those actions in
1016 their UIViewController's implementation of previewActionItems.
1018 Change the defaultActions to NSArray <id <WKPreviewActionItem>> *
1019 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1021 This new file defines our sub-protocol and sub-class for WKPreviewActions.
1022 * UIProcess/API/Cocoa/_WKPreviewAction.h: Added.
1023 * UIProcess/API/Cocoa/_WKPreviewAction.mm: Added.
1024 (+[_WKPreviewAction actionWithIdentifier:title:style:handler:]):
1026 New BOOL _uiDelegateProvidedPreviewingViewController keeps track of whether
1027 the client returned a view controller from
1028 _webView:previewingViewControllerForElement:defaultActions:. If they did
1029 return a view controller, then we should invoke
1030 _webView:commitPreviewingViewController: at commit time. If they returned
1031 nil, then they indicated that WebKit should continue with default previewing
1032 behavior, so we will not invoke the UIDelegate’s commit method.
1033 * UIProcess/ios/WKContentViewInteraction.h:
1034 * UIProcess/ios/WKContentViewInteraction.mm:
1035 (-[WKContentView _registerPreview]):
1036 (-[WKContentView _unregisterPreview]):
1037 (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1039 In order for our default actions to be useful, we have to create
1041 (-[WKContentView _presentedViewControllerForPreviewItemController:]):
1043 Only invoke _webView:commitPreviewedViewController: if
1044 _uiDelegateProvidedPreviewingViewController is YES.
1045 (-[WKContentView _previewItemController:commitPreview:]):
1046 * WebKit2.xcodeproj/project.pbxproj:
1048 2016-03-10 Jer Noble <jer.noble@apple.com>
1050 Add WebCore, WebKit, & WebKit2 preference/setting to enable Main Content heuristic.
1051 https://bugs.webkit.org/show_bug.cgi?id=155326
1052 <rdar://problem/25095408>
1054 Reviewed by Beth Dakin.
1056 Add SPI to get and set the new preference.
1058 * Shared/WebPreferencesDefinitions.h:
1059 * UIProcess/API/C/WKPreferences.cpp:
1060 (WKPreferencesSetMainContentUserGestureOverrideEnabled):
1061 (WKPreferencesGetMainContentUserGestureOverrideEnabled):
1062 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1063 * UIProcess/API/Cocoa/WKWebView.mm:
1064 (-[WKWebView _initializeWithConfiguration:]):
1065 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1066 (-[WKWebViewConfiguration init]):
1067 (-[WKWebViewConfiguration copyWithZone:]):
1068 (-[WKWebViewConfiguration _mainContentUserGestureOverrideEnabled]):
1069 (-[WKWebViewConfiguration _setMainContentUserGestureOverrideEnabled:]):
1070 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1071 * WebProcess/WebPage/WebPage.cpp:
1072 (WebKit::WebPage::updatePreferences):
1074 2016-03-10 Alex Christensen <achristensen@webkit.org>
1076 Remove firing assertion after r197865.
1077 https://bugs.webkit.org/show_bug.cgi?id=155137
1078 rdar://problem/25096835
1080 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1081 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1082 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
1083 This assertion was firing. I'm looking into why.
1085 2016-03-07 Jer Noble <jer.noble@apple.com>
1087 Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally
1088 https://bugs.webkit.org/show_bug.cgi?id=155141
1090 Reviewed by Beth Dakin.
1092 Add a new preference, videoPlaybackRequiresUserGesture, distinct from mediaPlaybackRequiresUserGesture. Legacy clients of
1093 mediaPlaybackRequiresUserGesture will still be able to use it normally, as setting that preference to true will effectively
1094 set both audioPlaybackRequiresUserGesture and videoPlaybackRequiresUserGesture to true. Make these preferences all available
1095 universally, rather than just on PLATFORM(IOS). This requires adding a definition for -setRequiresUserActionForMediaPlayback:
1096 and -requiresUserActionForMediaPlayback on !PLATFORM(IOS).
1098 * Shared/WebPreferencesDefinitions.h:
1099 * UIProcess/API/C/WKPreferences.cpp:
1100 (WKPreferencesSetVideoPlaybackRequiresUserGesture):
1101 (WKPreferencesGetVideoPlaybackRequiresUserGesture):
1102 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1103 * UIProcess/API/Cocoa/WKWebView.mm:
1104 (-[WKWebView _initializeWithConfiguration:]):
1105 (-[WKWebView _setObscuredInsets:]):
1106 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1107 (-[WKWebViewConfiguration init]):
1108 (-[WKWebViewConfiguration encodeWithCoder:]):
1109 (-[WKWebViewConfiguration initWithCoder:]):
1110 (-[WKWebViewConfiguration copyWithZone:]):
1111 (-[WKWebViewConfiguration requiresUserActionForMediaPlayback]):
1112 (-[WKWebViewConfiguration setRequiresUserActionForMediaPlayback:]):
1113 (-[WKWebViewConfiguration allowsInlineMediaPlayback]):
1114 (-[WKWebViewConfiguration setAllowsInlineMediaPlayback:]):
1115 (-[WKWebViewConfiguration _requiresUserActionForVideoPlayback]):
1116 (-[WKWebViewConfiguration _setRequiresUserActionForVideoPlayback:]):
1117 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1118 * WebProcess/WebPage/WebPage.cpp:
1119 (WebKit::WebPage::updatePreferences):
1121 2016-03-10 Commit Queue <commit-queue@webkit.org>
1123 Unreviewed, rolling out r197943.
1124 https://bugs.webkit.org/show_bug.cgi?id=155317
1126 This change broke Windows, WinCairo, GTK and EFL builds
1127 (Requested by ryanhaddad on #webkit).
1131 "Add a baseURL parameter to _WKUserStyleSheet"
1132 https://bugs.webkit.org/show_bug.cgi?id=155219
1133 http://trac.webkit.org/changeset/197943
1135 2016-03-10 Eric Carlson <eric.carlson@apple.com>
1137 [MediaStream] push media stream state to the UI process
1138 https://bugs.webkit.org/show_bug.cgi?id=155281
1140 Reviewed by Dean Jackson.
1142 * UIProcess/WebPageProxy.cpp:
1143 (WebKit::WebPageProxy::didCommitLoadForFrame): Don't clear m_mediaState, it is done in
1144 WebPageProxy::resetState. This reverts a change added in r197929.
1147 2016-03-08 Sam Weinig <sam@webkit.org>
1149 Add a baseURL parameter to _WKUserStyleSheet
1150 https://bugs.webkit.org/show_bug.cgi?id=155219
1152 Reviewed by Tim Horton.
1154 - Moves to a model for user content where instead of using a WebCore::UserContentController
1155 object, we implement the new WebCore::UserContentProvider interface (on the existing
1156 WebUserContentController object).
1157 - Uses this to maintain maps of UserStylesSheets and UserScripts along with their identifiers,
1158 freeing up the URL, which had been acting as the identifier, to be used as the baseURL which
1159 was what it was intended for.
1160 - Adds a baseURL property to _WKUserStyleSheet.
1162 * WebKit2.xcodeproj/project.pbxproj:
1165 * Scripts/webkit/messages.py:
1167 Add support for sending WebUserContentControllerDataTypes.
1169 * Shared/WebUserContentControllerDataTypes.cpp: Added.
1170 (WebKit::WebUserScriptData::encode):
1171 (WebKit::WebUserScriptData::decode):
1172 (WebKit::WebUserStyleSheetData::encode):
1173 (WebKit::WebUserStyleSheetData::decode):
1174 * Shared/WebUserContentControllerDataTypes.h: Added.
1175 Add helper types for sending user content over IPC.
1177 * UIProcess/API/APIUserScript.cpp:
1178 (API::UserScript::generateUniqueURL):
1179 (API::UserScript::UserScript):
1180 * UIProcess/API/APIUserScript.h:
1181 * UIProcess/API/APIUserStyleSheet.cpp:
1182 (API::UserStyleSheet::generateUniqueURL):
1183 (API::UserStyleSheet::UserStyleSheet):
1184 * UIProcess/API/APIUserStyleSheet.h:
1185 Add identifiers for tracking across processes.
1187 * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
1188 * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
1189 (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
1190 (-[_WKUserStyleSheet baseURL]):
1191 Add new initializer which takes a baseURL as well as an accessor for the baseURL.
1193 * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1194 (WebKit::WebUserContentControllerProxy::addProcess):
1195 (WebKit::WebUserContentControllerProxy::addUserScript):
1196 (WebKit::WebUserContentControllerProxy::removeUserScript):
1197 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
1198 (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
1199 Pass identifiers as well as user content.
1201 * WebProcess/InjectedBundle/InjectedBundle.cpp:
1202 (WebKit::InjectedBundle::addUserScript):
1203 (WebKit::InjectedBundle::addUserStyleSheet):
1204 Move user content in via move semantics rather than using a unique_ptr.
1206 (WebKit::InjectedBundle::removeUserScript):
1207 (WebKit::InjectedBundle::removeUserStyleSheet):
1208 (WebKit::InjectedBundle::removeUserScripts):
1209 (WebKit::InjectedBundle::removeUserStyleSheets):
1210 (WebKit::InjectedBundle::removeAllUserContent):
1211 Update for new function signatures.
1213 * WebProcess/UserContent/WebUserContentController.cpp:
1214 (WebKit::WebUserContentController::WebUserContentController):
1215 (WebKit::WebUserContentController::~WebUserContentController):
1216 (WebKit::WebUserContentController::addUserContentWorlds):
1217 (WebKit::WebUserContentController::removeUserContentWorlds):
1218 (WebKit::WebUserContentController::addUserScripts):
1219 (WebKit::WebUserContentController::removeUserScript):
1220 (WebKit::WebUserContentController::removeAllUserScripts):
1221 (WebKit::WebUserContentController::addUserStyleSheets):
1222 (WebKit::WebUserContentController::removeUserStyleSheet):
1223 (WebKit::WebUserContentController::removeAllUserStyleSheets):
1224 (WebKit::WebUserContentController::addUserScriptMessageHandlers):
1225 (WebKit::WebUserContentController::removeUserScriptMessageHandler):
1226 (WebKit::WebUserContentController::addUserContentExtensions):
1227 (WebKit::WebUserContentController::removeUserContentExtension):
1228 (WebKit::WebUserContentController::removeAllUserContentExtensions):
1229 (WebKit::WebUserContentController::addUserScriptInternal):
1230 (WebKit::WebUserContentController::addUserScript):
1231 (WebKit::WebUserContentController::removeUserScriptWithURL):
1232 (WebKit::WebUserContentController::removeUserScriptInternal):
1233 (WebKit::WebUserContentController::removeUserScripts):
1234 (WebKit::WebUserContentController::addUserStyleSheetInternal):
1235 (WebKit::WebUserContentController::addUserStyleSheet):
1236 (WebKit::WebUserContentController::removeUserStyleSheetWithURL):
1237 (WebKit::WebUserContentController::removeUserStyleSheetInternal):
1238 (WebKit::WebUserContentController::removeUserStyleSheets):
1239 (WebKit::WebUserContentController::removeAllUserContent):
1240 (WebKit::WebUserContentController::forEachUserScript):
1241 (WebKit::WebUserContentController::forEachUserStyleSheet):
1242 * WebProcess/UserContent/WebUserContentController.h:
1243 * WebProcess/UserContent/WebUserContentController.messages.in:
1244 Convert to inheriting from UserContentProvider, rather than containing a UserContentController.
1245 This means adding the storage for the user content, which has been simplified to avoid using
1248 * WebProcess/WebPage/WebPage.cpp:
1249 (WebKit::WebPage::addUserScript):
1250 (WebKit::WebPage::addUserStyleSheet):
1251 (WebKit::WebPage::removeAllUserContent):
1252 Update to call the WebUserContentController, rather than going to the UserContentController, which
1255 * WebProcess/WebPage/WebPageGroupProxy.cpp:
1256 (WebKit::WebPageGroupProxy::userContentController):
1257 * WebProcess/WebPage/WebPageGroupProxy.h:
1258 Return the WebUserContentController rather than old UserContentController.
1260 2016-03-10 Commit Queue <commit-queue@webkit.org>
1262 Unreviewed, rolling out r197923.
1263 https://bugs.webkit.org/show_bug.cgi?id=155301
1265 Rolling out this change due to breaking the build and
1266 LayoutTests. (Requested by ryanhaddad on #webkit).
1270 "Font antialiasing (smoothing) changes when elements are
1271 rendered into compositing layers"
1272 https://bugs.webkit.org/show_bug.cgi?id=23364
1273 http://trac.webkit.org/changeset/197923
1275 2016-03-10 Chris Dumez <cdumez@apple.com>
1277 Speculative revalidation requests do not have their 'first party for cookies' URL set
1278 https://bugs.webkit.org/show_bug.cgi?id=155284
1279 <rdar://problem/25053203>
1281 Reviewed by Antti Koivisto.
1283 Speculative revalidation requests did not have their 'first party for cookies'
1284 URL set. This means the underlying NSURLRequest has a nil mainDocumentURL.
1285 Without a way to determine whether the cookie is in a third-party context,
1286 CFNetwork defaults to accepting all cookies for these resources.
1288 * NetworkProcess/cache/NetworkCacheCoders.cpp:
1289 (WebKit::NetworkCache::Coder<WebCore::URL>::encode):
1290 (WebKit::NetworkCache::Coder<WebCore::URL>::decode):
1291 * NetworkProcess/cache/NetworkCacheCoders.h:
1292 Add template specialization to support encoding / decoding WebCore::URL.
1294 * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1295 (WebKit::NetworkCache::constructRevalidationRequest):
1296 Set the "first party for cookies" URL on the revalidation request.
1298 (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresourceLoad):
1299 (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
1300 Now keep the subresources' ResourceRequests, in addition to their key, so we can later
1301 extract the 'first party for cookies' URL from the request and save it to disk.
1303 (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
1304 Pass the ResourceRequest in addition to the key to
1305 PendingFrameLoad::registerSubresourceLoad().
1307 (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
1308 Add an extra SubresourceInfo parameter, in addition to the Entry, so we
1309 have access to the first party for cookies URL. Pass this URL to
1310 constructRevalidationRequest().
1312 (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
1313 Add an extra SubresourceInfo parameter, in addition to the Entry, so we
1314 have access to the first party for cookies URL.
1316 (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
1317 Pass the SubresourceInfo to preloadEntry().
1319 * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1321 * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1322 (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::encode):
1323 (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::decode):
1324 Encode / Decode new firstPartyForCookies member.
1326 (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
1327 (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
1328 Take SubresourceLoad objects in, instead of simple Key objects so we have
1329 access to the ResourceRequest. We extract the first party for cookies URL
1330 from the request and pass it to the SubresourceInfo constructor.
1332 * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1333 (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::SubresourceInfo):
1334 (WebKit::NetworkCache::SubresourcesEntry::SubresourceLoad::SubresourceLoad):
1336 2016-02-22 Jer Noble <jer.noble@apple.com>
1338 Enable AVFoundationNSURLSessionEnabled by default
1339 https://bugs.webkit.org/show_bug.cgi?id=154469
1341 Reviewed by Sam Weinig.
1343 * Shared/WebPreferencesDefinitions.h:
1345 2016-03-10 Eric Carlson <eric.carlson@apple.com>
1347 Unreviewed, revert changes accidentally committed with previous patch.
1349 * WebProcess/com.apple.WebProcess.sb.in:
1351 2016-03-10 Eric Carlson <eric.carlson@apple.com>
1353 [MediaStream] push media stream state to the UI process
1354 https://bugs.webkit.org/show_bug.cgi?id=155281
1356 Reviewed by Darin Adler.
1358 * UIProcess/API/C/WKPage.cpp:
1359 (WKPageGetMediaState): New.
1360 * UIProcess/API/C/WKPagePrivate.h:
1362 * UIProcess/WebPageProxy.cpp:
1363 (WebKit::WebPageProxy::didCommitLoadForFrame): Clear m_mediaState.
1364 (WebKit::WebPageProxy::isPlayingMediaDidChange): Call m_pageClient.isPlayingMediaDidChange when
1365 audio or video state changes, call m_uiClient->isPlayingAudioDidChange when audio, vidoe,
1366 or media stream state changes.
1367 * UIProcess/WebPageProxy.h:
1368 (WebKit::WebPageProxy::mediaStateFlags): New.
1370 2016-03-09 Carlos Garcia Campos <cgarcia@igalia.com>
1372 [GTK] Artifacts when using web view background color
1373 https://bugs.webkit.org/show_bug.cgi?id=155229
1375 Reviewed by Mario Sanchez Prada.
1377 This is because when using a web view color, we fill with the
1378 color every rectangle updated by the web process, but we should
1379 always fill the entire backing store before rendering the actual
1382 * WebProcess/WebPage/DrawingAreaImpl.cpp:
1383 (WebKit::DrawingAreaImpl::display): Ensure the web process always
1384 renders the whole visible rectangle when background is rendered by
1387 2016-03-09 Simon Fraser <simon.fraser@apple.com>
1389 Font antialiasing (smoothing) changes when elements are rendered into compositing layers
1390 https://bugs.webkit.org/show_bug.cgi?id=23364
1391 rdar://problem/7288429
1393 Reviewed by Tim Horton.
1395 Send the ContentsFormat to the UI process (but nothing happens to it there yet).
1397 * Shared/mac/RemoteLayerTreeTransaction.h:
1398 * Shared/mac/RemoteLayerTreeTransaction.mm:
1399 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1400 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1401 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1402 (WebKit::PlatformCALayerRemote::setContentsFormat):
1403 (WebKit::PlatformCALayerRemote::contentsFormat):
1404 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1406 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1408 Add runtime flags for shadow DOM and custom elements
1409 https://bugs.webkit.org/show_bug.cgi?id=155213
1411 Reviewed by Dean Jackson.
1413 Set the runtime flag based on preferences. Enable shadow DOM and disable custom elements by default.
1415 * Shared/WebPreferencesDefinitions.h:
1416 * UIProcess/API/C/WKPreferences.cpp:
1417 (WKPreferencesSetShadowDOMEnabled):
1418 (WKPreferencesGetShadowDOMEnabled):
1419 (WKPreferencesSetCustomElementsEnabled):
1420 (WKPreferencesGetCustomElementsEnabled):
1421 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1422 * WebProcess/InjectedBundle/InjectedBundle.cpp:
1423 (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1424 * WebProcess/WebPage/WebPage.cpp:
1425 (WebKit::WebPage::updatePreferences):
1427 2016-03-09 Brent Fulgham <bfulgham@apple.com>
1429 Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
1430 https://bugs.webkit.org/show_bug.cgi?id=155265
1431 <rdar://problem/11101440>
1433 Reviewed by Andy Estes.
1435 We require "AllowUniversalAccessFromFileURLs" to permit file URLs from accessing
1436 localStorage. However, this setting is not available on the Cocoa WKPreference (by design).
1437 Instead, you need to set this value on the WKWebViewConfiguration.
1439 Back out the work-around landed in r197889,
1441 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1442 (-[WKWebViewConfiguration init]): Remove test workaround.
1443 * UIProcess/mac/WebInspectorProxyMac.mm:
1444 (WebKit::WebInspectorProxy::platformCreateInspectorPage): Set the correct flag on
1445 the WKWebViewConfiguration.
1447 2016-03-09 Enrica Casucci <enrica@apple.com>
1449 Retrieve additional context for some data detector link for preview and action menu.
1450 https://bugs.webkit.org/show_bug.cgi?id=155278
1451 rdar://problem/24884951
1453 Reviewed by Tim Horton.
1455 Data detector results for items like calendar events, can be augmented
1456 retrieving the text surrounding the link.
1458 * Platform/spi/ios/DataDetectorsUISPI.h:
1459 * Shared/ios/InteractionInformationAtPosition.h:
1460 * Shared/ios/InteractionInformationAtPosition.mm:
1461 (WebKit::InteractionInformationAtPosition::encode):
1462 (WebKit::InteractionInformationAtPosition::decode):
1463 * UIProcess/ios/WKActionSheetAssistant.mm:
1464 (-[WKActionSheetAssistant showDataDetectorsSheet]):
1465 * UIProcess/ios/WKContentViewInteraction.mm:
1466 (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1467 * WebProcess/WebPage/ios/WebPageIOS.mm:
1468 (WebKit::WebPage::getPositionInformation):
1470 2016-03-09 Gavin Barraclough <barraclough@apple.com>
1472 Last opened tab does not receive SetHiddenPageTimerThrottlingIncreaseLimit message
1473 https://bugs.webkit.org/show_bug.cgi?id=155126
1475 Reviewed by Anders Carlson.
1477 WebPageProxy will increment the hidden page throttling counter from within its constructor,
1478 which currently causes the WebProcessPool to try to synchronously message all processes.
1479 The web page triggering the increment then fails to receive the message, since it was
1480 still being constructed. Make the update of the limit async, such that the page is fully
1481 constructed before the WebProcessPool processes the update.
1483 * UIProcess/WebProcessPool.cpp:
1484 (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
1485 - This now schedules a zero-delay timer to handle the update.
1486 (WebKit::m_hiddenPageThrottlingTimer):
1487 - This is now responsible for calling updateHiddenPageThrottlingAutoIncreaseLimit.
1488 * UIProcess/WebProcessPool.h:
1489 - Added m_hiddenPageThrottlingTimer.
1491 2016-03-09 David Kilzer <ddkilzer@apple.com>
1493 REGRESSION (r197149): Missing availability checks when soft-linking DataDetectors.framework
1494 <http://webkit.org/b/155258>
1496 Reviewed by Andy Estes.
1498 * Platform/mac/MenuUtilities.mm:
1499 (WebKit::menuItemForTelephoneNumber):
1500 (WebKit::menuForTelephoneNumber):
1501 - Add check that returns early if DataDetectors.framework is not
1504 * Shared/mac/WebHitTestResultData.mm:
1505 (WebKit::WebHitTestResultData::platformDecode):
1506 - Add Debug assertion. The soft-linked code should never be
1507 called if there was no actionContext passed in.
1509 * UIProcess/Cocoa/WebViewImpl.mm:
1510 (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly):
1511 - Protect calls to DDActionsManager with availability check.
1513 * UIProcess/mac/WKImmediateActionController.mm:
1514 (-[WKImmediateActionController _clearImmediateActionState]):
1515 (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1516 - Protect calls to DDActionsManager with availability check.
1517 (-[WKImmediateActionController _animationControllerForDataDetectedText]):
1518 (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
1519 - Add check that returns early if DataDetectors.framework is not
1522 2016-03-09 Keith Rollin <krollin@apple.com>
1524 Add state dumping facility
1525 https://bugs.webkit.org/show_bug.cgi?id=154930
1526 <rdar://problem/24939135>
1528 Reviewed by Anders Carlsson.
1530 Collect the times at which pages are loaded. Dump them when an OS
1531 state dump is triggered.
1533 * WebProcess/WebPage/WebPage.cpp:
1534 (WebKit::WebPage::didCommitLoad):
1535 * WebProcess/WebPage/WebPage.h:
1536 (WebKit::WebPage::lastPageLoadTime):
1537 * WebProcess/WebProcess.h:
1538 * WebProcess/cocoa/WebProcessCocoa.mm:
1539 (WebKit::WebProcess::registerWithStateDumper):
1540 (WebKit::WebProcess::platformInitializeProcess):
1542 2016-03-09 Anders Carlsson <andersca@apple.com>
1544 _WKWebsiteDataSize.h should be an SPI header.
1546 Rubber-stamped by Tim Horton.
1548 * WebKit2.xcodeproj/project.pbxproj:
1550 2016-03-09 Brent Fulgham <bfulgham@apple.com>
1552 Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
1553 https://bugs.webkit.org/show_bug.cgi?id=155265
1555 Unreviewed work-around to allow testing to continue.
1557 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1558 (-[WKWebViewConfiguration init]): Workaround build break.
1560 2016-03-09 Alex Christensen <achristensen@webkit.org>
1562 Fix use-after-free when cancelling synchronous XHR when using NetworkSession
1563 https://bugs.webkit.org/show_bug.cgi?id=155253
1565 Reviewed by Brady Eidson.
1567 * NetworkProcess/NetworkLoad.cpp:
1568 (WebKit::NetworkLoad::continueWillSendRequest):
1569 Store the completion handler on the stack before calling didFail, which deletes the
1570 NetworkLoad, so we don't access m_redirectCompletionHandler after deleting the NetworkLoad.
1572 2016-03-09 Commit Queue <commit-queue@webkit.org>
1574 Unreviewed, rolling out r197698.
1575 https://bugs.webkit.org/show_bug.cgi?id=155252
1577 Caused assertions, and wasn't reviewed by a WK2 owner
1578 (Requested by andersca on #webkit).
1582 "Last opened tab does not receive
1583 SetHiddenPageTimerThrottlingIncreaseLimit message"
1584 https://bugs.webkit.org/show_bug.cgi?id=155126
1585 http://trac.webkit.org/changeset/197698
1587 2016-03-09 Conrad Shultz <conrad_shultz@apple.com>
1589 WebsiteDataStore::Configuration::legacyWebsiteDataStoreConfiguration() should respect the passed-in configuration
1590 https://bugs.webkit.org/show_bug.cgi?id=155250
1592 Reviewed by Anders Carlsson.
1594 Note that the legacy directories are already set by default in ProcessPoolConfiguration::createWithLegacyOptions(),
1595 which is also where the shouldHaveLegacyDataStore flag, which will cause this code path to be reached, is set.
1597 * UIProcess/WebProcessPool.cpp:
1598 (WebKit::legacyWebsiteDataStoreConfiguration):
1599 Use the passed-in configuration to set the application cache, network cache, and media keys storage directories.
1601 2016-03-09 Chris Dumez <cdumez@apple.com>
1603 Speculative disk cache resource revalidations are sometimes wasted
1604 https://bugs.webkit.org/show_bug.cgi?id=155187
1605 <rdar://problem/25032905>
1607 Reviewed by Antti Koivisto.
1609 Speculative disk cache resource revalidations were sometimes wasted.
1611 We would sometimes correctly revalidate a resource but the
1612 NetworkResourceLoader then either:
1613 1. Fail to reuse the speculatively validated entry
1614 2. Reuse the speculatively validated entry but then validate it again
1616 Bug 1 was caused by the revalidated entry key sometimes being
1617 different from the cached entry key. This could happen when
1618 revalidation fails (the server did not send back a 304) in
1619 which case we call NetworkCache::store() which creates a new
1620 cache Entry, generating a cache key from our revalidation
1621 request. If the original request has a cache partition or a
1622 range, then the keys would not match because we did not set
1623 the cache partition or the range on the revalidation request.
1624 This has been addressed by setting the cache partition on the
1625 revalidation request in constructRevalidationRequest() and by
1626 not doing revalidation if the original request had a 'range'
1629 Bug 2 was caused by us marking a speculatively revalidated entry
1630 as "not needing revalidating" only in Cache::update(). Cache::update()
1631 is only called in the case the revalidation was successful (server
1632 returned a 304). If revalidation was not successful, Cache::store()
1633 would be called instead was we would fail to update the
1634 needsRevalidation flag. NetworkResourceLoader would then validate
1635 again the resource that was already speculatively revalidated.
1636 To address the problem, we now update the 'needsRevalidation' flag
1637 as soon as the speculative revalidation completes, in
1638 SpeculativeLoad::didComplete().
1640 * NetworkProcess/cache/NetworkCache.cpp:
1641 (WebKit::NetworkCache::Cache::retrieve):
1642 (WebKit::NetworkCache::makeCacheKey):
1643 (WebKit::NetworkCache::Cache::update):
1644 * NetworkProcess/cache/NetworkCacheEntry.cpp:
1645 (WebKit::NetworkCache::Entry::setNeedsValidation):
1646 * NetworkProcess/cache/NetworkCacheEntry.h:
1647 * NetworkProcess/cache/NetworkCacheKey.cpp:
1648 (WebKit::NetworkCache::noPartitionString):
1649 (WebKit::NetworkCache::Key::Key):
1650 (WebKit::NetworkCache::Key::hasPartition):
1651 * NetworkProcess/cache/NetworkCacheKey.h:
1652 * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1653 (WebKit::NetworkCache::SpeculativeLoad::didComplete):
1654 * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1655 (WebKit::NetworkCache::constructRevalidationRequest):
1656 (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
1657 (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
1659 2016-03-09 Brent Fulgham <bfulgham@apple.com>
1661 Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
1662 https://bugs.webkit.org/show_bug.cgi?id=155185
1664 Reviewed by Anders Carlsson.
1665 <rdar://problem/11101440>
1667 Tested by TestWebKitAPI tests IndexedDB.IndexedDBMultiProcess and IndexedDB.IndexedDBPersistence.
1669 Allow Cocoa WKWebViewConfiguration access to the 'allowUniversalAccessFromFileURLs' setting.
1671 * UIProcess/API/Cocoa/WKWebView.mm:
1672 (- [WKWebView _initializeWithConfiguration]): Set 'allowUniversalAccessFromFileURLsKey' in
1674 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1675 (-[WKWebViewConfiguration _allowUniversalAccessFromFileURLs]): Added,
1676 (-[WKWebViewConfiguration _setAllowUniversalAccessFromFileURLs:]): Added.
1677 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1679 2016-03-09 Enrica Casucci <enrica@apple.com>
1681 Add two finger tap on links.
1682 https://bugs.webkit.org/show_bug.cgi?id=155205
1683 rdar://problem/22937516
1685 Reviewed by Sam Weinig.
1687 Adds two finger tap gesture recognizer. When performed
1688 on a link, it calls the delegate.
1690 * Platform/spi/ios/UIKitSPI.h:
1691 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1692 * UIProcess/WebPageProxy.h:
1693 * UIProcess/ios/WKContentViewInteraction.h:
1694 * UIProcess/ios/WKContentViewInteraction.mm:
1695 (-[WKContentView setupInteraction]):
1696 (-[WKContentView cleanupInteraction]):
1697 (-[WKContentView _removeDefaultGestureRecognizers]):
1698 (-[WKContentView _addDefaultGestureRecognizers]):
1699 (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1700 * UIProcess/ios/WebPageProxyIOS.mm:
1701 (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
1702 * WebProcess/WebPage/WebPage.h:
1703 * WebProcess/WebPage/WebPage.messages.in:
1704 * WebProcess/WebPage/ios/WebPageIOS.mm:
1705 (WebKit::WebPage::handleTwoFingerTapAtPoint):
1707 2016-03-09 Alex Christensen <achristensen@webkit.org>
1709 Always call NSURLSession completion handlers
1710 https://bugs.webkit.org/show_bug.cgi?id=155137
1712 Reviewed by Darin Adler.
1714 There are some edge cases which should not be hit, but if they are they would cause the
1715 network process to hang and network resources to be leaked. This can be avoided.
1716 There are also a few release asserts that do not need to crash release builds.
1718 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1719 (WebKit::NetworkDataTask::NetworkDataTask):
1720 (WebKit::NetworkDataTask::didReceiveChallenge):
1721 (WebKit::NetworkDataTask::didCompleteWithError):
1722 (WebKit::NetworkDataTask::didReceiveResponse):
1723 (WebKit::NetworkDataTask::didReceiveData):
1724 (WebKit::NetworkDataTask::willPerformHTTPRedirection):
1725 (WebKit::NetworkDataTask::scheduleFailure):
1726 (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
1727 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1728 (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1729 (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1730 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1732 2016-03-08 Sam Weinig <sam@webkit.org>
1734 Roll r197632 back in now that the bots have caught up.
1736 * UIProcess/ios/WKContentViewInteraction.mm:
1737 (-[WKContentView textInputTraits]):
1739 2016-03-08 Oliver Hunt <oliver@apple.com>
1741 Start moving to separated writable and executable mappings in the JIT
1742 https://bugs.webkit.org/show_bug.cgi?id=155178
1744 Reviewed by Fil Pizlo.
1746 Update feature defines.
1748 * Configurations/FeatureDefines.xcconfig:
1750 2016-03-08 Brent Fulgham <bfulgham@apple.com>
1752 [WK2][Mac] Allow processes to set "fast-dev-casheable" bit in Network Process
1753 https://bugs.webkit.org/show_bug.cgi?id=155189
1754 <rdar://problem/25042678>
1756 Reviewed by Alexey Proskuryakov.
1758 Update the NetworkProcess sandbox profiles with a declaration that using the
1759 system-fctl to touch the "hot file" flag (to support caching operations)
1760 is allowed. I should have done this in Bug 154503, but did not.
1762 * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Add sandbox permission.
1764 2016-03-08 Commit Queue <commit-queue@webkit.org>
1766 Unreviewed, rolling out r197793 and r197799.
1767 https://bugs.webkit.org/show_bug.cgi?id=155195
1769 something weird happened while landing this and everything
1770 broke (Requested by olliej on #webkit).
1772 Reverted changesets:
1774 "Start moving to separated writable and executable mappings in
1776 https://bugs.webkit.org/show_bug.cgi?id=155178
1777 http://trac.webkit.org/changeset/197793
1779 "arm64 build fix after r197793."
1780 http://trac.webkit.org/changeset/197799
1782 2016-03-08 Brent Fulgham <bfulgham@apple.com>
1784 [WK2] Grant explicit read access to ManagedPreferences
1785 https://bugs.webkit.org/show_bug.cgi?id=155173
1786 <rdar://problem/24910550>
1788 Reviewed by Alexey Proskuryakov.
1790 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add new
1793 2016-03-08 Anders Carlsson <andersca@apple.com>
1795 Ignore deprecation warnings.
1797 * Shared/mac/ChildProcessMac.mm:
1798 (WebKit::ChildProcess::stopNSAppRunLoop):
1799 * Shared/mac/WebEventFactory.mm:
1800 (WebKit::mouseButtonForEvent):
1801 (WebKit::mouseEventTypeForEvent):
1802 (WebKit::clickCountForEvent):
1803 (WebKit::globalPointForEvent):
1804 (WebKit::pointForEvent):
1805 (WebKit::textFromEvent):
1806 (WebKit::unmodifiedTextFromEvent):
1807 (WebKit::isKeypadEvent):
1808 (WebKit::isKeyUpEvent):
1809 (WebKit::modifiersForEvent):
1810 (WebKit::WebEventFactory::createWebKeyboardEvent):
1811 * UIProcess/API/Cocoa/WKNavigationAction.mm:
1812 (toNSEventModifierFlags):
1813 * UIProcess/Cocoa/WebViewImpl.mm:
1814 (WebKit::WebViewImpl::becomeFirstResponder):
1815 (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
1816 (WebKit::WebViewImpl::viewDidMoveToWindow):
1817 (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
1818 (WebKit::WebViewImpl::createFullScreenWindow):
1819 (WebKit::WebViewImpl::sendToolTipMouseExited):
1820 (WebKit::WebViewImpl::sendToolTipMouseEntered):
1821 (WebKit::applicationFlagsForDrag):
1822 (WebKit::WebViewImpl::setLastMouseDownEvent):
1823 (WebKit::WebViewImpl::doneWithKeyEvent):
1824 (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
1825 (WebKit::WebViewImpl::performKeyEquivalent):
1826 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1827 (WebKit::PluginProcessProxy::beginModal):
1828 * UIProcess/mac/WebContextMenuProxyMac.mm:
1829 (WebKit::WebContextMenuProxyMac::showContextMenu):
1830 * UIProcess/mac/WebInspectorProxyMac.mm:
1831 (WebKit::WebInspectorProxy::platformCanAttach):
1832 * UIProcess/mac/WebPopupMenuProxyMac.mm:
1833 (WebKit::WebPopupMenuProxyMac::populate):
1834 (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1835 * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1836 (WebKit::modifierFlagsFromWebEvent):
1837 (WebKit::getEventTypeFromWebEvent):
1838 * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
1839 (WebKit::cssAlignmentValueForNSTextAlignment):
1840 * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1841 (WebKit::convertImageToBitmap):
1843 2016-03-08 Oliver Hunt <oliver@apple.com>
1845 Start moving to separated writable and executable mappings in the JIT
1846 https://bugs.webkit.org/show_bug.cgi?id=155178
1848 Reviewed by Filip Pizlo.
1850 Update feature defines.
1852 * Configurations/FeatureDefines.xcconfig:
1854 2016-03-08 Commit Queue <commit-queue@webkit.org>
1856 Unreviewed, rolling out r197766.
1857 https://bugs.webkit.org/show_bug.cgi?id=155183
1859 Has platform-specific code in non-platform files (Requested by
1864 "AX: Force allow user zoom"
1865 https://bugs.webkit.org/show_bug.cgi?id=155056
1866 http://trac.webkit.org/changeset/197766
1868 2016-03-04 Ada Chan <adachan@apple.com>
1870 Fix lifetime issues regarding WebVideoFullscreenInterfaceMac
1871 https://bugs.webkit.org/show_bug.cgi?id=155130
1873 Reviewed by Beth Dakin.
1875 Now that both fullscreen and video controls manager rely on WebVideoFullscreenInterface,
1876 we now keep track of a "client count" for each context ID so we'll only remove it
1877 from the context map after all the "clients" are done with it.
1879 Before this change, every time WebVideoFullscreenManager::setUpVideoControlsManager()
1880 is called, the existing interface is cleared and a new one is created even when there's
1881 an existing interface for that. With this change, we reuse the existing interface for
1884 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1885 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1886 (WebKit::WebVideoFullscreenManagerProxy::invalidate):
1887 Also clear out m_clientCounts.
1888 (WebKit::WebVideoFullscreenManagerProxy::addClientForContext):
1889 If the context ID is not in m_clientCounts yet, add the count of 1 to
1890 that table for that ID. Otherwise, increment the count by 1.
1891 (WebKit::WebVideoFullscreenManagerProxy::removeClientForContext):
1892 Assert that we have added this context id to m_clientCounts before.
1893 Decrement the count. If it reaches 0, remove this context ID from both
1894 m_clientCounts and m_contextMap.
1895 (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1896 We have started a new fullscreen session using this interface. Call
1897 addClientForContext() to update the client count.
1898 (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
1899 If the current controls manager set up has the same context ID as the one
1900 passed in, we don't have to do anything. Otherwise, if we have set up
1901 the video controls manager with a different ID before, call removeClientForContext()
1902 on the old ID to decrement its client count. Set m_controlsManagerContextId
1903 to the new value and call addClientForContext() with it.
1904 (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
1905 Instead of removing the mapping from m_contextMap directly, reset the fullscreen
1906 mode on the interface and call removeClientForContext(), which removes the mapping
1907 only if there's no more client using the interface.
1908 * WebProcess/cocoa/WebVideoFullscreenManager.h:
1909 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1910 (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager):
1911 Clear m_clientCounts.
1912 (WebKit::WebVideoFullscreenManager::removeContext):
1913 Add a helper method for removing the context.
1914 (WebKit::WebVideoFullscreenManager::addClientForContext):
1915 If the context ID is not in m_clientCounts yet, add the count of 1 to
1916 that table for that ID. Otherwise, increment the count by 1.
1917 (WebKit::WebVideoFullscreenManager::removeClientForContext):
1918 Assert that we have added this context id to m_clientCounts before.
1919 Decrement the count. If it reaches 0, remove this context ID from
1920 m_clientCounts and call removeContext() to clean up this context.
1921 (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
1922 We have started a new fullscreen session using this interface. Call
1923 addClientForContext() to update the client count. Create a layer hosting
1924 context if it's not there.
1925 (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
1926 If we have set up a context for this video element before, see if it's
1927 the one we are currently managing video controls for. If it is, return early.
1928 Otherwise, call removeClientForContext() on the previous m_controlsManagerContextId
1929 and update m_controlsManagerContextId to the context ID of this video element.
1930 If there's no context created for this video element yet, set one up.
1931 Send a SetUpVideoControlsManagerWithID message to the proxy object in the UI process
1932 so it'll update its controls manager context ID. Also, conditionalize all of this
1933 under PLATFORM(MAC) to be consistent with WebVideoFullscreenManagerProxy.
1934 (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
1935 Just reset the fullscreen mode on the interface and call removeClientForContext() which
1936 only cleans up the context if there's no more client using it.
1938 2016-03-08 Timothy Hatcher <timothy@apple.com>
1940 Web Inspector: Add automation protocol methods for navigation
1942 https://bugs.webkit.org/show_bug.cgi?id=155163
1943 rdar://problem/25029054
1945 Reviewed by Darin Adler.
1947 * UIProcess/Automation/Automation.json:
1948 * UIProcess/Automation/WebAutomationSession.cpp:
1949 (WebKit::WebAutomationSession::getBrowsingContexts): Set url.
1950 (WebKit::WebAutomationSession::getBrowsingContext): Added.
1951 (WebKit::WebAutomationSession::navigateBrowsingContext): Added.
1952 (WebKit::WebAutomationSession::goBackInBrowsingContext): Added.
1953 (WebKit::WebAutomationSession::goForwardInBrowsingContext): Added.
1954 (WebKit::WebAutomationSession::reloadBrowsingContext): Added.
1955 * UIProcess/Automation/WebAutomationSession.h:
1957 2016-03-08 Nan Wang <n_wang@apple.com>
1959 AX: Force allow user zoom
1960 https://bugs.webkit.org/show_bug.cgi?id=155056
1962 Reviewed by Chris Fleizach.
1964 Soft linked libAccessibility library so that we can observe the accessibility
1965 setting change for the force always user scalable feature.
1967 * WebProcess/WebPage/WebPage.cpp:
1968 (WebKit::forceAlwaysUserScalableChangedCallback):
1969 (WebKit::WebPage::create):
1970 (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1971 (WebKit::WebPage::~WebPage):
1972 (WebKit::WebPage::preferencesDidChange):
1973 (WebKit::WebPage::updateForceAlwaysUserScalable):
1974 (WebKit::WebPage::updatePreferences):
1975 * WebProcess/WebPage/WebPage.h:
1977 2016-03-08 Csaba Osztrogonác <ossy@webkit.org>
1979 One more unreviewed speculative buildfix after r197728.
1981 * NetworkProcess/NetworkResourceLoader.cpp:
1982 (WebKit::NetworkResourceLoader::didFinishLoading):
1983 (WebKit::NetworkResourceLoader::continueWillSendRequest):
1985 2016-03-08 Csaba Osztrogonác <ossy@webkit.org>
1987 Unreviewed speculative buildfix after r197728.
1989 * WebProcess/Network/WebLoaderStrategy.cpp:
1990 (WebKit::WebLoaderStrategy::scheduleLoad):
1992 2016-03-08 Timothy Hatcher <timothy@apple.com>
1994 Web Inspector: Make WebAutomationSession::closeBrowsingContext work as expected
1996 https://bugs.webkit.org/show_bug.cgi?id=155162
1997 rdar://problem/25027191
1999 Reviewed by Brian Burg.
2001 * UIProcess/Automation/WebAutomationSession.cpp:
2002 (WebKit::WebAutomationSession::closeBrowsingContext):
2003 Call closePage, the same method ultimately used by window.close().
2005 * UIProcess/WebPageProxy.h: Make closePage public.
2007 2016-03-07 Carlos Garcia Campos <cgarcia@igalia.com>
2009 REGRESSION(r197062): [GTK] Transparent backgrounds no longer work after r197062
2010 https://bugs.webkit.org/show_bug.cgi?id=155119
2012 Reviewed by Martin Robinson.
2014 This is because after r197062 we are now realizing the view too
2015 early, even before the toplevel window has been realized, forcing
2016 the toplevel window to be realized. If the RGBA visual is set on
2017 the window after it has been realzied it doesn't have any
2018 effect. We should wait until the toplevel window is realized to
2019 realize the web view, giving time to the application to set RGBA
2020 visual and background color. If the toplevel window is already
2021 realized we realize the web view immediately, so that this doesn't
2022 affect the tearing problems fixed in r197062.
2024 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2025 (toplevelWindowRealized):
2026 (webkitWebViewBaseSetToplevelOnScreenWindow):
2028 2016-03-07 Keith Rollin <krollin@apple.com>
2030 Enhance logging: Use "always on" macros
2031 https://bugs.webkit.org/show_bug.cgi?id=154499
2032 <rdar://problem/24757730>
2034 Reviewed by Chris Dumez.
2036 Make use of new logging macros by reporting on frame and resource
2039 Connection updated to report IPC errors, helping us identify when
2040 messaging between processes breaks down.
2042 ChildProcess updated to log if it is terminating early. Some
2043 sysdiagnose logging from customers indicate that this is happening in
2046 * NetworkProcess/NetworkResourceLoader.cpp:
2047 (WebKit::NetworkResourceLoader::startNetworkLoad):
2048 (WebKit::NetworkResourceLoader::didFinishLoading):
2049 (WebKit::NetworkResourceLoader::didFailLoading):
2050 (WebKit::NetworkResourceLoader::continueWillSendRequest):
2051 (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed):
2052 * NetworkProcess/NetworkResourceLoader.h:
2053 * Platform/IPC/Connection.cpp:
2054 (IPC::Connection::waitForSyncReply):
2055 * Shared/ChildProcess.cpp:
2056 (WebKit::didCloseOnConnectionWorkQueue):
2057 * WebProcess/Network/WebLoaderStrategy.cpp:
2058 (WebKit::WebLoaderStrategy::scheduleLoad):
2059 * WebProcess/Network/WebResourceLoader.cpp:
2060 (WebKit::WebResourceLoader::willSendRequest):
2061 (WebKit::WebResourceLoader::didReceiveResponse):
2062 (WebKit::WebResourceLoader::didReceiveData):
2063 (WebKit::WebResourceLoader::didFinishResourceLoad):
2064 (WebKit::WebResourceLoader::didFailResourceLoad):
2065 (WebKit::WebResourceLoader::didReceiveResource):
2066 (WebKit::WebResourceLoader::isAlwaysOnLoggingAllowed):
2067 * WebProcess/Network/WebResourceLoader.h:
2069 2016-03-07 Brent Fulgham <bfulgham@apple.com>
2071 Reduce startup and shutdown cost of resource load statistics
2072 https://bugs.webkit.org/show_bug.cgi?id=155120
2073 <rdar://problem/25010167>
2075 Reviewed by Andy Estes.
2077 Use a dedicated WorkQueue to process resource load statistics data. Allow
2078 processing to load (and save) previously stored statistics asynchronously so
2079 that it does not delay startup.
2081 Now that we have a more rational storage situation, get rid of the 'writeToDisk'
2082 method since it is no longer needed in the WK2 layer.
2084 Move all of the Resource Load Statistics file handling code from WebCore to this
2087 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2088 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Initialize
2089 member variable with storage path, rather than passing to WebCore code.
2090 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Revised to
2091 use the new WorkQueue code.
2092 (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled): When
2093 activating the feature, purge any old statistics before loading from disk.
2094 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Added.
2095 (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection): Added.
2096 (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection): Added.
2097 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): Make sure all
2098 of the WorkQueue tasks are done before terminating.
2099 (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Moved from WebCore.
2100 (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Ditto.
2101 (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): Ditto.
2102 (WebKit::WebResourceLoadStatisticsStore::writeToDisk): Deleted.
2103 * UIProcess/WebResourceLoadStatisticsStore.h:
2104 (WebKit::WebResourceLoadStatisticsStore::coreStore):
2105 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2106 (WebKit::WebsiteDataStore::webProcessWillOpenConnection): Call new WebResourceLoadStatisticsStore code.
2107 (WebKit::WebsiteDataStore::webProcessDidCloseConnection): Ditto.
2109 2016-03-07 Alex Christensen <achristensen@webkit.org>
2111 Fix cookies with private browsing and NetworkSession
2112 https://bugs.webkit.org/show_bug.cgi?id=155147
2113 rdar://problem/25018279
2115 Reviewed by Brady Eidson.
2117 In the NetworkSession constructor, we look for a NetworkStorageSession in the SessionTracker
2118 and use that NetworkStorageSession's CFHTTPCookieStorageRef in the NSURLSessionConfiguration.
2119 NetworkStorageSessions were being set in SessionTracker's storageSessionMap after NetworkSessions
2120 were created, causing the NSHTTPCookieStorage of the NSURLSession to be different from the
2121 CFHTTPCookieStorageRef used by document.cookie in newly created private browsing sessions.
2122 This fixes that problem by passing the NetworkStorageSession as a constructor parameter to the
2123 NetworkSession so it can use the correct CFHTTPCookieStorageRef in its NSURLSessionConfiguration
2124 before it is in the storageSessionMap.
2126 * NetworkProcess/NetworkSession.h:
2127 (WebKit::NetworkSession::sessionID):
2128 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2129 (WebKit::NetworkSession::defaultSession):
2130 (WebKit::NetworkSession::NetworkSession):
2131 * NetworkProcess/mac/RemoteNetworkingContext.mm:
2132 (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
2133 * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2134 (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
2136 2016-03-07 Brent Fulgham <bfulgham@apple.com>
2138 Correct bug in resource load statistics debug flag for legacy clients
2139 https://bugs.webkit.org/show_bug.cgi?id=155118
2140 <rdar://problem/25020088>
2142 Reviewed by Andy Estes.
2144 Some clients launch WebKit2 using the "legacy" configuration for the website data store.
2145 The Resource Load Statistics code was not added to this type of configuration, which
2146 prevents various WebKit2 clients from using this code.
2148 * UIProcess/WebProcessPool.cpp:
2149 (WebKit::legacyWebsiteDataStoreConfiguration): Tell the legacy initializer where to
2150 find the resource load statistics data.
2152 2016-03-07 Daniel Bates <dabates@apple.com>
2154 Cleanup: Add convenience function URL::procotolIsBlob()
2155 https://bugs.webkit.org/show_bug.cgi?id=155127
2156 <rdar://problem/25016829>
2158 Reviewed by Brent Fulgham.
2160 * NetworkProcess/NetworkLoad.cpp:
2161 (WebKit::NetworkLoad::NetworkLoad): Modified to use URL::protocolIsBlob().
2162 * NetworkProcess/NetworkResourceLoader.cpp:
2163 (WebKit::NetworkResourceLoader::NetworkResourceLoader): Ditto.
2164 * WebProcess/WebPage/WebPage.cpp:
2165 (WebKit::WebPage::canHandleRequest): Ditto.
2167 2016-03-07 Simon Fraser <simon.fraser@apple.com>
2169 Use CGColorSpaceCopyICCData instead of CGColorSpaceCopyICCProfile
2170 https://bugs.webkit.org/show_bug.cgi?id=155123
2171 rdar://problem/24990256
2173 Reviewed by Tim Horton.
2175 On newer OSes, use CGColorSpaceCopyICCData().
2177 * Shared/mac/ColorSpaceData.mm:
2178 (WebKit::ColorSpaceData::encode):
2180 2016-03-07 Gavin Barraclough <barraclough@apple.com>
2182 Last opened tab does not receive SetHiddenPageTimerThrottlingIncreaseLimit message
2183 https://bugs.webkit.org/show_bug.cgi?id=155126
2185 Reviewed by Chris Dumez.
2187 WebPageProxy will increment the hidden page throttling counter from within its constructor,
2188 which currently causes the WebProcessPool to try to synchronously message all processes.
2189 The web page triggering the increment then fails to receive the message, since it was
2190 still being constructed. Make the update of the limit async, such that the page is fully
2191 constructed before the WebProcessPool processes the update.
2193 * UIProcess/WebProcessPool.cpp:
2194 (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
2195 - This now schedules a zero-delay timer to handle the update.
2196 (WebKit::m_hiddenPageThrottlingTimer):
2197 - This is now responsible for calling updateHiddenPageThrottlingAutoIncreaseLimit.
2198 * UIProcess/WebProcessPool.h:
2199 - Added m_hiddenPageThrottlingTimer.
2201 2016-03-05 Enrica Casucci <enrica@apple.com>
2203 Support preview on attachment elements.
2204 https://bugs.webkit.org/show_bug.cgi?id=155074
2205 rdar://problem/24806079
2207 Reviewed by Sam Weinig.
2209 Allowing preview to start on attachment elements.
2210 Adding a private UIDelegate method to provide the data for the preview.
2212 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2213 * UIProcess/ios/WKContentViewInteraction.mm:
2214 (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2215 (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2217 2016-03-06 Andreas Kling <akling@apple.com>
2219 Reduce page cache capacity from 3 to 2.
2220 <https://webkit.org/b/155087>
2222 Reviewed by Antti Koivisto.
2224 It's extremely rare that users go back more than 2 pages in the page cache,
2225 and nowadays the network cache makes even un-cached pages fast to reload.
2227 Trimming the page cache from 3 to 2 entries has a very nice effect on heap
2228 fragmentation. I'm seeing a ~5% progression on the iPad PLUM test locally;
2229 average memory usage across 300 loads goes from ~121MB to ~114MB.
2231 * Shared/CacheModel.cpp:
2232 (WebKit::calculateCacheSizes):
2234 2016-03-05 Sam Weinig <sam@webkit.org>
2236 Revert usage of autofill field name for use with UITextInputTraits
2237 until our bots can catch up.
2239 * UIProcess/ios/WKContentViewInteraction.mm:
2240 (-[WKContentView textInputTraits]):
2242 2016-03-05 Chris Dumez <cdumez@apple.com>
2244 Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
2245 https://bugs.webkit.org/show_bug.cgi?id=155035
2247 Reviewed by Darin Adler.
2249 Update runtime application checks.
2251 * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2252 (API::WebsiteDataStore::defaultApplicationCacheDirectory):
2253 * UIProcess/Cocoa/VersionChecks.mm:
2254 (WebKit::linkedOnOrAfter):
2255 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2256 (WebKit::WebProcessPool::platformInitializeWebProcess):
2257 (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
2258 * UIProcess/ios/WKContentViewInteraction.mm:
2259 * UIProcess/mac/WebPageProxyMac.mm:
2260 (WebKit::expectsLegacyImplicitRubberBandControl):
2261 (WebKit::WebPageProxy::appleMailPaginationQuirkEnabled):
2263 2016-03-05 Sam Weinig <sam@webkit.org>
2265 Add support for processing the autofill field name out of form control elements ultimately to aid input methods
2266 <rdar://problem/23041180>
2267 https://bugs.webkit.org/show_bug.cgi?id=155079
2269 Reviewed by Enrica Casucci.
2271 * Shared/AssistedNodeInformation.cpp:
2272 (WebKit::AssistedNodeInformation::encode):
2273 (WebKit::AssistedNodeInformation::decode):
2274 * Shared/AssistedNodeInformation.h:
2275 Add AutofillFieldName. Convert some coders to use encodeEnum/decodeEnum instead of casting.
2277 * UIProcess/ios/WKContentViewInteraction.mm:
2278 (-[WKContentView textInputTraits]):
2279 Map AutofillFieldNames to the associated UITextContentTypes.
2281 * WebProcess/WebPage/ios/WebPageIOS.mm:
2282 (WebKit::WebPage::getAssistedNodeInformation):
2283 Extract the AutofillFieldNames onto the AssistedNodeInformation for <input> elements
2284 and <textarea> elements.
2286 2016-03-05 Timothy Hatcher <timothy@apple.com>
2288 Implement the Automation protocol commands by tracking WebPageProxy objects
2289 that are controlled by automation and assigning them a UUID handle.
2291 https://bugs.webkit.org/show_bug.cgi?id=154953
2292 rdar://problem/24947489
2294 Reviewed by Brian Burg.
2296 * UIProcess/API/APIAutomationSessionClient.h:
2297 (API::AutomationSessionClient::didRequestNewWindow):
2298 Return a WebPageProxy instead of void so it can be assigned a UUID handle.
2300 * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2301 Return a WKPageRef from _automationSessionDidRequestNewWindow:.
2303 * UIProcess/Automation/WebAutomationSession.cpp:
2304 (WebKit::WebAutomationSession::webPageProxyForHandle):
2305 (WebKit::WebAutomationSession::handleForWebPageProxy):
2306 (WebKit::WebAutomationSession::getBrowsingContexts):
2307 (WebKit::WebAutomationSession::createBrowsingContext):
2308 (WebKit::WebAutomationSession::closeBrowsingContext):
2309 (WebKit::WebAutomationSession::switchToBrowsingContext):
2311 * UIProcess/Automation/WebAutomationSession.h:
2312 Added new methods and maps to track pages and handles.
2314 * UIProcess/Cocoa/AutomationSessionClient.h:
2315 * UIProcess/Cocoa/AutomationSessionClient.mm:
2316 (WebKit::AutomationSessionClient::didRequestNewWindow):
2317 Return a WebPageProxy from the WKPageRef.
2319 * UIProcess/WebPageProxy.h: Make setFocus public.
2321 * UIProcess/WebProcessPool.cpp:
2322 (WebKit::WebProcessPool::setAutomationSession):
2323 Set the WebProcessPool on the WebAutomationSession so it can be used to find
2324 WebPageProxy objects controlled by automation.
2326 2016-03-05 Timothy Hatcher <timothy@apple.com>
2328 Rename Automation protocol methods to use "BrowsingContext" instead of "Window".
2329 Also flesh out the protocol commands more by adding switchToBrowsingContext
2330 and return a BrowsingContextHandle for createBrowsingContext.
2332 https://bugs.webkit.org/show_bug.cgi?id=154953
2333 rdar://problem/24947489
2335 Reviewed by Brian Burg.
2337 * UIProcess/Automation/Automation.json:
2338 * UIProcess/Automation/WebAutomationSession.cpp:
2339 (WebKit::WebAutomationSession::getBrowsingContexts):
2340 (WebKit::WebAutomationSession::createBrowsingContext):
2341 (WebKit::WebAutomationSession::closeBrowsingContext):
2342 (WebKit::WebAutomationSession::switchToBrowsingContext):
2343 (WebKit::WebAutomationSession::getWindows): Deleted.
2344 (WebKit::WebAutomationSession::openWindow): Deleted.
2345 (WebKit::WebAutomationSession::closeWindow): Deleted.
2346 * UIProcess/Automation/WebAutomationSession.h:
2348 2016-03-05 Yusuke Suzuki <utatane.tea@gmail.com>
2350 [ES6] Support Reflect.construct
2351 https://bugs.webkit.org/show_bug.cgi?id=147330
2353 Reviewed by Saam Barati.
2355 * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2356 (WebKit::JSNPMethod::getCallData):
2357 * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2358 (WebKit::JSNPObject::getCallData):
2359 (WebKit::JSNPObject::getConstructData):
2360 * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2361 (WebKit::NPJSObject::hasMethod):
2362 (WebKit::NPJSObject::construct):
2363 (WebKit::NPJSObject::invoke):
2365 2016-03-04 Alex Christensen <achristensen@webkit.org>
2367 Fix file mime-types when using NetworkSession
2368 https://bugs.webkit.org/show_bug.cgi?id=155058
2370 Reviewed by Andy Estes.
2372 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2373 (WebKit::NetworkDataTask::NetworkDataTask):
2374 Call adjustMIMETypeIfNecessary like we do in connection didReceiveResponse in
2375 WebCoreResourceHandleAsOperationQueueDelegate.mm.
2376 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2377 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2378 Don't content sniff file urls. This check is analogous to ResourceHandle::shouldContentSniffURL.
2380 2016-03-04 Sam Weinig <sam@webkit.org>
2382 [WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
2383 <rdar://problem/24943591>
2384 https://bugs.webkit.org/show_bug.cgi?id=155057
2386 Reviewed by Tim Horton.
2388 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2389 (WKBundlePageInsertNewlineInQuotedContent):
2390 * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2391 * WebProcess/WebPage/WebPage.cpp:
2392 (WebKit::WebPage::insertNewlineInQuotedContent):
2393 * WebProcess/WebPage/WebPage.h:
2394 Expose WKBundlePageInsertNewlineInQuotedContent as SPI.
2396 2016-03-04 Brent Fulgham <bfulgham@apple.com>
2398 Stub API to support a debug menu option for measuring resource load statistics
2399 https://bugs.webkit.org/show_bug.cgi?id=154998
2400 <rdar://problem/24944604>
2402 Reviewed by Andy Estes.
2404 * UIProcess/API/APIWebsiteDataStore.cpp:
2405 (API::WebsiteDataStore::resourceLoadStatisticsEnabled): Added stub.
2406 (API::WebsiteDataStore::setResourceLoadStatisticsEnabled): Ditto.
2407 * UIProcess/API/APIWebsiteDataStore.h:
2408 * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2409 (WKWebsiteDataStoreSetResourceLoadStatisticsEnabled): Added method that calls through
2410 to the underlying APIWebsiteDataStore class.
2411 (WKWebsiteDataStoreGetResourceLoadStatisticsEnabled): Ditto.
2412 * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2414 2016-03-03 Enrica Casucci <enrica@apple.com>
2416 Add a mechanism to customize the long press action.
2417 https://bugs.webkit.org/show_bug.cgi?id=154995
2418 rdar://problem/24823732
2420 Reviewed by Tim Horton.
2422 Adding a new private delegate method to allow clients to
2423 replace the action sheet displayed for images and links.
2424 The change also adds support for attachment elements.
2426 * Shared/ios/InteractionInformationAtPosition.h:
2427 * Shared/ios/InteractionInformationAtPosition.mm:
2428 (WebKit::InteractionInformationAtPosition::encode):
2429 (WebKit::InteractionInformationAtPosition::decode):
2430 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2431 * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2432 * UIProcess/ios/WKActionSheetAssistant.h:
2433 * UIProcess/ios/WKActionSheetAssistant.mm:
2434 (-[WKActionSheetAssistant showImageSheet]):
2435 (-[WKActionSheetAssistant showLinkSheet]):
2436 * UIProcess/ios/WKContentViewInteraction.mm:
2437 (-[WKContentView _showImageSheet]):
2438 (-[WKContentView _showAttachmentSheet]):
2439 (-[WKContentView _showLinkSheet]):
2440 (-[WKContentView _actionForLongPress]):
2441 (-[WKContentView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
2442 (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
2443 (-[WKContentView actionSheetAssistant:decideActionsForElement:defaultActions:]):
2444 * WebProcess/WebPage/ios/WebPageIOS.mm:
2445 (WebKit::WebPage::getPositionInformation):
2447 2016-03-04 Brent Fulgham <bfulgham@apple.com>
2449 [WK2] Gather resource load statistics
2450 https://bugs.webkit.org/show_bug.cgi?id=154278
2451 <rdar://problem/24702892>
2453 Reviewed by Andy Estes.
2455 Revise the WebProcess to notify the UIProcess about resource load statistics. These
2456 updates are not time-critical, and do not need to be done in concert with the actual
2457 load. As resource loads are made, each WebProcess notifies the UIProcess of the new
2458 load counts, then clears its local state. These statistics are then aggregated in
2461 * CMakeLists.txt: Add new ResourceLoadStatisticsState files to build.
2462 * DerivedSources.make: Ditto.
2463 * Platform/IPC/ArgumentCoders.h: Update to support HashCountedSets.
2464 * PlatformEfl.cmake: Add new ResourceLoadStatisticsState files to build.
2465 * PlatformGTK.cmake: Ditto.
2466 * PlatformMac.cmake: Ditto.
2467 * Shared/API/APIObject.h: Add new ResourceLoadStatistics type.
2468 * Shared/WebCoreArgumentCoders.cpp:
2469 (IPC::ArgumentCoder<ExceptionDetails>::decode): Support new ResourceLoadStatistics type.
2470 (IPC::ArgumentCoder<ResourceLoadStatistics>::encode): Added.
2471 (IPC::ArgumentCoder<ResourceLoadStatistics>::decode): Added.
2472 * Shared/WebCoreArgumentCoders.h:
2473 * Shared/WebProcessCreationParameters.cpp:
2474 (WebKit::WebProcessCreationParameters::encode): Handle 'resourceLoadStatisticsEnabled' flag.
2475 (WebKit::WebProcessCreationParameters::decode): Ditto.
2476 * Shared/WebProcessCreationParameters.h:
2477 * UIProcess/API/APIProcessPoolConfiguration.cpp:
2478 (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add storage location for the
2479 resource load statistics.
2480 (API::ProcessPoolConfiguration::copy): Handle the new storage location and the feature flag.
2481 * UIProcess/API/APIProcessPoolConfiguration.h:
2482 * UIProcess/API/APIWebsiteDataStore.cpp:
2483 (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Added stub.
2484 * UIProcess/API/APIWebsiteDataStore.h:
2485 * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2486 (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Added.
2487 (API::WebsiteDataStore::defaultDataStoreConfiguration): Added support for the new resource
2488 load statistics storage location.
2489 * UIProcess/API/Cocoa/WKWebView.mm:
2490 (-[WKWebView _initializeWithConfiguration:]): Sync Process Pool configuration parameters
2491 with the state of our websiteData object's "ResourceLoadStatisticsEnabled" flag, so that
2492 new processes are created in the right state.
2493 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2494 (-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]): Added.
2495 (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]): Added.
2496 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2497 * UIProcess/WebProcessPool.cpp:
2498 (WebKit::WebProcessPool::createNewWebProcess): Handle new flag for enabling resource
2500 * UIProcess/WebResourceLoadStatisticsStore.cpp: Added.
2501 (WebKit::WebResourceLoadStatisticsStore::create):
2502 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2503 (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
2504 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2505 (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled):
2506 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsEnabled):
2507 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2508 (WebKit::WebResourceLoadStatisticsStore::writeToDisk):
2509 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
2510 * UIProcess/WebResourceLoadStatisticsStore.h: Added.
2511 (WebKit::WebResourceLoadStatisticsStore::coreStore):
2512 * UIProcess/WebResourceLoadStatisticsStore.messages.in: Added.
2513 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2514 (WebKit::WebsiteDataStore::platformInitialize): Register a termination handler
2515 to close down the resource load statistics store.
2516 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2517 (WebKit::WebsiteDataStore::WebsiteDataStore): Initialize the new WebResourceLoadStatisticsStore
2519 (WebKit::WebsiteDataStore::webProcessWillOpenConnection): Register the WebResourceLoadStatisticsStore
2520 object as a work queue message receiver
2521 (WebKit::WebsiteDataStore::webProcessDidCloseConnection): Unregister WebResourceLoadStatisticsStore.
2522 (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled): Added.
2523 (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): Ditto.
2524 * UIProcess/WebsiteData/WebsiteDataStore.h:
2525 (WebKit::WebsiteDataStore::resourceLoadStatisticsStore): Added.
2526 * WebKit2.xcodeproj/project.pbxproj: Add new ResourceLoadStatisticsState files to build.
2527 * WebProcess/WebProcess.cpp:
2528 (WebKit::WebProcess::initializeWebProcess): Take into account the new parameter
2529 specifying whether resource load statistics are being captured.
2530 (WebKit::WebProcess::WebProcess): Initialized statistics changed notification timer.
2531 (WebKit::WebProcess::statisticsChangedTimerFired): Added. Send bundles of site load
2532 statistics to the UIProcess on a set interval. Clear out local cache after each send.
2533 (WebKit::WebProcess::setResourceLoadStatisticsEnabled): Added.
2534 * WebProcess/WebProcess.h:
2535 * WebProcess/WebProcess.messages.in: Add new SetResourceLoadStatisticsEnabled message.
2537 2016-03-04 Daniel Bates <dabates@apple.com>
2539 Temporarily use bundle identifier as part of user directory suffix
2540 https://bugs.webkit.org/show_bug.cgi?id=155042
2541 <rdar://problem/24983174>
2543 Reviewed by Brent Fulgham and Brady Eidson.
2545 * Shared/mac/ChildProcessMac.mm:
2546 (WebKit::ChildProcess::initializeSandbox):
2548 2016-03-04 Alex Christensen <achristensen@webkit.org>
2550 Release build fix after r197572.
2551 https://bugs.webkit.org/show_bug.cgi?id=154993
2553 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2554 (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2556 2016-03-04 Alex Christensen <achristensen@webkit.org>
2558 Use NSURLSession for loading in WebKit2
2559 https://bugs.webkit.org/show_bug.cgi?id=154993
2561 Reviewed by Sam Weinig.
2565 2016-03-04 Alex Christensen <achristensen@webkit.org>
2567 Use NetworkSession for pings
2568 https://bugs.webkit.org/show_bug.cgi?id=154984
2570 Reviewed by Antti Koivisto.
2572 Before this patch, we were using NSURLConnection for pings when the rest of the loading was being
2573 done with NSURLSession. To fix this, I implemented PingLoad, which is the NetworkSession equivalent
2576 This fixes http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html
2578 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2579 (WebKit::NetworkConnectionToWebProcess::loadPing):
2580 (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier):
2581 * NetworkProcess/PingLoad.h: Added.
2582 (WebKit::PingLoad::PingLoad):
2583 (WebKit::PingLoad::willPerformHTTPRedirection):
2584 (WebKit::PingLoad::didReceiveChallenge):
2585 (WebKit::PingLoad::didReceiveResponseNetworkSession):
2586 (WebKit::PingLoad::didReceiveData):
2587 (WebKit::PingLoad::didCompleteWithError):
2588 (WebKit::PingLoad::didBecomeDownload):
2589 (WebKit::PingLoad::didSendData):
2590 (WebKit::PingLoad::wasBlocked):
2591 (WebKit::PingLoad::cannotShowURL):
2592 (WebKit::PingLoad::timeoutTimerFired):
2593 (WebKit::PingLoad::~PingLoad):
2594 * WebKit2.xcodeproj/project.pbxproj:
2596 2016-03-04 Timothy Hatcher <timothy@apple.com>
2598 Inform WebKit and WebCore if a page is controlled by automation.
2600 https://bugs.webkit.org/show_bug.cgi?id=154991
2601 rdar://problem/24965784
2603 Reviewed by Joseph Pecoraro.
2605 * Shared/WebPageCreationParameters.cpp:
2606 (WebKit::WebPageCreationParameters::encode):
2607 (WebKit::WebPageCreationParameters::decode):
2608 * Shared/WebPageCreationParameters.h:
2609 * UIProcess/API/C/WKPage.cpp:
2610 (WKPageGetIsControlledByAutomation):
2611 (WKPageSetControlledByAutomation):
2612 * UIProcess/API/C/WKPagePrivate.h:
2613 * UIProcess/WebPageProxy.cpp:
2614 (WebKit::WebPageProxy::setControlledByAutomation):
2615 (WebKit::WebPageProxy::creationParameters):
2616 * UIProcess/WebPageProxy.h:
2617 (WebKit::WebPageProxy::isControlledByAutomation):
2618 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2619 (WKBundlePageIsControlledByAutomation):
2620 * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2621 * WebProcess/WebPage/WebPage.cpp:
2622 (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2623 (WebKit::WebPage::isControlledByAutomation):
2624 (WebKit::WebPage::setControlledByAutomation):
2625 * WebProcess/WebPage/WebPage.h:
2626 * WebProcess/WebPage/WebPage.messages.in:
2628 2016-03-03 Chris Dumez <cdumez@apple.com>
2630 Regression(r196770): Unable to use HipChat Mac app
2631 https://bugs.webkit.org/show_bug.cgi?id=154999
2632 <rdar://problem/24931959>
2634 Reviewed by Darin Adler.
2636 Have the NetworkProcess and the WebProcess pass the UIProcess bundle
2637 identifier to WebCore so that we can do app detection of applications
2638 using a WK2 WebView (such as HipChat).
2640 * NetworkProcess/NetworkProcess.cpp:
2641 (WebKit::NetworkProcess::initializeNetworkProcess):
2642 * WebProcess/WebProcess.cpp:
2643 (WebKit::WebProcess::initializeWebProcess):
2645 2016-03-03 Simon Fraser <simon.fraser@apple.com>
2647 Use larger tiles when possible to reduce per-tile painting overhead
2648 https://bugs.webkit.org/show_bug.cgi?id=154985
2649 rdar://problem/23635219
2651 Reviewed by Tim Horton.
2653 Do a bit of #include cleanup.
2655 * Shared/mac/RemoteLayerBackingStore.mm:
2656 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2657 * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
2658 * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2660 2016-03-03 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2662 Use std::make_unique<> when creating std::unique_ptr<>
2663 https://bugs.webkit.org/show_bug.cgi?id=154574
2665 Reviewed by Darin Adler.
2667 * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2668 (WebKit::NetworkCache::Statistics::open):
2669 * NetworkProcess/cache/NetworkCacheStatistics.h:
2670 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2671 (WebKit::WebChromeClient::createColorChooser):
2673 2016-03-03 Alex Christensen <achristensen@webkit.org>
2675 Move SPI to CFNetworkSPI.h
2676 https://bugs.webkit.org/show_bug.cgi?id=154992
2678 Reviewed by Andy Estes.
2680 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2681 (WebKit::applyBasicAuthorizationHeader):
2683 2016-03-03 Alex Christensen <achristensen@webkit.org>
2685 Use CredentialStorage with NetworkSession
2686 https://bugs.webkit.org/show_bug.cgi?id=154939
2688 Reviewed by Darin Adler.
2691 Added compile-time flag to help us be able to keep track and remove this code when we can.
2692 * NetworkProcess/NetworkDataTask.h:
2693 (WebKit::NetworkDataTask::pendingDownloadLocation):
2694 * NetworkProcess/NetworkProcess.cpp:
2695 (WebKit::NetworkProcess::clearCachedCredentials):
2696 (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
2697 * NetworkProcess/NetworkSession.h:
2698 (WebKit::NetworkSession::sessionID):
2699 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2700 (WebKit::applyBasicAuthorizationHeader):
2701 (WebKit::NetworkDataTask::NetworkDataTask):
2702 Use a credential storage and preemptively apply basic authentication headers if we have credentials from the storage.
2703 This is analogous to code in ResourceHandle::createNSURLConnection.
2705 (WebKit::NetworkDataTask::didReceiveChallenge):
2706 Make this look more like ResourceHandle::didReceiveAuthenticationChallenge.
2707 The call to tryPasswordBasedAuthentication was moved from the delegate callback to here.
2709 (WebKit::NetworkDataTask::willPerformHTTPRedirection):
2710 Use credentials from the credential storage if they exist. This is analogous to code in ResourceHandle::willSendRequest.
2712 (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
2713 Use credentials from the credential storage if they exist. This is analogous to code in ResourceHandle::tryHandlePasswordBasedAuthentication.
2715 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2716 (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2717 If we are given a credential with CredentialPersistenceForSession, put it in the credential storage and give
2718 CFNetwork a credential with CredentialPersistenceNone so it won't automatically be used again until the credential
2719 storage says its ok to use again. This gives us the ability to clear session credentials when logout credentials are used.
2720 This is analogous to code in ResourceHandle::receivedCredential.
2722 (WebKit::NetworkSession::defaultSession):
2723 (WebKit::NetworkSession::NetworkSession):
2724 (WebKit::NetworkSession::~NetworkSession):
2725 (WebKit::NetworkSession::dataTaskForIdentifier):
2726 (WebKit::NetworkSession::clearCredentials): Deleted.
2727 * WebProcess/WebProcess.cpp:
2728 (WebKit::WebProcess::clearCachedCredentials):
2729 (WebKit::WebProcess::focusedWebPage):
2730 We no longer need to clear credentials from the NSURLSessions because we don't store session credentials in them.
2731 Instead, calling CredentialStorage.clearCredentials is sufficient.
2733 2016-03-03 Andy Estes <aestes@apple.com>
2735 Adopt CFNetwork storage partitioning SPI
2736 https://bugs.webkit.org/show_bug.cgi?id=154957
2737 rdar://problem/23614620
2739 Reviewed by Darin Adler.
2741 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2742 (WebKit::NetworkDataTask::NetworkDataTask): Computed the storage partition identifier for the new session task.
2743 If non-empty, set it using a NSURLSessionTask SPI.
2745 2016-03-03 Alex Christensen <achristensen@webkit.org>
2747 [WK2] testRunner.setPrivateBrowsingEnabled doesn't work with NetworkProcess
2748 https://bugs.webkit.org/show_bug.cgi?id=115274
2750 Reviewed by Darin Adler.
2752 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2753 (WebKit::NetworkConnectionToWebProcess::blobSize):
2754 (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
2755 * NetworkProcess/NetworkConnectionToWebProcess.h:
2756 * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2757 * NetworkProcess/NetworkProcess.h:
2758 * WebProcess/InjectedBundle/InjectedBundle.cpp:
2759 (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2760 * WebProcess/WebProcess.cpp:
2761 (WebKit::WebProcess::destroyPrivateBrowsingSession):
2762 (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
2763 (WebKit::WebProcess::pluginProcessConnectionManager):
2764 * WebProcess/WebProcess.h:
2766 2016-03-02 Alex Christensen <achristensen@webkit.org>
2768 Properly cancel downloads when using NetworkSession
2769 https://bugs.webkit.org/show_bug.cgi?id=154893
2771 Reviewed by Brady Eidson.
2773 * NetworkProcess/Downloads/Download.cpp:
2774 (WebKit::Download::Download):
2775 * NetworkProcess/Downloads/Download.h:
2776 * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2777 (WebKit::Download::cancel):
2778 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2779 (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2781 2016-03-01 Ada Chan <adachan@apple.com>
2783 Update the media element's presentation mode properly after going in and out of full screen via the Full Screen API
2784 https://bugs.webkit.org/show_bug.cgi?id=154834
2786 Reviewed by Simon Fraser.
2788 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2789 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
2790 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2791 (WebKit::WebVideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
2792 Call the new exitFullscreenWithoutAnimationToMode() method on WebVideoFullscreenInterfaceMac.
2793 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2794 (WebKit::WebChromeClient::exitVideoFullscreenToModeWithoutAnimation):
2795 * WebProcess/WebCoreSupport/WebChromeClient.h:
2796 * WebProcess/cocoa/WebVideoFullscreenManager.h:
2797 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2798 (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
2800 2016-03-02 Beth Dakin <bdakin@apple.com>
2802 Crashes in media tests after http://trac.webkit.org/changeset/197461
2803 https://bugs.webkit.org/show_bug.cgi?id=154933
2805 Reviewed by Eric Carlson.
2807 Since the controlsManagerInterface is not guaranteed to exist, it doesn't
2808 make sense to return a reference. Return a pointer instead.
2809 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2810 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2811 (WebKit::WebVideoFullscreenManagerProxy::isVisible):
2812 (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
2813 (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
2815 2016-03-02 Beth Dakin <bdakin@apple.com>
2817 Add support for playbackControlsManager
2818 https://bugs.webkit.org/show_bug.cgi?id=154742
2820 rdar://problem/23833753
2822 Reviewed by Jer Noble.
2824 WebVideoFullscreenManagerProxy ensures the model and interface for the
2825 UIProcess side of the playbackControlsManager. It also caches the
2826 m_controlsManagerContextId so that it can return the
2827 controlsManagerInterface.
2828 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2829 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
2830 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2831 (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
2832 (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
2834 Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to
2835 update WebViewImplAdditions.
2836 * UIProcess/Cocoa/WebViewImpl.h:
2837 * UIProcess/Cocoa/WebViewImpl.mm:
2838 (WebKit::WebViewImpl::isPlayingMediaDidChange):
2839 * UIProcess/PageClient.h:
2840 * UIProcess/WebPageProxy.cpp:
2841 (WebKit::WebPageProxy::isPlayingMediaDidChange):
2842 (WebKit::WebPageProxy::isPlayingVideoWithAudio):
2843 * UIProcess/WebPageProxy.h:
2844 (WebKit::WebPageProxy::isPlayingAudio):
2845 * UIProcess/mac/PageClientImpl.h:
2846 * UIProcess/mac/PageClientImpl.mm:
2847 (WebKit::PageClientImpl::isPlayingMediaDidChange):
2849 Pipe setUpVideoControlsManager to the WebVideoFullscreenManager.
2850 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2851 (WebKit::WebChromeClient::setUpVideoControlsManager):
2852 * WebProcess/WebCoreSupport/WebChromeClient.h:
2854 Ensure the model an interface for the playbackControlsManager on the
2855 WebProcess side and pass the message to the UIProcess to do the same.
2856 * WebProcess/cocoa/WebVideoFullscreenManager.h:
2857 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2858 (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
2860 2016-03-02 Carlos Garcia Campos <cgarcia@igalia.com>
2862 REGRESSION(r197409): [GTK] Web process always crashes on WebPage construction after r197409
2863 https://bugs.webkit.org/show_bug.cgi?id=154918
2865 Reviewed by Žan Doberšek.
2867 We have an incorrect check in DrawingAreaImpl constructor that has
2868 never actually worked because it uses the page settings before
2869 they were initialized. But that has been fixed in r197409 and now
2870 we are always forcing accelerated compositing mode incorrectly,
2871 because m_alwaysUseCompositing is set in the constructor and never
2874 * WebProcess/WebPage/DrawingAreaImpl.cpp:
2875 (WebKit::DrawingAreaImpl::DrawingAreaImpl): Remove code to set
2876 settings and m_alwaysUseCompositing, since that should be done in
2877 updatePreferences().
2878 (WebKit::DrawingAreaImpl::updatePreferences): Update the settings
2879 accordingly and always update m_alwaysUseCompositing when AC is
2880 enabled and forced in the settings.
2881 * WebProcess/WebPage/WebPage.cpp:
2882 (WebKit::WebPage::WebPage): WebPage::updatePreferences() calls
2883 DrawingArea::updatePreferences(), but since r197409 it happens
2884 before the drawing area has been created. So, call
2885 DrawingArea::updatePreferences() in the constructor right after
2886 the main frame has been created, since
2887 DrawingArea::updatePreferences() uses the main frame.
2889 2016-02-29 Ada Chan <adachan@apple.com>
2891 Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
2892 https://bugs.webkit.org/show_bug.cgi?id=154823
2894 Reviewed by Tim Horton.
2896 * UIProcess/WebPageProxy.cpp:
2897 (WebKit::WebPageProxy::showPlaybackTargetPicker):
2898 (WebKit::WebPageProxy::customPlaybackActionSelected):
2899 * UIProcess/WebPageProxy.h:
2900 * UIProcess/WebPageProxy.messages.in:
2901 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2902 (WebKit::WebChromeClient::showPlaybackTargetPicker):
2903 * WebProcess/WebCoreSupport/WebChromeClient.h:
2904 * WebProcess/WebPage/WebPage.h:
2905 * WebProcess/WebPage/WebPage.messages.in:
2906 * WebProcess/WebPage/mac/WebPageMac.mm:
2907 (WebKit::WebPage::customPlaybackActionSelected):
2909 2016-02-29 Brent Fulgham <bfulgham@apple.com>
2911 [WK2] Stub support for WebsiteDataTypeResourceLoadStatistics
2912 https://bugs.webkit.org/show_bug.cgi?id=154689
2913 <rdar://problem/24702576>
2915 Reviewed by Sam Weinig.
2917 * Shared/WebsiteData/WebsiteDataType.h: Add new WebsiteDataTypeResourceLoadStatistics.
2918 * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2919 (dataTypesToString): Handle new type.
2920 * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2921 (WebKit::toWebsiteDataTypes): Ditto.
2922 (WebKit::toWKWebsiteDataTypes): Ditto.
2923 * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Add new _WebsiteDataTypeResourceLoadStatistics.
2925 2016-03-01 Alex Christensen <achristensen@webkit.org>
2927 Correctly keep track of NetworkDataTasks with and without credentials when using NetworkSession
2928 https://bugs.webkit.org/show_bug.cgi?id=154876
2930 Reviewed by Brady Eidson.
2932 I was seeing an assertion failure from ASSERT(!m_session.m_dataTaskMap.contains(taskIdentifier()))
2933 in the NetworkDataTask constructor sometimes. This is because a task identifier is not enough information
2934 to uniquely find a NetworkDataTask in a NetworkSession since r196034 because there are two NSURLSessions
2935 in a NetworkSession, one with credentials and one without. The assertion would fire in a case like if we
2936 made the first NetworkDataTask with credentials (taskIdentifier is 1) and the first NetworkDataTask
2937 without credentials before the first NetworkDataTask with credentials was finished. In that case, the
2938 taskIdentifier would also be 1, which would conflict with the other taskIdentifier. That taskIdentifier
2939 would uniquely identify the task in the correct NSURLSession, though, so the solution is to keep a map
2940 for each NSURLSession in the NetworkSession.
2942 * NetworkProcess/NetworkDataTask.h:
2943 * NetworkProcess/NetworkSession.h:
2944 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2945 (WebKit::NetworkDataTask::NetworkDataTask):
2946 (WebKit::NetworkDataTask::~NetworkDataTask):
2947 (WebKit::NetworkDataTask::suspend):
2948 (WebKit::serverTrustCredential):
2949 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2950 (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
2951 (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2952 (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2953 (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2954 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2955 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
2956 (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2957 (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2958 (WebKit::NetworkSession::clearCredentials):
2959 (WebKit::NetworkSession::dataTaskForIdentifier):
2960 (WebKit::NetworkSession::addDownloadID):
2962 2016-03-01 Andreas Kling <akling@apple.com>
2964 REGRESSION (r154616): Accelerated drawing is off during the initial load
2965 <https://webkit.org/b/123812>
2967 Reviewed by Tim Horton.
2969 Load preferences before instantiating the first DrawingArea. This ensures that we do the
2970 initial paint using accelerated drawing, and avoids allocating persistent data structures
2971 only needed by the software rendering path.
2973 * WebProcess/WebPage/WebPage.cpp:
2975 2016-03-01 Alex Christensen <achristensen@webkit.org>
2977 Fix tests when using NetworkSession
2978 https://bugs.webkit.org/show_bug.cgi?id=154866
2980 Reviewed by Brady Eidson.
2982 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2983 (WebKit::globalCustomProtocolManager):
2984 (WebKit::NetworkSession::setCustomProtocolManager):
2986 Use a static NeverDestroyed instead of a local NeverDestroyed.
2987 This fix was suggested by Darin after I broke the custom protocol tests in r197362.
2989 (WebKit::NetworkSession::clearCredentials):
2991 In r197223 I added code that I thought cleared the credentials of a session, but it was
2992 actually trying (and failing) to remove the credentials from the NSURLCredentialStorage that
2993 were stored with NSURLCredentialPersistencePermanent.
2994 This was causing credentials stored in an NSURLSession with NSURLCredentialPersistenceForSession
2995 to remain for the next tests, and was causing credentials from previous tests, usually from
2996 http/tests/loading/basic-credentials-sent-automatically.html, to be used in future tests.
2997 Creating a new NSURLSession is the equivalent of CredentialStorage::clearCredentials because it
2998 removes all credentials stored with NSURLCredentialPersistenceForSession.
3000 2016-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
3002 NetworkCache: Web process leaks resource buffer when using shareable reasources
3003 https://bugs.webkit.org/show_bug.cgi?id=154852
3005 Reviewed by Darin Adler.
3007 ResourceLoader::didReceiveBuffer() expects a PassRefPtr, but we
3008 are passing a raw pointer making PassRefPtr to take another
3009 reference instead of transfering the ownership as expected.
3011 * WebProcess/Network/WebResourceLoader.cpp:
3012 (WebKit::WebResourceLoader::didReceiveResource):
3014 2016-02-29 Zan Dobersek <zdobersek@igalia.com>
3016 ThreadedCompositor: clean up composition-specific resources before shutting down the thread
3017 https://bugs.webkit.org/show_bug.cgi?id=154793
3019 Reviewed by Carlos Garcia Campos.
3021 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3022 (WebKit::ThreadedCompositor::runCompositingThread): Before concluding the
3023 compositing thread run, clean up all the resources that were allocated at
3024 the start, and in the reverse order. Specifically, we now also deallocate
3025 the CoordinatedGraphicsScene and the SimpleViewportController objects. This
3026 way these are not deallocated on the main thread when the ThreadedCompositor
3027 destructor would otherwise clean them up.
3029 2016-02-29 Zan Dobersek <zdobersek@igalia.com>
3031 ThreadSafeCoordinatedSurface: remove the unused private create() static method
3032 https://bugs.webkit.org/show_bug.cgi?id=154792
3034 Reviewed by Carlos Garcia Campos.
3036 Remove the static ThreadSafeCoordinatedSurface::create() method that accepted
3037 a std::unique_ptr<ImageBuffer> object as its third parameter. This was not used
3040 * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
3041 (WebKit::ThreadSafeCoordinatedSurface::create): Deleted.
3042 * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:
3044 2016-02-29 Simon Fraser <simon.fraser@apple.com>
3046 Remove the experimental feature of antialiased font dilation
3047 https://bugs.webkit.org/show_bug.cgi?id=154843
3049 Reviewed by Zalan Bujtas.
3051 Remove the "antialiased font dilation" code path, and related prefs.
3053 * Shared/WebPreferencesDefinitions.h:
3054 * UIProcess/API/C/WKPreferences.cpp:
3055 (WKPreferencesSetAntialiasedFontDilationEnabled):
3056 (WKPreferencesGetAntialiasedFontDilationEnabled):
3057 * UIProcess/API/C/WKPreferencesRefPrivate.h:
3058 * UIProcess/API/Cocoa/WKPreferences.mm:
3059 (-[WKPreferences _antialiasedFontDilationEnabled]): Deleted.
3060 (-[WKPreferences _setAntialiasedFontDilationEnabled:]): Deleted.
3061 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3062 * WebProcess/WebPage/WebPage.cpp:
3063 (WebKit::WebPage::updatePreferences): Deleted.
3065 2016-02-29 Brady Eidson <beidson@apple.com>
3067 Modern IDB: WebKit 2 IPC layer easily confused about multiple web processes being connected.
3068 https://bugs.webkit.org/show_bug.cgi?id=154837
3070 Reviewed by Alex Christensen.
3072 The crux of the bug is that WebProcesses cannot assign themselves server-unique identifiers...
3073 The server must do that for them.
3075 A once-per-session-per-WebProcess sync message and a few updates to connection management fix this.
3077 * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
3078 (WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage):
3079 (WebKit::generateConnectionToServerIdentifier):
3080 (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
3081 * DatabaseProcess/DatabaseToWebProcessConnection.h:
3082 * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
3084 * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3085 (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
3086 (WebKit::generateConnectionToServerIdentifier): Deleted.
3088 * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
3089 (WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
3090 (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
3091 * WebProcess/Databases/WebToDatabaseProcessConnection.h:
3093 2016-02-29 Alex Christensen <achristensen@webkit.org>
3095 Don't call NetworkProcess::singleton from WebProcess when using NetworkSession
3096 https://bugs.webkit.org/show_bug.cgi?id=154829
3098 Reviewed by Anders Carlsson.
3100 We were calling NetworkProcess::singleton when making the default session in the
3101 WebProcess, which caused bad things to happen. We also were never clearing the
3102 credentials in the WebProcess between tests because it used to always call
3103 NetworkProcess::singleton, which caused flaky tests.
3105 This fixes repeatable crashes in http/tests/media/media-document-referer.html and
3106 http/tests/media/media-document.html when using NetworkSession.
3108 * NetworkProcess/NetworkProcess.cpp:
3109 (WebKit::NetworkProcess::NetworkProcess):
3110 (WebKit::NetworkProcess::~NetworkProcess):
3111 * NetworkProcess/NetworkSession.h:
3112 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3113 (WebKit::configurationForType):
3114 (WebKit::globalCustomProtocolManager):
3115 (WebKit::NetworkSession::setCustomProtocolManager):
3116 (WebKit::NetworkSession::defaultSession):
3117 * WebProcess/WebProcess.cpp:
3118 (WebKit::WebProcess::clearCachedCredentials):
3120 2016-02-29 Gavin Barraclough <barraclough@apple.com>
3122 RefCounter<T>::Event -> RefCounterEvent
3123 https://bugs.webkit.org/show_bug.cgi?id=154767
3125 Reviewed by Darin Adler.
3127 RefCounter<T>::Event is kinda verbose to use, and there is no need for this
3128 to be specific to a particular typeof RefCounter. Move the enum class up to
3129 the top level & rename to RefCounterEvent.
3131 Also remove UserObservablePageToken - this is vestigial & not really offering
3132 anything over just using UserObservablePageCounter::Token directly.
3134 * UIProcess/Plugins/PluginProcessManager.cpp:
3135 (WebKit::PluginProcessManager::PluginProcessManager):
3136 * UIProcess/Plugins/PluginProcessManager.h:
3137 * UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
3138 (WebKit::PluginProcessManager::updateProcessSuppressionDisabled):
3139 * UIProcess/ProcessThrottler.cpp:
3140 (WebKit::ProcessThrottler::ProcessThrottler):
3141 (WebKit::m_backgroundCounter):
3142 (WebKit::m_suspendMessageCount):
3143 * UIProcess/ProcessThrottler.h:
3144 * UIProcess/WebPageProxy.h:
3145 * UIProcess/WebProcessPool.cpp:
3146 (WebKit::WebProcessPool::WebProcessPool):
3147 (WebKit::m_processSuppressionDisabledForPageCounter):
3148 (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
3149 * UIProcess/WebProcessPool.h:
3151 2016-02-29 Konstantin Tokarev <annulen@yandex.ru>
3153 Fixed compilation with !ENABLE(DATABASE_PROCESS).
3154 https://bugs.webkit.org/show_bug.cgi?id=154813
3156 Reviewed by Michael Catanzaro.
3158 * UIProcess/WebProcessPool.cpp:
3159 (WebKit::WebProcessPool::terminateDatabaseProcess): Added missing #if
3162 2016-02-29 Adrien Plazas <aplazas@igalia.com>
3164 [GTK] Touch slider test fails due to assertion in webkitWebViewBaseTouchEvent()
3165 https://bugs.webkit.org/show_bug.cgi?id=153829
3167 Reviewed by Carlos Garcia Campos.
3169 Once a touch event sequence is identified as a gesture, remove it
3170 from the list of handled touch events.
3172 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3173 (webkitWebViewBaseTouchEvent):
3175 2016-02-29 Csaba Osztrogonác <ossy@webkit.org>
3177 [Mac][cmake] Unreviewed buildfix after r197177. Just for fun.
3179 * PlatformMac.cmake:
3181 2016-02-28 Sam Weinig <sam@webkit.org>
3183 Reimplement WKPageGroup in terms of WKUserContentController
3184 https://bugs.webkit.org/show_bug.cgi?id=154804
3186 Reviewed by Dan Bernstein.
3188 Instead of having both WebPageGroup and WebUserContentControllerProxy both keep track
3189 of user scripts and user stylesheets, give WebPageGroup a WebUserContentControllerProxy
3190 and let it take care of things. This allows us to remove a ton of duplicate code, and
3191 provides a convenient way for clients currently using PageGroup based user content insertion
3192 to start using UserContentController, since they can now be used at the same time.
3194 When using WKPageConfigurationRef, the rule is:
3195 - If you don't set a WKUserContentControllerRef, the one from the WKPageGroupRef will be used.
3196 - If you do set a WKUserContentControllerRef, it will be used, and the one from the WKPageGroupRef
3197 will do nothing for that web view.
3199 * DerivedSources.make:
3200 Remove WebPageGroupProxy. It no longer is a MessageReceiver.
3202 * Shared/WebPageGroupData.cpp:
3203 (WebKit::WebPageGroupData::encode):
3204 (WebKit::WebPageGroupData::decode):
3205 * Shared/WebPageGroupData.h:
3206 Stop encoding/decoding user content, instead just encode the identifier to the UserContentController.
3208 * UIProcess/API/C/WKPageGroup.cpp:
3209 (WKPageGroupGetUserContentController):
3210 * UIProcess/API/C/WKPageGroup.h:
3211 Add getter for the underlying WKUserContentControllerRef.
3213 * UIProcess/API/cpp/WKRetainPtr.h:
3215 Add retainWK() helper to match RetainPtr's retainPtr() helper.
3217 * UIProcess/WebPageGroup.cpp:
3218 (WebKit::WebPageGroup::WebPageGroup):
3219 (WebKit::WebPageGroup::userContentController):
3220 (WebKit::WebPageGroup::addUserStyleSheet):
3221 (WebKit::WebPageGroup::addUserScript):
3222 (WebKit::WebPageGroup::removeAllUserStyleSheets):
3223 (WebKit::WebPageGroup::removeAllUserScripts):
3224 (WebKit::WebPageGroup::removeAllUserContent):
3225 (WebKit::WebPageGroup::addUserContentExtension):
3226 (WebKit::WebPageGroup::removeUserContentExtension):
3227 (WebKit::WebPageGroup::removeAllUserContentExtensions):
3228 * UIProcess/WebPageGroup.h:
3229 Pass through to the WebUserContentControllerProxy.
3231 * UIProcess/WebPageProxy.cpp:
3232 (WebKit::WebPageProxy::WebPageProxy):
3233 (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
3234 (WebKit::WebPageProxy::creationParameters):
3235 * UIProcess/WebPageProxy.h:
3236 WebPageProxies always have a WebUserContentControllerProxy now, so it can go in a Ref and
3237 a few branches can be removed.
3239 * UIProcess/WebProcessPool.cpp:
3240 (WebKit::WebProcessPool::createWebPage):
3241 If a UserContentController is not passed in, use the one from the PageGroup.
3243 * WebKit2.xcodeproj/project.pbxproj:
3246 * WebProcess/InjectedBundle/InjectedBundle.cpp:
3247 Add some #includes that are now needed.
3249 * WebProcess/UserContent/WebUserContentController.cpp:
3250 (WebKit::WebUserContentController::getOrCreate):
3251 * WebProcess/UserContent/WebUserContentController.h:
3252 Modernize WebUserContentController::getOrCreate to return a Ref.
3254 * WebProcess/WebPage/WebPage.cpp:
3255 (WebKit::WebPage::WebPage):
3256 (WebKit::m_shouldDispatchFakeMouseMoveEvents):
3257 (WebKit::WebPage::addUserScript):
3258 (WebKit::WebPage::addUserStyleSheet):
3259 (WebKit::WebPage::removeAllUserContent):
3260 * WebProcess/WebPage/WebPage.h:
3261 Store the WebUserContentController in Ref, remove unnecessary branches/asserts.
3263 * WebProcess/WebPage/WebPageGroupProxy.cpp:
3264 (WebKit::WebPageGroupProxy::WebPageGroupProxy):
3265 (WebKit::WebPageGroupProxy::~WebPageGroupProxy):
3266 (WebKit::WebPageGroupProxy::userContentController):
3267 (WebKit::WebPageGroupProxy::addUserStyleSheet): Deleted.
3268 (WebKit::WebPageGroupProxy::addUserScript): Deleted.
3269 (WebKit::WebPageGroupProxy::removeAllUserStyleSheets): Deleted.
3270 (WebKit::WebPageGroupProxy::removeAllUserScripts): Deleted.
3271 (WebKit::WebPageGroupProxy::removeAllUserContent): Deleted.
3272 (WebKit::WebPageGroupProxy::addUserContentExtension): Deleted.
3273 (WebKit::WebPageGroupProxy::removeUserContentExtension): Deleted.
3274 (WebKit::WebPageGroupProxy::removeAllUserContentExtensions): Deleted.
3275 * WebProcess/WebPage/WebPageGroupProxy.h:
3276 Store a WebUserContentController in a Ref, remove now unnecessary message handling functions.
3278 * WebProcess/WebPage/WebPageGroupProxy.messages.in:
3281 * WebProcess/WebProcess.cpp:
3282 (WebKit::WebProcess::didReceiveMessage):
3283 Remove routing to WebPageGroupProxy, which is no longer a MessageReceiver.
3285 2016-02-28 Sam Weinig <sam@webkit.org>
3287 Bind _WKUserStyleSheets to _WKUserContentWorlds to allow for grouping of user content by associating to a world
3288 https://bugs.webkit.org/show_bug.cgi?id=154798
3290 Reviewed by Dan Bernstein.
3292 Treat _WKUserStyleSheets like WKUserScripts and allow them to be bound to a _WKUserContentWorld.
3293 The immediate benefit of this is allowing a client to bind a set of user content (scripts and stylesheets
3294 for now) to a world and have them easily remove all user content associated with that world easily.
3296 * Shared/API/APIArray.h:
3297 Add helpers removeAllMatching and removeAllOfTypeMatching.
3299 * UIProcess/API/APIUserStyleSheet.h:
3300 Add API::UserContentWorld member.
3302 * UIProcess/API/Cocoa/WKUserContentController.mm:
3303 (-[WKUserContentController _removeAllUserScriptsAssociatedWithUserContentWorld:]):
3304 (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithUserContentWorld:]):
3305 * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
3306 Add _removeAllUserScriptsAssociatedWithUserContentWorld and _removeAllUserStyleSheetsAssociatedWithUserContentWorld.
3308 * UIProcess/API/Cocoa/WKUserScript.mm:
3309 (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
3310 (toStringVector): Deleted.
3311 * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
3312 (API::toStringVector):
3313 Move toStringVector to a location where it can be shared.
3315 * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
3316 * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
3317 (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
3318 Add new initializer which has a world to be bound to. While here, match WKUserScript and add support for the
3319 legacy whitelist and blacklists.
3321 * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3322 (WebKit::WebUserContentControllerProxy::addProcess):
3323 (WebKit::WebUserContentControllerProxy::removeProcess):
3324 (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
3325 (WebKit::WebUserContentControllerProxy::shouldSendRemoveUserContentWorldsMessage):
3326 (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
3327 (WebKit::WebUserContentControllerProxy::addUserScript):
3328 (WebKit::WebUserContentControllerProxy::removeUserScript):
3329 (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
3330 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
3331 (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
3332 (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
3333 * UIProcess/UserContent/WebUserContentControllerProxy.h:
3334 Refactor to share the code which decides whether to send AddUserContentWorlds/RemoveUserContentWorlds
3337 * WebProcess/UserContent/WebUserContentController.cpp:
3338 (WebKit::WebUserContentController::addUserContentWorlds):
3339 (WebKit::WebUserContentController::removeUserContentWorlds):
3340 (WebKit::WebUserContentController::addUserScripts):
3341 (WebKit::WebUserContentController::removeUserScript):
3342 (WebKit::WebUserContentController::removeAllUserScripts):
3343 (WebKit::WebUserContentController::addUserStyleSheets):
3344 (WebKit::WebUserContentController::removeUserStyleSheet):
3345 (WebKit::WebUserContentController::removeAllUserStyleSheets):
3346 * WebProcess/UserContent/WebUserContentController.h:
3347 * WebProcess/UserContent/WebUserContentController.messages.in:
3348 Add support for binding stylesheets to worlds and allow removing all the scripts/stylesheets from a
3349 set of worlds at once by passing Vectors of world identifiers in the remove messages.
3351 2016-02-27 Commit Queue <commit-queue@webkit.org>
3353 Unreviewed, rolling out r197204, r197207, r197211, r197217,
3354 r197218, and r197219.
3355 https://bugs.webkit.org/show_bug.cgi?id=154780
3357 Caused crashes in WebVideoFullscreenManagerProxy (Requested by
3360 Reverted changesets:
3362 "Add support for playbackControlsManager"
3363 https://bugs.webkit.org/show_bug.cgi?id=154742
3364 http://trac.webkit.org/changeset/197204
3366 "Attempted build fix."
3367 http://trac.webkit.org/changeset/197207
3369 "Attempted build fix."
3370 http://trac.webkit.org/changeset/197211
3372 "Attempted 32-bit build fix."
3373 http://trac.webkit.org/changeset/197217
3375 "Another 32-bit build fix."
3376 http://trac.webkit.org/changeset/197218
3379 http://trac.webkit.org/changeset/197219
3381 2016-02-26 Carlos Garcia Campos <cgarcia@igalia.com>
3383 Unreviewed. Fix GTK+ clean build.
3385 Add missing header include.
3387 * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3389 2016-02-26 Carlos Garcia Campos <cgarcia@igalia.com>
3391 Network cache: old pages returned by disk cache on history navigation after session is restored
3392 https://bugs.webkit.org/show_bug.cgi?id=153230
3394 Reviewed by Chris Dumez.
3396 Since r181734, the network cache never revalidates resources for
3397 history navigation. This is good for the memory cache, but in the
3398 case of disk cache, we might end up with outdated pages when
3399 restoring the session. When restoring the session happens because
3400 of an API request (we also restore the session when recovering
3401 from a web process crash), we should revalidate back forward list
3402 requests in the disk cache if needed. This will only happen the
3403 first time they are loaded after a session restore. After a web process
3404 crash, resources will be used uncondionally from the disk cache.
3406 * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3407 (WebKit::WebBackForwardListProxy::addItemFromUIProcess): Use Ref&&
3408 instead of PassRefPtr.
3409 * WebProcess/WebPage/WebBackForwardListProxy.h:
3410 * WebProcess/WebPage/WebPage.cpp:
3411 (WebKit::WePage::WebPage): Call restoreSessionInternal passing
3412 No as restoredByAPIRequest parameter.
3413 (WebKit::WebPage::restoreSessionInternal): Set restoredFromSession
3414 flag to the created HistoryItem if the item was restored from
3415 session by an API request.
3416 (WebKit::WebPage::restoreSession): Call restoreSessionInternal
3417 passing Yes as restoredByAPIRequest parameter.
3418 * WebProcess/WebPage/WebPage.h:
3420 2016-02-26 Michael Catanzaro <mcatanzaro@igalia.com>
3424 Unreviewed. Shame I didn't notice in the previous commit.
3426 * WebProcess/UserContent/WebUserContentController.cpp:
3427 (WebKit::WebUserContentController::removeUserContentWorld):
3429 2016-02-26 Michael Catanzaro <mcatanzaro@igalia.com>
3431 Fix GTK and maybe EFL build after r197172.
3436 * UIProcess/API/gtk/WebKitUserContent.cpp:
3437 (_WebKitUserScript::_WebKitUserScript):
3438 * WebProcess/UserContent/WebUserContentController.cpp:
3439 (WebKit::WebUserContentController::removeUserContentWorld):
3440 (WebKit::WebUserContentController::addUserScripts):
3441 (WebKit::WebUserContentController::removeUserScript):
3442 (WebKit::WebUserContentController::removeAllUserScripts):
3444 2016-02-26 Michael Catanzaro <mcatanzaro@igalia.com>