Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: ios/web/web_state/ui/crw_ui_web_view_web_controller.mm

Issue 1137143004: WebUI for WKWebView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittest issues Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/ios_web_unittests.gyp ('k') | ios/web/web_state/ui/crw_web_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm b/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
index 36a9d8355b95e293957d35ffb6490f85408fc391..bd241939dab383377783720c431749e332a380e2 100644
--- a/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
+++ b/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
@@ -531,7 +531,18 @@ const size_t kMaxMessageQueueSize = 262144;
return web::WEB_VIEW_DOCUMENT_TYPE_UNKNOWN;
}
-- (void)loadWebRequest:(NSURLRequest*)request {
+- (void)loadRequest:(NSMutableURLRequest*)request {
+ DCHECK(web::GetWebClient());
+ GURL requestURL = net::GURLWithNSURL(request.URL);
+ // If the request is for WebUI, add information to let the network stack
+ // access the requestGroupID.
+ if (web::GetWebClient()->IsAppSpecificURL(requestURL)) {
+ // Sub requests of a chrome:// page will not contain the user agent.
+ // Instead use the username part of the URL to allow the network stack to
+ // associate a request to the correct tab.
+ request.URL = web::AddRequestGroupIDToURL(
+ request.URL, self.webStateImpl->GetRequestGroupID());
+ }
[_uiWebView loadRequest:request];
}
« no previous file with comments | « ios/web/ios_web_unittests.gyp ('k') | ios/web/web_state/ui/crw_web_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698