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

Unified Diff: remoting/client/plugin/main_plugin_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/main_plugin_thread_task_runner.h
diff --git a/remoting/client/plugin/main_plugin_thread_task_runner.h b/remoting/client/plugin/main_plugin_thread_task_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..546a7a00e8e5689ec208b8f7a7a7078f115452a4
--- /dev/null
+++ b/remoting/client/plugin/main_plugin_thread_task_runner.h
@@ -0,0 +1,49 @@
+// 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_MAIN_PLUGIN_THREAD_TASK_RUNNER_H_
+#define REMOTING_CLIENT_PLUGIN_MAIN_PLUGIN_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 MainPluginThreadTaskRunner : public base::SingleThreadTaskRunner {
Wez 2015/10/20 23:05:48 nit: I'd suggest calling this PepperMainThreadTask
Sergey Ulanov 2015/10/20 23:28:05 Done.
+ public:
+ MainPluginThreadTaskRunner();
+
+ // 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:
+ ~MainPluginThreadTaskRunner() override;
+
+ private:
+ void RunTask(int32_t result, const base::Closure& closure);
Wez 2015/10/20 23:05:48 nit: Not at all obvious from the name & parameters
Sergey Ulanov 2015/10/20 23:28:05 Added comment and renamed second parameter.
+
+ pp::Core* core_;
+ pp::CompletionCallbackFactory<MainPluginThreadTaskRunner> callback_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(MainPluginThreadTaskRunner);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_CLIENT_PLUGIN_MAIN_PLUGIN_THREAD_TASK_RUNNER_H_

Powered by Google App Engine
This is Rietveld 408576698