Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMECAST_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ | 5 #ifndef CHROMECAST_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |
| 6 #define CHROMECAST_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ | 6 #define CHROMECAST_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.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" |
| 11 #include "content/public/browser/browser_main_parts.h" | 11 #include "content/public/browser/browser_main_parts.h" |
| 12 #include "content/public/common/main_function_params.h" | 12 #include "content/public/common/main_function_params.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class SingleThreadTaskRunner; | 15 class SingleThreadTaskRunner; |
| 16 } // namespace base | 16 } // namespace base |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 class NetLog; | 19 class NetLog; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace chromecast { | 22 namespace chromecast { |
| 23 | 23 |
| 24 namespace media { | 24 namespace media { |
| 25 class MediaPipelineBackendManager; | |
| 25 class MediaResourceTracker; | 26 class MediaResourceTracker; |
| 26 class VideoPlaneController; | 27 class VideoPlaneController; |
| 27 } // namespace media | 28 } // namespace media |
| 28 | 29 |
| 29 namespace shell { | 30 namespace shell { |
| 30 class CastBrowserProcess; | 31 class CastBrowserProcess; |
| 31 class URLRequestContextFactory; | 32 class URLRequestContextFactory; |
| 32 | 33 |
| 33 class CastBrowserMainParts : public content::BrowserMainParts { | 34 class CastBrowserMainParts : public content::BrowserMainParts { |
| 34 public: | 35 public: |
| 35 // This class does not take ownership of |url_request_content_factory|. | 36 // This class does not take ownership of |url_request_content_factory|. |
| 36 CastBrowserMainParts(const content::MainFunctionParams& parameters, | 37 CastBrowserMainParts(const content::MainFunctionParams& parameters, |
| 37 URLRequestContextFactory* url_request_context_factory); | 38 URLRequestContextFactory* url_request_context_factory); |
| 38 ~CastBrowserMainParts() override; | 39 ~CastBrowserMainParts() override; |
| 39 | 40 |
| 40 scoped_refptr<base::SingleThreadTaskRunner> GetMediaTaskRunner() const; | 41 scoped_refptr<base::SingleThreadTaskRunner> GetMediaTaskRunner() const; |
| 42 | |
| 41 #if !defined(OS_ANDROID) | 43 #if !defined(OS_ANDROID) |
| 42 media::MediaResourceTracker* media_resource_tracker(); | 44 media::MediaResourceTracker* media_resource_tracker(); |
| 43 #endif | 45 #endif |
| 44 | 46 |
| 47 media::MediaPipelineBackendManager* media_pipeline_backend_manager(); | |
|
alokp
2016/03/31 04:37:24
We do not use MediaPipelineBackend on Android. Thi
tianyuwang1
2016/03/31 18:14:53
Done.
| |
| 48 | |
| 45 // content::BrowserMainParts implementation: | 49 // content::BrowserMainParts implementation: |
| 46 void PreMainMessageLoopStart() override; | 50 void PreMainMessageLoopStart() override; |
| 47 void PostMainMessageLoopStart() override; | 51 void PostMainMessageLoopStart() override; |
| 48 void ToolkitInitialized() override; | 52 void ToolkitInitialized() override; |
| 49 int PreCreateThreads() override; | 53 int PreCreateThreads() override; |
| 50 void PreMainMessageLoopRun() override; | 54 void PreMainMessageLoopRun() override; |
| 51 bool MainMessageLoopRun(int* result_code) override; | 55 bool MainMessageLoopRun(int* result_code) override; |
| 52 void PostMainMessageLoopRun() override; | 56 void PostMainMessageLoopRun() override; |
| 53 void PostDestroyThreads() override; | 57 void PostDestroyThreads() override; |
| 54 | 58 |
| 55 private: | 59 private: |
| 56 scoped_ptr<CastBrowserProcess> cast_browser_process_; | 60 scoped_ptr<CastBrowserProcess> cast_browser_process_; |
| 57 const content::MainFunctionParams parameters_; // For running browser tests. | 61 const content::MainFunctionParams parameters_; // For running browser tests. |
| 58 URLRequestContextFactory* const url_request_context_factory_; | 62 URLRequestContextFactory* const url_request_context_factory_; |
| 59 scoped_ptr<net::NetLog> net_log_; | 63 scoped_ptr<net::NetLog> net_log_; |
| 60 scoped_ptr<media::VideoPlaneController> video_plane_controller_; | 64 scoped_ptr<media::VideoPlaneController> video_plane_controller_; |
| 61 | 65 |
| 62 #if !defined(OS_ANDROID) | 66 #if !defined(OS_ANDROID) |
| 63 // Tracks usage of media resource by e.g. CMA pipeline, CDM. | 67 // Tracks usage of media resource by e.g. CMA pipeline, CDM. |
| 64 media::MediaResourceTracker* media_resource_tracker_; | 68 media::MediaResourceTracker* media_resource_tracker_; |
| 65 #endif | 69 #endif |
| 66 | 70 |
| 71 // Tracks all media pipeline backends. | |
| 72 scoped_ptr<media::MediaPipelineBackendManager> | |
| 73 media_pipeline_backend_manager_; | |
| 74 | |
| 67 DISALLOW_COPY_AND_ASSIGN(CastBrowserMainParts); | 75 DISALLOW_COPY_AND_ASSIGN(CastBrowserMainParts); |
| 68 }; | 76 }; |
| 69 | 77 |
| 70 } // namespace shell | 78 } // namespace shell |
| 71 } // namespace chromecast | 79 } // namespace chromecast |
| 72 | 80 |
| 73 #endif // CHROMECAST_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ | 81 #endif // CHROMECAST_BROWSER_CAST_BROWSER_MAIN_PARTS_H_ |
| OLD | NEW |