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

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

Issue 184024: Fix to ensure IO thread is created when ExtensionUpdater needs it.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/extensions_service.h" 5 #include "chrome/browser/extensions/extensions_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/chrome_thread.h" 12 #include "chrome/browser/chrome_thread.h"
12 #include "chrome/browser/extensions/crx_installer.h" 13 #include "chrome/browser/extensions/crx_installer.h"
13 #include "chrome/browser/extensions/extension_browser_event_router.h" 14 #include "chrome/browser/extensions/extension_browser_event_router.h"
14 #include "chrome/browser/extensions/extension_dom_ui.h" 15 #include "chrome/browser/extensions/extension_dom_ui.h"
15 #include "chrome/browser/extensions/extension_file_util.h" 16 #include "chrome/browser/extensions/extension_file_util.h"
16 #include "chrome/browser/extensions/extension_updater.h" 17 #include "chrome/browser/extensions/extension_updater.h"
17 #include "chrome/browser/extensions/external_extension_provider.h" 18 #include "chrome/browser/extensions/external_extension_provider.h"
18 #include "chrome/browser/extensions/external_pref_extension_provider.h" 19 #include "chrome/browser/extensions/external_pref_extension_provider.h"
19 #include "chrome/browser/profile.h" 20 #include "chrome/browser/profile.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 107 }
107 108
108 // Set up the ExtensionUpdater 109 // Set up the ExtensionUpdater
109 if (autoupdate_enabled) { 110 if (autoupdate_enabled) {
110 int update_frequency = kDefaultUpdateFrequencySeconds; 111 int update_frequency = kDefaultUpdateFrequencySeconds;
111 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) { 112 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) {
112 update_frequency = StringToInt(WideToASCII(command_line->GetSwitchValue( 113 update_frequency = StringToInt(WideToASCII(command_line->GetSwitchValue(
113 switches::kExtensionsUpdateFrequency))); 114 switches::kExtensionsUpdateFrequency)));
114 } 115 }
115 updater_ = new ExtensionUpdater(this, prefs, update_frequency, 116 updater_ = new ExtensionUpdater(this, prefs, update_frequency,
116 backend_loop_, ChromeThread::GetMessageLoop(ChromeThread::IO)); 117 backend_loop_, g_browser_process->io_thread()->message_loop());
117 } 118 }
118 119
119 backend_ = new ExtensionsServiceBackend(install_directory_, frontend_loop); 120 backend_ = new ExtensionsServiceBackend(install_directory_, frontend_loop);
120 } 121 }
121 122
122 ExtensionsService::~ExtensionsService() { 123 ExtensionsService::~ExtensionsService() {
123 UnloadAllExtensions(); 124 UnloadAllExtensions();
124 if (updater_.get()) { 125 if (updater_.get()) {
125 updater_->Stop(); 126 updater_->Stop();
126 } 127 }
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 linked_ptr<ExternalExtensionProvider>(test_provider); 701 linked_ptr<ExternalExtensionProvider>(test_provider);
701 } 702 }
702 703
703 void ExtensionsServiceBackend::OnExternalExtensionFound( 704 void ExtensionsServiceBackend::OnExternalExtensionFound(
704 const std::string& id, const Version* version, const FilePath& path, 705 const std::string& id, const Version* version, const FilePath& path,
705 Extension::Location location) { 706 Extension::Location location) {
706 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_, 707 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_,
707 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(), 708 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(),
708 path, location)); 709 path, location));
709 } 710 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698