Index: content/common/child_process_host_impl.cc |
diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc |
index f1e330c48e1face2abddd12b06fda6341091595b..2de884068a7d5c7b9ff1c9d3e09b67fcffcdfd07 100644 |
--- a/content/common/child_process_host_impl.cc |
+++ b/content/common/child_process_host_impl.cc |
@@ -77,6 +77,8 @@ FilePath TransformPathForFeature(const FilePath& path, |
namespace content { |
+int ChildProcessHostImpl::kInvalidChildProcessId = -1; |
+ |
// static |
ChildProcessHost* ChildProcessHost::Create(ChildProcessHostDelegate* delegate) { |
return new ChildProcessHostImpl(delegate); |
@@ -208,8 +210,14 @@ void ChildProcessHostImpl::AllocateSharedMemory( |
int ChildProcessHostImpl::GenerateChildProcessUniqueId() { |
// This function must be threadsafe. |
+ // |
+ // TODO(ajwong): Why not StaticAtomicSequenceNumber? |
static base::subtle::Atomic32 last_unique_child_id = 0; |
- return base::subtle::NoBarrier_AtomicIncrement(&last_unique_child_id, 1); |
+ int id = base::subtle::NoBarrier_AtomicIncrement(&last_unique_child_id, 1); |
+ |
+ CHECK_NE(kInvalidChildProcessId, id); |
+ |
+ return id; |
} |
bool ChildProcessHostImpl::OnMessageReceived(const IPC::Message& msg) { |