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

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

Issue 14757022: Add a non-blocking "OneShotEvent" class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename Latch to OneShotEvent Created 7 years, 7 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
OLDNEW
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/extensions/extension_system.h" 5 #include "chrome/browser/extensions/extension_system.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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 429 }
430 430
431 ExtensionWarningService* ExtensionSystemImpl::warning_service() { 431 ExtensionWarningService* ExtensionSystemImpl::warning_service() {
432 return shared_->warning_service(); 432 return shared_->warning_service();
433 } 433 }
434 434
435 Blacklist* ExtensionSystemImpl::blacklist() { 435 Blacklist* ExtensionSystemImpl::blacklist() {
436 return shared_->blacklist(); 436 return shared_->blacklist();
437 } 437 }
438 438
439 const OneShotEvent& ExtensionSystemImpl::ready() const {
440 return *shared_->ready();
441 }
442
443 void ExtensionSystemImpl::ExtensionServiceReady() {
444 shared_->ready()->Signal();
445 }
446
439 void ExtensionSystemImpl::RegisterExtensionWithRequestContexts( 447 void ExtensionSystemImpl::RegisterExtensionWithRequestContexts(
440 const Extension* extension) { 448 const Extension* extension) {
441 base::Time install_time; 449 base::Time install_time;
442 if (extension->location() != Manifest::COMPONENT) { 450 if (extension->location() != Manifest::COMPONENT) {
443 install_time = extension_service()->extension_prefs()-> 451 install_time = extension_service()->extension_prefs()->
444 GetInstallTime(extension->id()); 452 GetInstallTime(extension->id());
445 } 453 }
446 bool incognito_enabled = 454 bool incognito_enabled =
447 extension_service()->IsIncognitoEnabled(extension->id()); 455 extension_service()->IsIncognitoEnabled(extension->id());
448 BrowserThread::PostTask( 456 BrowserThread::PostTask(
449 BrowserThread::IO, FROM_HERE, 457 BrowserThread::IO, FROM_HERE,
450 base::Bind(&ExtensionInfoMap::AddExtension, info_map(), 458 base::Bind(&ExtensionInfoMap::AddExtension, info_map(),
451 make_scoped_refptr(extension), install_time, 459 make_scoped_refptr(extension), install_time,
452 incognito_enabled)); 460 incognito_enabled));
453 } 461 }
454 462
455 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( 463 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts(
456 const std::string& extension_id, 464 const std::string& extension_id,
457 const extension_misc::UnloadedExtensionReason reason) { 465 const extension_misc::UnloadedExtensionReason reason) {
458 BrowserThread::PostTask( 466 BrowserThread::PostTask(
459 BrowserThread::IO, FROM_HERE, 467 BrowserThread::IO, FROM_HERE,
460 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), 468 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(),
461 extension_id, reason)); 469 extension_id, reason));
462 } 470 }
463 471
464 } // namespace extensions 472 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698