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

Side by Side Diff: chrome/browser/extensions/api/processes/processes_api.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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
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/api/processes/processes_api.h" 5 #include "chrome/browser/extensions/api/processes/processes_api.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 19 matching lines...) Expand all
30 namespace extensions { 30 namespace extensions {
31 31
32 namespace errors { 32 namespace errors {
33 const char kNotAllowedToTerminate[] = "Not allowed to terminate process: *."; 33 const char kNotAllowedToTerminate[] = "Not allowed to terminate process: *.";
34 const char kProcessNotFound[] = "Process not found: *."; 34 const char kProcessNotFound[] = "Process not found: *.";
35 const char kInvalidArgument[] = "Invalid argument: *."; 35 const char kInvalidArgument[] = "Invalid argument: *.";
36 } // namespace errors 36 } // namespace errors
37 37
38 namespace { 38 namespace {
39 39
40 base::LazyInstance<BrowserContextKeyedAPIFactory<ProcessesAPI>> 40 base::LazyInstance<BrowserContextKeyedAPIFactory<ProcessesAPI>>::
41 g_processes_api_factory = LAZY_INSTANCE_INITIALIZER; 41 DestructorAtExit g_processes_api_factory = LAZY_INSTANCE_INITIALIZER;
42 42
43 int64_t GetRefreshTypesFlagOnlyEssentialData() { 43 int64_t GetRefreshTypesFlagOnlyEssentialData() {
44 // This is the only non-optional data in the Process as defined by the API in 44 // This is the only non-optional data in the Process as defined by the API in
45 // processes.idl. 45 // processes.idl.
46 return task_manager::REFRESH_TYPE_NACL; 46 return task_manager::REFRESH_TYPE_NACL;
47 } 47 }
48 48
49 // This does not include memory. The memory refresh flag will only be added once 49 // This does not include memory. The memory refresh flag will only be added once
50 // a listener to OnUpdatedWithMemory event is added. 50 // a listener to OnUpdatedWithMemory event is added.
51 int64_t GetRefreshTypesForProcessOptionalData() { 51 int64_t GetRefreshTypesForProcessOptionalData() {
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 // Send the response. 680 // Send the response.
681 Respond(ArgumentList( 681 Respond(ArgumentList(
682 api::processes::GetProcessInfo::Results::Create(processes))); 682 api::processes::GetProcessInfo::Results::Create(processes)));
683 683
684 // Stop observing the task manager, and balance the AddRef() in Run(). 684 // Stop observing the task manager, and balance the AddRef() in Run().
685 task_manager::TaskManagerInterface::GetTaskManager()->RemoveObserver(this); 685 task_manager::TaskManagerInterface::GetTaskManager()->RemoveObserver(this);
686 Release(); 686 Release();
687 } 687 }
688 688
689 } // namespace extensions 689 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698