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

Unified Diff: ios/web/webui/crw_web_ui_manager.mm

Issue 2644103004: Remove RequestTracker from WebStateImpl. (Closed)
Patch Set: Created 3 years, 11 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
« ios/web/web_state/web_state_impl.h ('K') | « ios/web/web_state/web_state_impl.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/webui/crw_web_ui_manager.mm
diff --git a/ios/web/webui/crw_web_ui_manager.mm b/ios/web/webui/crw_web_ui_manager.mm
index 2efc12b796a6cf8ffb054b1564144422b28cf330..a456bc9b3f71f115905d3f731c4c6e367a3821d5 100644
--- a/ios/web/webui/crw_web_ui_manager.mm
+++ b/ios/web/webui/crw_web_ui_manager.mm
@@ -113,21 +113,16 @@ const char kScriptCommandPrefix[] = "webui";
if (!web::GetWebClient()->IsAppSpecificURL(URL))
return;
- GURL navigationURL(URL);
- // Add request group ID to the URL, if not present. Request group ID may
- // already be added if restoring state to a WebUI page.
- GURL requestURL =
- web::ExtractRequestGroupIDFromURL(net::NSURLWithGURL(URL))
- ? URL
- : net::GURLWithNSURL(web::AddRequestGroupIDToURL(
- net::NSURLWithGURL(URL), _webState->GetRequestGroupID()));
+ // Copy |URL| as it is passed by reference which does not work correctly
+ // with blocks (if the object is destroyed the block will have a dangling
+ // reference).
+ GURL copyURL(URL);
base::WeakNSObject<CRWWebUIManager> weakSelf(self);
- [self loadWebUIPageForURL:requestURL
+ [self loadWebUIPageForURL:copyURL
completionHandler:^(NSString* HTML) {
web::WebStateImpl* webState = [weakSelf webState];
if (webState) {
- webState->LoadWebUIHtml(base::SysNSStringToUTF16(HTML),
- navigationURL);
+ webState->LoadWebUIHtml(base::SysNSStringToUTF16(HTML), copyURL);
}
}];
}
« ios/web/web_state/web_state_impl.h ('K') | « ios/web/web_state/web_state_impl.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698