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

Unified Diff: extensions/renderer/user_script_injector.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
« no previous file with comments | « extensions/renderer/script_context.cc ('k') | extensions/shell/browser/shell_nacl_browser_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/user_script_injector.cc
diff --git a/extensions/renderer/user_script_injector.cc b/extensions/renderer/user_script_injector.cc
index 73096868c94a4ff48f6e31aa2bc40e8e56b3a675..bd662fb7edc34a86b85a8641aa49ac79cda6d2f4 100644
--- a/extensions/renderer/user_script_injector.cc
+++ b/extensions/renderer/user_script_injector.cc
@@ -84,7 +84,7 @@ bool ShouldInjectScripts(const UserScript::FileList& scripts,
const std::set<std::string>& injected_files) {
for (const std::unique_ptr<UserScript::File>& file : scripts) {
// Check if the script is already injected.
- if (injected_files.count(file->url().path()) == 0) {
+ if (injected_files.count(file->url().path().as_string()) == 0) {
return true;
}
}
@@ -227,7 +227,7 @@ std::vector<blink::WebScriptSource> UserScriptInjector::GetJsSources(
for (const std::unique_ptr<UserScript::File>& file : js_scripts) {
const GURL& script_url = file->url();
// Check if the script is already injected.
- if (executing_scripts->count(script_url.path()) != 0)
+ if (executing_scripts->count(script_url.path().as_string()) != 0)
continue;
sources.push_back(blink::WebScriptSource(
@@ -235,7 +235,7 @@ std::vector<blink::WebScriptSource> UserScriptInjector::GetJsSources(
script_url));
(*num_injected_js_scripts) += 1;
- executing_scripts->insert(script_url.path());
+ executing_scripts->insert(script_url.path().as_string());
}
return sources;
@@ -253,7 +253,7 @@ std::vector<blink::WebString> UserScriptInjector::GetCssSources(
const UserScript::FileList& css_scripts = script_->css_scripts();
sources.reserve(css_scripts.size());
for (const std::unique_ptr<UserScript::File>& file : script_->css_scripts()) {
- const std::string& stylesheet_path = file->url().path();
+ const std::string& stylesheet_path = file->url().path().as_string();
// Check if the stylesheet is already injected.
if (injected_stylesheets->count(stylesheet_path) != 0)
continue;
« no previous file with comments | « extensions/renderer/script_context.cc ('k') | extensions/shell/browser/shell_nacl_browser_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698