OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/histogram_internals_request_job.h" | 5 #include "content/browser/histogram_internals_request_job.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/metrics/statistics_recorder.h" | 8 #include "base/metrics/statistics_recorder.h" |
9 #include "content/browser/histogram_synchronizer.h" | 9 #include "content/browser/histogram_synchronizer.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 path_.assign(spec.substr(offset)); | 27 path_.assign(spec.substr(offset)); |
28 } | 28 } |
29 | 29 |
30 void AboutHistogram(std::string* data, const std::string& path) { | 30 void AboutHistogram(std::string* data, const std::string& path) { |
31 #ifndef NDEBUG | 31 #ifndef NDEBUG |
32 // We only rush the acquisition of Histogram meta-data (meta-histograms) in | 32 // We only rush the acquisition of Histogram meta-data (meta-histograms) in |
33 // Debug mode, so that developers don't damage our data that we upload to UMA | 33 // Debug mode, so that developers don't damage our data that we upload to UMA |
34 // (in official builds). | 34 // (in official builds). |
35 base::StatisticsRecorder::CollectHistogramStats("Browser"); | 35 base::StatisticsRecorder::CollectHistogramStats("Browser"); |
36 #endif | 36 #endif |
37 content::HistogramSynchronizer::FetchHistograms(); | 37 HistogramSynchronizer::FetchHistograms(); |
38 | 38 |
39 std::string unescaped_query; | 39 std::string unescaped_query; |
40 std::string unescaped_title("About Histograms"); | 40 std::string unescaped_title("About Histograms"); |
41 if (!path.empty()) { | 41 if (!path.empty()) { |
42 unescaped_query = net::UnescapeURLComponent(path, | 42 unescaped_query = net::UnescapeURLComponent(path, |
43 net::UnescapeRule::NORMAL); | 43 net::UnescapeRule::NORMAL); |
44 unescaped_title += " - " + unescaped_query; | 44 unescaped_title += " - " + unescaped_query; |
45 } | 45 } |
46 | 46 |
47 data->append("<!DOCTYPE html>\n<html>\n<head>\n"); | 47 data->append("<!DOCTYPE html>\n<html>\n<head>\n"); |
(...skipping 20 matching lines...) Expand all Loading... |
68 const net::CompletionCallback& callback) const { | 68 const net::CompletionCallback& callback) const { |
69 mime_type->assign("text/html"); | 69 mime_type->assign("text/html"); |
70 charset->assign("UTF8"); | 70 charset->assign("UTF8"); |
71 | 71 |
72 data->clear(); | 72 data->clear(); |
73 AboutHistogram(data, path_); | 73 AboutHistogram(data, path_); |
74 return net::OK; | 74 return net::OK; |
75 } | 75 } |
76 | 76 |
77 } // namespace content | 77 } // namespace content |
OLD | NEW |