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

Unified Diff: components/scheduler/promises/thread_pool_promise_executor.h

Issue 1401553002: NOT INTENDED FOR LANDING: A promises demo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support for rejectatble promises! Created 4 years, 8 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: components/scheduler/promises/thread_pool_promise_executor.h
diff --git a/components/scheduler/promises/thread_pool_promise_executor.h b/components/scheduler/promises/thread_pool_promise_executor.h
new file mode 100644
index 0000000000000000000000000000000000000000..d2bf67ac54846b404a17137db828507857554077
--- /dev/null
+++ b/components/scheduler/promises/thread_pool_promise_executor.h
@@ -0,0 +1,36 @@
+// Copyright 2016 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 COMPONENTS_SCHEDULER_PROMISES_THREAD_POOL_PROMISE_EXECUTOR_H_
+#define COMPONENTS_SCHEDULER_PROMISES_THREAD_POOL_PROMISE_EXECUTOR_H_
+
+#include "base/macros.h"
+#include "components/scheduler/promises/promise_executor.h"
+
+namespace promise {
+namespace internal {
+
+class SCHEDULER_EXPORT ThreadPoolPromiseExecutor : public PromiseExecutor {
+ public:
+ ThreadPoolPromiseExecutor();
+ ~ThreadPoolPromiseExecutor() override;
+
+ // PromiseExecutor implementation:
+ void StartResolveInternal(PromiseBase* promise) override;
+ bool OnPromiseResolved(PromiseBase* promise) override;
+ bool OnPromiseRejected(PromiseBase* promise) override;
+
+ private:
+ void ExecutorDrivenResolve();
+ void DispatchExecutorDrivenResolve();
+
+ base::Lock lock_;
+
+ DISALLOW_COPY_AND_ASSIGN(ThreadPoolPromiseExecutor);
+};
+
+} // namespace internal
+} // namespace promise
+
+#endif // COMPONENTS_SCHEDULER_PROMISES_THREAD_POOL_PROMISE_EXECUTOR_H_
« no previous file with comments | « components/scheduler/promises/template_helpers.h ('k') | components/scheduler/promises/thread_pool_promise_executor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698