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

Side by Side Diff: media/cast/cast_environment.h

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, 2 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 | « media/base/wall_clock_time_source.cc ('k') | media/cast/cast_environment.cc » ('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 #ifndef MEDIA_CAST_CAST_ENVIRONMENT_H_ 5 #ifndef MEDIA_CAST_CAST_ENVIRONMENT_H_
6 #define MEDIA_CAST_CAST_ENVIRONMENT_H_ 6 #define MEDIA_CAST_CAST_ENVIRONMENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 14 matching lines...) Expand all
25 // and network IO is performed. 25 // and network IO is performed.
26 MAIN, 26 MAIN,
27 // The audio thread is where all send side audio processing is done, 27 // The audio thread is where all send side audio processing is done,
28 // primarily encoding / decoding but also re-sampling. 28 // primarily encoding / decoding but also re-sampling.
29 AUDIO, 29 AUDIO,
30 // The video encoder thread is where the video processing is done. 30 // The video encoder thread is where the video processing is done.
31 VIDEO, 31 VIDEO,
32 }; 32 };
33 33
34 CastEnvironment( 34 CastEnvironment(
35 scoped_ptr<base::TickClock> clock, 35 scoped_refptr<base::TickClock> clock,
36 scoped_refptr<base::SingleThreadTaskRunner> main_thread_proxy, 36 scoped_refptr<base::SingleThreadTaskRunner> main_thread_proxy,
37 scoped_refptr<base::SingleThreadTaskRunner> audio_thread_proxy, 37 scoped_refptr<base::SingleThreadTaskRunner> audio_thread_proxy,
38 scoped_refptr<base::SingleThreadTaskRunner> video_thread_proxy); 38 scoped_refptr<base::SingleThreadTaskRunner> video_thread_proxy);
39 39
40 // These are the same methods in message_loop.h, but are guaranteed to either 40 // These are the same methods in message_loop.h, but are guaranteed to either
41 // get posted to the MessageLoop if it's still alive, or be deleted otherwise. 41 // get posted to the MessageLoop if it's still alive, or be deleted otherwise.
42 // They return true iff the thread existed and the task was posted. Note that 42 // They return true if the thread existed and the task was posted. Note that
43 // even if the task is posted, there's no guarantee that it will run, since 43 // even if the task is posted, there's no guarantee that it will run, since
44 // the target thread may already have a Quit message in its queue. 44 // the target thread may already have a Quit message in its queue.
45 bool PostTask(ThreadId identifier, 45 bool PostTask(ThreadId identifier,
46 const tracked_objects::Location& from_here, 46 const tracked_objects::Location& from_here,
47 const base::Closure& task); 47 const base::Closure& task);
48 48
49 bool PostDelayedTask(ThreadId identifier, 49 bool PostDelayedTask(ThreadId identifier,
50 const tracked_objects::Location& from_here, 50 const tracked_objects::Location& from_here,
51 const base::Closure& task, 51 const base::Closure& task,
52 base::TimeDelta delay); 52 base::TimeDelta delay);
(...skipping 15 matching lines...) Expand all
68 68
69 bool HasVideoThread() { return video_thread_proxy_.get() ? true : false; } 69 bool HasVideoThread() { return video_thread_proxy_.get() ? true : false; }
70 70
71 protected: 71 protected:
72 virtual ~CastEnvironment(); 72 virtual ~CastEnvironment();
73 73
74 // Subclasses may override these. 74 // Subclasses may override these.
75 scoped_refptr<base::SingleThreadTaskRunner> main_thread_proxy_; 75 scoped_refptr<base::SingleThreadTaskRunner> main_thread_proxy_;
76 scoped_refptr<base::SingleThreadTaskRunner> audio_thread_proxy_; 76 scoped_refptr<base::SingleThreadTaskRunner> audio_thread_proxy_;
77 scoped_refptr<base::SingleThreadTaskRunner> video_thread_proxy_; 77 scoped_refptr<base::SingleThreadTaskRunner> video_thread_proxy_;
78 scoped_ptr<base::TickClock> clock_; 78 scoped_refptr<base::TickClock> clock_;
79 scoped_ptr<LoggingImpl> logging_; 79 scoped_ptr<LoggingImpl> logging_;
80 80
81 private: 81 private:
82 friend class base::RefCountedThreadSafe<CastEnvironment>; 82 friend class base::RefCountedThreadSafe<CastEnvironment>;
83 83
84 DISALLOW_COPY_AND_ASSIGN(CastEnvironment); 84 DISALLOW_COPY_AND_ASSIGN(CastEnvironment);
85 }; 85 };
86 86
87 } // namespace cast 87 } // namespace cast
88 } // namespace media 88 } // namespace media
89 89
90 #endif // MEDIA_CAST_CAST_ENVIRONMENT_H_ 90 #endif // MEDIA_CAST_CAST_ENVIRONMENT_H_
OLDNEW
« no previous file with comments | « media/base/wall_clock_time_source.cc ('k') | media/cast/cast_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698