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

Unified Diff: chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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
Index: chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
index dfcd2cbcb3e2fe0a4a86e7eddf0d8d356170ddbc..70464eaf99d4b80342a51ca520c7c148cec4eda2 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
@@ -439,7 +439,7 @@ void MobileSetupHandler::HandleStartActivation(const base::ListValue* args) {
if (!web_ui())
return;
- std::string path = web_ui()->GetWebContents()->GetURL().path();
+ base::StringPiece path = web_ui()->GetWebContents()->GetURL().path();
if (path.empty())
return;
@@ -447,7 +447,8 @@ void MobileSetupHandler::HandleStartActivation(const base::ListValue* args) {
type_ = TYPE_ACTIVATION;
MobileActivator::GetInstance()->AddObserver(this);
- MobileActivator::GetInstance()->InitiateActivation(path.substr(1));
+ MobileActivator::GetInstance()->InitiateActivation(
+ path.substr(1).as_string());
}
void MobileSetupHandler::HandleSetTransactionStatus(
@@ -490,7 +491,7 @@ void MobileSetupHandler::HandleGetDeviceInfo(const base::ListValue* args) {
if (!web_ui())
return;
- std::string path = web_ui()->GetWebContents()->GetURL().path();
+ base::StringPiece path = web_ui()->GetWebContents()->GetURL().path();
if (path.empty())
return;
@@ -498,7 +499,8 @@ void MobileSetupHandler::HandleGetDeviceInfo(const base::ListValue* args) {
NetworkHandler::Get()->network_state_handler();
// TODO: Figure out why the path has an extra '/' in the front. (e.g. It is
// '//service/5' instead of '/service/5'.
- const NetworkState* network = nsh->GetNetworkState(path.substr(1));
+ const NetworkState* network =
+ nsh->GetNetworkState(path.substr(1).as_string());
if (!network) {
web_ui()->GetWebContents()->Close();
return;
@@ -559,7 +561,8 @@ void MobileSetupHandler::DefaultNetworkChanged(
if (!web_ui())
return;
- std::string path = web_ui()->GetWebContents()->GetURL().path().substr(1);
+ std::string path =
+ web_ui()->GetWebContents()->GetURL().path().substr(1).as_string();
if (path.empty())
return;
@@ -579,7 +582,8 @@ void MobileSetupHandler::NetworkConnectionStateChanged(
if (!web_ui())
return;
- std::string path = web_ui()->GetWebContents()->GetURL().path().substr(1);
+ std::string path =
+ web_ui()->GetWebContents()->GetURL().path().substr(1).as_string();
if (path.empty() || path != network->path())
return;
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.cc ('k') | chrome/browser/ui/webui/devtools_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698