1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_SCOPED_CHILD_PROCESS_REFERENCE_H_
6 #define CONTENT_CHILD_SCOPED_CHILD_PROCESS_REFERENCE_H_
8 #include "base/basictypes.h"
16 // Scoper class that automatically adds a reference to the current child
17 // process in constructor and releases the reference on scope out.
18 // Consumers of this class can call ReleaseWithDelay() to explicitly release
19 // the reference with a certain delay.
20 class ScopedChildProcessReference
{
22 ScopedChildProcessReference();
23 ~ScopedChildProcessReference();
25 // Releases the process reference after |delay|. Once this is called
26 // scoping out has no effect.
27 // It is not valid to call this more than once.
28 void ReleaseWithDelay(const base::TimeDelta
& delay
);
32 DISALLOW_COPY_AND_ASSIGN(ScopedChildProcessReference
);
35 } // namespace content
37 #endif // CONTENT_CHILD_SCOPED_CHILD_PROCESS_REFERENCE_H_