OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 ProfileImplIOData::Handle::GetChromeURLDataManagerBackendGetter() const { | 124 ProfileImplIOData::Handle::GetChromeURLDataManagerBackendGetter() const { |
125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
126 LazyInitialize(); | 126 LazyInitialize(); |
127 return base::Bind(&ProfileIOData::GetChromeURLDataManagerBackend, | 127 return base::Bind(&ProfileIOData::GetChromeURLDataManagerBackend, |
128 base::Unretained(io_data_)); | 128 base::Unretained(io_data_)); |
129 } | 129 } |
130 | 130 |
131 const content::ResourceContext& | 131 const content::ResourceContext& |
132 ProfileImplIOData::Handle::GetResourceContext() const { | 132 ProfileImplIOData::Handle::GetResourceContext() const { |
133 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 133 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 134 LazyInitialize(); |
| 135 return GetResourceContextNoInit(); |
| 136 } |
| 137 |
| 138 const content::ResourceContext& |
| 139 ProfileImplIOData::Handle::GetResourceContextNoInit() const { |
| 140 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
134 // Don't call LazyInitialize here, since the resource context is created at | 141 // Don't call LazyInitialize here, since the resource context is created at |
135 // the beginning of initalization and is used by some members while they're | 142 // the beginning of initalization and is used by some members while they're |
136 // being initialized (i.e. AppCacheService). | 143 // being initialized (i.e. AppCacheService). |
137 return io_data_->GetResourceContext(); | 144 return io_data_->GetResourceContext(); |
138 } | 145 } |
139 | 146 |
140 scoped_refptr<ChromeURLRequestContextGetter> | 147 scoped_refptr<ChromeURLRequestContextGetter> |
141 ProfileImplIOData::Handle::GetMainRequestContextGetter() const { | 148 ProfileImplIOData::Handle::GetMainRequestContextGetter() const { |
142 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 149 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
143 LazyInitialize(); | 150 LazyInitialize(); |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 scoped_refptr<ChromeURLRequestContext> | 502 scoped_refptr<ChromeURLRequestContext> |
496 ProfileImplIOData::AcquireIsolatedAppRequestContext( | 503 ProfileImplIOData::AcquireIsolatedAppRequestContext( |
497 scoped_refptr<ChromeURLRequestContext> main_context, | 504 scoped_refptr<ChromeURLRequestContext> main_context, |
498 const std::string& app_id) const { | 505 const std::string& app_id) const { |
499 // We create per-app contexts on demand, unlike the others above. | 506 // We create per-app contexts on demand, unlike the others above. |
500 scoped_refptr<ChromeURLRequestContext> app_request_context = | 507 scoped_refptr<ChromeURLRequestContext> app_request_context = |
501 InitializeAppRequestContext(main_context, app_id); | 508 InitializeAppRequestContext(main_context, app_id); |
502 DCHECK(app_request_context); | 509 DCHECK(app_request_context); |
503 return app_request_context; | 510 return app_request_context; |
504 } | 511 } |
OLD | NEW |