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

Unified Diff: remoting/client/plugin/pepper_main_thread_task_runner.h

Issue 1410923004: Replace PluginThreadTaskRunner with a simpler MainPluginThreadTaskRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_mac_test
Patch Set: Created 5 years, 2 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: remoting/client/plugin/pepper_main_thread_task_runner.h
diff --git a/remoting/client/plugin/pepper_main_thread_task_runner.h b/remoting/client/plugin/pepper_main_thread_task_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..a6e839a76e92cc7141f7436d1ed4b279b58c2a1c
--- /dev/null
+++ b/remoting/client/plugin/pepper_main_thread_task_runner.h
@@ -0,0 +1,51 @@
+// 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.
+
+#ifndef REMOTING_CLIENT_PLUGIN_PEPPER_MAIN_THREAD_TASK_RUNNER_H_
+#define REMOTING_CLIENT_PLUGIN_PEPPER_MAIN_THREAD_TASK_RUNNER_H_
+
+#include "base/callback_forward.h"
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "base/single_thread_task_runner.h"
+#include "base/time/time.h"
+#include "ppapi/utility/completion_callback_factory.h"
+
+namespace pp {
+class Core;
+} // namespace pp
+
+namespace remoting {
+
+// SingleThreadTaskRunner implementation for the main plugin thread.
+class PepperMainThreadTaskRunner : public base::SingleThreadTaskRunner {
+ public:
+ PepperMainThreadTaskRunner();
+
+ // base::SingleThreadTaskRunner interface.
+ bool PostDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override;
+ bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override;
+ bool RunsTasksOnCurrentThread() const override;
+
+ protected:
+ ~PepperMainThreadTaskRunner() override;
+
+ private:
+ // Helper that allows a base::Closure to be used as a pp::CompletionCallback,
+ // by ignoring the completion result.
+ void RunTask(int32_t result, const base::Closure& task);
+
+ pp::Core* core_;
+ pp::CompletionCallbackFactory<PepperMainThreadTaskRunner> callback_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperMainThreadTaskRunner);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_CLIENT_PLUGIN_PEPPER_MAIN_THREAD_TASK_RUNNER_H_
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/client/plugin/pepper_main_thread_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698