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/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "base/json/json_string_value_serializer.h" | 11 #include "base/json/json_string_value_serializer.h" |
12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
13 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "base/trace_event/trace_event.h" |
16 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
17 #include "chrome/browser/search/hotword_service.h" | 18 #include "chrome/browser/search/hotword_service.h" |
18 #include "chrome/browser/search/hotword_service_factory.h" | 19 #include "chrome/browser/search/hotword_service_factory.h" |
19 #include "chrome/common/chrome_paths.h" | 20 #include "chrome/common/chrome_paths.h" |
20 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/common/chrome_version_info.h" | 22 #include "chrome/common/chrome_version_info.h" |
22 #include "chrome/common/extensions/extension_constants.h" | 23 #include "chrome/common/extensions/extension_constants.h" |
23 #include "chrome/grit/generated_resources.h" | 24 #include "chrome/grit/generated_resources.h" |
24 #include "components/crx_file/id_util.h" | 25 #include "components/crx_file/id_util.h" |
25 #include "content/public/browser/browser_context.h" | 26 #include "content/public/browser/browser_context.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 local_state_(local_state), | 120 local_state_(local_state), |
120 browser_context_(browser_context), | 121 browser_context_(browser_context), |
121 extension_service_(extension_service), | 122 extension_service_(extension_service), |
122 weak_factory_(this) {} | 123 weak_factory_(this) {} |
123 | 124 |
124 ComponentLoader::~ComponentLoader() { | 125 ComponentLoader::~ComponentLoader() { |
125 ClearAllRegistered(); | 126 ClearAllRegistered(); |
126 } | 127 } |
127 | 128 |
128 void ComponentLoader::LoadAll() { | 129 void ComponentLoader::LoadAll() { |
| 130 TRACE_EVENT0("browser,startup", "ComponentLoader::LoadAll"); |
129 const base::TimeTicks start_time = base::TimeTicks::Now(); | 131 const base::TimeTicks start_time = base::TimeTicks::Now(); |
130 for (RegisteredComponentExtensions::iterator it = | 132 for (RegisteredComponentExtensions::iterator it = |
131 component_extensions_.begin(); | 133 component_extensions_.begin(); |
132 it != component_extensions_.end(); ++it) { | 134 it != component_extensions_.end(); ++it) { |
133 Load(*it); | 135 Load(*it); |
134 } | 136 } |
135 UMA_HISTOGRAM_TIMES("Extensions.LoadAllComponentTime", | 137 UMA_HISTOGRAM_TIMES("Extensions.LoadAllComponentTime", |
136 base::TimeTicks::Now() - start_time); | 138 base::TimeTicks::Now() - start_time); |
137 } | 139 } |
138 | 140 |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 662 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
661 storage::FileSystemContext* file_system_context = | 663 storage::FileSystemContext* file_system_context = |
662 content::BrowserContext::GetStoragePartitionForSite( | 664 content::BrowserContext::GetStoragePartitionForSite( |
663 off_the_record_context, site)->GetFileSystemContext(); | 665 off_the_record_context, site)->GetFileSystemContext(); |
664 file_system_context->EnableTemporaryFileSystemInIncognito(); | 666 file_system_context->EnableTemporaryFileSystemInIncognito(); |
665 } | 667 } |
666 #endif | 668 #endif |
667 } | 669 } |
668 | 670 |
669 } // namespace extensions | 671 } // namespace extensions |
OLD | NEW |