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

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

Issue 670623002: Change base::TickClock to a ref counted class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_redesign
Patch Set: y Created 6 years, 1 month 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
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_delegate.h" 5 #include "chrome/renderer/media/cast_session_delegate.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "chrome/common/chrome_version_info.h" 10 #include "chrome/common/chrome_version_info.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 create_video_encode_mem_cb); 82 create_video_encode_mem_cb);
83 } 83 }
84 84
85 void CastSessionDelegate::StartUDP(const net::IPEndPoint& remote_endpoint, 85 void CastSessionDelegate::StartUDP(const net::IPEndPoint& remote_endpoint,
86 scoped_ptr<base::DictionaryValue> options) { 86 scoped_ptr<base::DictionaryValue> options) {
87 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); 87 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
88 88
89 // CastSender uses the renderer's IO thread as the main thread. This reduces 89 // CastSender uses the renderer's IO thread as the main thread. This reduces
90 // thread hopping for incoming video frames and outgoing network packets. 90 // thread hopping for incoming video frames and outgoing network packets.
91 cast_environment_ = new CastEnvironment( 91 cast_environment_ = new CastEnvironment(
92 scoped_ptr<base::TickClock>(new base::DefaultTickClock()).Pass(), 92 scoped_refptr<base::TickClock>(new base::DefaultTickClock()),
93 base::MessageLoopProxy::current(), 93 base::MessageLoopProxy::current(),
94 g_cast_threads.Get().GetAudioEncodeMessageLoopProxy(), 94 g_cast_threads.Get().GetAudioEncodeMessageLoopProxy(),
95 g_cast_threads.Get().GetVideoEncodeMessageLoopProxy()); 95 g_cast_threads.Get().GetVideoEncodeMessageLoopProxy());
96 96
97 event_subscribers_.reset( 97 event_subscribers_.reset(
98 new media::cast::RawEventSubscriberBundle(cast_environment_)); 98 new media::cast::RawEventSubscriberBundle(cast_environment_));
99 99
100 // Rationale for using unretained: The callback cannot be called after the 100 // Rationale for using unretained: The callback cannot be called after the
101 // destruction of CastTransportSenderIPC, and they both share the same thread. 101 // destruction of CastTransportSenderIPC, and they both share the same thread.
102 cast_transport_.reset(new CastTransportSenderIPC( 102 cast_transport_.reset(new CastTransportSenderIPC(
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } else { 279 } else {
280 cast_environment_->Logging()->InsertFrameEvent( 280 cast_environment_->Logging()->InsertFrameEvent(
281 it->timestamp, 281 it->timestamp,
282 it->type, 282 it->type,
283 it->media_type, 283 it->media_type,
284 it->rtp_timestamp, 284 it->rtp_timestamp,
285 it->frame_id); 285 it->frame_id);
286 } 286 }
287 } 287 }
288 } 288 }
OLDNEW
« no previous file with comments | « chrome/browser/media/cast_transport_host_filter.cc ('k') | components/copresence/handlers/audio/audio_directive_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698