diff options
author | halliwell <halliwell@chromium.org> | 2016-01-28 11:17:34 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-28 19:19:31 +0000 |
commit | f3aa3bae8b0541ccc151b6e24d6ae4fcab4fa2ea (patch) | |
tree | ca21237926e22c5ff4b22f968a0338a08fb5b65d /chromecast | |
parent | 04e8f1204c1927e6e52aade394cd1d9530ab9481 (diff) | |
download | chromium_src-f3aa3bae8b0541ccc151b6e24d6ae4fcab4fa2ea.zip chromium_src-f3aa3bae8b0541ccc151b6e24d6ae4fcab4fa2ea.tar.gz chromium_src-f3aa3bae8b0541ccc151b6e24d6ae4fcab4fa2ea.tar.bz2 |
[Chromecast] Extend PreCreateThreads hook to internal code
This is necessary to run some cleanup on the drm store at
startup.
BUG=internal b/23944748
Review URL: https://codereview.chromium.org/1643543003
Cr-Commit-Position: refs/heads/master@{#372128}
Diffstat (limited to 'chromecast')
-rw-r--r-- | chromecast/browser/cast_browser_main_parts.cc | 3 | ||||
-rw-r--r-- | chromecast/browser/cast_content_browser_client.cc | 3 | ||||
-rw-r--r-- | chromecast/browser/cast_content_browser_client.h | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc index 92e3a48..e67b3d2 100644 --- a/chromecast/browser/cast_browser_main_parts.cc +++ b/chromecast/browser/cast_browser_main_parts.cc @@ -315,6 +315,9 @@ int CastBrowserMainParts::PreCreateThreads() { if (!base::CreateDirectory(home_dir)) return 1; + // Hook for internal code + cast_browser_process_->browser_client()->PreCreateThreads(); + // AudioManager is created immediately after threads are created, requiring // AudioManagerFactory to be set beforehand. ::media::AudioManager::SetFactory(new media::CastAudioManagerFactory()); diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc index 5b475ef..b490317 100644 --- a/chromecast/browser/cast_content_browser_client.cc +++ b/chromecast/browser/cast_content_browser_client.cc @@ -76,6 +76,9 @@ void CastContentBrowserClient::AppendExtraCommandLineSwitches( base::CommandLine* command_line) { } +void CastContentBrowserClient::PreCreateThreads() { +} + scoped_ptr<CastService> CastContentBrowserClient::CreateCastService( content::BrowserContext* browser_context, PrefService* pref_service, diff --git a/chromecast/browser/cast_content_browser_client.h b/chromecast/browser/cast_content_browser_client.h index 8d54a1a..815f20e 100644 --- a/chromecast/browser/cast_content_browser_client.h +++ b/chromecast/browser/cast_content_browser_client.h @@ -53,6 +53,9 @@ class CastContentBrowserClient : public content::ContentBrowserClient { // Appends extra command line arguments before launching a new process. virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line); + // Hook for code to run before browser threads created. + virtual void PreCreateThreads(); + // Creates and returns the CastService instance for the current process. // Note: |request_context_getter| might be different than the main request // getter accessible via CastBrowserProcess. |