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

Unified Diff: base/threading/worker_pool_win.cc

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 years, 1 month 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/threading/worker_pool_unittest.cc ('k') | base/time/pr_time_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool_win.cc
diff --git a/base/threading/worker_pool_win.cc b/base/threading/worker_pool_win.cc
deleted file mode 100644
index 1b0ade5e244c9495570a126b00c080c53943a6ae..0000000000000000000000000000000000000000
--- a/base/threading/worker_pool_win.cc
+++ /dev/null
@@ -1,73 +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 "base/threading/worker_pool.h"
-
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/logging.h"
-#include "base/pending_task.h"
-#include "base/threading/thread_local.h"
-#include "base/trace_event/trace_event.h"
-#include "base/tracked_objects.h"
-
-namespace base {
-
-namespace {
-
-base::LazyInstance<ThreadLocalBoolean>::Leaky
- g_worker_pool_running_on_this_thread = LAZY_INSTANCE_INITIALIZER;
-
-DWORD CALLBACK WorkItemCallback(void* param) {
- PendingTask* pending_task = static_cast<PendingTask*>(param);
- TRACE_EVENT2("toplevel", "WorkItemCallback::Run",
- "src_file", pending_task->posted_from.file_name(),
- "src_func", pending_task->posted_from.function_name());
-
- g_worker_pool_running_on_this_thread.Get().Set(true);
-
- tracked_objects::TaskStopwatch stopwatch;
- stopwatch.Start();
- pending_task->task.Run();
- stopwatch.Stop();
-
- g_worker_pool_running_on_this_thread.Get().Set(false);
-
- tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking(
- pending_task->birth_tally, pending_task->time_posted, stopwatch);
-
- delete pending_task;
- return 0;
-}
-
-// Takes ownership of |pending_task|
-bool PostTaskInternal(PendingTask* pending_task, bool task_is_slow) {
- ULONG flags = 0;
- if (task_is_slow)
- flags |= WT_EXECUTELONGFUNCTION;
-
- if (!QueueUserWorkItem(WorkItemCallback, pending_task, flags)) {
- DPLOG(ERROR) << "QueueUserWorkItem failed";
- delete pending_task;
- return false;
- }
-
- return true;
-}
-
-} // namespace
-
-// static
-bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
- const base::Closure& task, bool task_is_slow) {
- PendingTask* pending_task = new PendingTask(from_here, task);
- return PostTaskInternal(pending_task, task_is_slow);
-}
-
-// static
-bool WorkerPool::RunsTasksOnCurrentThread() {
- return g_worker_pool_running_on_this_thread.Get().Get();
-}
-
-} // namespace base
« no previous file with comments | « base/threading/worker_pool_unittest.cc ('k') | base/time/pr_time_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698