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

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

Issue 8505033: Allow JSONWriter and JSONValueSerializer to omit binary values when instructed to do so. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address lint warning. Created 9 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 unified diff | Download patch | Annotate | Revision Log
« base/json/json_writer.h ('K') | « base/json/json_writer_unittest.cc ('k') | no next file » | 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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 timers->Append(counter); 999 timers->Append(counter);
1000 } 1000 }
1001 break; 1001 break;
1002 default: 1002 default:
1003 NOTREACHED(); 1003 NOTREACHED();
1004 } 1004 }
1005 } 1005 }
1006 1006
1007 std::string data; 1007 std::string data;
1008 if (query == "json" || query == kStringsJsPath) { 1008 if (query == "json" || query == kStringsJsPath) {
1009 base::JSONWriter::WriteWithOptionalEscape(&root, true, false, &data); 1009 base::JSONWriter::Write(&root, true,
1010 base::JSONWriter::OPTIONS_DO_NOT_ESCAPE, &data);
1010 if (query == kStringsJsPath) 1011 if (query == kStringsJsPath)
1011 data = "var templateData = " + data + ";"; 1012 data = "var templateData = " + data + ";";
1012 } else if (query == "raw") { 1013 } else if (query == "raw") {
1013 // Dump the raw counters which have changed in text format. 1014 // Dump the raw counters which have changed in text format.
1014 data = "<pre>"; 1015 data = "<pre>";
1015 data.append(StringPrintf("Counter changes in the last %ldms\n", 1016 data.append(StringPrintf("Counter changes in the last %ldms\n",
1016 static_cast<long int>(time_since_last_sample.InMilliseconds()))); 1017 static_cast<long int>(time_since_last_sample.InMilliseconds())));
1017 for (size_t i = 0; i < counters->GetSize(); ++i) { 1018 for (size_t i = 0; i < counters->GetSize(); ++i) {
1018 Value* entry = NULL; 1019 Value* entry = NULL;
1019 bool rv = counters->Get(i, &entry); 1020 bool rv = counters->Get(i, &entry);
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 return false; 1631 return false;
1631 } 1632 }
1632 1633
1633 std::vector<std::string> ChromePaths() { 1634 std::vector<std::string> ChromePaths() {
1634 std::vector<std::string> paths; 1635 std::vector<std::string> paths;
1635 paths.reserve(arraysize(kChromePaths)); 1636 paths.reserve(arraysize(kChromePaths));
1636 for (size_t i = 0; i < arraysize(kChromePaths); i++) 1637 for (size_t i = 0; i < arraysize(kChromePaths); i++)
1637 paths.push_back(kChromePaths[i]); 1638 paths.push_back(kChromePaths[i]);
1638 return paths; 1639 return paths;
1639 } 1640 }
OLDNEW
« base/json/json_writer.h ('K') | « base/json/json_writer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698