OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/engine/common/blimp_browser_context.h" | 5 #include "blimp/engine/common/blimp_browser_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 off_the_record_(off_the_record), | 73 off_the_record_(off_the_record), |
74 net_log_(net_log) { | 74 net_log_(net_log) { |
75 InitWhileIOAllowed(); | 75 InitWhileIOAllowed(); |
76 InitPrefService(); | 76 InitPrefService(); |
77 metrics_service_client_.reset( | 77 metrics_service_client_.reset( |
78 new BlimpMetricsServiceClient(pref_service_.get(), | 78 new BlimpMetricsServiceClient(pref_service_.get(), |
79 GetSystemRequestContextGetter())); | 79 GetSystemRequestContextGetter())); |
80 } | 80 } |
81 | 81 |
82 BlimpBrowserContext::~BlimpBrowserContext() { | 82 BlimpBrowserContext::~BlimpBrowserContext() { |
| 83 ShutdownStoragePartitions(); |
83 if (resource_context_) { | 84 if (resource_context_) { |
84 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, | 85 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, |
85 resource_context_.release()); | 86 resource_context_.release()); |
86 } | 87 } |
87 } | 88 } |
88 | 89 |
89 void BlimpBrowserContext::InitWhileIOAllowed() { | 90 void BlimpBrowserContext::InitWhileIOAllowed() { |
90 // Ensures ~/.config/blimp_engine directory exists. | 91 // Ensures ~/.config/blimp_engine directory exists. |
91 std::unique_ptr<base::Environment> env(base::Environment::Create()); | 92 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
92 base::FilePath config_dir(base::nix::GetXDGDirectory( | 93 base::FilePath config_dir(base::nix::GetXDGDirectory( |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 205 |
205 net::URLRequestContextGetter* | 206 net::URLRequestContextGetter* |
206 BlimpBrowserContext::CreateMediaRequestContextForStoragePartition( | 207 BlimpBrowserContext::CreateMediaRequestContextForStoragePartition( |
207 const base::FilePath& partition_path, | 208 const base::FilePath& partition_path, |
208 bool in_memory) { | 209 bool in_memory) { |
209 return nullptr; | 210 return nullptr; |
210 } | 211 } |
211 | 212 |
212 } // namespace engine | 213 } // namespace engine |
213 } // namespace blimp | 214 } // namespace blimp |
OLD | NEW |