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

Side by Side Diff: chrome/browser/browser_about_handler.cc

Issue 7397021: Re-land r93365 - add RefCountedString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/memory/ref_counted_memory_unittest.cc ('k') | chrome/browser/browser_signin.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser_about_handler.h" 5 #include "chrome/browser/browser_about_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 response = AboutLinuxProxyConfig(); 1414 response = AboutLinuxProxyConfig();
1415 } else if (host == chrome::kChromeUISandboxHost) { 1415 } else if (host == chrome::kChromeUISandboxHost) {
1416 response = AboutSandbox(); 1416 response = AboutSandbox();
1417 #endif 1417 #endif
1418 } 1418 }
1419 1419
1420 FinishDataRequest(response, request_id); 1420 FinishDataRequest(response, request_id);
1421 } 1421 }
1422 1422
1423 void AboutSource::FinishDataRequest(const std::string& html, int request_id) { 1423 void AboutSource::FinishDataRequest(const std::string& html, int request_id) {
1424 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); 1424 std::string html_copy(html);
1425 html_bytes->data.resize(html.size()); 1425 SendResponse(request_id, base::RefCountedString::TakeString(&html_copy));
1426 std::copy(html.begin(), html.end(), html_bytes->data.begin());
1427 SendResponse(request_id, html_bytes);
1428 } 1426 }
1429 1427
1430 std::string AboutSource::GetMimeType(const std::string& path) const { 1428 std::string AboutSource::GetMimeType(const std::string& path) const {
1431 if (path == kCreditsJsPath || 1429 if (path == kCreditsJsPath ||
1432 path == kStatsJsPath || 1430 path == kStatsJsPath ||
1433 path == kStringsJsPath || 1431 path == kStringsJsPath ||
1434 path == kVersionJsPath || 1432 path == kVersionJsPath ||
1435 path == kMemoryJsPath) { 1433 path == kMemoryJsPath) {
1436 return "application/javascript"; 1434 return "application/javascript";
1437 } 1435 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 return false; 1520 return false;
1523 } 1521 }
1524 1522
1525 std::vector<std::string> ChromePaths() { 1523 std::vector<std::string> ChromePaths() {
1526 std::vector<std::string> paths; 1524 std::vector<std::string> paths;
1527 paths.reserve(arraysize(kChromePaths)); 1525 paths.reserve(arraysize(kChromePaths));
1528 for (size_t i = 0; i < arraysize(kChromePaths); i++) 1526 for (size_t i = 0; i < arraysize(kChromePaths); i++)
1529 paths.push_back(kChromePaths[i]); 1527 paths.push_back(kChromePaths[i]);
1530 return paths; 1528 return paths;
1531 } 1529 }
OLDNEW
« no previous file with comments | « base/memory/ref_counted_memory_unittest.cc ('k') | chrome/browser/browser_signin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698