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

Unified Diff: content/browser/renderer_host/media/media_log_host.cc

Issue 7480032: Plumb media data from renderers up to MediaInternals in the browser process. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Much cleanup and making MediaLog thread safe. Created 9 years, 5 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/browser/renderer_host/media/media_log_host.cc
diff --git a/content/browser/renderer_host/media/media_log_host.cc b/content/browser/renderer_host/media/media_log_host.cc
new file mode 100644
index 0000000000000000000000000000000000000000..95bc70bc5cd84cbb52f9d3d417721e14816ebe1b
--- /dev/null
+++ b/content/browser/renderer_host/media/media_log_host.cc
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 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.
+
+#include "content/browser/renderer_host/media/media_log_host.h"
+
+#include "content/browser/renderer_host/media/media_observer.h"
+#include "content/browser/resource_context.h"
+#include "content/common/media/media_log_messages.h"
+
+MediaLogHost::MediaLogHost(const content::ResourceContext* resource_context)
+ : resource_context_(resource_context) {}
+
+MediaLogHost::~MediaLogHost() {}
+
+void MediaLogHost::OnChannelClosing() {
+ BrowserMessageFilter::OnChannelClosing();
jam 2011/07/29 16:08:55 you don't need to override this
Scott Franklin 2011/07/29 22:30:25 This appeared to be standard practice in every oth
+}
+
+void MediaLogHost::OnDestruct() const {
+ BrowserThread::DeleteOnIOThread::Destruct(this);
jam 2011/07/29 16:08:55 ditto. there's no reason that I see that makes you
Scott Franklin 2011/07/29 22:30:25 Ditto.
+}
+
+bool MediaLogHost::OnMessageReceived(const IPC::Message& message,
+ bool* message_was_ok) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP_EX(MediaLogHost, message, *message_was_ok)
+ IPC_MESSAGE_HANDLER(MediaLogMsg_MediaEvent, OnMediaEvent)
jam 2011/07/29 16:08:55 given that you have just one message, it seems eas
Scott Franklin 2011/07/29 22:30:25 Yeah, I was expecting many messages, but then one
+ IPC_MESSAGE_UNHANDLED(handled = false);
+ IPC_END_MESSAGE_MAP_EX()
+
+ return handled;
+}
+
+void MediaLogHost::OnMediaEvent(const media::MediaLog::Event& event) {
+ resource_context_->media_observer()->OnMediaEvent(event);
+}

Powered by Google App Engine
This is Rietveld 408576698