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

Unified Diff: extensions/renderer/script_injection.cc

Issue 2250263004: [Extensions] Reduce string copy in renderer/ UserScript. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: extensions/renderer/script_injection.cc
diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc
index da93590c3908c00fb33421a2b3ff9f1077e04b06..69cfc526c797f2cd7b9407495b34290765210d9e 100644
--- a/extensions/renderer/script_injection.cc
+++ b/extensions/renderer/script_injection.cc
@@ -312,11 +312,11 @@ void ScriptInjection::OnJsInjectionCompleted(
}
void ScriptInjection::InjectCss() {
- std::vector<std::string> css_sources =
+ std::vector<blink::WebString> css_sources =
injector_->GetCssSources(run_location_);
blink::WebLocalFrame* web_frame = render_frame_->GetWebFrame();
- for (const std::string& css : css_sources)
- web_frame->document().insertStyleSheet(blink::WebString::fromUTF8(css));
+ for (const blink::WebString& css : css_sources)
+ web_frame->document().insertStyleSheet(css);
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698