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 #include "chrome/browser/extensions/extension_system_impl.h" | 5 #include "chrome/browser/extensions/extension_system_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 268 base::ThreadRestrictions::ScopedAllowIO allow_io; | 268 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 269 extension_service_->component_loader()->AddOrReplace( | 269 extension_service_->component_loader()->AddOrReplace( |
| 270 base::FilePath(t.token())); | 270 base::FilePath(t.token())); |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 | 273 |
| 274 app_sorting_.reset(new ChromeAppSorting(profile_)); | 274 app_sorting_.reset(new ChromeAppSorting(profile_)); |
| 275 | 275 |
| 276 InitInstallGates(); | 276 InitInstallGates(); |
| 277 | 277 |
| 278 // ExtensionService::Init() might finish loading a component extension before | |
|
Devlin
2016/11/22 16:02:20
Could we shorten this to simply:
// Extension API
lazyboy
2016/11/22 19:33:30
Done.
| |
| 279 // Init() completes, e.g. when Init() is blocked showing an extension load | |
| 280 // error. In that case extension API call from any component extension can | |
| 281 // arrive at ExtensionFunctionDispatcher, which will access |quota_service_|. | |
| 282 // So initialize |quota_service_| before calling Init(). | |
| 283 quota_service_.reset(new QuotaService); | |
| 284 | |
| 278 extension_service_->Init(); | 285 extension_service_->Init(); |
| 279 | 286 |
| 280 // Make sure ExtensionSyncService is created. | 287 // Make sure ExtensionSyncService is created. |
| 281 ExtensionSyncService::Get(profile_); | 288 ExtensionSyncService::Get(profile_); |
| 282 | 289 |
| 283 // Make the chrome://extension-icon/ resource available. | 290 // Make the chrome://extension-icon/ resource available. |
| 284 content::URLDataSource::Add(profile_, new ExtensionIconSource(profile_)); | 291 content::URLDataSource::Add(profile_, new ExtensionIconSource(profile_)); |
| 285 | |
| 286 quota_service_.reset(new QuotaService); | |
| 287 } | 292 } |
| 288 | 293 |
| 289 void ExtensionSystemImpl::Shared::Shutdown() { | 294 void ExtensionSystemImpl::Shared::Shutdown() { |
| 290 if (content_verifier_.get()) | 295 if (content_verifier_.get()) |
| 291 content_verifier_->Shutdown(); | 296 content_verifier_->Shutdown(); |
| 292 if (extension_service_) | 297 if (extension_service_) |
| 293 extension_service_->Shutdown(); | 298 extension_service_->Shutdown(); |
| 294 } | 299 } |
| 295 | 300 |
| 296 ServiceWorkerManager* ExtensionSystemImpl::Shared::service_worker_manager() { | 301 ServiceWorkerManager* ExtensionSystemImpl::Shared::service_worker_manager() { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 470 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 475 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 471 const std::string& extension_id, | 476 const std::string& extension_id, |
| 472 const UnloadedExtensionInfo::Reason reason) { | 477 const UnloadedExtensionInfo::Reason reason) { |
| 473 BrowserThread::PostTask( | 478 BrowserThread::PostTask( |
| 474 BrowserThread::IO, | 479 BrowserThread::IO, |
| 475 FROM_HERE, | 480 FROM_HERE, |
| 476 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); | 481 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); |
| 477 } | 482 } |
| 478 | 483 |
| 479 } // namespace extensions | 484 } // namespace extensions |
| OLD | NEW |