OLD | NEW |
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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 timers->Append(counter); | 983 timers->Append(counter); |
984 } | 984 } |
985 break; | 985 break; |
986 default: | 986 default: |
987 NOTREACHED(); | 987 NOTREACHED(); |
988 } | 988 } |
989 } | 989 } |
990 | 990 |
991 std::string data; | 991 std::string data; |
992 if (query == "json" || query == kStringsJsPath) { | 992 if (query == "json" || query == kStringsJsPath) { |
993 base::JSONWriter::WriteWithOptionalEscape(&root, true, false, &data); | 993 base::JSONWriter::WriteWithOptions( |
| 994 &root, true, base::JSONWriter::OPTIONS_DO_NOT_ESCAPE, &data); |
994 if (query == kStringsJsPath) | 995 if (query == kStringsJsPath) |
995 data = "var templateData = " + data + ";"; | 996 data = "var templateData = " + data + ";"; |
996 } else if (query == "raw") { | 997 } else if (query == "raw") { |
997 // Dump the raw counters which have changed in text format. | 998 // Dump the raw counters which have changed in text format. |
998 data = "<pre>"; | 999 data = "<pre>"; |
999 data.append(StringPrintf("Counter changes in the last %ldms\n", | 1000 data.append(StringPrintf("Counter changes in the last %ldms\n", |
1000 static_cast<long int>(time_since_last_sample.InMilliseconds()))); | 1001 static_cast<long int>(time_since_last_sample.InMilliseconds()))); |
1001 for (size_t i = 0; i < counters->GetSize(); ++i) { | 1002 for (size_t i = 0; i < counters->GetSize(); ++i) { |
1002 Value* entry = NULL; | 1003 Value* entry = NULL; |
1003 bool rv = counters->Get(i, &entry); | 1004 bool rv = counters->Get(i, &entry); |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 return false; | 1613 return false; |
1613 } | 1614 } |
1614 | 1615 |
1615 std::vector<std::string> ChromePaths() { | 1616 std::vector<std::string> ChromePaths() { |
1616 std::vector<std::string> paths; | 1617 std::vector<std::string> paths; |
1617 paths.reserve(arraysize(kChromePaths)); | 1618 paths.reserve(arraysize(kChromePaths)); |
1618 for (size_t i = 0; i < arraysize(kChromePaths); i++) | 1619 for (size_t i = 0; i < arraysize(kChromePaths); i++) |
1619 paths.push_back(kChromePaths[i]); | 1620 paths.push_back(kChromePaths[i]); |
1620 return paths; | 1621 return paths; |
1621 } | 1622 } |
OLD | NEW |