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

Side by Side Diff: chrome/renderer/media/cast_session.cc

Issue 170063006: Cast: Add JS API to get raw events logs from cast extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass presubmit Created 6 years, 10 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
« no previous file with comments | « chrome/renderer/media/cast_session.h ('k') | chrome/renderer/media/cast_session_delegate.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/media/cast_session.h" 5 #include "chrome/renderer/media/cast_session.h"
6 6
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "chrome/renderer/media/cast_session_delegate.h" 8 #include "chrome/renderer/media/cast_session_delegate.h"
9 #include "content/public/renderer/render_thread.h" 9 #include "content/public/renderer/render_thread.h"
10 #include "media/base/bind_to_current_loop.h" 10 #include "media/base/bind_to_current_loop.h"
11 #include "media/base/video_frame.h" 11 #include "media/base/video_frame.h"
12 #include "media/cast/cast_config.h" 12 #include "media/cast/cast_config.h"
13 #include "media/cast/cast_sender.h" 13 #include "media/cast/cast_sender.h"
14 #include "media/cast/logging/logging_defines.h"
14 15
15 CastSession::CastSession() 16 CastSession::CastSession()
16 : delegate_(new CastSessionDelegate()), 17 : delegate_(new CastSessionDelegate()),
17 io_message_loop_proxy_( 18 io_message_loop_proxy_(
18 content::RenderThread::Get()->GetIOMessageLoopProxy()) {} 19 content::RenderThread::Get()->GetIOMessageLoopProxy()) {}
19 20
20 CastSession::~CastSession() { 21 CastSession::~CastSession() {
21 // We should always be able to delete the object on the IO thread. 22 // We should always be able to delete the object on the IO thread.
22 CHECK(io_message_loop_proxy_->DeleteSoon(FROM_HERE, delegate_.release())); 23 CHECK(io_message_loop_proxy_->DeleteSoon(FROM_HERE, delegate_.release()));
23 } 24 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 const net::IPEndPoint& remote_endpoint) { 57 const net::IPEndPoint& remote_endpoint) {
57 io_message_loop_proxy_->PostTask( 58 io_message_loop_proxy_->PostTask(
58 FROM_HERE, 59 FROM_HERE,
59 base::Bind( 60 base::Bind(
60 &CastSessionDelegate::StartUDP, 61 &CastSessionDelegate::StartUDP,
61 base::Unretained(delegate_.get()), 62 base::Unretained(delegate_.get()),
62 local_endpoint, 63 local_endpoint,
63 remote_endpoint)); 64 remote_endpoint));
64 } 65 }
65 66
66 void CastSession::GetEventLogsAndReset(const EventLogsCallback& callback) { 67 void CastSession::ToggleLogging(bool is_audio, bool enable) {
68 io_message_loop_proxy_->PostTask(
69 FROM_HERE,
70 base::Bind(&CastSessionDelegate::ToggleLogging,
71 base::Unretained(delegate_.get()),
72 is_audio,
73 enable));
74 }
75
76 void CastSession::GetEventLogsAndReset(
77 bool is_audio, const EventLogsCallback& callback) {
67 io_message_loop_proxy_->PostTask( 78 io_message_loop_proxy_->PostTask(
68 FROM_HERE, 79 FROM_HERE,
69 base::Bind(&CastSessionDelegate::GetEventLogsAndReset, 80 base::Bind(&CastSessionDelegate::GetEventLogsAndReset,
70 base::Unretained(delegate_.get()), 81 base::Unretained(delegate_.get()),
71 callback)); 82 is_audio,
83 media::BindToCurrentLoop(callback)));
72 } 84 }
OLDNEW
« no previous file with comments | « chrome/renderer/media/cast_session.h ('k') | chrome/renderer/media/cast_session_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698