Chromium Code Reviews| Index: chrome/browser/extensions/api/processes/processes_api.cc |
| diff --git a/chrome/browser/extensions/api/processes/processes_api.cc b/chrome/browser/extensions/api/processes/processes_api.cc |
| index 1779d9262519fb8ca218400e3547e8e5bf05a98c..94c2565b9faac3a97edd6d4b1da91d8de2d30c58 100644 |
| --- a/chrome/browser/extensions/api/processes/processes_api.cc |
| +++ b/chrome/browser/extensions/api/processes/processes_api.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/callback.h" |
| #include "base/json/json_writer.h" |
| +#include "base/lazy_instance.h" |
| #include "base/message_loop.h" |
| #include "base/metrics/histogram.h" |
| #include "base/string_number_conversions.h" |
| @@ -13,7 +14,6 @@ |
| #include "base/values.h" |
| #include "chrome/browser/extensions/api/processes/processes_api_constants.h" |
| -#include "chrome/browser/extensions/api/processes/processes_api_factory.h" |
| #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| #include "chrome/browser/extensions/event_router.h" |
| #include "chrome/browser/extensions/extension_function_registry.h" |
| @@ -506,7 +506,7 @@ void ProcessesAPI::Shutdown() { |
| // static |
| ProcessesAPI* ProcessesAPI::Get(Profile* profile) { |
| - return ProcessesAPIFactory::GetForProfile(profile); |
| + return ProfileKeyedAPIFactory<ProcessesAPI>::GetForProfile(profile); |
| } |
| ProcessesEventRouter* ProcessesAPI::processes_event_router() { |
| @@ -528,6 +528,15 @@ void ProcessesAPI::OnListenerRemoved(const EventListenerInfo& details) { |
| processes_event_router()->ListenerRemoved(); |
| } |
| +static base::LazyInstance<ProfileKeyedAPIFactory<ProcessesAPI> > |
| +g_factory = LAZY_INSTANCE_INITIALIZER; |
| + |
| +template <> |
| +ProfileKeyedAPIFactory<ProcessesAPI>* |
|
Jeffrey Yasskin
2012/12/22 00:16:04
You should declare this specialization in processe
Yoyo Zhou
2012/12/26 17:46:33
Honestly, I was surprised to find that not declari
Jeffrey Yasskin
2012/12/26 19:21:55
Yeah, the biggest problem with missing declaration
|
| +ProfileKeyedAPIFactory<ProcessesAPI>::GetInstance() { |
| + return &g_factory.Get(); |
| +} |
| + |
| GetProcessIdForTabFunction::GetProcessIdForTabFunction() : tab_id_(-1) { |
| } |