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

Unified Diff: content/common/child_process_host_impl.cc

Issue 10600009: Support partitioning of storage contexts based on render_id. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix comments Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698