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

Unified Diff: mojo/edk/embedder/platform_task_runner.h

Issue 1462083003: Add //mojo/edk/platform and move platform_task_runners.h there. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: update readme 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
Index: mojo/edk/embedder/platform_task_runner.h
diff --git a/mojo/edk/embedder/platform_task_runner.h b/mojo/edk/embedder/platform_task_runner.h
deleted file mode 100644
index 1561c6b023b699211cf25e34c09c9168ef51cbf4..0000000000000000000000000000000000000000
--- a/mojo/edk/embedder/platform_task_runner.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2015 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.
-
-// This file provides an interface for "task runners", which are used within the
-// EDK itself.
-
-#ifndef MOJO_EDK_EMBEDDER_PLATFORM_TASK_RUNNER_H_
-#define MOJO_EDK_EMBEDDER_PLATFORM_TASK_RUNNER_H_
-
-#include "base/callback_forward.h"
-#include "mojo/edk/util/ref_counted.h"
-#include "mojo/public/cpp/system/macros.h"
-
-namespace mojo {
-namespace embedder {
-
-// Interface for "task runners", which can be used to schedule tasks to be run
-// asynchronously (possibly on a different thread). Implementations must be
-// thread-safe.
-class PlatformTaskRunner
- : public util::RefCountedThreadSafe<PlatformTaskRunner> {
- public:
- virtual ~PlatformTaskRunner() {}
-
- // Posts a task to this task runner (i.e., schedule the task). The task must
- // be run (insofar as this can be guaranteed). (This must not run the task
- // synchronously.)
- // TODO(vtl): Replace the |base::Closure| with |std::function<void()>|.
- virtual void PostTask(const base::Closure& task) = 0;
-
- // Returns true if this task runner may run tasks on the current thread, false
- // otherwise (e.g., if this task runner only runs tasks on a different
- // thread).
- virtual bool RunsTasksOnCurrentThread() const = 0;
-
- protected:
- PlatformTaskRunner() {}
-
- private:
- MOJO_DISALLOW_COPY_AND_ASSIGN(PlatformTaskRunner);
-};
-
-} // namespace embedder
-} // namespace mojo
-
-#endif // MOJO_EDK_EMBEDDER_PLATFORM_TASK_RUNNER_H_

Powered by Google App Engine
This is Rietveld 408576698