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 #ifndef CHROME_RENDERER_RENDERER_HISTOGRAM_SNAPSHOTS_H_ | 5 #ifndef CHROME_RENDERER_RENDERER_HISTOGRAM_SNAPSHOTS_H_ |
6 #define CHROME_RENDERER_RENDERER_HISTOGRAM_SNAPSHOTS_H_ | 6 #define CHROME_RENDERER_RENDERER_HISTOGRAM_SNAPSHOTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 11 matching lines...) Expand all Loading... |
22 public content::RenderProcessObserver { | 22 public content::RenderProcessObserver { |
23 public: | 23 public: |
24 RendererHistogramSnapshots(); | 24 RendererHistogramSnapshots(); |
25 virtual ~RendererHistogramSnapshots(); | 25 virtual ~RendererHistogramSnapshots(); |
26 | 26 |
27 // Send the histogram data. | 27 // Send the histogram data. |
28 void SendHistograms(int sequence_number); | 28 void SendHistograms(int sequence_number); |
29 | 29 |
30 private: | 30 private: |
31 // RenderProcessObserver implementation. | 31 // RenderProcessObserver implementation. |
32 virtual bool OnControlMessageReceived(const IPC::Message& message); | 32 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
33 | 33 |
34 void OnGetRendererHistograms(int sequence_number); | 34 void OnGetRendererHistograms(int sequence_number); |
35 | 35 |
36 // Maintain a map of histogram names to the sample stats we've sent. | 36 // Maintain a map of histogram names to the sample stats we've sent. |
37 typedef std::map<std::string, base::Histogram::SampleSet> LoggedSampleMap; | 37 typedef std::map<std::string, base::Histogram::SampleSet> LoggedSampleMap; |
38 typedef std::vector<std::string> HistogramPickledList; | 38 typedef std::vector<std::string> HistogramPickledList; |
39 | 39 |
40 // Extract snapshot data and then send it off the the Browser process. | 40 // Extract snapshot data and then send it off the the Browser process. |
41 // Send only a delta to what we have already sent. | 41 // Send only a delta to what we have already sent. |
42 void UploadAllHistrograms(int sequence_number); | 42 void UploadAllHistrograms(int sequence_number); |
43 | 43 |
44 base::WeakPtrFactory<RendererHistogramSnapshots> weak_factory_; | 44 base::WeakPtrFactory<RendererHistogramSnapshots> weak_factory_; |
45 | 45 |
46 // HistogramSender interface (override) methods. | 46 // HistogramSender interface (override) methods. |
47 virtual void TransmitHistogramDelta( | 47 virtual void TransmitHistogramDelta( |
48 const base::Histogram& histogram, | 48 const base::Histogram& histogram, |
49 const base::Histogram::SampleSet& snapshot); | 49 const base::Histogram::SampleSet& snapshot) OVERRIDE; |
50 virtual void InconsistencyDetected(int problem); | 50 virtual void InconsistencyDetected(int problem) OVERRIDE; |
51 virtual void UniqueInconsistencyDetected(int problem); | 51 virtual void UniqueInconsistencyDetected(int problem) OVERRIDE; |
52 virtual void SnapshotProblemResolved(int amount); | 52 virtual void SnapshotProblemResolved(int amount) OVERRIDE; |
53 | 53 |
54 // Collection of histograms to send to the browser. | 54 // Collection of histograms to send to the browser. |
55 HistogramPickledList pickled_histograms_; | 55 HistogramPickledList pickled_histograms_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(RendererHistogramSnapshots); | 57 DISALLOW_COPY_AND_ASSIGN(RendererHistogramSnapshots); |
58 }; | 58 }; |
59 | 59 |
60 #endif // CHROME_RENDERER_RENDERER_HISTOGRAM_SNAPSHOTS_H_ | 60 #endif // CHROME_RENDERER_RENDERER_HISTOGRAM_SNAPSHOTS_H_ |
OLD | NEW |