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

Unified Diff: chrome/browser/ui/webui/net_internals_ui.cc

Issue 7397021: Re-land r93365 - add RefCountedString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit_tests Created 9 years, 5 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: chrome/browser/ui/webui/net_internals_ui.cc
diff --git a/chrome/browser/ui/webui/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals_ui.cc
index a4341b24847f88dc2f00c092683b2cacb1fe07fa..577e5a01695a47727750dc9134c32a8bf9813dc1 100644
--- a/chrome/browser/ui/webui/net_internals_ui.cc
+++ b/chrome/browser/ui/webui/net_internals_ui.cc
@@ -483,19 +483,13 @@ void NetInternalsHTMLSource::StartDataRequest(const std::string& path,
jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html);
jstemplate_builder::AppendJsTemplateSourceHtml(&full_html);
- scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes);
- html_bytes->data.resize(full_html.size());
- std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin());
- SendResponse(request_id, html_bytes);
+ SendResponse(request_id, base::RefCountedString::TakeString(&full_html));
return;
}
- const std::string data_string("<p style='color:red'>Failed to read resource" +
+ std::string data_string("<p style='color:red'>Failed to read resource" +
EscapeForHTML(filename) + "</p>");
- scoped_refptr<RefCountedBytes> bytes(new RefCountedBytes);
- bytes->data.resize(data_string.size());
- std::copy(data_string.begin(), data_string.end(), bytes->data.begin());
- SendResponse(request_id, bytes);
+ SendResponse(request_id, base::RefCountedString::TakeString(&data_string));
}
std::string NetInternalsHTMLSource::GetMimeType(const std::string&) const {

Powered by Google App Engine
This is Rietveld 408576698