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

Side by Side Diff: components/scheduler/promises/single_thread_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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #ifndef COMPONENTS_SCHEDULER_PROMISES_SINGLE_THREAD_PROMISE_EXECUTOR_H_
6 #define COMPONENTS_SCHEDULER_PROMISES_SINGLE_THREAD_PROMISE_EXECUTOR_H_
7
8 #include "base/macros.h"
9 #include "base/single_thread_task_runner.h"
10 #include "components/scheduler/promises/promise_executor.h"
11
12 namespace promise {
13 namespace internal {
14
15 class SCHEDULER_EXPORT SingleThreadPromiseExecutor : public PromiseExecutor {
16 public:
17 explicit SingleThreadPromiseExecutor(
18 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
19 ~SingleThreadPromiseExecutor() override;
20
21 // PromiseExecutor implementation:
22 void StartResolveInternal(PromiseBase* promise) override;
23 bool OnPromiseResolved(PromiseBase* promise) override;
24 bool OnPromiseRejected(PromiseBase* promise) override;
25
26 private:
27 void ResolveImpl();
28 void DispatchResolveImpl();
29
30 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
31
32 DISALLOW_COPY_AND_ASSIGN(SingleThreadPromiseExecutor);
33 };
34
35 } // namespace internal
36 } // namespace promise
37
38 #endif // COMPONENTS_SCHEDULER_PROMISES_SINGLE_THREAD_PROMISE_EXECUTOR_H_
OLDNEW
« no previous file with comments | « components/scheduler/promises/rejectable.h ('k') | components/scheduler/promises/single_thread_promise_executor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698