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

Unified Diff: content/common/child_process_info.cc

Issue 8770027: Get rid of the ChildProcessInfo class. It was carrying unnecessary data, and the fact that some p... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/child_process_info.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/child_process_info.cc
===================================================================
--- content/common/child_process_info.cc (revision 112500)
+++ content/common/child_process_info.cc (working copy)
@@ -1,65 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/common/child_process_info.h"
-
-#include <limits>
-
-#include "base/atomicops.h"
-#include "base/i18n/rtl.h"
-#include "base/logging.h"
-#include "base/process_util.h"
-#include "base/rand_util.h"
-#include "base/stringprintf.h"
-#include "base/utf_string_conversions.h"
-
-ChildProcessInfo::ChildProcessInfo(content::ProcessType type, int id) :
- type_(type) {
- if (id == -1)
- id_ = GenerateChildProcessUniqueId();
- else
- id_ = id;
-}
-
-ChildProcessInfo::ChildProcessInfo(const ChildProcessInfo& original)
- : type_(original.type_),
- name_(original.name_),
- version_(original.version_),
- id_(original.id_),
- process_(original.process_) {
-}
-
-ChildProcessInfo::~ChildProcessInfo() {
-}
-
-ChildProcessInfo& ChildProcessInfo::operator=(
- const ChildProcessInfo& original) {
- if (&original != this) {
- type_ = original.type_;
- name_ = original.name_;
- version_ = original.version_;
- id_ = original.id_;
- process_ = original.process_;
- }
- return *this;
-}
-
-std::string ChildProcessInfo::GenerateRandomChannelID(void* instance) {
- // Note: the string must start with the current process id, this is how
- // child processes determine the pid of the parent.
- // Build the channel ID. This is composed of a unique identifier for the
- // parent browser process, an identifier for the child instance, and a random
- // component. We use a random component so that a hacked child process can't
- // cause denial of service by causing future named pipe creation to fail.
- return base::StringPrintf("%d.%p.%d",
- base::GetCurrentProcId(), instance,
- base::RandInt(0, std::numeric_limits<int>::max()));
-}
-
-// static
-int ChildProcessInfo::GenerateChildProcessUniqueId() {
- // This function must be threadsafe.
- static base::subtle::Atomic32 last_unique_child_id = 0;
- return base::subtle::NoBarrier_AtomicIncrement(&last_unique_child_id, 1);
-}
« no previous file with comments | « content/common/child_process_info.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698