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

Unified Diff: content/common/child_histogram_message_filter.h

Issue 10454086: Histograms - Support histograms for Plugins, GPU (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/common/child_histogram_message_filter.h
===================================================================
--- content/common/child_histogram_message_filter.h (revision 0)
+++ content/common/child_histogram_message_filter.h (working copy)
@@ -0,0 +1,61 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMOM_CHILD_HISTOGRAM_MESSAGE_FILTER_H_
+#define CONTENT_COMMOM_CHILD_HISTOGRAM_MESSAGE_FILTER_H_
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/metrics/histogram.h"
+#include "base/metrics/histogram_sender.h"
+#include "ipc/ipc_channel_proxy.h"
+
+class MessageLoop;
+
+class ChildHistogramMessageFilter : public base::HistogramSender,
+ public IPC::ChannelProxy::MessageFilter {
+ public:
+ ChildHistogramMessageFilter();
+
+ // IPC::ChannelProxy::MessageFilter implementation.
+ virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
+ virtual void OnFilterRemoved() OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // HistogramSender interface (override) methods.
+ virtual void SendHistograms(int sequence_number) OVERRIDE;
+
+ protected:
+ virtual ~ChildHistogramMessageFilter();
+
+ private:
+ typedef std::vector<std::string> HistogramPickledList;
+
+ // Message handlers.
+ virtual void OnGetChildHistogramData(int sequence_number);
+
+ // Extract snapshot data and then send it off the the Browser process.
+ // Send only a delta to what we have already sent.
+ void UploadAllHistrograms(int sequence_number);
+
+ // HistogramSender interface (override) methods.
+ virtual void TransmitHistogramDelta(
+ const base::Histogram& histogram,
+ const base::Histogram::SampleSet& snapshot) OVERRIDE;
+ virtual void InconsistencyDetected(int problem) OVERRIDE;
+ virtual void UniqueInconsistencyDetected(int problem) OVERRIDE;
+ virtual void SnapshotProblemResolved(int amount) OVERRIDE;
+
+ IPC::Channel* channel_;
+
+ // Collection of histograms to send to the browser.
+ HistogramPickledList pickled_histograms_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChildHistogramMessageFilter);
+};
+
+#endif // CONTENT_COMMOM_CHILD_HISTOGRAM_MESSAGE_FILTER_H_
Property changes on: content/common/child_histogram_message_filter.h
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
Added: svn:eol-style
## -0,0 +1 ##
+LF

Powered by Google App Engine
This is Rietveld 408576698