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

Unified Diff: content/renderer/webrtc_logging_handler_impl.cc

Issue 13119009: Adding WebRTC logging filter, handler and handler host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed render_thread_impl.* and render_process_host_impl.cc changes from this CL. Created 7 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: content/renderer/webrtc_logging_handler_impl.cc
diff --git a/content/renderer/webrtc_logging_handler_impl.cc b/content/renderer/webrtc_logging_handler_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d94656428f8404f3472d33b270c6996b392b52ec
--- /dev/null
+++ b/content/renderer/webrtc_logging_handler_impl.cc
@@ -0,0 +1,51 @@
+// Copyright (c) 2013 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/renderer/webrtc_logging_handler_impl.h"
+
+#include "base/logging.h"
+#include "base/message_loop_proxy.h"
+#include "content/renderer/webrtc_logging_message_filter.h"
+
+namespace content {
+
+// TODO(grunell): Probably skip the thread dchecks and make sure here instead
tommi (sloooow) - chröme 2013/03/28 11:00:10 I like the thread dchecks :)
Henrik Grunell 2013/04/02 10:06:40 Me too. But there's also dchecks in the filter. An
+// that the filter is called on the right thread.
+
+WebRtcLoggingHandlerImpl::WebRtcLoggingHandlerImpl(
+ const scoped_refptr<WebRtcLoggingMessageFilter>& message_filter,
+ const scoped_refptr<base::MessageLoopProxy>& io_message_loop)
+ : message_filter_(message_filter),
+ io_message_loop_(io_message_loop) {
+}
+
+WebRtcLoggingHandlerImpl::~WebRtcLoggingHandlerImpl() {
+}
+
+void WebRtcLoggingHandlerImpl::OnFilterRemoved() {
+ message_filter_ = NULL;
+}
+
+void WebRtcLoggingHandlerImpl::OpenLog() {
+ DCHECK(io_message_loop_->BelongsToCurrentThread());
+ // TODO(grunell): Check if already opened. (Could have been opened by another
+ // render view.)
+ if (message_filter_)
+ message_filter_->OpenLog();
+}
+
+void WebRtcLoggingHandlerImpl::OnLogOpened(
+ base::SharedMemoryHandle handle,
+ uint32 length) {
+ DCHECK(io_message_loop_->BelongsToCurrentThread());
+ // TODO(grunell): Setup stuff.
+}
+
+void WebRtcLoggingHandlerImpl::OnOpenLogFailed() {
+ DCHECK(io_message_loop_->BelongsToCurrentThread());
+ LOG(ERROR) << "Could not open log.";
+ // TODO(grunell): Handle error.
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698