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

Unified Diff: extensions/renderer/dispatcher.cc

Issue 2250263004: [Extensions] Reduce string copy in renderer/ UserScript. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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
« no previous file with comments | « no previous file | extensions/renderer/programmatic_script_injector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/dispatcher.cc
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index 27979f922e75cd6199efcf077c8a6d43b2e94bf3..ab8c2e3494373de869c6986a0e5003a60d637cc5 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -582,10 +582,11 @@ void Dispatcher::DidCreateDocumentElement(blink::WebLocalFrame* frame) {
if (extension && extension->is_extension() &&
OptionsPageInfo::ShouldUseChromeStyle(extension) &&
effective_document_url == OptionsPageInfo::GetOptionsPage(extension)) {
+ base::StringPiece extension_css =
+ ResourceBundle::GetSharedInstance().GetRawDataResource(
+ IDR_EXTENSION_CSS);
frame->document().insertStyleSheet(
- WebString::fromUTF8(ResourceBundle::GetSharedInstance()
- .GetRawDataResource(IDR_EXTENSION_CSS)
- .as_string()));
+ WebString::fromUTF8(extension_css.data(), extension_css.length()));
}
// In testing, the document lifetime events can happen after the render
« no previous file with comments | « no previous file | extensions/renderer/programmatic_script_injector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698