1 2016-03-17 Andy Estes <aestes@apple.com>
3 [Mac] Enable Content-Disposition: attachment sandbox
4 https://bugs.webkit.org/show_bug.cgi?id=155578
5 <rdar://problem/21886326>
7 Reviewed by Dan Bernstein.
9 Covered by the existing set of attachment sandbox tests, which have always been run on Mac.
11 * WebProcess/WebPage/WebPage.cpp:
12 (WebKit::WebPage::WebPage):
14 2016-03-16 Beth Dakin <bdakin@apple.com>
16 Provide NSSpellChecker spellChecking methods with the current insertion point
17 https://bugs.webkit.org/show_bug.cgi?id=155532
19 rdar://problem/24066952
21 Reviewed by Simon Fraser.
23 Pass the insertionPoint to the UIProcess
24 * UIProcess/TextChecker.h:
25 * UIProcess/WebPageProxy.cpp:
26 (WebKit::WebPageProxy::checkTextOfParagraph):
27 (WebKit::WebPageProxy::getGuessesForWord):
28 (WebKit::WebPageProxy::requestCheckingOfString):
29 * UIProcess/WebPageProxy.h:
30 * UIProcess/WebPageProxy.messages.in:
31 * UIProcess/efl/TextCheckerEfl.cpp:
32 (WebKit::TextChecker::checkTextOfParagraph):
33 (WebKit::TextChecker::getGuessesForWord):
34 (WebKit::TextChecker::requestCheckingOfString):
35 * UIProcess/gtk/TextCheckerGtk.cpp:
36 (WebKit::TextChecker::getGuessesForWord):
37 (WebKit::TextChecker::requestCheckingOfString):
38 (WebKit::TextChecker::checkTextOfParagraph):
39 * UIProcess/ios/TextCheckerIOS.mm:
40 (WebKit::TextChecker::checkTextOfParagraph):
41 (WebKit::TextChecker::getGuessesForWord):
42 (WebKit::TextChecker::requestCheckingOfString):
43 * UIProcess/mac/TextCheckerMac.mm:
44 (WebKit::TextChecker::checkTextOfParagraph):
45 (WebKit::TextChecker::getGuessesForWord):
46 (WebKit::TextChecker::ignoreWord):
47 (WebKit::TextChecker::requestCheckingOfString):
49 Extract the insertion point from the VisibleSelection that WebCore has
51 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
52 (WebKit::insertionPointFromCurrentSelection):
53 (WebKit::WebEditorClient::checkTextOfParagraph):
54 (WebKit::WebEditorClient::getGuessesForWord):
55 (WebKit::WebEditorClient::requestCheckingOfString):
56 * WebProcess/WebCoreSupport/WebEditorClient.h:
58 2016-03-16 Tim Horton <timothy_horton@apple.com>
60 REGRESSION (r192184): CleanMyDrive 2's tutorial window is blank
61 https://bugs.webkit.org/show_bug.cgi?id=155550
62 <rdar://problem/24250689>
64 Reviewed by Dan Bernstein.
66 * UIProcess/API/Cocoa/WKWebView.mm:
67 (-[WKWebView _setDrawsTransparentBackground:]):
68 The app is using this SPI via key-value coding, so just keeping the implementation
69 is sufficient to make AppKit stop throwing an undefined key exception.
70 Log once that this is deprecated (... it's also SPI) and then forward to setDrawsBackground.
72 2016-03-16 Daniel Bates <dabates@apple.com>
74 <video> and <audio> elements do not obey Content Security Policy on redirect
75 https://bugs.webkit.org/show_bug.cgi?id=155509
76 <rdar://problem/10234844>
78 Reviewed by Alex Christensen.
80 Use 0ms as the maximum buffering time for media resource just as we do currently.
82 * WebProcess/Network/WebLoaderStrategy.cpp:
83 (WebKit::maximumBufferingTime):
85 2016-03-16 Chris Dumez <cdumez@apple.com>
87 Unreviewed, rolling out r198235, r198240, r198241, and
90 Causing crashes on ARM
94 "Remove compile time define for SEPARATED_HEAP"
95 https://bugs.webkit.org/show_bug.cgi?id=155508
96 http://trac.webkit.org/changeset/198235
98 "Gardening: build fix after r198235."
99 http://trac.webkit.org/changeset/198240
102 http://trac.webkit.org/changeset/198241
104 "Rename performJITMemcpy to something more inline with our
105 normal webkit function names"
106 https://bugs.webkit.org/show_bug.cgi?id=155525
107 http://trac.webkit.org/changeset/198252
109 2016-03-16 Commit Queue <commit-queue@webkit.org>
111 Unreviewed, rolling out r196803.
112 https://bugs.webkit.org/show_bug.cgi?id=155534
114 Introduced several rendering issues in popular websites
115 (Requested by KaL on #webkit).
119 "[GTK] Limit the number of tiles according to the visible
121 https://bugs.webkit.org/show_bug.cgi?id=126122
122 http://trac.webkit.org/changeset/196803
124 2016-03-15 Enrica Casucci <enrica@apple.com>
126 Follow up to r195769.
127 https://bugs.webkit.org/show_bug.cgi?id=155519
128 rdar://problem/25146483
130 Reviewed by Tim Horton.
132 There are two code paths that lead to calling handleSyntheticClick()
133 where we need to check if the default action can be performed on the
135 Only one was covered in r195769 and this patch addresses the missing one.
136 I've also discovered that the point reported in DidNotHandleTapAsClick was
137 incorrectly always (0, 0) and I've fixed it.
139 * WebProcess/WebPage/ios/WebPageIOS.mm:
140 (WebKit::WebPage::handleTap):
142 2016-03-15 Ryan Haddad <ryanhaddad@apple.com>
144 Unreviewed, rolling out r198230.
146 This change caused LayoutTests to fail on Mac
150 "REGRESSION (r194660): Navigating to HTTPS sites may fail with
152 https://bugs.webkit.org/show_bug.cgi?id=155455
153 http://trac.webkit.org/changeset/198230
155 2016-03-15 Oliver Hunt <oliver@apple.com>
157 Remove compile time define for SEPARATED_HEAP
158 https://bugs.webkit.org/show_bug.cgi?id=155508
160 Reviewed by Mark Lam.
162 Remove the feature define.
164 * Configurations/FeatureDefines.xcconfig:
166 2016-03-15 Daniel Bates <dabates@apple.com>
168 REGRESSION (r194660): Navigating to HTTPS sites may fail with error
169 https://bugs.webkit.org/show_bug.cgi?id=155455
170 <rdar://problem/24308793>
172 Reviewed by Alexey Proskuryakov.
174 Fixes an issue where navigating to an HTTPS site may fail because the Security Framework uses
175 a cache directory that it does not have permission to use.
177 * Shared/mac/ChildProcessMac.mm:
178 (WebKit::codeSigningIdentifierForProcess): Queries the Security Framework for the code signed
179 bundle identifier/code signing identifier.
180 (WebKit::ChildProcess::initializeSandbox): Use the client identifier as part of the user directory
181 suffix. Verify that the client identifier matches the code signed bundled identifier/code
182 signing identifier for the code signed app/tool. Fix minor code style issue; use a C++-style cast
183 instead of a C-style cast when casting an OSStatus to a long.
184 (WebKit::findSecCodeForProcess): Deleted; incorporated logic into WebKit::codeSigningIdentifierForProcess().
186 2016-03-15 Antti Koivisto <antti@apple.com>
188 Add Antti to WebKit2 Owners file
189 https://bugs.webkit.org/show_bug.cgi?id=155504
191 Reviewed by Anders Carlsson and Sam Weinig.
195 2016-03-15 Gyuyoung Kim <gyuyoung.kim@webkit.org>
197 EFL build has been broken since r198180
198 https://bugs.webkit.org/show_bug.cgi?id=155488
200 Unreviewed build fix.
202 * WebProcess/UserContent/WebUserContentController.h: Use ENABLE(USER_MESSAGE_HANDLERS) guard.
204 2016-03-15 Chris Dumez <cdumez@apple.com>
206 Regression(r197939): ASSERTION FAILED: url.containsOnlyASCII() in URL.cpp
207 https://bugs.webkit.org/show_bug.cgi?id=155449
208 <rdar://problem/25134826>
210 Reviewed by Carlos Garcia Campos.
212 Bump WK2 Network Disk Cache version after r197939 as the new cache format
213 is not compatible with the old one and leads to assertions being hit when
214 browsing in Debug builds.
216 SubresourceInfo used to only contain a boolean and would therefore be
217 serialized as "0" / "1". However, after r197939, a URL field was added
218 and when trying to decode old cache entries with the new format, we
219 would try to construct a URL from the String "0" or "1". This would
220 assert because these are not valid URLs.
222 * NetworkProcess/cache/NetworkCacheStorage.h:
224 2016-03-14 Chris Dumez <cdumez@apple.com>
226 Unreviewed, rolling out r197981.
228 Caused a massive PLT regression on Mac.
232 "Font antialiasing (smoothing) changes when elements are
233 rendered into compositing layers"
234 https://bugs.webkit.org/show_bug.cgi?id=23364
235 http://trac.webkit.org/changeset/197981
237 2016-03-14 Sam Weinig <sam@webkit.org>
239 Add a baseURL parameter to _WKUserStyleSheet
240 https://bugs.webkit.org/show_bug.cgi?id=155219
242 Reviewed by Tim Horton.
244 - Moves to a model for user content where instead of using a WebCore::UserContentController
245 object, we implement the new WebCore::UserContentProvider interface (on the existing
246 WebUserContentController object).
247 - Uses this to maintain maps of UserStylesSheets and UserScripts along with their identifiers,
248 freeing up the URL, which had been acting as the identifier, to be used as the baseURL which
249 was what it was intended for.
250 - Adds a baseURL property to _WKUserStyleSheet.
252 * WebKit2.xcodeproj/project.pbxproj:
255 * Scripts/webkit/messages.py:
257 Add support for sending WebUserContentControllerDataTypes.
259 * Shared/WebUserContentControllerDataTypes.cpp: Added.
260 (WebKit::WebUserScriptData::encode):
261 (WebKit::WebUserScriptData::decode):
262 (WebKit::WebUserStyleSheetData::encode):
263 (WebKit::WebUserStyleSheetData::decode):
264 * Shared/WebUserContentControllerDataTypes.h: Added.
265 Add helper types for sending user content over IPC.
267 * UIProcess/API/APIUserScript.cpp:
268 (API::UserScript::generateUniqueURL):
269 (API::UserScript::UserScript):
270 * UIProcess/API/APIUserScript.h:
271 * UIProcess/API/APIUserStyleSheet.cpp:
272 (API::UserStyleSheet::generateUniqueURL):
273 (API::UserStyleSheet::UserStyleSheet):
274 * UIProcess/API/APIUserStyleSheet.h:
275 Add identifiers for tracking across processes.
277 * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
278 * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
279 (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
280 (-[_WKUserStyleSheet baseURL]):
281 Add new initializer which takes a baseURL as well as an accessor for the baseURL.
283 * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
284 (WebKit::WebUserContentControllerProxy::addProcess):
285 (WebKit::WebUserContentControllerProxy::addUserScript):
286 (WebKit::WebUserContentControllerProxy::removeUserScript):
287 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
288 (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
289 Pass identifiers as well as user content.
291 * WebProcess/InjectedBundle/InjectedBundle.cpp:
292 (WebKit::InjectedBundle::addUserScript):
293 (WebKit::InjectedBundle::addUserStyleSheet):
294 Move user content in via move semantics rather than using a unique_ptr.
296 (WebKit::InjectedBundle::removeUserScript):
297 (WebKit::InjectedBundle::removeUserStyleSheet):
298 (WebKit::InjectedBundle::removeUserScripts):
299 (WebKit::InjectedBundle::removeUserStyleSheets):
300 (WebKit::InjectedBundle::removeAllUserContent):
301 Update for new function signatures.
303 * WebProcess/UserContent/WebUserContentController.cpp:
304 (WebKit::WebUserContentController::WebUserContentController):
305 (WebKit::WebUserContentController::~WebUserContentController):
306 (WebKit::WebUserContentController::addUserContentWorlds):
307 (WebKit::WebUserContentController::removeUserContentWorlds):
308 (WebKit::WebUserContentController::addUserScripts):
309 (WebKit::WebUserContentController::removeUserScript):
310 (WebKit::WebUserContentController::removeAllUserScripts):
311 (WebKit::WebUserContentController::addUserStyleSheets):
312 (WebKit::WebUserContentController::removeUserStyleSheet):
313 (WebKit::WebUserContentController::removeAllUserStyleSheets):
314 (WebKit::WebUserContentController::addUserScriptMessageHandlers):
315 (WebKit::WebUserContentController::removeUserScriptMessageHandler):
316 (WebKit::WebUserContentController::addUserContentExtensions):
317 (WebKit::WebUserContentController::removeUserContentExtension):
318 (WebKit::WebUserContentController::removeAllUserContentExtensions):
319 (WebKit::WebUserContentController::addUserScriptInternal):
320 (WebKit::WebUserContentController::addUserScript):
321 (WebKit::WebUserContentController::removeUserScriptWithURL):
322 (WebKit::WebUserContentController::removeUserScriptInternal):
323 (WebKit::WebUserContentController::removeUserScripts):
324 (WebKit::WebUserContentController::addUserStyleSheetInternal):
325 (WebKit::WebUserContentController::addUserStyleSheet):
326 (WebKit::WebUserContentController::removeUserStyleSheetWithURL):
327 (WebKit::WebUserContentController::removeUserStyleSheetInternal):
328 (WebKit::WebUserContentController::removeUserStyleSheets):
329 (WebKit::WebUserContentController::removeAllUserContent):
330 (WebKit::WebUserContentController::forEachUserScript):
331 (WebKit::WebUserContentController::forEachUserStyleSheet):
332 * WebProcess/UserContent/WebUserContentController.h:
333 * WebProcess/UserContent/WebUserContentController.messages.in:
334 Convert to inheriting from UserContentProvider, rather than containing a UserContentController.
335 This means adding the storage for the user content, which has been simplified to avoid using
338 * WebProcess/WebPage/WebPage.cpp:
339 (WebKit::WebPage::addUserScript):
340 (WebKit::WebPage::addUserStyleSheet):
341 (WebKit::WebPage::removeAllUserContent):
342 Update to call the WebUserContentController, rather than going to the UserContentController, which
345 * WebProcess/WebPage/WebPageGroupProxy.cpp:
346 (WebKit::WebPageGroupProxy::userContentController):
347 * WebProcess/WebPage/WebPageGroupProxy.h:
348 Return the WebUserContentController rather than old UserContentController.
350 2016-03-14 Joonghun Park <jh718.park@samsung.com>
352 Purge PassRefPtr from ArrayBuffer, ArchiveResource, Pasteboard, LegacyWebArchive and DataObjectGtk
353 https://bugs.webkit.org/show_bug.cgi?id=150497
355 Reviewed by Darin Adler.
357 * Shared/APIWebArchive.mm:
358 (API::WebArchive::WebArchive):
359 * Shared/APIWebArchiveResource.mm:
360 (API::WebArchiveResource::data):
361 * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
362 (WebKit::PDFPlugin::addArchiveResource):
363 * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
364 (WebKit::WebPlatformStrategies::bufferForType):
365 (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
366 * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
367 * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
368 (WebKit::WebEditorClient::documentFragmentFromAttributedString):
369 * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
370 (WebKit::WebDragClient::declareAndWriteDragImage):
371 * WebProcess/WebPage/WebFrame.cpp:
372 (WebKit::WebFrame::webArchiveData):
373 * WebProcess/WebPage/WebPage.cpp:
374 (WebKit::resourceDataForFrame):
376 2016-03-14 Oliver Hunt <oliver@apple.com>
378 Temporarily disable the separated heap.
379 https://bugs.webkit.org/show_bug.cgi?id=155472
381 Reviewed by Geoffrey Garen.
383 Temporarily disable this.
385 * Configurations/FeatureDefines.xcconfig:
387 2016-03-14 Beth Dakin <bdakin@apple.com>
389 [iOS] WKPreviewAction conforms to NSCopying but doesn’t override -
391 https://bugs.webkit.org/show_bug.cgi?id=155395
393 Reviewed by Sam Weinig.
395 * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
396 (-[WKPreviewAction copyWithZone:]):
398 2016-03-14 Anders Carlsson <andersca@apple.com>
400 Remove usage of -[UIGestureRecognizer requireOtherGestureToFail:]
401 https://bugs.webkit.org/show_bug.cgi?id=155461
402 rdar://problem/25143282
404 Reviewed by Beth Dakin.
406 Use -[UIGestureRecognizer requireGestureRecognizerToFail:] instead, which has been API ever since UIGestureRecognizer was added.
408 * Platform/spi/ios/UIKitSPI.h:
409 * UIProcess/ios/WKContentViewInteraction.mm:
410 (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
412 2016-03-14 Anders Carlsson <andersca@apple.com>
414 REGRESSION (r191691): Can't Share Selected Text
415 https://bugs.webkit.org/show_bug.cgi?id=155459
416 rdar://problem/24893625
418 Reviewed by Tim Horton.
420 Add the selected text as well. Somehow this got lost in the refactoring.
422 * UIProcess/mac/WebContextMenuProxyMac.mm:
423 (WebKit::WebContextMenuProxyMac::createShareMenuItem):
425 2016-03-14 Tim Horton <timothy_horton@apple.com>
427 Revert r194125 and r194186: We're going to fix this a different way.
429 * Shared/NativeWebGestureEvent.h:
430 * Shared/mac/NativeWebGestureEventMac.mm:
431 (WebKit::pointForEvent):
432 (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
433 (WebKit::distanceForTouches): Deleted.
434 * UIProcess/API/Cocoa/WKWebView.mm:
435 (-[WKWebView selectFindMatch:completionHandler:]):
436 (-[WKWebView _web_superInputContext]):
437 (-[WKWebView touchesBeganWithEvent:]): Deleted.
438 (-[WKWebView touchesMovedWithEvent:]): Deleted.
439 (-[WKWebView touchesEndedWithEvent:]): Deleted.
440 (-[WKWebView touchesCancelledWithEvent:]): Deleted.
441 * UIProcess/API/mac/WKView.mm:
442 (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
443 (-[WKView initWithFrame:processPool:configuration:webView:]):
444 (-[WKView touchesBeganWithEvent:]): Deleted.
445 (-[WKView touchesMovedWithEvent:]): Deleted.
446 (-[WKView touchesEndedWithEvent:]): Deleted.
447 (-[WKView touchesCancelledWithEvent:]): Deleted.
448 * UIProcess/Cocoa/WebViewImpl.h:
449 * UIProcess/Cocoa/WebViewImpl.mm:
450 (WebKit::WebViewImpl::WebViewImpl):
451 (WebKit::WebViewImpl::magnifyWithEvent):
452 (WebKit::WebViewImpl::smartMagnifyWithEvent):
453 (WebKit::WebViewImpl::rotateWithEvent):
454 (WebKit::WebViewImpl::touchesOrderedByAge): Deleted.
455 (WebKit::WebViewImpl::touchesBeganWithEvent): Deleted.
456 (WebKit::WebViewImpl::touchesMovedWithEvent): Deleted.
457 (WebKit::WebViewImpl::touchesEndedWithEvent): Deleted.
458 (WebKit::WebViewImpl::touchesCancelledWithEvent): Deleted.
460 2016-03-14 Anders Carlsson <andersca@apple.com>
464 Create an empty PDF selection.
466 * Shared/mac/PDFKitImports.h:
467 * Shared/mac/PDFKitImports.mm:
468 (WebKit::pdfSelectionClass):
469 * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
470 (WebKit::PDFPlugin::nextMatchForString):
472 2016-03-14 Beth Dakin <bdakin@apple.com>
474 Unable to commit previews in Mobile Safari
475 https://bugs.webkit.org/show_bug.cgi?id=155450
477 rdar://problem/25135529
479 Reviewed by Tim Horton.
481 _uiDelegateProvidedPreviewingViewController was being consulted before
482 invoking the old SPI, which was always wrong. It should have been consulted
483 before calling the new API! But also, it doesn’t seem to be necessary at all
484 since [WKContentView _previewItemController:commitPreview:] is only invoked
485 when a custom view controller has been provided.
487 * UIProcess/ios/WKContentViewInteraction.h:
488 * UIProcess/ios/WKContentViewInteraction.mm:
489 (-[WKContentView _registerPreview]):
490 (-[WKContentView _unregisterPreview]):
491 (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
492 (-[WKContentView _presentedViewControllerForPreviewItemController:]):
493 (-[WKContentView _previewItemController:commitPreview:]):
495 2016-03-14 Brent Fulgham <bfulgham@apple.com>
497 PingHandle delete's itself but pointer is still used by handleDataURL
498 https://bugs.webkit.org/show_bug.cgi?id=154752
499 <rdar://problem/24872347>
501 Reviewed by Alex Christensen.
503 When a PingLoad is destroyed, we should tell its client so that the client can clear the pointer it
504 holds to the element to avoid accidentally attempting to use deallocated memory.
506 * NetworkProcess/PingLoad.h:
507 (WebKit::PingLoad::~PingLoad): Notify the client we are being destroyed.
509 2016-03-14 Carlos Garcia Campos <cgarcia@igalia.com>
511 Unreviewed. Fix the GTK+ build after r198124.
513 WebsiteDataTypes is now an OptionSet.
515 * UIProcess/API/gtk/WebKitWebContext.cpp:
516 (webkit_web_context_clear_cache):
518 2016-03-14 Carlos Garcia Campos <cgarcia@igalia.com>
520 [GTK] Reimplement webkit_web_context_clear_cache functionality.
521 https://bugs.webkit.org/show_bug.cgi?id=146041
523 Reviewed by Michael Catanzaro.
525 * UIProcess/API/gtk/WebKitWebContext.cpp:
526 (webkit_web_context_clear_cache):
528 2016-03-14 Jeremy Huddleston Sequoia <jeremyhu@apple.com>
530 Install WebKit2 WebProcess NetworkProcess on OSX when not building the Mac PORT
531 https://bugs.webkit.org/show_bug.cgi?id=152651
533 Reviewed by Philippe Normand.
537 2016-03-13 Joseph Pecoraro <pecoraro@apple.com>
539 Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
540 https://bugs.webkit.org/show_bug.cgi?id=155417
542 Reviewed by Yusuke Suzuki.
544 * Configurations/FeatureDefines.xcconfig:
546 2016-03-13 Dan Bernstein <mitz@apple.com>
548 [Mac] Injected bundle in relocatable WebContent service can’t use XPC services from other relocatable frameworks
549 https://bugs.webkit.org/show_bug.cgi?id=155414
550 <rdar://problem/24428418>
552 Reviewed by Sam Weinig.
554 * Configurations/DebugRelease.xcconfig:
555 Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to NO, because
556 engineering builds are ad-hoc signed and therefore can’t have a private entitlement.
558 * Configurations/WebContent-OSX.entitlements: Added. Includes the XPC domain extension
561 * Configurations/WebContentService.xcconfig:
562 Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to YES if not already set
563 and the framework is relocatable. Set CODE_SIGN_ENTITLEMENTS to the new entitlements file
564 if the domain extension entitlement is needed.
566 * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
568 2016-03-13 Dean Jackson <dino@apple.com>
570 <attachment> should be a runtime-enabled feature
571 https://bugs.webkit.org/show_bug.cgi?id=155413
572 <rdar://problem/25120753>
574 Reviewed by Sam Weinig and Anders Carlsson.
576 Add an internal setting on WKWebViewConfiguration
577 to enable the <attachment> element support.
579 * Shared/WebPreferencesDefinitions.h:
580 * UIProcess/API/Cocoa/WKWebView.mm:
581 (-[WKWebView _initializeWithConfiguration:]):
582 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
583 (-[WKWebViewConfiguration init]):
584 (-[WKWebViewConfiguration copyWithZone:]):
585 (-[WKWebViewConfiguration _attachmentElementEnabled]):
586 (-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
587 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
588 * WebProcess/WebPage/WebPage.cpp:
589 (WebKit::WebPage::updatePreferences):
591 2016-03-12 Sam Weinig <sam@webkit.org>
593 WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
594 <rdar://problem/25129946>
595 https://bugs.webkit.org/show_bug.cgi?id=155401
597 Reviewed by Alex Christensen.
599 The issue was that NSURLSessionDataTasks can continue to invoke their NSURLSession's delegate methods
600 after -[NSURLSession invalidateAndCancel] is called. So, when the NetworkSession was destroyed, and
601 still had outstanding data tasks, the session delegate would get called, try to use the session, and
602 crash. To fix this I:
604 - Made NetworkSession RefCounted.
605 - Gave NetworkSession two delegates, one for each NSURLSession.
606 - Made each delegate have a strong reference to the NetworkSession that gets cleared out in the
607 newly implemented URLSession:didBecomeInvalidWithError: method.
608 - Changed from simply destroying the NetworkSession in SessionTracker::destroySession(), to derefing
609 it and explicitly calling invalidateAndCancel on the two associated NSURLSessions (which in turn
610 eventually cause the URLSession:didBecomeInvalidWithError: to fire).
611 - To ensure the correct lifetime of the WebCore::NetworkStorageSession, I made it a member of the
612 NetworkSession. This also allowed some simplification inside SessionTracker.
614 * NetworkProcess/NetworkDataTask.h:
615 (WebKit::NetworkDataTask::setPendingDownload):
616 (WebKit::NetworkDataTask::pendingDownloadLocation):
617 * NetworkProcess/NetworkLoad.cpp:
618 (WebKit::NetworkLoad::NetworkLoad):
619 * NetworkProcess/NetworkSession.h:
620 (WebKit::NetworkSession::sessionID):
621 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
622 (WebKit::NetworkDataTask::NetworkDataTask):
623 (WebKit::NetworkDataTask::~NetworkDataTask):
624 (WebKit::NetworkDataTask::willPerformHTTPRedirection):
625 (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
626 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
627 (-[WKNetworkSessionDelegate initWithNetworkSession:]):
628 (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
629 (WebKit::NetworkSession::setCustomProtocolManager):
630 (WebKit::NetworkSession::create):
631 (WebKit::NetworkSession::defaultSession):
632 (WebKit::NetworkSession::NetworkSession):
633 (WebKit::NetworkSession::~NetworkSession):
634 (WebKit::NetworkSession::invalidateAndCancel):
635 (WebKit::NetworkSession::networkStorageSession):
636 (WebKit::NetworkSession::clearCredentials):
637 * NetworkProcess/mac/RemoteNetworkingContext.mm:
638 (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
639 * Shared/SessionTracker.cpp:
640 (WebKit::identifierBase):
641 (WebKit::SessionTracker::getIdentifierBase):
642 (WebKit::SessionTracker::setIdentifierBase):
643 (WebKit::staticSessionMap):
644 (WebKit::SessionTracker::networkSession):
645 (WebKit::SessionTracker::storageSession):
646 (WebKit::staticStorageSessionMap):
647 (WebKit::SessionTracker::sessionID):
648 (WebKit::SessionTracker::setSession):
649 (WebKit::SessionTracker::destroySession):
650 (WebKit::SessionTracker::forEachNetworkStorageSession):
651 (WebKit::storageSessionToID): Deleted.
652 (WebKit::SessionTracker::storageSessionMap): Deleted.
653 * Shared/SessionTracker.h:
654 * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
655 (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
656 (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
657 (WebKit::WebFrameNetworkingContext::localFileContentSniffingEnabled):
658 (WebKit::WebFrameNetworkingContext::scheduledRunLoopPairs):
659 * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
660 (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
661 (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
662 (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
664 2016-03-12 Myles C. Maxfield <mmaxfield@apple.com>
666 Delete dead SVG Font code
667 https://bugs.webkit.org/show_bug.cgi?id=154718
669 Reviewed by Antti Koivisto.
671 * Configurations/FeatureDefines.xcconfig:
673 2016-03-12 Beth Dakin <bdakin@apple.com>
675 Make preview inline navigation work API
676 https://bugs.webkit.org/show_bug.cgi?id=155383
678 rdar://problem/25117985
680 Reviewed by Dan Bernstein.
683 _WKElementInfo is now WKElementInfo in file and class names. Header is now
686 _WKPreviewElementInfo is now WKPreviewElementInfo in file and class names.
687 Header is now public.
689 _WKPreviewAction is now WKPreviewActionItem in filenames (header is now
690 public), the protocol _WKPreviewActionItem is now WKPreviewActionItem, and
691 the _WKPreviewAction class is now WKPreviewAction. (The internal header is
692 still project, of course.)
694 WKPreviewActionIdentifiersPrivate.h/mm is now
695 WKPreviewActionItemIdentifiers.h/mm and all the the identifiers have been
696 updated. Header is now public.
698 * Shared/API/Cocoa/WebKit.h:
699 * UIProcess/API/Cocoa/WKElementInfo.h: Copied from UIProcess/API/Cocoa/_WKElementInfo.h.
700 * UIProcess/API/Cocoa/WKElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKElementInfo.mm.
701 (-[WKElementInfo copyWithZone:]):
702 (-[_WKElementInfo copyWithZone:]): Deleted.
703 * UIProcess/API/Cocoa/WKElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKElementInfoInternal.h.
704 * UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h: Removed.
705 * UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm: Removed.
706 * UIProcess/API/Cocoa/WKPreviewActionItem.h: Copied from UIProcess/API/Cocoa/_WKPreviewAction.h.
707 * UIProcess/API/Cocoa/WKPreviewActionItem.mm: Copied from UIProcess/API/Cocoa/_WKPreviewAction.mm.
708 * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h.
709 * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm.
710 * UIProcess/API/Cocoa/WKPreviewActionItemInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewActionInternal.h.
711 * UIProcess/API/Cocoa/WKPreviewElementInfo.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.h.
712 * UIProcess/API/Cocoa/WKPreviewElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.mm.
713 (-[WKPreviewElementInfo _initWithLinkURL:]):
714 (-[_WKPreviewElementInfo _initWithLinkURL:]): Deleted.
715 * UIProcess/API/Cocoa/WKPreviewElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h.
716 * UIProcess/API/Cocoa/WKUIDelegate.h:
717 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
718 * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
719 * UIProcess/API/Cocoa/_WKElementInfo.h: Removed.
720 * UIProcess/API/Cocoa/_WKElementInfo.mm: Removed.
721 * UIProcess/API/Cocoa/_WKElementInfoInternal.h: Removed.
722 * UIProcess/API/Cocoa/_WKPreviewAction.h: Removed.
723 * UIProcess/API/Cocoa/_WKPreviewAction.mm: Removed.
724 * UIProcess/API/Cocoa/_WKPreviewActionInternal.h: Removed.
725 * UIProcess/API/Cocoa/_WKPreviewElementInfo.h: Removed.
726 * UIProcess/API/Cocoa/_WKPreviewElementInfo.mm: Removed.
727 * UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h: Removed.
728 * UIProcess/ios/WKContentViewInteraction.mm:
729 (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
730 (previewIdentifierForElementAction):
731 (-[WKContentView _presentedViewControllerForPreviewItemController:]):
732 (-[WKContentView _previewItemController:commitPreview:]):
733 * WebKit2.xcodeproj/project.pbxproj:
735 2016-03-12 Jeremy Huddleston Sequoia <jeremyhu@apple.com>
737 [GTK][Mac] Use DYLD_LIBRARY_PATH on OSX rather then LD_LIBRARY_PATH
738 https://bugs.webkit.org/show_bug.cgi?id=152650
740 Reviewed by Carlos Garcia Campos.
744 2016-03-11 John Wilander <wilander@apple.com>
746 Move prevalent resource classifier from WebCore to WebKit.
747 https://bugs.webkit.org/show_bug.cgi?id=155242
748 <rdar://problem/24913272>
750 Reviewed by Andy Estes.
752 * UIProcess/WebResourceLoadStatisticsStore.cpp:
753 (WebKit::WebResourceLoadStatisticsStore::create):
754 (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
755 (WebKit::hasPrevalentResourceCharacteristics):
756 (WebKit::classifyPrevalentResources):
757 - Moved these two functions from WebCore.
758 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
759 - Calls processStatistics with a lamda function to classify prevalent resources.
760 * WebKit2.xcodeproj/project.pbxproj:
761 - Fixed the ordering of source files.
763 2016-03-11 Sam Weinig <sam@webkit.org>
765 WebKit needs a new sandbox profile addition for DataDetectors
766 <rdar://problem/25091102>
768 Reviewed by Brent Fulgham.
770 * WebProcess/com.apple.WebProcess.sb.in:
772 2016-03-11 Chris Dumez <cdumez@apple.com>
774 Regression(r198040): WebKit2.DocumentStartUserScriptAlertCrashTest API test is crashing in debug
775 https://bugs.webkit.org/show_bug.cgi?id=155382
777 Reviewed by Alexey Proskuryakov.
779 r198040 introduced an assertion to make sure we never call
780 applicationBundleIsEqualTo() before setApplicationBundleIdentifier()
781 is called. This new assertion found a bug as it turns out we were
782 calling setApplicationBundleIdentifier() too late during the
783 WebProcess initialization and some runtime applications checks were
784 already done by then.
786 To address the problem, this patch moves the
787 setApplicationBundleIdentifier() call as early as possible during
788 the WebProcess and the NetworkProcess initialization. It also moves
789 it to the Cocoa specific files for clarity.
791 * NetworkProcess/NetworkProcess.cpp:
792 (WebKit::NetworkProcess::initializeNetworkProcess):
793 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
794 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
795 * WebProcess/WebProcess.cpp:
796 (WebKit::WebProcess::initializeWebProcess):
797 * WebProcess/cocoa/WebProcessCocoa.mm:
798 (WebKit::WebProcess::platformInitializeWebProcess):
800 2016-03-11 Enrica Casucci <enrica@apple.com>
802 Use only selected text for Look up.
803 https://bugs.webkit.org/show_bug.cgi?id=155380
805 Reviewed by Tim Horton.
807 The corresponding piece that uses the extended context for Look up
808 is not ready yet. For the moment default to retrieving the selected text.
810 * UIProcess/ios/WKContentViewInteraction.mm:
811 (-[WKContentView _lookup:]):
813 2016-03-11 Chelsea Pugh <cpugh@apple.com>
815 [iOS] Allow clients to specify text suggestions to be used for a form input session
816 https://bugs.webkit.org/show_bug.cgi?id=155343
818 Reviewed by Dan Bernstein.
820 * UIProcess/API/Cocoa/_WKFormInputSession.h:
821 * UIProcess/API/Cocoa/_WKInputDelegate.h:
822 * UIProcess/ios/WKContentViewInteraction.mm:
823 (-[WKFormInputSession suggestions]): Add a getter for suggestions.
824 (-[WKFormInputSession setSuggestions:]): Add a setter, which calls setSuggestions with our suggestions on the input delegate.
825 (-[WKContentView insertTextSuggestion:]): Call _webView:insertTextSuggestion:inInputSession: on our input delegate so clients know
826 a text suggestion was tapped.
828 2016-03-11 Anders Carlsson <andersca@apple.com>
830 Creating and releasing a WKBackForwardListItem crashes
831 https://bugs.webkit.org/show_bug.cgi?id=155376
832 rdar://problem/17377712
834 Reviewed by Dan Bernstein.
836 Make init unavailable.
838 * UIProcess/API/Cocoa/WKBackForwardListItem.h:
840 2016-03-11 Beth Dakin <bdakin@apple.com>
844 _WKPreviewAction should be in an internal header
845 https://bugs.webkit.org/show_bug.cgi?id=155370
847 Rubber-stamped by Dan Bernstein.
849 * UIProcess/API/Cocoa/_WKPreviewActionInternal.h:
851 2016-03-11 Beth Dakin <bdakin@apple.com>
853 _WKPreviewAction should be in an internal header
854 https://bugs.webkit.org/show_bug.cgi?id=155370
856 Reviewed by Tim Horton.
858 Move _WKPreviewAction to an Internal header since only the protocol needs to
860 * UIProcess/API/Cocoa/_WKPreviewAction.h:
861 * UIProcess/API/Cocoa/_WKPreviewAction.mm:
862 * UIProcess/API/Cocoa/_WKPreviewActionInternal.h: Added.
863 * UIProcess/ios/WKContentViewInteraction.mm:
864 * WebKit2.xcodeproj/project.pbxproj:
866 2016-03-11 Yusuke Suzuki <utatane.tea@gmail.com>
868 [ES6] Implement Reflect.set without receiver support
869 https://bugs.webkit.org/show_bug.cgi?id=155024
871 Reviewed by Geoffrey Garen.
873 NPJSObject::setProperty may call `methodTable()->put` operation, but we intentionally do not propagate it to the caller's ::put.
874 In the current implementation, we just use the result of ::setProperty call.
875 This is `true` when ::setProperty attempts to call `methodTable()->put`.
876 In ::setProperty, after calling `methodTable()->put`, ::setProperty function clears the exception state.
877 So this is not the same semantics to the simple data property store. Rather, this is like the accessor.
878 In ECMA262 [[Set]], it returns true if there is a setter. So we just use the returned value of ::setProperty.
879 This indicates that there is a setter for the given [[Set]] operation.
881 * WebProcess/Plugins/Netscape/JSNPObject.cpp:
882 (WebKit::JSNPObject::put):
883 * WebProcess/Plugins/Netscape/JSNPObject.h:
885 2016-03-10 David Kilzer <ddkilzer@apple.com>
887 REGRESSION (r197986): Don't try to link to undefined $(WEBKIT_SYSTEM_INTERFACE_LIBRARY)
889 Follow-up build fix for:
890 AX: Force allow user zoom
891 <https://bugs.webkit.org/show_bug.cgi?id=155056>
893 Fixes the following build failure:
894 ld: library not found for -l-lAccessibility
895 clang: error: linker command failed with exit code 1 (use -v to see invocation)
897 * Configurations/WebKit.xcconfig: Remove
898 "-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)" from OTHER_LDFLAGS since
899 that macro is not defined, and there is no need to link to
900 libWebKitSystemInterface.a.
902 2016-03-10 Jeremy Jones <jeremyj@apple.com>
904 Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
905 https://bugs.webkit.org/show_bug.cgi?id=155117
906 rdar://problem/6802240
908 Reviewed by Simon Fraser.
910 Make AVAsset AVURLAssetUsesNoPersistentCacheKey match !m_websiteDataStore->isPersistent()
911 This will prevent persistent media caches when webkit is using in-memory caching.
913 * Shared/WebPageCreationParameters.cpp: Add mediaShouldUsePersistentCache.
914 (WebKit::WebPageCreationParameters::encode):
915 (WebKit::WebPageCreationParameters::decode):
916 * Shared/WebPageCreationParameters.h:
917 * UIProcess/WebPageProxy.cpp:
918 (WebKit::WebPageProxy::creationParameters): Add mediaShouldUsePersistentCache.
919 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
920 (WebKit::WebChromeClient::mediaShouldUsePersistentCache): Added.
921 * WebProcess/WebCoreSupport/WebChromeClient.h:
922 * WebProcess/WebPage/WebPage.cpp:
923 (WebKit::m_mediaUsesPersistentCache): Added.
924 * WebProcess/WebPage/WebPage.h:
925 (WebKit::WebPage::mediaShouldUsePersistentCache): Added.
927 2016-03-10 Nan Wang <n_wang@apple.com>
929 AX: Force allow user zoom
930 https://bugs.webkit.org/show_bug.cgi?id=155056
932 Reviewed by Simon Fraser.
934 Linked libAccessibility library so that we can observe the accessibility
935 setting change for the force always user scalable feature.
937 * Configurations/WebKit.xcconfig:
938 * UIProcess/API/Cocoa/WKWebView.mm:
939 (shouldAllowPictureInPictureMediaPlayback):
940 (forceAlwaysUserScalableChangedCallback):
941 (-[WKWebView _initializeWithConfiguration:]):
942 (-[WKWebView dealloc]):
943 (-[WKWebView _navigationGestureDidEnd]):
944 (-[WKWebView _updateForceAlwaysUserScalable]):
945 * UIProcess/API/Cocoa/WKWebViewInternal.h:
946 * UIProcess/WebPageProxy.h:
947 * UIProcess/ios/WebPageProxyIOS.mm:
948 (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
949 (WebKit::WebPageProxy::updateForceAlwaysUserScalable):
950 (WebKit::WebPageProxy::setMaximumUnobscuredSize):
951 * WebProcess/WebPage/WebPage.cpp:
952 (WebKit::WebPage::updatePreferences):
953 * WebProcess/WebPage/WebPage.h:
954 * WebProcess/WebPage/WebPage.messages.in:
955 * WebProcess/WebPage/ios/WebPageIOS.mm:
956 (WebKit::WebPage::disableInspectorNodeSearch):
957 (WebKit::WebPage::updateForceAlwaysUserScalable):
958 (WebKit::innerFrameQuad):
960 2016-03-10 Simon Fraser <simon.fraser@apple.com>
962 Font antialiasing (smoothing) changes when elements are rendered into compositing layers
963 https://bugs.webkit.org/show_bug.cgi?id=23364
965 Reviewed by Tim Horton.
967 Send the ContentsFormat to the UI process (but nothing happens to it there yet).
969 Allow internal clients to turn off smoothed layer text, so that WebKitTestRunner
972 * Shared/WebProcessCreationParameters.cpp:
973 (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
974 (WebKit::WebProcessCreationParameters::encode):
975 (WebKit::WebProcessCreationParameters::decode):
976 * Shared/WebProcessCreationParameters.h:
977 * Shared/mac/RemoteLayerTreeTransaction.h:
978 * Shared/mac/RemoteLayerTreeTransaction.mm:
979 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
980 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
981 * UIProcess/API/C/WKContext.cpp:
982 (WKContextEnableSmoothedLayerText):
983 * UIProcess/API/C/WKContextPrivate.h:
984 * UIProcess/WebProcessPool.cpp:
985 (WebKit::WebProcessPool::createNewWebProcess):
986 (WebKit::WebProcessPool::enableSmoothedLayerText):
987 (WebKit::WebProcessPool::WebProcessPool): Deleted.
988 * UIProcess/WebProcessPool.h:
989 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
990 (WebKit::PlatformCALayerRemote::setContentsFormat):
991 (WebKit::PlatformCALayerRemote::contentsFormat):
992 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
993 * WebProcess/WebProcess.cpp:
994 (WebKit::WebProcess::initializeWebProcess):
995 (WebKit::WebProcess::enableSmoothedLayerText):
996 * WebProcess/WebProcess.h:
997 * WebProcess/WebProcess.messages.in:
999 2016-03-10 Enrica Casucci <enrica@apple.com>
1001 Expose additional WKDataDetectorTypes.
1002 https://bugs.webkit.org/show_bug.cgi?id=155331
1003 rdar://problem/24175813
1005 Reviewed by Tim Horton.
1007 Adding API to enable data detection of tracking numbers,
1008 flight number and spotlight suggestions.
1010 * UIProcess/API/Cocoa/WKWebView.mm:
1011 (fromWKDataDetectorTypes):
1012 * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1014 2016-03-10 Beth Dakin <bdakin@apple.com>
1016 defaultActions in UIDelegate method
1017 _webView:previewingViewControllerForElement:defaultActions: need to be
1018 use-able by a client
1019 https://bugs.webkit.org/show_bug.cgi?id=155304
1021 rdar://problem/24269296
1023 Reviewed by Anders Carlsson.
1025 This patch adds a new protocol, WKPreviewActionItem, which is a sub-protocol
1026 of UIPreviewActionItem. The new protocol adds an identifier so that clients
1027 can identify which of our default actions they want to use. In order for a
1028 client to use our default action items, they need to return those actions in
1029 their UIViewController's implementation of previewActionItems.
1031 Change the defaultActions to NSArray <id <WKPreviewActionItem>> *
1032 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1034 This new file defines our sub-protocol and sub-class for WKPreviewActions.
1035 * UIProcess/API/Cocoa/_WKPreviewAction.h: Added.
1036 * UIProcess/API/Cocoa/_WKPreviewAction.mm: Added.
1037 (+[_WKPreviewAction actionWithIdentifier:title:style:handler:]):
1039 New BOOL _uiDelegateProvidedPreviewingViewController keeps track of whether
1040 the client returned a view controller from
1041 _webView:previewingViewControllerForElement:defaultActions:. If they did
1042 return a view controller, then we should invoke
1043 _webView:commitPreviewingViewController: at commit time. If they returned
1044 nil, then they indicated that WebKit should continue with default previewing
1045 behavior, so we will not invoke the UIDelegate’s commit method.
1046 * UIProcess/ios/WKContentViewInteraction.h:
1047 * UIProcess/ios/WKContentViewInteraction.mm:
1048 (-[WKContentView _registerPreview]):
1049 (-[WKContentView _unregisterPreview]):
1050 (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1052 In order for our default actions to be useful, we have to create
1054 (-[WKContentView _presentedViewControllerForPreviewItemController:]):
1056 Only invoke _webView:commitPreviewedViewController: if
1057 _uiDelegateProvidedPreviewingViewController is YES.
1058 (-[WKContentView _previewItemController:commitPreview:]):
1059 * WebKit2.xcodeproj/project.pbxproj:
1061 2016-03-10 Jer Noble <jer.noble@apple.com>
1063 Add WebCore, WebKit, & WebKit2 preference/setting to enable Main Content heuristic.
1064 https://bugs.webkit.org/show_bug.cgi?id=155326
1065 <rdar://problem/25095408>
1067 Reviewed by Beth Dakin.
1069 Add SPI to get and set the new preference.
1071 * Shared/WebPreferencesDefinitions.h:
1072 * UIProcess/API/C/WKPreferences.cpp:
1073 (WKPreferencesSetMainContentUserGestureOverrideEnabled):
1074 (WKPreferencesGetMainContentUserGestureOverrideEnabled):
1075 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1076 * UIProcess/API/Cocoa/WKWebView.mm:
1077 (-[WKWebView _initializeWithConfiguration:]):
1078 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1079 (-[WKWebViewConfiguration init]):
1080 (-[WKWebViewConfiguration copyWithZone:]):
1081 (-[WKWebViewConfiguration _mainContentUserGestureOverrideEnabled]):
1082 (-[WKWebViewConfiguration _setMainContentUserGestureOverrideEnabled:]):
1083 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1084 * WebProcess/WebPage/WebPage.cpp:
1085 (WebKit::WebPage::updatePreferences):
1087 2016-03-10 Alex Christensen <achristensen@webkit.org>
1089 Remove firing assertion after r197865.
1090 https://bugs.webkit.org/show_bug.cgi?id=155137
1091 rdar://problem/25096835
1093 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1094 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1095 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
1096 This assertion was firing. I'm looking into why.
1098 2016-03-07 Jer Noble <jer.noble@apple.com>
1100 Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally
1101 https://bugs.webkit.org/show_bug.cgi?id=155141
1103 Reviewed by Beth Dakin.
1105 Add a new preference, videoPlaybackRequiresUserGesture, distinct from mediaPlaybackRequiresUserGesture. Legacy clients of
1106 mediaPlaybackRequiresUserGesture will still be able to use it normally, as setting that preference to true will effectively
1107 set both audioPlaybackRequiresUserGesture and videoPlaybackRequiresUserGesture to true. Make these preferences all available
1108 universally, rather than just on PLATFORM(IOS). This requires adding a definition for -setRequiresUserActionForMediaPlayback:
1109 and -requiresUserActionForMediaPlayback on !PLATFORM(IOS).
1111 * Shared/WebPreferencesDefinitions.h:
1112 * UIProcess/API/C/WKPreferences.cpp:
1113 (WKPreferencesSetVideoPlaybackRequiresUserGesture):
1114 (WKPreferencesGetVideoPlaybackRequiresUserGesture):
1115 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1116 * UIProcess/API/Cocoa/WKWebView.mm:
1117 (-[WKWebView _initializeWithConfiguration:]):
1118 (-[WKWebView _setObscuredInsets:]):
1119 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1120 (-[WKWebViewConfiguration init]):
1121 (-[WKWebViewConfiguration encodeWithCoder:]):
1122 (-[WKWebViewConfiguration initWithCoder:]):
1123 (-[WKWebViewConfiguration copyWithZone:]):
1124 (-[WKWebViewConfiguration requiresUserActionForMediaPlayback]):
1125 (-[WKWebViewConfiguration setRequiresUserActionForMediaPlayback:]):
1126 (-[WKWebViewConfiguration allowsInlineMediaPlayback]):
1127 (-[WKWebViewConfiguration setAllowsInlineMediaPlayback:]):
1128 (-[WKWebViewConfiguration _requiresUserActionForVideoPlayback]):
1129 (-[WKWebViewConfiguration _setRequiresUserActionForVideoPlayback:]):
1130 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1131 * WebProcess/WebPage/WebPage.cpp:
1132 (WebKit::WebPage::updatePreferences):
1134 2016-03-10 Commit Queue <commit-queue@webkit.org>
1136 Unreviewed, rolling out r197943.
1137 https://bugs.webkit.org/show_bug.cgi?id=155317
1139 This change broke Windows, WinCairo, GTK and EFL builds
1140 (Requested by ryanhaddad on #webkit).
1144 "Add a baseURL parameter to _WKUserStyleSheet"
1145 https://bugs.webkit.org/show_bug.cgi?id=155219
1146 http://trac.webkit.org/changeset/197943
1148 2016-03-10 Eric Carlson <eric.carlson@apple.com>
1150 [MediaStream] push media stream state to the UI process
1151 https://bugs.webkit.org/show_bug.cgi?id=155281
1153 Reviewed by Dean Jackson.
1155 * UIProcess/WebPageProxy.cpp:
1156 (WebKit::WebPageProxy::didCommitLoadForFrame): Don't clear m_mediaState, it is done in
1157 WebPageProxy::resetState. This reverts a change added in r197929.
1160 2016-03-08 Sam Weinig <sam@webkit.org>
1162 Add a baseURL parameter to _WKUserStyleSheet
1163 https://bugs.webkit.org/show_bug.cgi?id=155219
1165 Reviewed by Tim Horton.
1167 - Moves to a model for user content where instead of using a WebCore::UserContentController
1168 object, we implement the new WebCore::UserContentProvider interface (on the existing
1169 WebUserContentController object).
1170 - Uses this to maintain maps of UserStylesSheets and UserScripts along with their identifiers,
1171 freeing up the URL, which had been acting as the identifier, to be used as the baseURL which
1172 was what it was intended for.
1173 - Adds a baseURL property to _WKUserStyleSheet.
1175 * WebKit2.xcodeproj/project.pbxproj:
1178 * Scripts/webkit/messages.py:
1180 Add support for sending WebUserContentControllerDataTypes.
1182 * Shared/WebUserContentControllerDataTypes.cpp: Added.
1183 (WebKit::WebUserScriptData::encode):
1184 (WebKit::WebUserScriptData::decode):
1185 (WebKit::WebUserStyleSheetData::encode):
1186 (WebKit::WebUserStyleSheetData::decode):
1187 * Shared/WebUserContentControllerDataTypes.h: Added.
1188 Add helper types for sending user content over IPC.
1190 * UIProcess/API/APIUserScript.cpp:
1191 (API::UserScript::generateUniqueURL):
1192 (API::UserScript::UserScript):
1193 * UIProcess/API/APIUserScript.h:
1194 * UIProcess/API/APIUserStyleSheet.cpp:
1195 (API::UserStyleSheet::generateUniqueURL):
1196 (API::UserStyleSheet::UserStyleSheet):
1197 * UIProcess/API/APIUserStyleSheet.h:
1198 Add identifiers for tracking across processes.
1200 * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
1201 * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
1202 (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
1203 (-[_WKUserStyleSheet baseURL]):
1204 Add new initializer which takes a baseURL as well as an accessor for the baseURL.
1206 * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1207 (WebKit::WebUserContentControllerProxy::addProcess):
1208 (WebKit::WebUserContentControllerProxy::addUserScript):
1209 (WebKit::WebUserContentControllerProxy::removeUserScript):
1210 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
1211 (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
1212 Pass identifiers as well as user content.
1214 * WebProcess/InjectedBundle/InjectedBundle.cpp:
1215 (WebKit::InjectedBundle::addUserScript):
1216 (WebKit::InjectedBundle::addUserStyleSheet):
1217 Move user content in via move semantics rather than using a unique_ptr.
1219 (WebKit::InjectedBundle::removeUserScript):
1220 (WebKit::InjectedBundle::removeUserStyleSheet):
1221 (WebKit::InjectedBundle::removeUserScripts):
1222 (WebKit::InjectedBundle::removeUserStyleSheets):
1223 (WebKit::InjectedBundle::removeAllUserContent):
1224 Update for new function signatures.
1226 * WebProcess/UserContent/WebUserContentController.cpp:
1227 (WebKit::WebUserContentController::WebUserContentController):
1228 (WebKit::WebUserContentController::~WebUserContentController):
1229 (WebKit::WebUserContentController::addUserContentWorlds):
1230 (WebKit::WebUserContentController::removeUserContentWorlds):
1231 (WebKit::WebUserContentController::addUserScripts):
1232 (WebKit::WebUserContentController::removeUserScript):
1233 (WebKit::WebUserContentController::removeAllUserScripts):
1234 (WebKit::WebUserContentController::addUserStyleSheets):
1235 (WebKit::WebUserContentController::removeUserStyleSheet):
1236 (WebKit::WebUserContentController::removeAllUserStyleSheets):
1237 (WebKit::WebUserContentController::addUserScriptMessageHandlers):
1238 (WebKit::WebUserContentController::removeUserScriptMessageHandler):
1239 (WebKit::WebUserContentController::addUserContentExtensions):
1240 (WebKit::WebUserContentController::removeUserContentExtension):
1241 (WebKit::WebUserContentController::removeAllUserContentExtensions):
1242 (WebKit::WebUserContentController::addUserScriptInternal):
1243 (WebKit::WebUserContentController::addUserScript):
1244 (WebKit::WebUserContentController::removeUserScriptWithURL):
1245 (WebKit::WebUserContentController::removeUserScriptInternal):
1246 (WebKit::WebUserContentController::removeUserScripts):
1247 (WebKit::WebUserContentController::addUserStyleSheetInternal):
1248 (WebKit::WebUserContentController::addUserStyleSheet):
1249 (WebKit::WebUserContentController::removeUserStyleSheetWithURL):
1250 (WebKit::WebUserContentController::removeUserStyleSheetInternal):
1251 (WebKit::WebUserContentController::removeUserStyleSheets):
1252 (WebKit::WebUserContentController::removeAllUserContent):
1253 (WebKit::WebUserContentController::forEachUserScript):
1254 (WebKit::WebUserContentController::forEachUserStyleSheet):
1255 * WebProcess/UserContent/WebUserContentController.h:
1256 * WebProcess/UserContent/WebUserContentController.messages.in:
1257 Convert to inheriting from UserContentProvider, rather than containing a UserContentController.
1258 This means adding the storage for the user content, which has been simplified to avoid using
1261 * WebProcess/WebPage/WebPage.cpp:
1262 (WebKit::WebPage::addUserScript):
1263 (WebKit::WebPage::addUserStyleSheet):
1264 (WebKit::WebPage::removeAllUserContent):
1265 Update to call the WebUserContentController, rather than going to the UserContentController, which
1268 * WebProcess/WebPage/WebPageGroupProxy.cpp:
1269 (WebKit::WebPageGroupProxy::userContentController):
1270 * WebProcess/WebPage/WebPageGroupProxy.h:
1271 Return the WebUserContentController rather than old UserContentController.
1273 2016-03-10 Commit Queue <commit-queue@webkit.org>
1275 Unreviewed, rolling out r197923.
1276 https://bugs.webkit.org/show_bug.cgi?id=155301
1278 Rolling out this change due to breaking the build and
1279 LayoutTests. (Requested by ryanhaddad on #webkit).
1283 "Font antialiasing (smoothing) changes when elements are
1284 rendered into compositing layers"
1285 https://bugs.webkit.org/show_bug.cgi?id=23364
1286 http://trac.webkit.org/changeset/197923
1288 2016-03-10 Chris Dumez <cdumez@apple.com>
1290 Speculative revalidation requests do not have their 'first party for cookies' URL set
1291 https://bugs.webkit.org/show_bug.cgi?id=155284
1292 <rdar://problem/25053203>
1294 Reviewed by Antti Koivisto.
1296 Speculative revalidation requests did not have their 'first party for cookies'
1297 URL set. This means the underlying NSURLRequest has a nil mainDocumentURL.
1298 Without a way to determine whether the cookie is in a third-party context,
1299 CFNetwork defaults to accepting all cookies for these resources.
1301 * NetworkProcess/cache/NetworkCacheCoders.cpp:
1302 (WebKit::NetworkCache::Coder<WebCore::URL>::encode):
1303 (WebKit::NetworkCache::Coder<WebCore::URL>::decode):
1304 * NetworkProcess/cache/NetworkCacheCoders.h:
1305 Add template specialization to support encoding / decoding WebCore::URL.
1307 * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1308 (WebKit::NetworkCache::constructRevalidationRequest):
1309 Set the "first party for cookies" URL on the revalidation request.
1311 (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresourceLoad):
1312 (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
1313 Now keep the subresources' ResourceRequests, in addition to their key, so we can later
1314 extract the 'first party for cookies' URL from the request and save it to disk.
1316 (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
1317 Pass the ResourceRequest in addition to the key to
1318 PendingFrameLoad::registerSubresourceLoad().
1320 (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
1321 Add an extra SubresourceInfo parameter, in addition to the Entry, so we
1322 have access to the first party for cookies URL. Pass this URL to
1323 constructRevalidationRequest().
1325 (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
1326 Add an extra SubresourceInfo parameter, in addition to the Entry, so we
1327 have access to the first party for cookies URL.
1329 (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
1330 Pass the SubresourceInfo to preloadEntry().
1332 * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1334 * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1335 (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::encode):
1336 (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::decode):
1337 Encode / Decode new firstPartyForCookies member.
1339 (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
1340 (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
1341 Take SubresourceLoad objects in, instead of simple Key objects so we have
1342 access to the ResourceRequest. We extract the first party for cookies URL
1343 from the request and pass it to the SubresourceInfo constructor.
1345 * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1346 (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::SubresourceInfo):
1347 (WebKit::NetworkCache::SubresourcesEntry::SubresourceLoad::SubresourceLoad):
1349 2016-02-22 Jer Noble <jer.noble@apple.com>
1351 Enable AVFoundationNSURLSessionEnabled by default
1352 https://bugs.webkit.org/show_bug.cgi?id=154469
1354 Reviewed by Sam Weinig.
1356 * Shared/WebPreferencesDefinitions.h:
1358 2016-03-10 Eric Carlson <eric.carlson@apple.com>
1360 Unreviewed, revert changes accidentally committed with previous patch.
1362 * WebProcess/com.apple.WebProcess.sb.in:
1364 2016-03-10 Eric Carlson <eric.carlson@apple.com>
1366 [MediaStream] push media stream state to the UI process
1367 https://bugs.webkit.org/show_bug.cgi?id=155281
1369 Reviewed by Darin Adler.
1371 * UIProcess/API/C/WKPage.cpp:
1372 (WKPageGetMediaState): New.
1373 * UIProcess/API/C/WKPagePrivate.h:
1375 * UIProcess/WebPageProxy.cpp:
1376 (WebKit::WebPageProxy::didCommitLoadForFrame): Clear m_mediaState.
1377 (WebKit::WebPageProxy::isPlayingMediaDidChange): Call m_pageClient.isPlayingMediaDidChange when
1378 audio or video state changes, call m_uiClient->isPlayingAudioDidChange when audio, vidoe,
1379 or media stream state changes.
1380 * UIProcess/WebPageProxy.h:
1381 (WebKit::WebPageProxy::mediaStateFlags): New.
1383 2016-03-09 Carlos Garcia Campos <cgarcia@igalia.com>
1385 [GTK] Artifacts when using web view background color
1386 https://bugs.webkit.org/show_bug.cgi?id=155229
1388 Reviewed by Mario Sanchez Prada.
1390 This is because when using a web view color, we fill with the
1391 color every rectangle updated by the web process, but we should
1392 always fill the entire backing store before rendering the actual
1395 * WebProcess/WebPage/DrawingAreaImpl.cpp:
1396 (WebKit::DrawingAreaImpl::display): Ensure the web process always
1397 renders the whole visible rectangle when background is rendered by
1400 2016-03-09 Simon Fraser <simon.fraser@apple.com>
1402 Font antialiasing (smoothing) changes when elements are rendered into compositing layers
1403 https://bugs.webkit.org/show_bug.cgi?id=23364
1404 rdar://problem/7288429
1406 Reviewed by Tim Horton.
1408 Send the ContentsFormat to the UI process (but nothing happens to it there yet).
1410 * Shared/mac/RemoteLayerTreeTransaction.h:
1411 * Shared/mac/RemoteLayerTreeTransaction.mm:
1412 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1413 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1414 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1415 (WebKit::PlatformCALayerRemote::setContentsFormat):
1416 (WebKit::PlatformCALayerRemote::contentsFormat):
1417 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1419 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1421 Add runtime flags for shadow DOM and custom elements
1422 https://bugs.webkit.org/show_bug.cgi?id=155213
1424 Reviewed by Dean Jackson.
1426 Set the runtime flag based on preferences. Enable shadow DOM and disable custom elements by default.
1428 * Shared/WebPreferencesDefinitions.h:
1429 * UIProcess/API/C/WKPreferences.cpp:
1430 (WKPreferencesSetShadowDOMEnabled):
1431 (WKPreferencesGetShadowDOMEnabled):
1432 (WKPreferencesSetCustomElementsEnabled):
1433 (WKPreferencesGetCustomElementsEnabled):
1434 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1435 * WebProcess/InjectedBundle/InjectedBundle.cpp:
1436 (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1437 * WebProcess/WebPage/WebPage.cpp:
1438 (WebKit::WebPage::updatePreferences):
1440 2016-03-09 Brent Fulgham <bfulgham@apple.com>
1442 Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
1443 https://bugs.webkit.org/show_bug.cgi?id=155265
1444 <rdar://problem/11101440>
1446 Reviewed by Andy Estes.
1448 We require "AllowUniversalAccessFromFileURLs" to permit file URLs from accessing
1449 localStorage. However, this setting is not available on the Cocoa WKPreference (by design).
1450 Instead, you need to set this value on the WKWebViewConfiguration.
1452 Back out the work-around landed in r197889,
1454 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1455 (-[WKWebViewConfiguration init]): Remove test workaround.
1456 * UIProcess/mac/WebInspectorProxyMac.mm:
1457 (WebKit::WebInspectorProxy::platformCreateInspectorPage): Set the correct flag on
1458 the WKWebViewConfiguration.
1460 2016-03-09 Enrica Casucci <enrica@apple.com>
1462 Retrieve additional context for some data detector link for preview and action menu.
1463 https://bugs.webkit.org/show_bug.cgi?id=155278
1464 rdar://problem/24884951
1466 Reviewed by Tim Horton.
1468 Data detector results for items like calendar events, can be augmented
1469 retrieving the text surrounding the link.
1471 * Platform/spi/ios/DataDetectorsUISPI.h:
1472 * Shared/ios/InteractionInformationAtPosition.h:
1473 * Shared/ios/InteractionInformationAtPosition.mm:
1474 (WebKit::InteractionInformationAtPosition::encode):
1475 (WebKit::InteractionInformationAtPosition::decode):
1476 * UIProcess/ios/WKActionSheetAssistant.mm:
1477 (-[WKActionSheetAssistant showDataDetectorsSheet]):
1478 * UIProcess/ios/WKContentViewInteraction.mm:
1479 (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1480 * WebProcess/WebPage/ios/WebPageIOS.mm:
1481 (WebKit::WebPage::getPositionInformation):
1483 2016-03-09 Gavin Barraclough <barraclough@apple.com>
1485 Last opened tab does not receive SetHiddenPageTimerThrottlingIncreaseLimit message
1486 https://bugs.webkit.org/show_bug.cgi?id=155126
1488 Reviewed by Anders Carlson.
1490 WebPageProxy will increment the hidden page throttling counter from within its constructor,
1491 which currently causes the WebProcessPool to try to synchronously message all processes.
1492 The web page triggering the increment then fails to receive the message, since it was
1493 still being constructed. Make the update of the limit async, such that the page is fully
1494 constructed before the WebProcessPool processes the update.
1496 * UIProcess/WebProcessPool.cpp:
1497 (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
1498 - This now schedules a zero-delay timer to handle the update.
1499 (WebKit::m_hiddenPageThrottlingTimer):
1500 - This is now responsible for calling updateHiddenPageThrottlingAutoIncreaseLimit.
1501 * UIProcess/WebProcessPool.h:
1502 - Added m_hiddenPageThrottlingTimer.
1504 2016-03-09 David Kilzer <ddkilzer@apple.com>
1506 REGRESSION (r197149): Missing availability checks when soft-linking DataDetectors.framework
1507 <http://webkit.org/b/155258>
1509 Reviewed by Andy Estes.
1511 * Platform/mac/MenuUtilities.mm:
1512 (WebKit::menuItemForTelephoneNumber):
1513 (WebKit::menuForTelephoneNumber):
1514 - Add check that returns early if DataDetectors.framework is not
1517 * Shared/mac/WebHitTestResultData.mm:
1518 (WebKit::WebHitTestResultData::platformDecode):
1519 - Add Debug assertion. The soft-linked code should never be
1520 called if there was no actionContext passed in.
1522 * UIProcess/Cocoa/WebViewImpl.mm:
1523 (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly):
1524 - Protect calls to DDActionsManager with availability check.
1526 * UIProcess/mac/WKImmediateActionController.mm:
1527 (-[WKImmediateActionController _clearImmediateActionState]):
1528 (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1529 - Protect calls to DDActionsManager with availability check.
1530 (-[WKImmediateActionController _animationControllerForDataDetectedText]):
1531 (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
1532 - Add check that returns early if DataDetectors.framework is not
1535 2016-03-09 Keith Rollin <krollin@apple.com>
1537 Add state dumping facility
1538 https://bugs.webkit.org/show_bug.cgi?id=154930
1539 <rdar://problem/24939135>
1541 Reviewed by Anders Carlsson.
1543 Collect the times at which pages are loaded. Dump them when an OS
1544 state dump is triggered.
1546 * WebProcess/WebPage/WebPage.cpp:
1547 (WebKit::WebPage::didCommitLoad):
1548 * WebProcess/WebPage/WebPage.h:
1549 (WebKit::WebPage::lastPageLoadTime):
1550 * WebProcess/WebProcess.h:
1551 * WebProcess/cocoa/WebProcessCocoa.mm:
1552 (WebKit::WebProcess::registerWithStateDumper):
1553 (WebKit::WebProcess::platformInitializeProcess):
1555 2016-03-09 Anders Carlsson <andersca@apple.com>
1557 _WKWebsiteDataSize.h should be an SPI header.
1559 Rubber-stamped by Tim Horton.
1561 * WebKit2.xcodeproj/project.pbxproj:
1563 2016-03-09 Brent Fulgham <bfulgham@apple.com>
1565 Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
1566 https://bugs.webkit.org/show_bug.cgi?id=155265
1568 Unreviewed work-around to allow testing to continue.
1570 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1571 (-[WKWebViewConfiguration init]): Workaround build break.
1573 2016-03-09 Alex Christensen <achristensen@webkit.org>
1575 Fix use-after-free when cancelling synchronous XHR when using NetworkSession
1576 https://bugs.webkit.org/show_bug.cgi?id=155253
1578 Reviewed by Brady Eidson.
1580 * NetworkProcess/NetworkLoad.cpp:
1581 (WebKit::NetworkLoad::continueWillSendRequest):
1582 Store the completion handler on the stack before calling didFail, which deletes the
1583 NetworkLoad, so we don't access m_redirectCompletionHandler after deleting the NetworkLoad.
1585 2016-03-09 Commit Queue <commit-queue@webkit.org>
1587 Unreviewed, rolling out r197698.
1588 https://bugs.webkit.org/show_bug.cgi?id=155252
1590 Caused assertions, and wasn't reviewed by a WK2 owner
1591 (Requested by andersca on #webkit).
1595 "Last opened tab does not receive
1596 SetHiddenPageTimerThrottlingIncreaseLimit message"
1597 https://bugs.webkit.org/show_bug.cgi?id=155126
1598 http://trac.webkit.org/changeset/197698
1600 2016-03-09 Conrad Shultz <conrad_shultz@apple.com>
1602 WebsiteDataStore::Configuration::legacyWebsiteDataStoreConfiguration() should respect the passed-in configuration
1603 https://bugs.webkit.org/show_bug.cgi?id=155250
1605 Reviewed by Anders Carlsson.
1607 Note that the legacy directories are already set by default in ProcessPoolConfiguration::createWithLegacyOptions(),
1608 which is also where the shouldHaveLegacyDataStore flag, which will cause this code path to be reached, is set.
1610 * UIProcess/WebProcessPool.cpp:
1611 (WebKit::legacyWebsiteDataStoreConfiguration):
1612 Use the passed-in configuration to set the application cache, network cache, and media keys storage directories.
1614 2016-03-09 Chris Dumez <cdumez@apple.com>
1616 Speculative disk cache resource revalidations are sometimes wasted
1617 https://bugs.webkit.org/show_bug.cgi?id=155187
1618 <rdar://problem/25032905>
1620 Reviewed by Antti Koivisto.
1622 Speculative disk cache resource revalidations were sometimes wasted.
1624 We would sometimes correctly revalidate a resource but the
1625 NetworkResourceLoader then either:
1626 1. Fail to reuse the speculatively validated entry
1627 2. Reuse the speculatively validated entry but then validate it again
1629 Bug 1 was caused by the revalidated entry key sometimes being
1630 different from the cached entry key. This could happen when
1631 revalidation fails (the server did not send back a 304) in
1632 which case we call NetworkCache::store() which creates a new
1633 cache Entry, generating a cache key from our revalidation
1634 request. If the original request has a cache partition or a
1635 range, then the keys would not match because we did not set
1636 the cache partition or the range on the revalidation request.
1637 This has been addressed by setting the cache partition on the
1638 revalidation request in constructRevalidationRequest() and by
1639 not doing revalidation if the original request had a 'range'
1642 Bug 2 was caused by us marking a speculatively revalidated entry
1643 as "not needing revalidating" only in Cache::update(). Cache::update()
1644 is only called in the case the revalidation was successful (server
1645 returned a 304). If revalidation was not successful, Cache::store()
1646 would be called instead was we would fail to update the
1647 needsRevalidation flag. NetworkResourceLoader would then validate
1648 again the resource that was already speculatively revalidated.
1649 To address the problem, we now update the 'needsRevalidation' flag
1650 as soon as the speculative revalidation completes, in
1651 SpeculativeLoad::didComplete().
1653 * NetworkProcess/cache/NetworkCache.cpp:
1654 (WebKit::NetworkCache::Cache::retrieve):
1655 (WebKit::NetworkCache::makeCacheKey):
1656 (WebKit::NetworkCache::Cache::update):
1657 * NetworkProcess/cache/NetworkCacheEntry.cpp:
1658 (WebKit::NetworkCache::Entry::setNeedsValidation):
1659 * NetworkProcess/cache/NetworkCacheEntry.h:
1660 * NetworkProcess/cache/NetworkCacheKey.cpp:
1661 (WebKit::NetworkCache::noPartitionString):
1662 (WebKit::NetworkCache::Key::Key):
1663 (WebKit::NetworkCache::Key::hasPartition):
1664 * NetworkProcess/cache/NetworkCacheKey.h:
1665 * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1666 (WebKit::NetworkCache::SpeculativeLoad::didComplete):
1667 * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1668 (WebKit::NetworkCache::constructRevalidationRequest):
1669 (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
1670 (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
1672 2016-03-09 Brent Fulgham <bfulgham@apple.com>
1674 Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
1675 https://bugs.webkit.org/show_bug.cgi?id=155185
1677 Reviewed by Anders Carlsson.
1678 <rdar://problem/11101440>
1680 Tested by TestWebKitAPI tests IndexedDB.IndexedDBMultiProcess and IndexedDB.IndexedDBPersistence.
1682 Allow Cocoa WKWebViewConfiguration access to the 'allowUniversalAccessFromFileURLs' setting.
1684 * UIProcess/API/Cocoa/WKWebView.mm:
1685 (- [WKWebView _initializeWithConfiguration]): Set 'allowUniversalAccessFromFileURLsKey' in
1687 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1688 (-[WKWebViewConfiguration _allowUniversalAccessFromFileURLs]): Added,
1689 (-[WKWebViewConfiguration _setAllowUniversalAccessFromFileURLs:]): Added.
1690 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1692 2016-03-09 Enrica Casucci <enrica@apple.com>
1694 Add two finger tap on links.
1695 https://bugs.webkit.org/show_bug.cgi?id=155205
1696 rdar://problem/22937516
1698 Reviewed by Sam Weinig.
1700 Adds two finger tap gesture recognizer. When performed
1701 on a link, it calls the delegate.
1703 * Platform/spi/ios/UIKitSPI.h:
1704 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1705 * UIProcess/WebPageProxy.h:
1706 * UIProcess/ios/WKContentViewInteraction.h:
1707 * UIProcess/ios/WKContentViewInteraction.mm:
1708 (-[WKContentView setupInteraction]):
1709 (-[WKContentView cleanupInteraction]):
1710 (-[WKContentView _removeDefaultGestureRecognizers]):
1711 (-[WKContentView _addDefaultGestureRecognizers]):
1712 (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1713 * UIProcess/ios/WebPageProxyIOS.mm:
1714 (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
1715 * WebProcess/WebPage/WebPage.h:
1716 * WebProcess/WebPage/WebPage.messages.in:
1717 * WebProcess/WebPage/ios/WebPageIOS.mm:
1718 (WebKit::WebPage::handleTwoFingerTapAtPoint):
1720 2016-03-09 Alex Christensen <achristensen@webkit.org>
1722 Always call NSURLSession completion handlers
1723 https://bugs.webkit.org/show_bug.cgi?id=155137
1725 Reviewed by Darin Adler.
1727 There are some edge cases which should not be hit, but if they are they would cause the
1728 network process to hang and network resources to be leaked. This can be avoided.
1729 There are also a few release asserts that do not need to crash release builds.
1731 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1732 (WebKit::NetworkDataTask::NetworkDataTask):
1733 (WebKit::NetworkDataTask::didReceiveChallenge):
1734 (WebKit::NetworkDataTask::didCompleteWithError):
1735 (WebKit::NetworkDataTask::didReceiveResponse):
1736 (WebKit::NetworkDataTask::didReceiveData):
1737 (WebKit::NetworkDataTask::willPerformHTTPRedirection):
1738 (WebKit::NetworkDataTask::scheduleFailure):
1739 (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
1740 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1741 (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1742 (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1743 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1745 2016-03-08 Sam Weinig <sam@webkit.org>
1747 Roll r197632 back in now that the bots have caught up.
1749 * UIProcess/ios/WKContentViewInteraction.mm:
1750 (-[WKContentView textInputTraits]):
1752 2016-03-08 Oliver Hunt <oliver@apple.com>
1754 Start moving to separated writable and executable mappings in the JIT
1755 https://bugs.webkit.org/show_bug.cgi?id=155178
1757 Reviewed by Fil Pizlo.
1759 Update feature defines.
1761 * Configurations/FeatureDefines.xcconfig:
1763 2016-03-08 Brent Fulgham <bfulgham@apple.com>
1765 [WK2][Mac] Allow processes to set "fast-dev-casheable" bit in Network Process
1766 https://bugs.webkit.org/show_bug.cgi?id=155189
1767 <rdar://problem/25042678>
1769 Reviewed by Alexey Proskuryakov.
1771 Update the NetworkProcess sandbox profiles with a declaration that using the
1772 system-fctl to touch the "hot file" flag (to support caching operations)
1773 is allowed. I should have done this in Bug 154503, but did not.
1775 * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Add sandbox permission.
1777 2016-03-08 Commit Queue <commit-queue@webkit.org>
1779 Unreviewed, rolling out r197793 and r197799.
1780 https://bugs.webkit.org/show_bug.cgi?id=155195
1782 something weird happened while landing this and everything
1783 broke (Requested by olliej on #webkit).
1785 Reverted changesets:
1787 "Start moving to separated writable and executable mappings in
1789 https://bugs.webkit.org/show_bug.cgi?id=155178
1790 http://trac.webkit.org/changeset/197793
1792 "arm64 build fix after r197793."
1793 http://trac.webkit.org/changeset/197799
1795 2016-03-08 Brent Fulgham <bfulgham@apple.com>
1797 [WK2] Grant explicit read access to ManagedPreferences
1798 https://bugs.webkit.org/show_bug.cgi?id=155173
1799 <rdar://problem/24910550>
1801 Reviewed by Alexey Proskuryakov.
1803 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add new
1806 2016-03-08 Anders Carlsson <andersca@apple.com>
1808 Ignore deprecation warnings.
1810 * Shared/mac/ChildProcessMac.mm:
1811 (WebKit::ChildProcess::stopNSAppRunLoop):
1812 * Shared/mac/WebEventFactory.mm:
1813 (WebKit::mouseButtonForEvent):
1814 (WebKit::mouseEventTypeForEvent):
1815 (WebKit::clickCountForEvent):
1816 (WebKit::globalPointForEvent):
1817 (WebKit::pointForEvent):
1818 (WebKit::textFromEvent):
1819 (WebKit::unmodifiedTextFromEvent):
1820 (WebKit::isKeypadEvent):
1821 (WebKit::isKeyUpEvent):
1822 (WebKit::modifiersForEvent):
1823 (WebKit::WebEventFactory::createWebKeyboardEvent):
1824 * UIProcess/API/Cocoa/WKNavigationAction.mm:
1825 (toNSEventModifierFlags):
1826 * UIProcess/Cocoa/WebViewImpl.mm:
1827 (WebKit::WebViewImpl::becomeFirstResponder):
1828 (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
1829 (WebKit::WebViewImpl::viewDidMoveToWindow):
1830 (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
1831 (WebKit::WebViewImpl::createFullScreenWindow):
1832 (WebKit::WebViewImpl::sendToolTipMouseExited):
1833 (WebKit::WebViewImpl::sendToolTipMouseEntered):
1834 (WebKit::applicationFlagsForDrag):
1835 (WebKit::WebViewImpl::setLastMouseDownEvent):
1836 (WebKit::WebViewImpl::doneWithKeyEvent):
1837 (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
1838 (WebKit::WebViewImpl::performKeyEquivalent):
1839 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1840 (WebKit::PluginProcessProxy::beginModal):
1841 * UIProcess/mac/WebContextMenuProxyMac.mm:
1842 (WebKit::WebContextMenuProxyMac::showContextMenu):
1843 * UIProcess/mac/WebInspectorProxyMac.mm:
1844 (WebKit::WebInspectorProxy::platformCanAttach):
1845 * UIProcess/mac/WebPopupMenuProxyMac.mm:
1846 (WebKit::WebPopupMenuProxyMac::populate):
1847 (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1848 * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1849 (WebKit::modifierFlagsFromWebEvent):
1850 (WebKit::getEventTypeFromWebEvent):
1851 * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
1852 (WebKit::cssAlignmentValueForNSTextAlignment):
1853 * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1854 (WebKit::convertImageToBitmap):
1856 2016-03-08 Oliver Hunt <oliver@apple.com>
1858 Start moving to separated writable and executable mappings in the JIT
1859 https://bugs.webkit.org/show_bug.cgi?id=155178
1861 Reviewed by Filip Pizlo.
1863 Update feature defines.
1865 * Configurations/FeatureDefines.xcconfig:
1867 2016-03-08 Commit Queue <commit-queue@webkit.org>
1869 Unreviewed, rolling out r197766.
1870 https://bugs.webkit.org/show_bug.cgi?id=155183
1872 Has platform-specific code in non-platform files (Requested by
1877 "AX: Force allow user zoom"
1878 https://bugs.webkit.org/show_bug.cgi?id=155056
1879 http://trac.webkit.org/changeset/197766
1881 2016-03-04 Ada Chan <adachan@apple.com>
1883 Fix lifetime issues regarding WebVideoFullscreenInterfaceMac
1884 https://bugs.webkit.org/show_bug.cgi?id=155130
1886 Reviewed by Beth Dakin.
1888 Now that both fullscreen and video controls manager rely on WebVideoFullscreenInterface,
1889 we now keep track of a "client count" for each context ID so we'll only remove it
1890 from the context map after all the "clients" are done with it.
1892 Before this change, every time WebVideoFullscreenManager::setUpVideoControlsManager()
1893 is called, the existing interface is cleared and a new one is created even when there's
1894 an existing interface for that. With this change, we reuse the existing interface for
1897 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1898 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1899 (WebKit::WebVideoFullscreenManagerProxy::invalidate):
1900 Also clear out m_clientCounts.
1901 (WebKit::WebVideoFullscreenManagerProxy::addClientForContext):
1902 If the context ID is not in m_clientCounts yet, add the count of 1 to
1903 that table for that ID. Otherwise, increment the count by 1.
1904 (WebKit::WebVideoFullscreenManagerProxy::removeClientForContext):
1905 Assert that we have added this context id to m_clientCounts before.
1906 Decrement the count. If it reaches 0, remove this context ID from both
1907 m_clientCounts and m_contextMap.
1908 (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1909 We have started a new fullscreen session using this interface. Call
1910 addClientForContext() to update the client count.
1911 (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
1912 If the current controls manager set up has the same context ID as the one
1913 passed in, we don't have to do anything. Otherwise, if we have set up
1914 the video controls manager with a different ID before, call removeClientForContext()
1915 on the old ID to decrement its client count. Set m_controlsManagerContextId
1916 to the new value and call addClientForContext() with it.
1917 (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
1918 Instead of removing the mapping from m_contextMap directly, reset the fullscreen
1919 mode on the interface and call removeClientForContext(), which removes the mapping
1920 only if there's no more client using the interface.
1921 * WebProcess/cocoa/WebVideoFullscreenManager.h:
1922 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1923 (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager):
1924 Clear m_clientCounts.
1925 (WebKit::WebVideoFullscreenManager::removeContext):
1926 Add a helper method for removing the context.
1927 (WebKit::WebVideoFullscreenManager::addClientForContext):
1928 If the context ID is not in m_clientCounts yet, add the count of 1 to
1929 that table for that ID. Otherwise, increment the count by 1.
1930 (WebKit::WebVideoFullscreenManager::removeClientForContext):
1931 Assert that we have added this context id to m_clientCounts before.
1932 Decrement the count. If it reaches 0, remove this context ID from
1933 m_clientCounts and call removeContext() to clean up this context.
1934 (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
1935 We have started a new fullscreen session using this interface. Call
1936 addClientForContext() to update the client count. Create a layer hosting
1937 context if it's not there.
1938 (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
1939 If we have set up a context for this video element before, see if it's
1940 the one we are currently managing video controls for. If it is, return early.
1941 Otherwise, call removeClientForContext() on the previous m_controlsManagerContextId
1942 and update m_controlsManagerContextId to the context ID of this video element.
1943 If there's no context created for this video element yet, set one up.
1944 Send a SetUpVideoControlsManagerWithID message to the proxy object in the UI process
1945 so it'll update its controls manager context ID. Also, conditionalize all of this
1946 under PLATFORM(MAC) to be consistent with WebVideoFullscreenManagerProxy.
1947 (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
1948 Just reset the fullscreen mode on the interface and call removeClientForContext() which
1949 only cleans up the context if there's no more client using it.
1951 2016-03-08 Timothy Hatcher <timothy@apple.com>
1953 Web Inspector: Add automation protocol methods for navigation
1955 https://bugs.webkit.org/show_bug.cgi?id=155163
1956 rdar://problem/25029054
1958 Reviewed by Darin Adler.
1960 * UIProcess/Automation/Automation.json:
1961 * UIProcess/Automation/WebAutomationSession.cpp:
1962 (WebKit::WebAutomationSession::getBrowsingContexts): Set url.
1963 (WebKit::WebAutomationSession::getBrowsingContext): Added.
1964 (WebKit::WebAutomationSession::navigateBrowsingContext): Added.
1965 (WebKit::WebAutomationSession::goBackInBrowsingContext): Added.
1966 (WebKit::WebAutomationSession::goForwardInBrowsingContext): Added.
1967 (WebKit::WebAutomationSession::reloadBrowsingContext): Added.
1968 * UIProcess/Automation/WebAutomationSession.h:
1970 2016-03-08 Nan Wang <n_wang@apple.com>
1972 AX: Force allow user zoom
1973 https://bugs.webkit.org/show_bug.cgi?id=155056
1975 Reviewed by Chris Fleizach.
1977 Soft linked libAccessibility library so that we can observe the accessibility
1978 setting change for the force always user scalable feature.
1980 * WebProcess/WebPage/WebPage.cpp:
1981 (WebKit::forceAlwaysUserScalableChangedCallback):
1982 (WebKit::WebPage::create):
1983 (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1984 (WebKit::WebPage::~WebPage):
1985 (WebKit::WebPage::preferencesDidChange):
1986 (WebKit::WebPage::updateForceAlwaysUserScalable):
1987 (WebKit::WebPage::updatePreferences):
1988 * WebProcess/WebPage/WebPage.h:
1990 2016-03-08 Csaba Osztrogonác <ossy@webkit.org>
1992 One more unreviewed speculative buildfix after r197728.
1994 * NetworkProcess/NetworkResourceLoader.cpp:
1995 (WebKit::NetworkResourceLoader::didFinishLoading):
1996 (WebKit::NetworkResourceLoader::continueWillSendRequest):
1998 2016-03-08 Csaba Osztrogonác <ossy@webkit.org>
2000 Unreviewed speculative buildfix after r197728.
2002 * WebProcess/Network/WebLoaderStrategy.cpp:
2003 (WebKit::WebLoaderStrategy::scheduleLoad):
2005 2016-03-08 Timothy Hatcher <timothy@apple.com>
2007 Web Inspector: Make WebAutomationSession::closeBrowsingContext work as expected
2009 https://bugs.webkit.org/show_bug.cgi?id=155162
2010 rdar://problem/25027191
2012 Reviewed by Brian Burg.
2014 * UIProcess/Automation/WebAutomationSession.cpp:
2015 (WebKit::WebAutomationSession::closeBrowsingContext):
2016 Call closePage, the same method ultimately used by window.close().
2018 * UIProcess/WebPageProxy.h: Make closePage public.
2020 2016-03-07 Carlos Garcia Campos <cgarcia@igalia.com>
2022 REGRESSION(r197062): [GTK] Transparent backgrounds no longer work after r197062
2023 https://bugs.webkit.org/show_bug.cgi?id=155119
2025 Reviewed by Martin Robinson.
2027 This is because after r197062 we are now realizing the view too
2028 early, even before the toplevel window has been realized, forcing
2029 the toplevel window to be realized. If the RGBA visual is set on
2030 the window after it has been realzied it doesn't have any
2031 effect. We should wait until the toplevel window is realized to
2032 realize the web view, giving time to the application to set RGBA
2033 visual and background color. If the toplevel window is already
2034 realized we realize the web view immediately, so that this doesn't
2035 affect the tearing problems fixed in r197062.
2037 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2038 (toplevelWindowRealized):
2039 (webkitWebViewBaseSetToplevelOnScreenWindow):
2041 2016-03-07 Keith Rollin <krollin@apple.com>
2043 Enhance logging: Use "always on" macros
2044 https://bugs.webkit.org/show_bug.cgi?id=154499
2045 <rdar://problem/24757730>
2047 Reviewed by Chris Dumez.
2049 Make use of new logging macros by reporting on frame and resource
2052 Connection updated to report IPC errors, helping us identify when
2053 messaging between processes breaks down.
2055 ChildProcess updated to log if it is terminating early. Some
2056 sysdiagnose logging from customers indicate that this is happening in
2059 * NetworkProcess/NetworkResourceLoader.cpp:
2060 (WebKit::NetworkResourceLoader::startNetworkLoad):
2061 (WebKit::NetworkResourceLoader::didFinishLoading):
2062 (WebKit::NetworkResourceLoader::didFailLoading):
2063 (WebKit::NetworkResourceLoader::continueWillSendRequest):
2064 (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed):
2065 * NetworkProcess/NetworkResourceLoader.h:
2066 * Platform/IPC/Connection.cpp:
2067 (IPC::Connection::waitForSyncReply):
2068 * Shared/ChildProcess.cpp:
2069 (WebKit::didCloseOnConnectionWorkQueue):
2070 * WebProcess/Network/WebLoaderStrategy.cpp:
2071 (WebKit::WebLoaderStrategy::scheduleLoad):
2072 * WebProcess/Network/WebResourceLoader.cpp:
2073 (WebKit::WebResourceLoader::willSendRequest):
2074 (WebKit::WebResourceLoader::didReceiveResponse):
2075 (WebKit::WebResourceLoader::didReceiveData):
2076 (WebKit::WebResourceLoader::didFinishResourceLoad):
2077 (WebKit::WebResourceLoader::didFailResourceLoad):
2078 (WebKit::WebResourceLoader::didReceiveResource):
2079 (WebKit::WebResourceLoader::isAlwaysOnLoggingAllowed):
2080 * WebProcess/Network/WebResourceLoader.h:
2082 2016-03-07 Brent Fulgham <bfulgham@apple.com>
2084 Reduce startup and shutdown cost of resource load statistics
2085 https://bugs.webkit.org/show_bug.cgi?id=155120
2086 <rdar://problem/25010167>
2088 Reviewed by Andy Estes.
2090 Use a dedicated WorkQueue to process resource load statistics data. Allow
2091 processing to load (and save) previously stored statistics asynchronously so
2092 that it does not delay startup.
2094 Now that we have a more rational storage situation, get rid of the 'writeToDisk'
2095 method since it is no longer needed in the WK2 layer.
2097 Move all of the Resource Load Statistics file handling code from WebCore to this
2100 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2101 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Initialize
2102 member variable with storage path, rather than passing to WebCore code.
2103 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Revised to
2104 use the new WorkQueue code.
2105 (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled): When
2106 activating the feature, purge any old statistics before loading from disk.
2107 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Added.
2108 (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection): Added.
2109 (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection): Added.
2110 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): Make sure all
2111 of the WorkQueue tasks are done before terminating.
2112 (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Moved from WebCore.
2113 (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Ditto.
2114 (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): Ditto.
2115 (WebKit::WebResourceLoadStatisticsStore::writeToDisk): Deleted.
2116 * UIProcess/WebResourceLoadStatisticsStore.h:
2117 (WebKit::WebResourceLoadStatisticsStore::coreStore):
2118 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2119 (WebKit::WebsiteDataStore::webProcessWillOpenConnection): Call new WebResourceLoadStatisticsStore code.
2120 (WebKit::WebsiteDataStore::webProcessDidCloseConnection): Ditto.
2122 2016-03-07 Alex Christensen <achristensen@webkit.org>
2124 Fix cookies with private browsing and NetworkSession
2125 https://bugs.webkit.org/show_bug.cgi?id=155147
2126 rdar://problem/25018279
2128 Reviewed by Brady Eidson.
2130 In the NetworkSession constructor, we look for a NetworkStorageSession in the SessionTracker
2131 and use that NetworkStorageSession's CFHTTPCookieStorageRef in the NSURLSessionConfiguration.
2132 NetworkStorageSessions were being set in SessionTracker's storageSessionMap after NetworkSessions
2133 were created, causing the NSHTTPCookieStorage of the NSURLSession to be different from the
2134 CFHTTPCookieStorageRef used by document.cookie in newly created private browsing sessions.
2135 This fixes that problem by passing the NetworkStorageSession as a constructor parameter to the
2136 NetworkSession so it can use the correct CFHTTPCookieStorageRef in its NSURLSessionConfiguration
2137 before it is in the storageSessionMap.
2139 * NetworkProcess/NetworkSession.h:
2140 (WebKit::NetworkSession::sessionID):
2141 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2142 (WebKit::NetworkSession::defaultSession):
2143 (WebKit::NetworkSession::NetworkSession):
2144 * NetworkProcess/mac/RemoteNetworkingContext.mm:
2145 (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
2146 * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2147 (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
2149 2016-03-07 Brent Fulgham <bfulgham@apple.com>
2151 Correct bug in resource load statistics debug flag for legacy clients
2152 https://bugs.webkit.org/show_bug.cgi?id=155118
2153 <rdar://problem/25020088>
2155 Reviewed by Andy Estes.
2157 Some clients launch WebKit2 using the "legacy" configuration for the website data store.
2158 The Resource Load Statistics code was not added to this type of configuration, which
2159 prevents various WebKit2 clients from using this code.
2161 * UIProcess/WebProcessPool.cpp:
2162 (WebKit::legacyWebsiteDataStoreConfiguration): Tell the legacy initializer where to
2163 find the resource load statistics data.
2165 2016-03-07 Daniel Bates <dabates@apple.com>
2167 Cleanup: Add convenience function URL::procotolIsBlob()
2168 https://bugs.webkit.org/show_bug.cgi?id=155127
2169 <rdar://problem/25016829>
2171 Reviewed by Brent Fulgham.
2173 * NetworkProcess/NetworkLoad.cpp:
2174 (WebKit::NetworkLoad::NetworkLoad): Modified to use URL::protocolIsBlob().
2175 * NetworkProcess/NetworkResourceLoader.cpp:
2176 (WebKit::NetworkResourceLoader::NetworkResourceLoader): Ditto.
2177 * WebProcess/WebPage/WebPage.cpp:
2178 (WebKit::WebPage::canHandleRequest): Ditto.
2180 2016-03-07 Simon Fraser <simon.fraser@apple.com>
2182 Use CGColorSpaceCopyICCData instead of CGColorSpaceCopyICCProfile
2183 https://bugs.webkit.org/show_bug.cgi?id=155123
2184 rdar://problem/24990256
2186 Reviewed by Tim Horton.
2188 On newer OSes, use CGColorSpaceCopyICCData().
2190 * Shared/mac/ColorSpaceData.mm:
2191 (WebKit::ColorSpaceData::encode):
2193 2016-03-07 Gavin Barraclough <barraclough@apple.com>
2195 Last opened tab does not receive SetHiddenPageTimerThrottlingIncreaseLimit message
2196 https://bugs.webkit.org/show_bug.cgi?id=155126
2198 Reviewed by Chris Dumez.
2200 WebPageProxy will increment the hidden page throttling counter from within its constructor,
2201 which currently causes the WebProcessPool to try to synchronously message all processes.
2202 The web page triggering the increment then fails to receive the message, since it was
2203 still being constructed. Make the update of the limit async, such that the page is fully
2204 constructed before the WebProcessPool processes the update.
2206 * UIProcess/WebProcessPool.cpp:
2207 (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
2208 - This now schedules a zero-delay timer to handle the update.
2209 (WebKit::m_hiddenPageThrottlingTimer):
2210 - This is now responsible for calling updateHiddenPageThrottlingAutoIncreaseLimit.
2211 * UIProcess/WebProcessPool.h:
2212 - Added m_hiddenPageThrottlingTimer.
2214 2016-03-05 Enrica Casucci <enrica@apple.com>
2216 Support preview on attachment elements.
2217 https://bugs.webkit.org/show_bug.cgi?id=155074
2218 rdar://problem/24806079
2220 Reviewed by Sam Weinig.
2222 Allowing preview to start on attachment elements.
2223 Adding a private UIDelegate method to provide the data for the preview.
2225 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2226 * UIProcess/ios/WKContentViewInteraction.mm:
2227 (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2228 (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2230 2016-03-06 Andreas Kling <akling@apple.com>
2232 Reduce page cache capacity from 3 to 2.
2233 <https://webkit.org/b/155087>
2235 Reviewed by Antti Koivisto.
2237 It's extremely rare that users go back more than 2 pages in the page cache,
2238 and nowadays the network cache makes even un-cached pages fast to reload.
2240 Trimming the page cache from 3 to 2 entries has a very nice effect on heap
2241 fragmentation. I'm seeing a ~5% progression on the iPad PLUM test locally;
2242 average memory usage across 300 loads goes from ~121MB to ~114MB.
2244 * Shared/CacheModel.cpp:
2245 (WebKit::calculateCacheSizes):
2247 2016-03-05 Sam Weinig <sam@webkit.org>
2249 Revert usage of autofill field name for use with UITextInputTraits
2250 until our bots can catch up.
2252 * UIProcess/ios/WKContentViewInteraction.mm:
2253 (-[WKContentView textInputTraits]):
2255 2016-03-05 Chris Dumez <cdumez@apple.com>
2257 Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
2258 https://bugs.webkit.org/show_bug.cgi?id=155035
2260 Reviewed by Darin Adler.
2262 Update runtime application checks.
2264 * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2265 (API::WebsiteDataStore::defaultApplicationCacheDirectory):
2266 * UIProcess/Cocoa/VersionChecks.mm:
2267 (WebKit::linkedOnOrAfter):
2268 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2269 (WebKit::WebProcessPool::platformInitializeWebProcess):
2270 (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
2271 * UIProcess/ios/WKContentViewInteraction.mm:
2272 * UIProcess/mac/WebPageProxyMac.mm:
2273 (WebKit::expectsLegacyImplicitRubberBandControl):
2274 (WebKit::WebPageProxy::appleMailPaginationQuirkEnabled):
2276 2016-03-05 Sam Weinig <sam@webkit.org>
2278 Add support for processing the autofill field name out of form control elements ultimately to aid input methods
2279 <rdar://problem/23041180>
2280 https://bugs.webkit.org/show_bug.cgi?id=155079
2282 Reviewed by Enrica Casucci.
2284 * Shared/AssistedNodeInformation.cpp:
2285 (WebKit::AssistedNodeInformation::encode):
2286 (WebKit::AssistedNodeInformation::decode):
2287 * Shared/AssistedNodeInformation.h:
2288 Add AutofillFieldName. Convert some coders to use encodeEnum/decodeEnum instead of casting.
2290 * UIProcess/ios/WKContentViewInteraction.mm:
2291 (-[WKContentView textInputTraits]):
2292 Map AutofillFieldNames to the associated UITextContentTypes.
2294 * WebProcess/WebPage/ios/WebPageIOS.mm:
2295 (WebKit::WebPage::getAssistedNodeInformation):
2296 Extract the AutofillFieldNames onto the AssistedNodeInformation for <input> elements
2297 and <textarea> elements.
2299 2016-03-05 Timothy Hatcher <timothy@apple.com>
2301 Implement the Automation protocol commands by tracking WebPageProxy objects
2302 that are controlled by automation and assigning them a UUID handle.
2304 https://bugs.webkit.org/show_bug.cgi?id=154953
2305 rdar://problem/24947489
2307 Reviewed by Brian Burg.
2309 * UIProcess/API/APIAutomationSessionClient.h:
2310 (API::AutomationSessionClient::didRequestNewWindow):
2311 Return a WebPageProxy instead of void so it can be assigned a UUID handle.
2313 * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2314 Return a WKPageRef from _automationSessionDidRequestNewWindow:.
2316 * UIProcess/Automation/WebAutomationSession.cpp:
2317 (WebKit::WebAutomationSession::webPageProxyForHandle):
2318 (WebKit::WebAutomationSession::handleForWebPageProxy):
2319 (WebKit::WebAutomationSession::getBrowsingContexts):
2320 (WebKit::WebAutomationSession::createBrowsingContext):
2321 (WebKit::WebAutomationSession::closeBrowsingContext):
2322 (WebKit::WebAutomationSession::switchToBrowsingContext):
2324 * UIProcess/Automation/WebAutomationSession.h:
2325 Added new methods and maps to track pages and handles.
2327 * UIProcess/Cocoa/AutomationSessionClient.h:
2328 * UIProcess/Cocoa/AutomationSessionClient.mm:
2329 (WebKit::AutomationSessionClient::didRequestNewWindow):
2330 Return a WebPageProxy from the WKPageRef.
2332 * UIProcess/WebPageProxy.h: Make setFocus public.
2334 * UIProcess/WebProcessPool.cpp:
2335 (WebKit::WebProcessPool::setAutomationSession):
2336 Set the WebProcessPool on the WebAutomationSession so it can be used to find
2337 WebPageProxy objects controlled by automation.
2339 2016-03-05 Timothy Hatcher <timothy@apple.com>
2341 Rename Automation protocol methods to use "BrowsingContext" instead of "Window".
2342 Also flesh out the protocol commands more by adding switchToBrowsingContext
2343 and return a BrowsingContextHandle for createBrowsingContext.
2345 https://bugs.webkit.org/show_bug.cgi?id=154953
2346 rdar://problem/24947489
2348 Reviewed by Brian Burg.
2350 * UIProcess/Automation/Automation.json:
2351 * UIProcess/Automation/WebAutomationSession.cpp:
2352 (WebKit::WebAutomationSession::getBrowsingContexts):
2353 (WebKit::WebAutomationSession::createBrowsingContext):
2354 (WebKit::WebAutomationSession::closeBrowsingContext):
2355 (WebKit::WebAutomationSession::switchToBrowsingContext):
2356 (WebKit::WebAutomationSession::getWindows): Deleted.
2357 (WebKit::WebAutomationSession::openWindow): Deleted.
2358 (WebKit::WebAutomationSession::closeWindow): Deleted.
2359 * UIProcess/Automation/WebAutomationSession.h:
2361 2016-03-05 Yusuke Suzuki <utatane.tea@gmail.com>
2363 [ES6] Support Reflect.construct
2364 https://bugs.webkit.org/show_bug.cgi?id=147330
2366 Reviewed by Saam Barati.
2368 * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2369 (WebKit::JSNPMethod::getCallData):
2370 * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2371 (WebKit::JSNPObject::getCallData):
2372 (WebKit::JSNPObject::getConstructData):
2373 * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2374 (WebKit::NPJSObject::hasMethod):
2375 (WebKit::NPJSObject::construct):
2376 (WebKit::NPJSObject::invoke):
2378 2016-03-04 Alex Christensen <achristensen@webkit.org>
2380 Fix file mime-types when using NetworkSession
2381 https://bugs.webkit.org/show_bug.cgi?id=155058
2383 Reviewed by Andy Estes.
2385 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2386 (WebKit::NetworkDataTask::NetworkDataTask):
2387 Call adjustMIMETypeIfNecessary like we do in connection didReceiveResponse in
2388 WebCoreResourceHandleAsOperationQueueDelegate.mm.
2389 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2390 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2391 Don't content sniff file urls. This check is analogous to ResourceHandle::shouldContentSniffURL.
2393 2016-03-04 Sam Weinig <sam@webkit.org>
2395 [WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
2396 <rdar://problem/24943591>
2397 https://bugs.webkit.org/show_bug.cgi?id=155057
2399 Reviewed by Tim Horton.
2401 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2402 (WKBundlePageInsertNewlineInQuotedContent):
2403 * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2404 * WebProcess/WebPage/WebPage.cpp:
2405 (WebKit::WebPage::insertNewlineInQuotedContent):
2406 * WebProcess/WebPage/WebPage.h:
2407 Expose WKBundlePageInsertNewlineInQuotedContent as SPI.
2409 2016-03-04 Brent Fulgham <bfulgham@apple.com>
2411 Stub API to support a debug menu option for measuring resource load statistics
2412 https://bugs.webkit.org/show_bug.cgi?id=154998
2413 <rdar://problem/24944604>
2415 Reviewed by Andy Estes.
2417 * UIProcess/API/APIWebsiteDataStore.cpp:
2418 (API::WebsiteDataStore::resourceLoadStatisticsEnabled): Added stub.
2419 (API::WebsiteDataStore::setResourceLoadStatisticsEnabled): Ditto.
2420 * UIProcess/API/APIWebsiteDataStore.h:
2421 * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2422 (WKWebsiteDataStoreSetResourceLoadStatisticsEnabled): Added method that calls through
2423 to the underlying APIWebsiteDataStore class.
2424 (WKWebsiteDataStoreGetResourceLoadStatisticsEnabled): Ditto.
2425 * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2427 2016-03-03 Enrica Casucci <enrica@apple.com>
2429 Add a mechanism to customize the long press action.
2430 https://bugs.webkit.org/show_bug.cgi?id=154995
2431 rdar://problem/24823732
2433 Reviewed by Tim Horton.
2435 Adding a new private delegate method to allow clients to
2436 replace the action sheet displayed for images and links.
2437 The change also adds support for attachment elements.
2439 * Shared/ios/InteractionInformationAtPosition.h:
2440 * Shared/ios/InteractionInformationAtPosition.mm:
2441 (WebKit::InteractionInformationAtPosition::encode):
2442 (WebKit::InteractionInformationAtPosition::decode):
2443 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2444 * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2445 * UIProcess/ios/WKActionSheetAssistant.h:
2446 * UIProcess/ios/WKActionSheetAssistant.mm:
2447 (-[WKActionSheetAssistant showImageSheet]):
2448 (-[WKActionSheetAssistant showLinkSheet]):
2449 * UIProcess/ios/WKContentViewInteraction.mm:
2450 (-[WKContentView _showImageSheet]):
2451 (-[WKContentView _showAttachmentSheet]):
2452 (-[WKContentView _showLinkSheet]):
2453 (-[WKContentView _actionForLongPress]):
2454 (-[WKContentView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
2455 (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
2456 (-[WKContentView actionSheetAssistant:decideActionsForElement:defaultActions:]):
2457 * WebProcess/WebPage/ios/WebPageIOS.mm:
2458 (WebKit::WebPage::getPositionInformation):
2460 2016-03-04 Brent Fulgham <bfulgham@apple.com>
2462 [WK2] Gather resource load statistics
2463 https://bugs.webkit.org/show_bug.cgi?id=154278
2464 <rdar://problem/24702892>
2466 Reviewed by Andy Estes.
2468 Revise the WebProcess to notify the UIProcess about resource load statistics. These
2469 updates are not time-critical, and do not need to be done in concert with the actual
2470 load. As resource loads are made, each WebProcess notifies the UIProcess of the new
2471 load counts, then clears its local state. These statistics are then aggregated in
2474 * CMakeLists.txt: Add new ResourceLoadStatisticsState files to build.
2475 * DerivedSources.make: Ditto.
2476 * Platform/IPC/ArgumentCoders.h: Update to support HashCountedSets.
2477 * PlatformEfl.cmake: Add new ResourceLoadStatisticsState files to build.
2478 * PlatformGTK.cmake: Ditto.
2479 * PlatformMac.cmake: Ditto.
2480 * Shared/API/APIObject.h: Add new ResourceLoadStatistics type.
2481 * Shared/WebCoreArgumentCoders.cpp:
2482 (IPC::ArgumentCoder<ExceptionDetails>::decode): Support new ResourceLoadStatistics type.
2483 (IPC::ArgumentCoder<ResourceLoadStatistics>::encode): Added.
2484 (IPC::ArgumentCoder<ResourceLoadStatistics>::decode): Added.
2485 * Shared/WebCoreArgumentCoders.h:
2486 * Shared/WebProcessCreationParameters.cpp:
2487 (WebKit::WebProcessCreationParameters::encode): Handle 'resourceLoadStatisticsEnabled' flag.
2488 (WebKit::WebProcessCreationParameters::decode): Ditto.
2489 * Shared/WebProcessCreationParameters.h:
2490 * UIProcess/API/APIProcessPoolConfiguration.cpp:
2491 (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add storage location for the
2492 resource load statistics.
2493 (API::ProcessPoolConfiguration::copy): Handle the new storage location and the feature flag.
2494 * UIProcess/API/APIProcessPoolConfiguration.h:
2495 * UIProcess/API/APIWebsiteDataStore.cpp:
2496 (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Added stub.
2497 * UIProcess/API/APIWebsiteDataStore.h:
2498 * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2499 (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Added.
2500 (API::WebsiteDataStore::defaultDataStoreConfiguration): Added support for the new resource
2501 load statistics storage location.
2502 * UIProcess/API/Cocoa/WKWebView.mm:
2503 (-[WKWebView _initializeWithConfiguration:]): Sync Process Pool configuration parameters
2504 with the state of our websiteData object's "ResourceLoadStatisticsEnabled" flag, so that
2505 new processes are created in the right state.
2506 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2507 (-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]): Added.
2508 (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]): Added.
2509 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2510 * UIProcess/WebProcessPool.cpp:
2511 (WebKit::WebProcessPool::createNewWebProcess): Handle new flag for enabling resource
2513 * UIProcess/WebResourceLoadStatisticsStore.cpp: Added.
2514 (WebKit::WebResourceLoadStatisticsStore::create):
2515 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2516 (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
2517 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2518 (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled):
2519 (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsEnabled):
2520 (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2521 (WebKit::WebResourceLoadStatisticsStore::writeToDisk):
2522 (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
2523 * UIProcess/WebResourceLoadStatisticsStore.h: Added.
2524 (WebKit::WebResourceLoadStatisticsStore::coreStore):
2525 * UIProcess/WebResourceLoadStatisticsStore.messages.in: Added.
2526 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2527 (WebKit::WebsiteDataStore::platformInitialize): Register a termination handler
2528 to close down the resource load statistics store.
2529 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2530 (WebKit::WebsiteDataStore::WebsiteDataStore): Initialize the new WebResourceLoadStatisticsStore
2532 (WebKit::WebsiteDataStore::webProcessWillOpenConnection): Register the WebResourceLoadStatisticsStore
2533 object as a work queue message receiver
2534 (WebKit::WebsiteDataStore::webProcessDidCloseConnection): Unregister WebResourceLoadStatisticsStore.
2535 (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled): Added.
2536 (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): Ditto.
2537 * UIProcess/WebsiteData/WebsiteDataStore.h:
2538 (WebKit::WebsiteDataStore::resourceLoadStatisticsStore): Added.
2539 * WebKit2.xcodeproj/project.pbxproj: Add new ResourceLoadStatisticsState files to build.
2540 * WebProcess/WebProcess.cpp:
2541 (WebKit::WebProcess::initializeWebProcess): Take into account the new parameter
2542 specifying whether resource load statistics are being captured.
2543 (WebKit::WebProcess::WebProcess): Initialized statistics changed notification timer.
2544 (WebKit::WebProcess::statisticsChangedTimerFired): Added. Send bundles of site load
2545 statistics to the UIProcess on a set interval. Clear out local cache after each send.
2546 (WebKit::WebProcess::setResourceLoadStatisticsEnabled): Added.
2547 * WebProcess/WebProcess.h:
2548 * WebProcess/WebProcess.messages.in: Add new SetResourceLoadStatisticsEnabled message.
2550 2016-03-04 Daniel Bates <dabates@apple.com>
2552 Temporarily use bundle identifier as part of user directory suffix
2553 https://bugs.webkit.org/show_bug.cgi?id=155042
2554 <rdar://problem/24983174>
2556 Reviewed by Brent Fulgham and Brady Eidson.
2558 * Shared/mac/ChildProcessMac.mm:
2559 (WebKit::ChildProcess::initializeSandbox):
2561 2016-03-04 Alex Christensen <achristensen@webkit.org>
2563 Release build fix after r197572.
2564 https://bugs.webkit.org/show_bug.cgi?id=154993
2566 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2567 (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2569 2016-03-04 Alex Christensen <achristensen@webkit.org>
2571 Use NSURLSession for loading in WebKit2
2572 https://bugs.webkit.org/show_bug.cgi?id=154993
2574 Reviewed by Sam Weinig.
2578 2016-03-04 Alex Christensen <achristensen@webkit.org>
2580 Use NetworkSession for pings
2581 https://bugs.webkit.org/show_bug.cgi?id=154984
2583 Reviewed by Antti Koivisto.
2585 Before this patch, we were using NSURLConnection for pings when the rest of the loading was being
2586 done with NSURLSession. To fix this, I implemented PingLoad, which is the NetworkSession equivalent
2589 This fixes http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html
2591 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2592 (WebKit::NetworkConnectionToWebProcess::loadPing):
2593 (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier):
2594 * NetworkProcess/PingLoad.h: Added.
2595 (WebKit::PingLoad::PingLoad):
2596 (WebKit::PingLoad::willPerformHTTPRedirection):
2597 (WebKit::PingLoad::didReceiveChallenge):
2598 (WebKit::PingLoad::didReceiveResponseNetworkSession):
2599 (WebKit::PingLoad::didReceiveData):
2600 (WebKit::PingLoad::didCompleteWithError):
2601 (WebKit::PingLoad::didBecomeDownload):
2602 (WebKit::PingLoad::didSendData):
2603 (WebKit::PingLoad::wasBlocked):
2604 (WebKit::PingLoad::cannotShowURL):
2605 (WebKit::PingLoad::timeoutTimerFired):
2606 (WebKit::PingLoad::~PingLoad):
2607 * WebKit2.xcodeproj/project.pbxproj:
2609 2016-03-04 Timothy Hatcher <timothy@apple.com>
2611 Inform WebKit and WebCore if a page is controlled by automation.
2613 https://bugs.webkit.org/show_bug.cgi?id=154991
2614 rdar://problem/24965784
2616 Reviewed by Joseph Pecoraro.
2618 * Shared/WebPageCreationParameters.cpp:
2619 (WebKit::WebPageCreationParameters::encode):
2620 (WebKit::WebPageCreationParameters::decode):
2621 * Shared/WebPageCreationParameters.h:
2622 * UIProcess/API/C/WKPage.cpp:
2623 (WKPageGetIsControlledByAutomation):
2624 (WKPageSetControlledByAutomation):
2625 * UIProcess/API/C/WKPagePrivate.h:
2626 * UIProcess/WebPageProxy.cpp:
2627 (WebKit::WebPageProxy::setControlledByAutomation):
2628 (WebKit::WebPageProxy::creationParameters):
2629 * UIProcess/WebPageProxy.h:
2630 (WebKit::WebPageProxy::isControlledByAutomation):
2631 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2632 (WKBundlePageIsControlledByAutomation):
2633 * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2634 * WebProcess/WebPage/WebPage.cpp:
2635 (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2636 (WebKit::WebPage::isControlledByAutomation):
2637 (WebKit::WebPage::setControlledByAutomation):
2638 * WebProcess/WebPage/WebPage.h:
2639 * WebProcess/WebPage/WebPage.messages.in:
2641 2016-03-03 Chris Dumez <cdumez@apple.com>
2643 Regression(r196770): Unable to use HipChat Mac app
2644 https://bugs.webkit.org/show_bug.cgi?id=154999
2645 <rdar://problem/24931959>
2647 Reviewed by Darin Adler.
2649 Have the NetworkProcess and the WebProcess pass the UIProcess bundle
2650 identifier to WebCore so that we can do app detection of applications
2651 using a WK2 WebView (such as HipChat).
2653 * NetworkProcess/NetworkProcess.cpp:
2654 (WebKit::NetworkProcess::initializeNetworkProcess):
2655 * WebProcess/WebProcess.cpp:
2656 (WebKit::WebProcess::initializeWebProcess):
2658 2016-03-03 Simon Fraser <simon.fraser@apple.com>
2660 Use larger tiles when possible to reduce per-tile painting overhead
2661 https://bugs.webkit.org/show_bug.cgi?id=154985
2662 rdar://problem/23635219
2664 Reviewed by Tim Horton.
2666 Do a bit of #include cleanup.
2668 * Shared/mac/RemoteLayerBackingStore.mm:
2669 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2670 * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
2671 * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2673 2016-03-03 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2675 Use std::make_unique<> when creating std::unique_ptr<>
2676 https://bugs.webkit.org/show_bug.cgi?id=154574
2678 Reviewed by Darin Adler.
2680 * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2681 (WebKit::NetworkCache::Statistics::open):
2682 * NetworkProcess/cache/NetworkCacheStatistics.h:
2683 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2684 (WebKit::WebChromeClient::createColorChooser):
2686 2016-03-03 Alex Christensen <achristensen@webkit.org>
2688 Move SPI to CFNetworkSPI.h
2689 https://bugs.webkit.org/show_bug.cgi?id=154992
2691 Reviewed by Andy Estes.
2693 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2694 (WebKit::applyBasicAuthorizationHeader):
2696 2016-03-03 Alex Christensen <achristensen@webkit.org>
2698 Use CredentialStorage with NetworkSession
2699 https://bugs.webkit.org/show_bug.cgi?id=154939
2701 Reviewed by Darin Adler.
2704 Added compile-time flag to help us be able to keep track and remove this code when we can.
2705 * NetworkProcess/NetworkDataTask.h:
2706 (WebKit::NetworkDataTask::pendingDownloadLocation):
2707 * NetworkProcess/NetworkProcess.cpp:
2708 (WebKit::NetworkProcess::clearCachedCredentials):
2709 (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
2710 * NetworkProcess/NetworkSession.h:
2711 (WebKit::NetworkSession::sessionID):
2712 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2713 (WebKit::applyBasicAuthorizationHeader):
2714 (WebKit::NetworkDataTask::NetworkDataTask):
2715 Use a credential storage and preemptively apply basic authentication headers if we have credentials from the storage.
2716 This is analogous to code in ResourceHandle::createNSURLConnection.
2718 (WebKit::NetworkDataTask::didReceiveChallenge):
2719 Make this look more like ResourceHandle::didReceiveAuthenticationChallenge.
2720 The call to tryPasswordBasedAuthentication was moved from the delegate callback to here.
2722 (WebKit::NetworkDataTask::willPerformHTTPRedirection):
2723 Use credentials from the credential storage if they exist. This is analogous to code in ResourceHandle::willSendRequest.
2725 (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
2726 Use credentials from the credential storage if they exist. This is analogous to code in ResourceHandle::tryHandlePasswordBasedAuthentication.
2728 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2729 (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2730 If we are given a credential with CredentialPersistenceForSession, put it in the credential storage and give
2731 CFNetwork a credential with CredentialPersistenceNone so it won't automatically be used again until the credential
2732 storage says its ok to use again. This gives us the ability to clear session credentials when logout credentials are used.
2733 This is analogous to code in ResourceHandle::receivedCredential.
2735 (WebKit::NetworkSession::defaultSession):
2736 (WebKit::NetworkSession::NetworkSession):
2737 (WebKit::NetworkSession::~NetworkSession):
2738 (WebKit::NetworkSession::dataTaskForIdentifier):
2739 (WebKit::NetworkSession::clearCredentials): Deleted.
2740 * WebProcess/WebProcess.cpp:
2741 (WebKit::WebProcess::clearCachedCredentials):
2742 (WebKit::WebProcess::focusedWebPage):
2743 We no longer need to clear credentials from the NSURLSessions because we don't store session credentials in them.
2744 Instead, calling CredentialStorage.clearCredentials is sufficient.
2746 2016-03-03 Andy Estes <aestes@apple.com>
2748 Adopt CFNetwork storage partitioning SPI
2749 https://bugs.webkit.org/show_bug.cgi?id=154957
2750 rdar://problem/23614620
2752 Reviewed by Darin Adler.
2754 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2755 (WebKit::NetworkDataTask::NetworkDataTask): Computed the storage partition identifier for the new session task.
2756 If non-empty, set it using a NSURLSessionTask SPI.
2758 2016-03-03 Alex Christensen <achristensen@webkit.org>
2760 [WK2] testRunner.setPrivateBrowsingEnabled doesn't work with NetworkProcess
2761 https://bugs.webkit.org/show_bug.cgi?id=115274
2763 Reviewed by Darin Adler.
2765 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2766 (WebKit::NetworkConnectionToWebProcess::blobSize):
2767 (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
2768 * NetworkProcess/NetworkConnectionToWebProcess.h:
2769 * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2770 * NetworkProcess/NetworkProcess.h:
2771 * WebProcess/InjectedBundle/InjectedBundle.cpp:
2772 (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2773 * WebProcess/WebProcess.cpp:
2774 (WebKit::WebProcess::destroyPrivateBrowsingSession):
2775 (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
2776 (WebKit::WebProcess::pluginProcessConnectionManager):
2777 * WebProcess/WebProcess.h:
2779 2016-03-02 Alex Christensen <achristensen@webkit.org>
2781 Properly cancel downloads when using NetworkSession
2782 https://bugs.webkit.org/show_bug.cgi?id=154893
2784 Reviewed by Brady Eidson.
2786 * NetworkProcess/Downloads/Download.cpp:
2787 (WebKit::Download::Download):
2788 * NetworkProcess/Downloads/Download.h:
2789 * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2790 (WebKit::Download::cancel):
2791 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2792 (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2794 2016-03-01 Ada Chan <adachan@apple.com>
2796 Update the media element's presentation mode properly after going in and out of full screen via the Full Screen API
2797 https://bugs.webkit.org/show_bug.cgi?id=154834
2799 Reviewed by Simon Fraser.
2801 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2802 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
2803 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2804 (WebKit::WebVideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
2805 Call the new exitFullscreenWithoutAnimationToMode() method on WebVideoFullscreenInterfaceMac.
2806 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2807 (WebKit::WebChromeClient::exitVideoFullscreenToModeWithoutAnimation):
2808 * WebProcess/WebCoreSupport/WebChromeClient.h:
2809 * WebProcess/cocoa/WebVideoFullscreenManager.h:
2810 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2811 (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
2813 2016-03-02 Beth Dakin <bdakin@apple.com>
2815 Crashes in media tests after http://trac.webkit.org/changeset/197461
2816 https://bugs.webkit.org/show_bug.cgi?id=154933
2818 Reviewed by Eric Carlson.
2820 Since the controlsManagerInterface is not guaranteed to exist, it doesn't
2821 make sense to return a reference. Return a pointer instead.
2822 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2823 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2824 (WebKit::WebVideoFullscreenManagerProxy::isVisible):
2825 (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
2826 (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
2828 2016-03-02 Beth Dakin <bdakin@apple.com>
2830 Add support for playbackControlsManager
2831 https://bugs.webkit.org/show_bug.cgi?id=154742
2833 rdar://problem/23833753
2835 Reviewed by Jer Noble.
2837 WebVideoFullscreenManagerProxy ensures the model and interface for the
2838 UIProcess side of the playbackControlsManager. It also caches the
2839 m_controlsManagerContextId so that it can return the
2840 controlsManagerInterface.
2841 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2842 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
2843 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2844 (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
2845 (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
2847 Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to
2848 update WebViewImplAdditions.
2849 * UIProcess/Cocoa/WebViewImpl.h:
2850 * UIProcess/Cocoa/WebViewImpl.mm:
2851 (WebKit::WebViewImpl::isPlayingMediaDidChange):
2852 * UIProcess/PageClient.h:
2853 * UIProcess/WebPageProxy.cpp:
2854 (WebKit::WebPageProxy::isPlayingMediaDidChange):
2855 (WebKit::WebPageProxy::isPlayingVideoWithAudio):
2856 * UIProcess/WebPageProxy.h:
2857 (WebKit::WebPageProxy::isPlayingAudio):
2858 * UIProcess/mac/PageClientImpl.h:
2859 * UIProcess/mac/PageClientImpl.mm:
2860 (WebKit::PageClientImpl::isPlayingMediaDidChange):
2862 Pipe setUpVideoControlsManager to the WebVideoFullscreenManager.
2863 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2864 (WebKit::WebChromeClient::setUpVideoControlsManager):
2865 * WebProcess/WebCoreSupport/WebChromeClient.h:
2867 Ensure the model an interface for the playbackControlsManager on the
2868 WebProcess side and pass the message to the UIProcess to do the same.
2869 * WebProcess/cocoa/WebVideoFullscreenManager.h:
2870 * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2871 (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
2873 2016-03-02 Carlos Garcia Campos <cgarcia@igalia.com>
2875 REGRESSION(r197409): [GTK] Web process always crashes on WebPage construction after r197409
2876 https://bugs.webkit.org/show_bug.cgi?id=154918
2878 Reviewed by Žan Doberšek.
2880 We have an incorrect check in DrawingAreaImpl constructor that has
2881 never actually worked because it uses the page settings before
2882 they were initialized. But that has been fixed in r197409 and now
2883 we are always forcing accelerated compositing mode incorrectly,
2884 because m_alwaysUseCompositing is set in the constructor and never
2887 * WebProcess/WebPage/DrawingAreaImpl.cpp:
2888 (WebKit::DrawingAreaImpl::DrawingAreaImpl): Remove code to set
2889 settings and m_alwaysUseCompositing, since that should be done in
2890 updatePreferences().
2891 (WebKit::DrawingAreaImpl::updatePreferences): Update the settings
2892 accordingly and always update m_alwaysUseCompositing when AC is
2893 enabled and forced in the settings.
2894 * WebProcess/WebPage/WebPage.cpp:
2895 (WebKit::WebPage::WebPage): WebPage::updatePreferences() calls
2896 DrawingArea::updatePreferences(), but since r197409 it happens
2897 before the drawing area has been created. So, call
2898 DrawingArea::updatePreferences() in the constructor right after
2899 the main frame has been created, since
2900 DrawingArea::updatePreferences() uses the main frame.
2902 2016-02-29 Ada Chan <adachan@apple.com>
2904 Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
2905 https://bugs.webkit.org/show_bug.cgi?id=154823
2907 Reviewed by Tim Horton.
2909 * UIProcess/WebPageProxy.cpp:
2910 (WebKit::WebPageProxy::showPlaybackTargetPicker):
2911 (WebKit::WebPageProxy::customPlaybackActionSelected):
2912 * UIProcess/WebPageProxy.h:
2913 * UIProcess/WebPageProxy.messages.in:
2914 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2915 (WebKit::WebChromeClient::showPlaybackTargetPicker):
2916 * WebProcess/WebCoreSupport/WebChromeClient.h:
2917 * WebProcess/WebPage/WebPage.h:
2918 * WebProcess/WebPage/WebPage.messages.in:
2919 * WebProcess/WebPage/mac/WebPageMac.mm:
2920 (WebKit::WebPage::customPlaybackActionSelected):
2922 2016-02-29 Brent Fulgham <bfulgham@apple.com>
2924 [WK2] Stub support for WebsiteDataTypeResourceLoadStatistics
2925 https://bugs.webkit.org/show_bug.cgi?id=154689
2926 <rdar://problem/24702576>
2928 Reviewed by Sam Weinig.
2930 * Shared/WebsiteData/WebsiteDataType.h: Add new WebsiteDataTypeResourceLoadStatistics.
2931 * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2932 (dataTypesToString): Handle new type.
2933 * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2934 (WebKit::toWebsiteDataTypes): Ditto.
2935 (WebKit::toWKWebsiteDataTypes): Ditto.
2936 * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Add new _WebsiteDataTypeResourceLoadStatistics.
2938 2016-03-01 Alex Christensen <achristensen@webkit.org>
2940 Correctly keep track of NetworkDataTasks with and without credentials when using NetworkSession
2941 https://bugs.webkit.org/show_bug.cgi?id=154876
2943 Reviewed by Brady Eidson.
2945 I was seeing an assertion failure from ASSERT(!m_session.m_dataTaskMap.contains(taskIdentifier()))
2946 in the NetworkDataTask constructor sometimes. This is because a task identifier is not enough information
2947 to uniquely find a NetworkDataTask in a NetworkSession since r196034 because there are two NSURLSessions
2948 in a NetworkSession, one with credentials and one without. The assertion would fire in a case like if we
2949 made the first NetworkDataTask with credentials (taskIdentifier is 1) and the first NetworkDataTask
2950 without credentials before the first NetworkDataTask with credentials was finished. In that case, the
2951 taskIdentifier would also be 1, which would conflict with the other taskIdentifier. That taskIdentifier
2952 would uniquely identify the task in the correct NSURLSession, though, so the solution is to keep a map
2953 for each NSURLSession in the NetworkSession.
2955 * NetworkProcess/NetworkDataTask.h:
2956 * NetworkProcess/NetworkSession.h:
2957 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2958 (WebKit::NetworkDataTask::NetworkDataTask):
2959 (WebKit::NetworkDataTask::~NetworkDataTask):
2960 (WebKit::NetworkDataTask::suspend):
2961 (WebKit::serverTrustCredential):
2962 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2963 (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
2964 (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2965 (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2966 (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2967 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2968 (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
2969 (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2970 (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2971 (WebKit::NetworkSession::clearCredentials):
2972 (WebKit::NetworkSession::dataTaskForIdentifier):
2973 (WebKit::NetworkSession::addDownloadID):
2975 2016-03-01 Andreas Kling <akling@apple.com>
2977 REGRESSION (r154616): Accelerated drawing is off during the initial load
2978 <https://webkit.org/b/123812>
2980 Reviewed by Tim Horton.
2982 Load preferences before instantiating the first DrawingArea. This ensures that we do the
2983 initial paint using accelerated drawing, and avoids allocating persistent data structures
2984 only needed by the software rendering path.
2986 * WebProcess/WebPage/WebPage.cpp:
2988 2016-03-01 Alex Christensen <achristensen@webkit.org>
2990 Fix tests when using NetworkSession
2991 https://bugs.webkit.org/show_bug.cgi?id=154866
2993 Reviewed by Brady Eidson.
2995 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2996 (WebKit::globalCustomProtocolManager):
2997 (WebKit::NetworkSession::setCustomProtocolManager):
2999 Use a static NeverDestroyed instead of a local NeverDestroyed.
3000 This fix was suggested by Darin after I broke the custom protocol tests in r197362.
3002 (WebKit::NetworkSession::clearCredentials):
3004 In r197223 I added code that I thought cleared the credentials of a session, but it was
3005 actually trying (and failing) to remove the credentials from the NSURLCredentialStorage that
3006 were stored with NSURLCredentialPersistencePermanent.
3007 This was causing credentials stored in an NSURLSession with NSURLCredentialPersistenceForSession
3008 to remain for the next tests, and was causing credentials from previous tests, usually from
3009 http/tests/loading/basic-credentials-sent-automatically.html, to be used in future tests.
3010 Creating a new NSURLSession is the equivalent of CredentialStorage::clearCredentials because it
3011 removes all credentials stored with NSURLCredentialPersistenceForSession.
3013 2016-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
3015 NetworkCache: Web process leaks resource buffer when using shareable reasources
3016 https://bugs.webkit.org/show_bug.cgi?id=154852
3018 Reviewed by Darin Adler.
3020 ResourceLoader::didReceiveBuffer() expects a PassRefPtr, but we
3021 are passing a raw pointer making PassRefPtr to take another
3022 reference instead of transfering the ownership as expected.
3024 * WebProcess/Network/WebResourceLoader.cpp:
3025 (WebKit::WebResourceLoader::didReceiveResource):
3027 2016-02-29 Zan Dobersek <zdobersek@igalia.com>
3029 ThreadedCompositor: clean up composition-specific resources before shutting down the thread
3030 https://bugs.webkit.org/show_bug.cgi?id=154793
3032 Reviewed by Carlos Garcia Campos.
3034 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3035 (WebKit::ThreadedCompositor::runCompositingThread): Before concluding the
3036 compositing thread run, clean up all the resources that were allocated at
3037 the start, and in the reverse order. Specifically, we now also deallocate
3038 the CoordinatedGraphicsScene and the SimpleViewportController objects. This
3039 way these are not deallocated on the main thread when the ThreadedCompositor
3040 destructor would otherwise clean them up.
3042 2016-02-29 Zan Dobersek <zdobersek@igalia.com>
3044 ThreadSafeCoordinatedSurface: remove the unused private create() static method
3045 https://bugs.webkit.org/show_bug.cgi?id=154792
3047 Reviewed by Carlos Garcia Campos.
3049 Remove the static ThreadSafeCoordinatedSurface::create() method that accepted
3050 a std::unique_ptr<ImageBuffer> object as its third parameter. This was not used
3053 * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
3054 (WebKit::ThreadSafeCoordinatedSurface::create): Deleted.
3055 * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:
3057 2016-02-29 Simon Fraser <simon.fraser@apple.com>
3059 Remove the experimental feature of antialiased font dilation
3060 https://bugs.webkit.org/show_bug.cgi?id=154843
3062 Reviewed by Zalan Bujtas.
3064 Remove the "antialiased font dilation" code path, and related prefs.
3066 * Shared/WebPreferencesDefinitions.h:
3067 * UIProcess/API/C/WKPreferences.cpp:
3068 (WKPreferencesSetAntialiasedFontDilationEnabled):
3069 (WKPreferencesGetAntialiasedFontDilationEnabled):
3070 * UIProcess/API/C/WKPreferencesRefPrivate.h:
3071 * UIProcess/API/Cocoa/WKPreferences.mm:
3072 (-[WKPreferences _antialiasedFontDilationEnabled]): Deleted.
3073 (-[WKPreferences _setAntialiasedFontDilationEnabled:]): Deleted.
3074 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3075 * WebProcess/WebPage/WebPage.cpp:
3076 (WebKit::WebPage::updatePreferences): Deleted.
3078 2016-02-29 Brady Eidson <beidson@apple.com>
3080 Modern IDB: WebKit 2 IPC layer easily confused about multiple web processes being connected.
3081 https://bugs.webkit.org/show_bug.cgi?id=154837
3083 Reviewed by Alex Christensen.
3085 The crux of the bug is that WebProcesses cannot assign themselves server-unique identifiers...
3086 The server must do that for them.
3088 A once-per-session-per-WebProcess sync message and a few updates to connection management fix this.
3090 * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
3091 (WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage):
3092 (WebKit::generateConnectionToServerIdentifier):
3093 (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
3094 * DatabaseProcess/DatabaseToWebProcessConnection.h:
3095 * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
3097 * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3098 (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
3099 (WebKit::generateConnectionToServerIdentifier): Deleted.
3101 * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
3102 (WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
3103 (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
3104 * WebProcess/Databases/WebToDatabaseProcessConnection.h:
3106 2016-02-29 Alex Christensen <achristensen@webkit.org>
3108 Don't call NetworkProcess::singleton from WebProcess when using NetworkSession
3109 https://bugs.webkit.org/show_bug.cgi?id=154829
3111 Reviewed by Anders Carlsson.
3113 We were calling NetworkProcess::singleton when making the default session in the
3114 WebProcess, which caused bad things to happen. We also were never clearing the
3115 credentials in the WebProcess between tests because it used to always call
3116 NetworkProcess::singleton, which caused flaky tests.
3118 This fixes repeatable crashes in http/tests/media/media-document-referer.html and
3119 http/tests/media/media-document.html when using NetworkSession.
3121 * NetworkProcess/NetworkProcess.cpp:
3122 (WebKit::NetworkProcess::NetworkProcess):
3123 (WebKit::NetworkProcess::~NetworkProcess):
3124 * NetworkProcess/NetworkSession.h:
3125 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3126 (WebKit::configurationForType):
3127 (WebKit::globalCustomProtocolManager):
3128 (WebKit::NetworkSession::setCustomProtocolManager):
3129 (WebKit::NetworkSession::defaultSession):
3130 * WebProcess/WebProcess.cpp:
3131 (WebKit::WebProcess::clearCachedCredentials):
3133 2016-02-29 Gavin Barraclough <barraclough@apple.com>
3135 RefCounter<T>::Event -> RefCounterEvent
3136 https://bugs.webkit.org/show_bug.cgi?id=154767
3138 Reviewed by Darin Adler.
3140 RefCounter<T>::Event is kinda verbose to use, and there is no need for this
3141 to be specific to a particular typeof RefCounter. Move the enum class up to
3142 the top level & rename to RefCounterEvent.
3144 Also remove UserObservablePageToken - this is vestigial & not really offering
3145 anything over just using UserObservablePageCounter::Token directly.
3147 * UIProcess/Plugins/PluginProcessManager.cpp:
3148 (WebKit::PluginProcessManager::PluginProcessManager):
3149 * UIProcess/Plugins/PluginProcessManager.h:
3150 * UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
3151 (WebKit::PluginProcessManager::updateProcessSuppressionDisabled):
3152 * UIProcess/ProcessThrottler.cpp:
3153 (WebKit::ProcessThrottler::ProcessThrottler):
3154 (WebKit::m_backgroundCounter):
3155 (WebKit::m_suspendMessageCount):
3156 * UIProcess/ProcessThrottler.h:
3157 * UIProcess/WebPageProxy.h:
3158 * UIProcess/WebProcessPool.cpp:
3159 (WebKit::WebProcessPool::WebProcessPool):
3160 (WebKit::m_processSuppressionDisabledForPageCounter):
3161 (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
3162 * UIProcess/WebProcessPool.h:
3164 2016-02-29 Konstantin Tokarev <annulen@yandex.ru>
3166 Fixed compilation with !ENABLE(DATABASE_PROCESS).
3167 https://bugs.webkit.org/show_bug.cgi?id=154813
3169 Reviewed by Michael Catanzaro.
3171 * UIProcess/WebProcessPool.cpp:
3172 (WebKit::WebProcessPool::terminateDatabaseProcess): Added missing #if
3175 2016-02-29 Adrien Plazas <aplazas@igalia.com>
3177 [GTK] Touch slider test fails due to assertion in webkitWebViewBaseTouchEvent()
3178 https://bugs.webkit.org/show_bug.cgi?id=153829
3180 Reviewed by Carlos Garcia Campos.
3182 Once a touch event sequence is identified as a gesture, remove it
3183 from the list of handled touch events.
3185 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3186 (webkitWebViewBaseTouchEvent):
3188 2016-02-29 Csaba Osztrogonác <ossy@webkit.org>
3190 [Mac][cmake] Unreviewed buildfix after r197177. Just for fun.
3192 * PlatformMac.cmake:
3194 2016-02-28 Sam Weinig <sam@webkit.org>
3196 Reimplement WKPageGroup in terms of WKUserContentController
3197 https://bugs.webkit.org/show_bug.cgi?id=154804
3199 Reviewed by Dan Bernstein.
3201 Instead of having both WebPageGroup and WebUserContentControllerProxy both keep track
3202 of user scripts and user stylesheets, give WebPageGroup a WebUserContentControllerProxy
3203 and let it take care of things. This allows us to remove a ton of duplicate code, and
3204 provides a convenient way for clients currently using PageGroup based user content insertion
3205 to start using UserContentController, since they can now be used at the same time.
3207 When using WKPageConfigurationRef, the rule is:
3208 - If you don't set a WKUserContentControllerRef, the one from the WKPageGroupRef will be used.
3209 - If you do set a WKUserContentControllerRef, it will be used, and the one from the WKPageGroupRef
3210 will do nothing for that web view.
3212 * DerivedSources.make:
3213 Remove WebPageGroupProxy. It no longer is a MessageReceiver.
3215 * Shared/WebPageGroupData.cpp:
3216 (WebKit::WebPageGroupData::encode):
3217 (WebKit::WebPageGroupData::decode):
3218 * Shared/WebPageGroupData.h:
3219 Stop encoding/decoding user content, instead just encode the identifier to the UserContentController.
3221 * UIProcess/API/C/WKPageGroup.cpp:
3222 (WKPageGroupGetUserContentController):
3223 * UIProcess/API/C/WKPageGroup.h:
3224 Add getter for the underlying WKUserContentControllerRef.
3226 * UIProcess/API/cpp/WKRetainPtr.h:
3228 Add retainWK() helper to match RetainPtr's retainPtr() helper.
3230 * UIProcess/WebPageGroup.cpp:
3231 (WebKit::WebPageGroup::WebPageGroup):
3232 (WebKit::WebPageGroup::userContentController):
3233 (WebKit::WebPageGroup::addUserStyleSheet):
3234 (WebKit::WebPageGroup::addUserScript):
3235 (WebKit::WebPageGroup::removeAllUserStyleSheets):
3236 (WebKit::WebPageGroup::removeAllUserScripts):
3237 (WebKit::WebPageGroup::removeAllUserContent):
3238 (WebKit::WebPageGroup::addUserContentExtension):
3239 (WebKit::WebPageGroup::removeUserContentExtension):
3240 (WebKit::WebPageGroup::removeAllUserContentExtensions):
3241 * UIProcess/WebPageGroup.h:
3242 Pass through to the WebUserContentControllerProxy.
3244 * UIProcess/WebPageProxy.cpp:
3245 (WebKit::WebPageProxy::WebPageProxy):
3246 (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
3247 (WebKit::WebPageProxy::creationParameters):
3248 * UIProcess/WebPageProxy.h:
3249 WebPageProxies always have a WebUserContentControllerProxy now, so it can go in a Ref and
3250 a few branches can be removed.
3252 * UIProcess/WebProcessPool.cpp:
3253 (WebKit::WebProcessPool::createWebPage):
3254 If a UserContentController is not passed in, use the one from the PageGroup.
3256 * WebKit2.xcodeproj/project.pbxproj:
3259 * WebProcess/InjectedBundle/InjectedBundle.cpp:
3260 Add some #includes that are now needed.
3262 * WebProcess/UserContent/WebUserContentController.cpp:
3263 (WebKit::WebUserContentController::getOrCreate):
3264 * WebProcess/UserContent/WebUserContentController.h:
3265 Modernize WebUserContentController::getOrCreate to return a Ref.
3267 * WebProcess/WebPage/WebPage.cpp:
3268 (WebKit::WebPage::WebPage):
3269 (WebKit::m_shouldDispatchFakeMouseMoveEvents):
3270 (WebKit::WebPage::addUserScript):
3271 (WebKit::WebPage::addUserStyleSheet):
3272 (WebKit::WebPage::removeAllUserContent):
3273 * WebProcess/WebPage/WebPage.h:
3274 Store the WebUserContentController in Ref, remove unnecessary branches/asserts.
3276 * WebProcess/WebPage/WebPageGroupProxy.cpp:
3277 (WebKit::WebPageGroupProxy::WebPageGroupProxy):
3278 (WebKit::WebPageGroupProxy::~WebPageGroupProxy):
3279 (WebKit::WebPageGroupProxy::userContentController):
3280 (WebKit::WebPageGroupProxy::addUserStyleSheet): Deleted.
3281 (WebKit::WebPageGroupProxy::addUserScript): Deleted.
3282 (WebKit::WebPageGroupProxy::removeAllUserStyleSheets): Deleted.
3283 (WebKit::WebPageGroupProxy::removeAllUserScripts): Deleted.
3284 (WebKit::WebPageGroupProxy::removeAllUserContent): Deleted.
3285 (WebKit::WebPageGroupProxy::addUserContentExtension): Deleted.
3286 (WebKit::WebPageGroupProxy::removeUserContentExtension): Deleted.
3287 (WebKit::WebPageGroupProxy::removeAllUserContentExtensions): Deleted.
3288 * WebProcess/WebPage/WebPageGroupProxy.h:
3289 Store a WebUserContentController in a Ref, remove now unnecessary message handling functions.
3291 * WebProcess/WebPage/WebPageGroupProxy.messages.in:
3294 * WebProcess/WebProcess.cpp:
3295 (WebKit::WebProcess::didReceiveMessage):
3296 Remove routing to WebPageGroupProxy, which is no longer a MessageReceiver.
3298 2016-02-28 Sam Weinig <sam@webkit.org>
3300 Bind _WKUserStyleSheets to _WKUserContentWorlds to allow for grouping of user content by associating to a world
3301 https://bugs.webkit.org/show_bug.cgi?id=154798
3303 Reviewed by Dan Bernstein.
3305 Treat _WKUserStyleSheets like WKUserScripts and allow them to be bound to a _WKUserContentWorld.
3306 The immediate benefit of this is allowing a client to bind a set of user content (scripts and stylesheets
3307 for now) to a world and have them easily remove all user content associated with that world easily.
3309 * Shared/API/APIArray.h:
3310 Add helpers removeAllMatching and removeAllOfTypeMatching.
3312 * UIProcess/API/APIUserStyleSheet.h:
3313 Add API::UserContentWorld member.
3315 * UIProcess/API/Cocoa/WKUserContentController.mm:
3316 (-[WKUserContentController _removeAllUserScriptsAssociatedWithUserContentWorld:]):
3317 (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithUserContentWorld:]):
3318 * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
3319 Add _removeAllUserScriptsAssociatedWithUserContentWorld and _removeAllUserStyleSheetsAssociatedWithUserContentWorld.
3321 * UIProcess/API/Cocoa/WKUserScript.mm:
3322 (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
3323 (toStringVector): Deleted.
3324 * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
3325 (API::toStringVector):
3326 Move toStringVector to a location where it can be shared.
3328 * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
3329 * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
3330 (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
3331 Add new initializer which has a world to be bound to. While here, match WKUserScript and add support for the
3332 legacy whitelist and blacklists.
3334 * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3335 (WebKit::WebUserContentControllerProxy::addProcess):
3336 (WebKit::WebUserContentControllerProxy::removeProcess):
3337 (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
3338 (WebKit::WebUserContentControllerProxy::shouldSendRemoveUserContentWorldsMessage):
3339 (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
3340 (WebKit::WebUserContentControllerProxy::addUserScript):
3341 (WebKit::WebUserContentControllerProxy::removeUserScript):
3342 (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
3343 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
3344 (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
3345 (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
3346 * UIProcess/UserContent/WebUserContentControllerProxy.h:
3347 Refactor to share the code which decides whether to send AddUserContentWorlds/RemoveUserContentWorlds
3350 * WebProcess/UserContent/WebUserContentController.cpp:
3351 (WebKit::WebUserContentController::addUserContentWorlds):
3352 (WebKit::WebUserContentController::removeUserContentWorlds):
3353 (WebKit::WebUserContentController::addUserScripts):
3354 (WebKit::WebUserContentController::removeUserScript):
3355 (WebKit::WebUserContentController::removeAllUserScripts):
3356 (WebKit::WebUserContentController::addUserStyleSheets):
3357 (WebKit::WebUserContentController::removeUserStyleSheet):
3358 (WebKit::WebUserContentController::removeAllUserStyleSheets):
3359 * WebProcess/UserContent/WebUserContentController.h:
3360 * WebProcess/UserContent/WebUserContentController.messages.in:
3361 Add support for binding stylesheets to worlds and allow removing all the scripts/stylesheets from a
3362 set of worlds at once by passing Vectors of world identifiers in the remove messages.
3364 2016-02-27 Commit Queue <commit-queue@webkit.org>
3366 Unreviewed, rolling out r197204, r197207, r197211, r197217,
3367 r197218, and r197219.
3368 https://bugs.webkit.org/show_bug.cgi?id=154780
3370 Caused crashes in WebVideoFullscreenManagerProxy (Requested by
3373 Reverted changesets:
3375 "Add support for playbackControlsManager"
3376 https://bugs.webkit.org/show_bug.cgi?id=154742
3377 http://trac.webkit.org/changeset/197204
3379 "Attempted build fix."
3380 http://trac.webkit.org/changeset/197207
3382 "Attempted build fix."
3383 http://trac.webkit.org/changeset/197211
3385 "Attempted 32-bit build fix."
3386 http://trac.webkit.org/changeset/197217
3388 "Another 32-bit build fix."
3389 http://trac.webkit.org/changeset/197218
3392 http://trac.webkit.org/changeset/197219
3394 2016-02-26 Carlos Garcia Campos <cgarcia@igalia.com>
3396 Unreviewed. Fix GTK+ clean build.
3398 Add missing header include.
3400 * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3402 2016-02-26 Carlos Garcia Campos <cgarcia@igalia.com>
3404 Network cache: old pages returned by disk cache on history navigation after session is restored
3405 https://bugs.webkit.org/show_bug.cgi?id=153230
3407 Reviewed by Chris Dumez.
3409 Since r181734, the network cache never revalidates resources for
3410 history navigation. This is good for the memory cache, but in the
3411 case of disk cache, we might end up with outdated pages when
3412 restoring the session. When restoring the session happens because
3413 of an API request (we also restore the session when recovering
3414 from a web process crash), we should revalidate back forward list
3415 requests in the disk cache if needed. This will only happen the
3416 first time they are loaded after a session restore. After a web process
3417 crash, resources will be used uncondionally from the disk cache.
3419 * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3420 (WebKit::WebBackForwardListProxy::addItemFromUIProcess): Use Ref&&
3421 instead of PassRefPtr.
3422 * WebProcess/WebPage/WebBackForwardListProxy.h:
3423 * WebProcess/WebPage/WebPage.cpp:
3424 (WebKit::WePage::WebPage): Call restoreSessionInternal passing
3425 No as restoredByAPIRequest parameter.
3426 (WebKit::WebPage::restoreSessionInternal): Set restoredFromSession
3427 flag to the created HistoryItem if the item was restored from
3428 session by an API request.
3429 (WebKit::WebPage::restoreSession): Call restoreSessionInternal
3430 passing Yes as restoredByAPIRequest parameter.
3431 * WebProcess/WebPage/WebPage.h:
3433 2016-02-26 Michael Catanzaro <mcatanzaro@igalia.com>
3437 Unreviewed. Shame I didn't notice in the previous commit.
3439 * WebProcess/UserContent/WebUserContentController.cpp:
3440 (WebKit::WebUserContentController::removeUserContentWorld):
3442 2016-02-26 Michael Catanzaro <mcatanzaro@igalia.com>
3444 Fix GTK and maybe EFL build after r197172.