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

Side by Side Diff: content/common/child_process_info.h

Issue 8757014: Move GetProcessTypeNameInEnglish beside the ProcessType enum where it belongs. This also helps re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/metrics/tracking_synchronizer.cc ('k') | content/common/child_process_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CONTENT_COMMON_CHILD_PROCESS_INFO_H_ 5 #ifndef CONTENT_COMMON_CHILD_PROCESS_INFO_H_
6 #define CONTENT_COMMON_CHILD_PROCESS_INFO_H_ 6 #define CONTENT_COMMON_CHILD_PROCESS_INFO_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 27 matching lines...) Expand all
38 // Getter to the process ID. 38 // Getter to the process ID.
39 int pid() const { return process_.pid(); } 39 int pid() const { return process_.pid(); }
40 40
41 // The unique identifier for this child process. This identifier is NOT a 41 // The unique identifier for this child process. This identifier is NOT a
42 // process ID, and will be unique for all types of child process for 42 // process ID, and will be unique for all types of child process for
43 // one run of the browser. 43 // one run of the browser.
44 int id() const { return id_; } 44 int id() const { return id_; }
45 45
46 void SetProcessBackgrounded() const { process_.SetProcessBackgrounded(true); } 46 void SetProcessBackgrounded() const { process_.SetProcessBackgrounded(true); }
47 47
48 // Returns an English name of the process type, should only be used for non
49 // user-visible strings, or debugging pages like about:memory.
50 static std::string GetTypeNameInEnglish(content::ProcessType type);
51
52 // We define the < operator so that the ChildProcessInfo can be used as a key 48 // We define the < operator so that the ChildProcessInfo can be used as a key
53 // in a std::map. 49 // in a std::map.
54 bool operator <(const ChildProcessInfo& rhs) const { 50 bool operator <(const ChildProcessInfo& rhs) const {
55 if (process_.handle() != rhs.process_.handle()) 51 if (process_.handle() != rhs.process_.handle())
56 return process_ .handle() < rhs.process_.handle(); 52 return process_ .handle() < rhs.process_.handle();
57 return false; 53 return false;
58 } 54 }
59 55
60 bool operator ==(const ChildProcessInfo& rhs) const { 56 bool operator ==(const ChildProcessInfo& rhs) const {
61 return process_.handle() == rhs.process_.handle(); 57 return process_.handle() == rhs.process_.handle();
(...skipping 28 matching lines...) Expand all
90 content::ProcessType type_; 86 content::ProcessType type_;
91 string16 name_; 87 string16 name_;
92 string16 version_; 88 string16 version_;
93 int id_; 89 int id_;
94 90
95 // The handle to the process. 91 // The handle to the process.
96 mutable base::Process process_; 92 mutable base::Process process_;
97 }; 93 };
98 94
99 #endif // CONTENT_COMMON_CHILD_PROCESS_INFO_H_ 95 #endif // CONTENT_COMMON_CHILD_PROCESS_INFO_H_
OLDNEW
« no previous file with comments | « chrome/browser/metrics/tracking_synchronizer.cc ('k') | content/common/child_process_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698