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/api/processes/processes_api.h" | 5 #include "chrome/browser/extensions/api/processes/processes_api.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 502 |
503 void ProcessesAPI::Shutdown() { | 503 void ProcessesAPI::Shutdown() { |
504 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 504 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
505 } | 505 } |
506 | 506 |
507 static base::LazyInstance<ProfileKeyedAPIFactory<ProcessesAPI> > | 507 static base::LazyInstance<ProfileKeyedAPIFactory<ProcessesAPI> > |
508 g_factory = LAZY_INSTANCE_INITIALIZER; | 508 g_factory = LAZY_INSTANCE_INITIALIZER; |
509 | 509 |
510 // static | 510 // static |
511 ProfileKeyedAPIFactory<ProcessesAPI>* ProcessesAPI::GetFactoryInstance() { | 511 ProfileKeyedAPIFactory<ProcessesAPI>* ProcessesAPI::GetFactoryInstance() { |
512 return &g_factory.Get(); | 512 return g_factory.Pointer(); |
513 } | 513 } |
514 | 514 |
515 // static | 515 // static |
516 ProcessesAPI* ProcessesAPI::Get(Profile* profile) { | 516 ProcessesAPI* ProcessesAPI::Get(Profile* profile) { |
517 return ProfileKeyedAPIFactory<ProcessesAPI>::GetForProfile(profile); | 517 return ProfileKeyedAPIFactory<ProcessesAPI>::GetForProfile(profile); |
518 } | 518 } |
519 | 519 |
520 ProcessesEventRouter* ProcessesAPI::processes_event_router() { | 520 ProcessesEventRouter* ProcessesAPI::processes_event_router() { |
521 if (!processes_event_router_) | 521 if (!processes_event_router_) |
522 processes_event_router_.reset(new ProcessesEventRouter(profile_)); | 522 processes_event_router_.reset(new ProcessesEventRouter(profile_)); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 | 758 |
759 SetResult(processes); | 759 SetResult(processes); |
760 SendResponse(true); | 760 SendResponse(true); |
761 | 761 |
762 // Balance the AddRef in the RunImpl. | 762 // Balance the AddRef in the RunImpl. |
763 Release(); | 763 Release(); |
764 #endif // defined(ENABLE_TASK_MANAGER) | 764 #endif // defined(ENABLE_TASK_MANAGER) |
765 } | 765 } |
766 | 766 |
767 } // namespace extensions | 767 } // namespace extensions |
OLD | NEW |