Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: chrome/browser/extensions/extension_system_impl.cc

Issue 671763002: Extract ProcessManager from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "extensions/browser/content_verifier_delegate.h" 45 #include "extensions/browser/content_verifier_delegate.h"
46 #include "extensions/browser/event_router.h" 46 #include "extensions/browser/event_router.h"
47 #include "extensions/browser/extension_pref_store.h" 47 #include "extensions/browser/extension_pref_store.h"
48 #include "extensions/browser/extension_pref_value_map.h" 48 #include "extensions/browser/extension_pref_value_map.h"
49 #include "extensions/browser/extension_pref_value_map_factory.h" 49 #include "extensions/browser/extension_pref_value_map_factory.h"
50 #include "extensions/browser/extension_prefs.h" 50 #include "extensions/browser/extension_prefs.h"
51 #include "extensions/browser/extension_registry.h" 51 #include "extensions/browser/extension_registry.h"
52 #include "extensions/browser/info_map.h" 52 #include "extensions/browser/info_map.h"
53 #include "extensions/browser/lazy_background_task_queue.h" 53 #include "extensions/browser/lazy_background_task_queue.h"
54 #include "extensions/browser/management_policy.h" 54 #include "extensions/browser/management_policy.h"
55 #include "extensions/browser/process_manager.h"
56 #include "extensions/browser/quota_service.h" 55 #include "extensions/browser/quota_service.h"
57 #include "extensions/browser/runtime_data.h" 56 #include "extensions/browser/runtime_data.h"
58 #include "extensions/browser/state_store.h" 57 #include "extensions/browser/state_store.h"
59 #include "extensions/browser/warning_service.h" 58 #include "extensions/browser/warning_service.h"
60 #include "extensions/browser/warning_set.h" 59 #include "extensions/browser/warning_set.h"
61 #include "extensions/common/constants.h" 60 #include "extensions/common/constants.h"
62 #include "extensions/common/extension.h" 61 #include "extensions/common/extension.h"
63 #include "extensions/common/extension_urls.h" 62 #include "extensions/common/extension_urls.h"
64 #include "extensions/common/manifest.h" 63 #include "extensions/common/manifest.h"
65 #include "extensions/common/manifest_url_handlers.h" 64 #include "extensions/common/manifest_url_handlers.h"
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 } 507 }
509 508
510 // 509 //
511 // ExtensionSystemImpl 510 // ExtensionSystemImpl
512 // 511 //
513 512
514 ExtensionSystemImpl::ExtensionSystemImpl(Profile* profile) 513 ExtensionSystemImpl::ExtensionSystemImpl(Profile* profile)
515 : profile_(profile) { 514 : profile_(profile) {
516 shared_ = ExtensionSystemSharedFactory::GetForBrowserContext(profile); 515 shared_ = ExtensionSystemSharedFactory::GetForBrowserContext(profile);
517 516
518 if (profile->IsOffTheRecord()) { 517 if (!profile->IsOffTheRecord()) {
519 process_manager_.reset(ProcessManager::Create(profile));
520 } else {
521 shared_->InitPrefs(); 518 shared_->InitPrefs();
522 } 519 }
523 } 520 }
524 521
525 ExtensionSystemImpl::~ExtensionSystemImpl() { 522 ExtensionSystemImpl::~ExtensionSystemImpl() {
526 } 523 }
527 524
528 void ExtensionSystemImpl::Shutdown() { 525 void ExtensionSystemImpl::Shutdown() {
529 process_manager_.reset();
530 } 526 }
531 527
532 void ExtensionSystemImpl::InitForRegularProfile(bool extensions_enabled) { 528 void ExtensionSystemImpl::InitForRegularProfile(bool extensions_enabled) {
533 DCHECK(!profile_->IsOffTheRecord()); 529 DCHECK(!profile_->IsOffTheRecord());
534 if (shared_user_script_master() || extension_service()) 530 if (shared_user_script_master() || extension_service())
535 return; // Already initialized. 531 return; // Already initialized.
536 532
537 // The InfoMap needs to be created before the ProcessManager. 533 // The InfoMap needs to be created before the ProcessManager.
538 shared_->info_map(); 534 shared_->info_map();
539
540 process_manager_.reset(ProcessManager::Create(profile_));
541
542 shared_->Init(extensions_enabled); 535 shared_->Init(extensions_enabled);
543 } 536 }
544 537
545 ExtensionService* ExtensionSystemImpl::extension_service() { 538 ExtensionService* ExtensionSystemImpl::extension_service() {
546 return shared_->extension_service(); 539 return shared_->extension_service();
547 } 540 }
548 541
549 RuntimeData* ExtensionSystemImpl::runtime_data() { 542 RuntimeData* ExtensionSystemImpl::runtime_data() {
550 return shared_->runtime_data(); 543 return shared_->runtime_data();
551 } 544 }
552 545
553 ManagementPolicy* ExtensionSystemImpl::management_policy() { 546 ManagementPolicy* ExtensionSystemImpl::management_policy() {
554 return shared_->management_policy(); 547 return shared_->management_policy();
555 } 548 }
556 549
557 SharedUserScriptMaster* ExtensionSystemImpl::shared_user_script_master() { 550 SharedUserScriptMaster* ExtensionSystemImpl::shared_user_script_master() {
558 return shared_->shared_user_script_master(); 551 return shared_->shared_user_script_master();
559 } 552 }
560 553
561 ProcessManager* ExtensionSystemImpl::process_manager() {
562 return process_manager_.get();
563 }
564
565 StateStore* ExtensionSystemImpl::state_store() { 554 StateStore* ExtensionSystemImpl::state_store() {
566 return shared_->state_store(); 555 return shared_->state_store();
567 } 556 }
568 557
569 StateStore* ExtensionSystemImpl::rules_store() { 558 StateStore* ExtensionSystemImpl::rules_store() {
570 return shared_->rules_store(); 559 return shared_->rules_store();
571 } 560 }
572 561
573 InfoMap* ExtensionSystemImpl::info_map() { return shared_->info_map(); } 562 InfoMap* ExtensionSystemImpl::info_map() { return shared_->info_map(); }
574 563
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( 640 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts(
652 const std::string& extension_id, 641 const std::string& extension_id,
653 const UnloadedExtensionInfo::Reason reason) { 642 const UnloadedExtensionInfo::Reason reason) {
654 BrowserThread::PostTask( 643 BrowserThread::PostTask(
655 BrowserThread::IO, 644 BrowserThread::IO,
656 FROM_HERE, 645 FROM_HERE,
657 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); 646 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
658 } 647 }
659 648
660 } // namespace extensions 649 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_system_impl.h ('k') | chrome/browser/extensions/extension_test_notification_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698