diff options
| author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-03 06:42:27 +0000 |
|---|---|---|
| committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-03 06:42:27 +0000 |
| commit | 9cf1c2d4f2285402a744d30d3761d7284e5d367d (patch) | |
| tree | 01d0c4793bcfa3bd29d2e7a492d4451d85626d98 /chrome/browser/extensions/test_extension_system.cc | |
| parent | 96277f35f0438f59bf1155dc8431e07037bb9159 (diff) | |
| download | chromium_src-9cf1c2d4f2285402a744d30d3761d7284e5d367d.zip chromium_src-9cf1c2d4f2285402a744d30d3761d7284e5d367d.tar.gz chromium_src-9cf1c2d4f2285402a744d30d3761d7284e5d367d.tar.bz2 | |
Revert 124817 - Take extensions out of Profile into a profile-keyed service, ExtensionSystem.
This may be causing this crash:
Note: Google Test filter = PrerenderBrowserTest.PrerenderUnload
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from PrerenderBrowserTest, where TypeParam =
[ RUN ] PrerenderBrowserTest.PrerenderUnload
[2464:2324:0302/211059:6709843:FATAL:profile_dependency_manager.cc(134)] Check failed: false. Attempted to access a Profile that was ShutDown(). This is most likely a heap smasher in progress. After ProfileKeyedService::Shutdown() completes, your service MUST NOT refer to depended Profile services again.
Move InitExtensions into ExtensionSystem.
Remove a few accessors (ExtensionDevToolsManager, ExtensionMessageService). The others have too many callers to fix in one go.
BUG=104095
TEST=Open and close an incognito window; should not crash.
Review URL: http://codereview.chromium.org/9369013
TBR=yoz@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9583036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/test_extension_system.cc')
| -rw-r--r-- | chrome/browser/extensions/test_extension_system.cc | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/chrome/browser/extensions/test_extension_system.cc b/chrome/browser/extensions/test_extension_system.cc deleted file mode 100644 index 5f271bf..0000000 --- a/chrome/browser/extensions/test_extension_system.cc +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/extensions/test_extension_system.h" - -#include "chrome/browser/extensions/extension_devtools_manager.h" -#include "chrome/browser/extensions/extension_event_router.h" -#include "chrome/browser/extensions/extension_info_map.h" -#include "chrome/browser/extensions/extension_message_service.h" -#include "chrome/browser/extensions/extension_pref_value_map.h" -#include "chrome/browser/extensions/extension_process_manager.h" -#include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/user_script_master.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/common/chrome_switches.h" - - -TestExtensionSystem::TestExtensionSystem(Profile* profile) - : profile_(profile) { -} - -TestExtensionSystem::~TestExtensionSystem() { -} - -void TestExtensionSystem::Shutdown() { - extension_process_manager_.reset(); -} - -void TestExtensionSystem::CreateExtensionProcessManager() { - extension_process_manager_.reset(ExtensionProcessManager::Create(profile_)); -} - -ExtensionService* TestExtensionSystem::CreateExtensionService( - const CommandLine* command_line, - const FilePath& install_directory, - bool autoupdate_enabled) { - // Extension pref store, created for use by |extension_prefs_|. - extension_pref_value_map_.reset(new ExtensionPrefValueMap); - - bool extensions_disabled = - command_line && command_line->HasSwitch(switches::kDisableExtensions); - - // Note that the GetPrefs() creates a TestingPrefService, therefore - // the extension controlled pref values set in extension_prefs_ - // are not reflected in the pref service. One would need to - // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). - - extension_prefs_.reset( - new ExtensionPrefs(profile_->GetPrefs(), - install_directory, - extension_pref_value_map_.get())); - extension_prefs_->Init(extensions_disabled); - extension_service_.reset(new ExtensionService(profile_, - command_line, - install_directory, - extension_prefs_.get(), - autoupdate_enabled, - true)); - return extension_service_.get(); -} - -ExtensionService* TestExtensionSystem::extension_service() { - return extension_service_.get(); -} - -void TestExtensionSystem::SetExtensionService(ExtensionService* service) { - extension_service_.reset(service); -} - -UserScriptMaster* TestExtensionSystem::user_script_master() { - return NULL; -} - -ExtensionDevToolsManager* TestExtensionSystem::devtools_manager() { - return NULL; -} - -ExtensionProcessManager* TestExtensionSystem::process_manager() { - return extension_process_manager_.get(); -} - -ExtensionInfoMap* TestExtensionSystem::info_map() { - return NULL; -} - -ExtensionMessageService* TestExtensionSystem::message_service() { - return NULL; -} - -ExtensionEventRouter* TestExtensionSystem::event_router() { - return NULL; -} - -// static -ProfileKeyedBase* TestExtensionSystem::Build(Profile* profile) { - return new TestExtensionSystem(profile); -} |
