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

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

Issue 2644103004: Remove RequestTracker from WebStateImpl. (Closed)
Patch Set: Rebase. 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
« no previous file with comments | « 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..bdd0e3b0908b7575d2ad2a7f1cc190ef4bdef458 100644
--- a/ios/web/webui/crw_web_ui_manager.mm
+++ b/ios/web/webui/crw_web_ui_manager.mm
@@ -17,7 +17,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "ios/web/grit/ios_web_resources.h"
-#import "ios/web/net/request_group_util.h"
#include "ios/web/public/browser_state.h"
#import "ios/web/public/web_client.h"
#import "ios/web/public/web_state/web_state_observer_bridge.h"
@@ -113,21 +112,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);
}
}];
}
« no previous file with comments | « 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