summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortbreisacher@chromium.org <tbreisacher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 00:11:10 +0000
committertbreisacher@chromium.org <tbreisacher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 00:11:10 +0000
commitd126e1d6de0289a30c34363969ea69fb48c61b01 (patch)
treeb3dcdebcbebf2cb18f8bb3dd7ec56cc8a850748c
parent63ce73bc5679131f67ff23b14194580d2529ad4c (diff)
downloadchromium_src-d126e1d6de0289a30c34363969ea69fb48c61b01.zip
chromium_src-d126e1d6de0289a30c34363969ea69fb48c61b01.tar.gz
chromium_src-d126e1d6de0289a30c34363969ea69fb48c61b01.tar.bz2
Make sure that ChildProcessData.type always gets initialized
CID=102569 BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/9004027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115230 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/task_manager/task_manager_resource_providers.cc3
-rw-r--r--content/browser/browser_child_process_host.cc4
-rw-r--r--content/public/browser/child_process_data.h4
3 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc
index 43415fc..4853396 100644
--- a/chrome/browser/task_manager/task_manager_resource_providers.cc
+++ b/chrome/browser/task_manager/task_manager_resource_providers.cc
@@ -1076,8 +1076,7 @@ void TaskManagerChildProcessResourceProvider::RetrieveChildProcessData() {
// Only add processes which are already started, since we need their handle.
if ((*iter)->handle() == base::kNullProcessHandle)
continue;
- content::ChildProcessData data;
- data.type = (*iter)->type();
+ content::ChildProcessData data((*iter)->type());
data.name = (*iter)->name();
data.handle = (*iter)->handle();
child_processes.push_back(data);
diff --git a/content/browser/browser_child_process_host.cc b/content/browser/browser_child_process_host.cc
index 93c997b..7f737bc 100644
--- a/content/browser/browser_child_process_host.cc
+++ b/content/browser/browser_child_process_host.cc
@@ -56,12 +56,12 @@ void ChildNotificationHelper(int notification_type,
BrowserChildProcessHost::BrowserChildProcessHost(
content::ProcessType type)
- : ALLOW_THIS_IN_INITIALIZER_LIST(client_(this)),
+ : data_(type),
+ ALLOW_THIS_IN_INITIALIZER_LIST(client_(this)),
#if !defined(OS_WIN)
ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)),
#endif
disconnect_was_alive_(false) {
- data_.type = type;
data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId();
child_process_host_.reset(ChildProcessHost::Create(this));
diff --git a/content/public/browser/child_process_data.h b/content/public/browser/child_process_data.h
index 6f20dd3..2124d80 100644
--- a/content/public/browser/child_process_data.h
+++ b/content/public/browser/child_process_data.h
@@ -30,7 +30,9 @@ struct ChildProcessData {
// The handle to the process.
base::ProcessHandle handle;
- ChildProcessData() : id(0), handle(base::kNullProcessHandle) {}
+ ChildProcessData(content::ProcessType type)
+ : type(type), id(0), handle(base::kNullProcessHandle) {
+}
};
} // namespace content