OLD | NEW |
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_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 const std::string& id, bool include_disabled) const { | 557 const std::string& id, bool include_disabled) const { |
558 return GetExtensionByIdInternal(id, true, include_disabled, false); | 558 return GetExtensionByIdInternal(id, true, include_disabled, false); |
559 } | 559 } |
560 | 560 |
561 void ExtensionService::Init() { | 561 void ExtensionService::Init() { |
562 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 562 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
563 | 563 |
564 DCHECK(!ready_); // Can't redo init. | 564 DCHECK(!ready_); // Can't redo init. |
565 DCHECK_EQ(extensions_.size(), 0u); | 565 DCHECK_EQ(extensions_.size(), 0u); |
566 | 566 |
567 // Hack: we need to ensure the ResourceDispatcherHost is ready before we load | |
568 // the first extension, because its members listen for loaded notifications. | |
569 g_browser_process->resource_dispatcher_host(); | |
570 | |
571 component_loader_->LoadAll(); | 567 component_loader_->LoadAll(); |
572 extensions::InstalledLoader(this).LoadAllExtensions(); | 568 extensions::InstalledLoader(this).LoadAllExtensions(); |
573 | 569 |
574 // If we are running in the import process, don't bother initializing the | 570 // If we are running in the import process, don't bother initializing the |
575 // extension service since this can interfere with the main browser process | 571 // extension service since this can interfere with the main browser process |
576 // that is already running an extension service for this profile. | 572 // that is already running an extension service for this profile. |
577 // TODO(aa): can we start up even less of ExtensionService? | 573 // TODO(aa): can we start up even less of ExtensionService? |
578 // http://crbug.com/107636 | 574 // http://crbug.com/107636 |
579 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kImport) && | 575 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kImport) && |
580 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kImportFromFile)) { | 576 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kImportFromFile)) { |
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2643 // | 2639 // |
2644 // To coexist with certain unit tests that don't have an IO thread message | 2640 // To coexist with certain unit tests that don't have an IO thread message |
2645 // loop available at ExtensionService shutdown, we lazy-initialize this | 2641 // loop available at ExtensionService shutdown, we lazy-initialize this |
2646 // object so that those cases neither create nor destroy a SocketController. | 2642 // object so that those cases neither create nor destroy a SocketController. |
2647 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2643 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
2648 if (!socket_controller_) { | 2644 if (!socket_controller_) { |
2649 socket_controller_ = new extensions::SocketController(); | 2645 socket_controller_ = new extensions::SocketController(); |
2650 } | 2646 } |
2651 return socket_controller_; | 2647 return socket_controller_; |
2652 } | 2648 } |
OLD | NEW |