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

Side by Side Diff: chrome/renderer/renderer_histogram_snapshots.cc

Issue 7631063: Prefix all IPC messages used by src\chrome with Chrome. For e.g ChromeViewMsg_, ChromeViewHostMsg... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « chrome/renderer/print_web_view_helper.cc ('k') | chrome/renderer/searchbox.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/renderer/renderer_histogram_snapshots.h" 5 #include "chrome/renderer/renderer_histogram_snapshots.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 18 matching lines...) Expand all
29 void RendererHistogramSnapshots::SendHistograms(int sequence_number) { 29 void RendererHistogramSnapshots::SendHistograms(int sequence_number) {
30 RenderThread::current()->message_loop()->PostTask(FROM_HERE, 30 RenderThread::current()->message_loop()->PostTask(FROM_HERE,
31 renderer_histogram_snapshots_factory_.NewRunnableMethod( 31 renderer_histogram_snapshots_factory_.NewRunnableMethod(
32 &RendererHistogramSnapshots::UploadAllHistrograms, sequence_number)); 32 &RendererHistogramSnapshots::UploadAllHistrograms, sequence_number));
33 } 33 }
34 34
35 bool RendererHistogramSnapshots::OnControlMessageReceived( 35 bool RendererHistogramSnapshots::OnControlMessageReceived(
36 const IPC::Message& message) { 36 const IPC::Message& message) {
37 bool handled = true; 37 bool handled = true;
38 IPC_BEGIN_MESSAGE_MAP(RendererHistogramSnapshots, message) 38 IPC_BEGIN_MESSAGE_MAP(RendererHistogramSnapshots, message)
39 IPC_MESSAGE_HANDLER(ViewMsg_GetRendererHistograms, OnGetRendererHistograms) 39 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetRendererHistograms,
40 OnGetRendererHistograms)
40 IPC_MESSAGE_UNHANDLED(handled = false) 41 IPC_MESSAGE_UNHANDLED(handled = false)
41 IPC_END_MESSAGE_MAP() 42 IPC_END_MESSAGE_MAP()
42 return handled; 43 return handled;
43 } 44 }
44 45
45 void RendererHistogramSnapshots::OnGetRendererHistograms(int sequence_number) { 46 void RendererHistogramSnapshots::OnGetRendererHistograms(int sequence_number) {
46 SendHistograms(sequence_number); 47 SendHistograms(sequence_number);
47 } 48 }
48 49
49 void RendererHistogramSnapshots::UploadAllHistrograms(int sequence_number) { 50 void RendererHistogramSnapshots::UploadAllHistrograms(int sequence_number) {
50 DCHECK_EQ(0u, pickled_histograms_.size()); 51 DCHECK_EQ(0u, pickled_histograms_.size());
51 52
52 // Push snapshots into our pickled_histograms_ vector. 53 // Push snapshots into our pickled_histograms_ vector.
53 TransmitAllHistograms(Histogram::kIPCSerializationSourceFlag, false); 54 TransmitAllHistograms(Histogram::kIPCSerializationSourceFlag, false);
54 55
55 // Send the sequence number and list of pickled histograms over synchronous 56 // Send the sequence number and list of pickled histograms over synchronous
56 // IPC, so we can clear pickled_histograms_ afterwards. 57 // IPC, so we can clear pickled_histograms_ afterwards.
57 RenderThread::current()->Send( 58 RenderThread::current()->Send(
58 new ViewHostMsg_RendererHistograms( 59 new ChromeViewHostMsg_RendererHistograms(
59 sequence_number, pickled_histograms_)); 60 sequence_number, pickled_histograms_));
60 61
61 pickled_histograms_.clear(); 62 pickled_histograms_.clear();
62 } 63 }
63 64
64 void RendererHistogramSnapshots::TransmitHistogramDelta( 65 void RendererHistogramSnapshots::TransmitHistogramDelta(
65 const base::Histogram& histogram, 66 const base::Histogram& histogram,
66 const base::Histogram::SampleSet& snapshot) { 67 const base::Histogram::SampleSet& snapshot) {
67 DCHECK_NE(0, snapshot.TotalCount()); 68 DCHECK_NE(0, snapshot.TotalCount());
68 snapshot.CheckSize(histogram); 69 snapshot.CheckSize(histogram);
(...skipping 11 matching lines...) Expand all
80 void RendererHistogramSnapshots::UniqueInconsistencyDetected(int problem) { 81 void RendererHistogramSnapshots::UniqueInconsistencyDetected(int problem) {
81 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesRendererUnique", 82 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesRendererUnique",
82 problem, Histogram::NEVER_EXCEEDED_VALUE); 83 problem, Histogram::NEVER_EXCEEDED_VALUE);
83 } 84 }
84 85
85 void RendererHistogramSnapshots::SnapshotProblemResolved(int amount) { 86 void RendererHistogramSnapshots::SnapshotProblemResolved(int amount) {
86 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotRenderer", 87 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotRenderer",
87 std::abs(amount)); 88 std::abs(amount));
88 } 89 }
89 90
OLDNEW
« no previous file with comments | « chrome/renderer/print_web_view_helper.cc ('k') | chrome/renderer/searchbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698