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

Unified Diff: base/memory/scoped_open_process.h

Issue 868543002: Move OpenProcessHandle to Process::Open. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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
« no previous file with comments | « base/base.gypi ('k') | base/process/process.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/scoped_open_process.h
diff --git a/base/memory/scoped_open_process.h b/base/memory/scoped_open_process.h
deleted file mode 100644
index 8bb19e241ec7921add1c535fc4a68e1e47f639bc..0000000000000000000000000000000000000000
--- a/base/memory/scoped_open_process.h
+++ /dev/null
@@ -1,48 +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.
-
-#ifndef BASE_MEMORY_SCOPED_OPEN_PROCESS_H_
-#define BASE_MEMORY_SCOPED_OPEN_PROCESS_H_
-
-#include "base/process/process_handle.h"
-
-namespace base {
-
-// A class that opens a process from its process id and closes it when the
-// instance goes out of scope.
-class ScopedOpenProcess {
- public:
- ScopedOpenProcess() : handle_(kNullProcessHandle) {
- }
-
- // Automatically close the process.
- ~ScopedOpenProcess() {
- Close();
- }
-
- // Open a new process by pid. Closes any previously opened process (even if
- // opening the new one fails).
- bool Open(ProcessId pid) {
- Close();
- return OpenProcessHandle(pid, &handle_);
- }
-
- // Close the previously opened process.
- void Close() {
- if (handle_ == kNullProcessHandle)
- return;
-
- CloseProcessHandle(handle_);
- handle_ = kNullProcessHandle;
- }
-
- ProcessHandle handle() const { return handle_; }
-
- private:
- ProcessHandle handle_;
- DISALLOW_COPY_AND_ASSIGN(ScopedOpenProcess);
-};
-} // namespace base
-
-#endif // BASE_MEMORY_SCOPED_OPEN_PROCESS_H_
« no previous file with comments | « base/base.gypi ('k') | base/process/process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698