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 #include "chromecast/browser/cast_browser_context.h" | 5 #include "chromecast/browser/cast_browser_context.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 CastBrowserContext::CastBrowserContext( | 51 CastBrowserContext::CastBrowserContext( |
52 URLRequestContextFactory* url_request_context_factory) | 52 URLRequestContextFactory* url_request_context_factory) |
53 : url_request_context_factory_(url_request_context_factory), | 53 : url_request_context_factory_(url_request_context_factory), |
54 resource_context_(new CastResourceContext(url_request_context_factory)), | 54 resource_context_(new CastResourceContext(url_request_context_factory)), |
55 download_manager_delegate_(new CastDownloadManagerDelegate()) { | 55 download_manager_delegate_(new CastDownloadManagerDelegate()) { |
56 InitWhileIOAllowed(); | 56 InitWhileIOAllowed(); |
57 } | 57 } |
58 | 58 |
59 CastBrowserContext::~CastBrowserContext() { | 59 CastBrowserContext::~CastBrowserContext() { |
| 60 ShutdownStoragePartitions(); |
60 content::BrowserThread::DeleteSoon( | 61 content::BrowserThread::DeleteSoon( |
61 content::BrowserThread::IO, | 62 content::BrowserThread::IO, |
62 FROM_HERE, | 63 FROM_HERE, |
63 resource_context_.release()); | 64 resource_context_.release()); |
64 } | 65 } |
65 | 66 |
66 void CastBrowserContext::InitWhileIOAllowed() { | 67 void CastBrowserContext::InitWhileIOAllowed() { |
67 #if defined(OS_ANDROID) | 68 #if defined(OS_ANDROID) |
68 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &path_)); | 69 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &path_)); |
69 path_ = path_.Append(FILE_PATH_LITERAL("cast_shell")); | 70 path_ = path_.Append(FILE_PATH_LITERAL("cast_shell")); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 156 } |
156 | 157 |
157 net::URLRequestContextGetter* | 158 net::URLRequestContextGetter* |
158 CastBrowserContext::CreateMediaRequestContextForStoragePartition( | 159 CastBrowserContext::CreateMediaRequestContextForStoragePartition( |
159 const base::FilePath& partition_path, bool in_memory) { | 160 const base::FilePath& partition_path, bool in_memory) { |
160 return nullptr; | 161 return nullptr; |
161 } | 162 } |
162 | 163 |
163 } // namespace shell | 164 } // namespace shell |
164 } // namespace chromecast | 165 } // namespace chromecast |
OLD | NEW |