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

Unified Diff: sandbox/win/src/win2k_threadpool.cc

Issue 1851213002: Remove sandbox on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nacl compile issues Created 4 years, 9 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 | « sandbox/win/src/win2k_threadpool.h ('k') | sandbox/win/src/win_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/win2k_threadpool.cc
diff --git a/sandbox/win/src/win2k_threadpool.cc b/sandbox/win/src/win2k_threadpool.cc
deleted file mode 100644
index 35de38a0f136bf575283fb5465a281dacf01fec7..0000000000000000000000000000000000000000
--- a/sandbox/win/src/win2k_threadpool.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2012 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 "sandbox/win/src/win2k_threadpool.h"
-
-#include <stddef.h>
-
-#include "sandbox/win/src/win_utils.h"
-
-namespace sandbox {
-
-Win2kThreadPool::Win2kThreadPool() {
- ::InitializeCriticalSection(&lock_);
-}
-
-bool Win2kThreadPool::RegisterWait(const void* cookie, HANDLE waitable_object,
- CrossCallIPCCallback callback,
- void* context) {
- if (0 == cookie) {
- return false;
- }
- HANDLE pool_object = NULL;
- // create a wait for a kernel object, with no timeout
- if (!::RegisterWaitForSingleObject(&pool_object, waitable_object, callback,
- context, INFINITE, WT_EXECUTEDEFAULT)) {
- return false;
- }
- PoolObject pool_obj = {cookie, pool_object};
- AutoLock lock(&lock_);
- pool_objects_.push_back(pool_obj);
- return true;
-}
-
-bool Win2kThreadPool::UnRegisterWaits(void* cookie) {
- if (0 == cookie) {
- return false;
- }
- AutoLock lock(&lock_);
- bool success = true;
- PoolObjects::iterator it = pool_objects_.begin();
- while (it != pool_objects_.end()) {
- if (it->cookie == cookie) {
- HANDLE wait = it->wait;
- it = pool_objects_.erase(it);
- success &= (::UnregisterWaitEx(wait, INVALID_HANDLE_VALUE) != 0);
- } else {
- ++it;
- }
- }
- return success;
-}
-
-size_t Win2kThreadPool::OutstandingWaits() {
- AutoLock lock(&lock_);
- return pool_objects_.size();
-}
-
-Win2kThreadPool::~Win2kThreadPool() {
- // Here we used to unregister all the pool wait handles. Now, following the
- // rest of the code we avoid lengthy or blocking calls given that the process
- // is being torn down.
- ::DeleteCriticalSection(&lock_);
-}
-
-} // namespace sandbox
« no previous file with comments | « sandbox/win/src/win2k_threadpool.h ('k') | sandbox/win/src/win_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698