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

Unified Diff: components/rappor/rappor_message_filter.h

Issue 1014543003: Add an IPC method for Blink to call RapporService::RecordSample() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments and cleanup Created 5 years, 9 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: components/rappor/rappor_message_filter.h
diff --git a/components/rappor/rappor_message_filter.h b/components/rappor/rappor_message_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..fdf06a48715122f0f9b1a736569640f3dbfe957e
--- /dev/null
+++ b/components/rappor/rappor_message_filter.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2015 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 COMPONENTS_RAPPOR_RAPPOR_MESSAGE_FILTER_H_
+#define COMPONENTS_RAPPOR_RAPPOR_MESSAGE_FILTER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/macros.h"
+#include "content/public/browser/browser_message_filter.h"
+
+namespace rappor {
+
+class RapporService;
+
+// This class sends and receives trace messages on child processes.
+class RapporMessageFilter : public content::BrowserMessageFilter {
+ public:
+ explicit RapporMessageFilter(RapporService*);
+
+ void OverrideThreadForMessage(const IPC::Message& message,
+ content::BrowserThread::ID* thread) override;
+ bool OnMessageReceived(const IPC::Message& message) override;
+
+ private:
+ ~RapporMessageFilter() override;
+
+ void OnRecordSample(const std::string&, const std::string&);
+
+ RapporService* m_rapporService;
+
+ DISALLOW_COPY_AND_ASSIGN(RapporMessageFilter);
+};
+
+} // namespace rappor
+
+#endif // COMPONENTS_RAPPOR_RAPPOR_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698