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

Side by Side Diff: remoting/base/plugin_message_loop_proxy.h

Issue 7655006: Revert 97050 - Add PluginMessageLoopProxy and use it for Host plugin UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/base/plugin_message_loop_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 REMOTING_BASE_PLUGIN_MESSAGE_LOOP_H_
6 #define REMOTING_BASE_PLUGIN_MESSAGE_LOOP_H_
7
8 #include "base/callback.h"
9 #include "base/compiler_specific.h"
10 #include "base/message_loop_proxy.h"
11
12 namespace remoting {
13
14 // MessageLoopProxy for plugin main threads.
15 class PluginMessageLoopProxy : public base::MessageLoopProxy {
16 public:
17 class Delegate {
18 public:
19 Delegate() { }
20 virtual ~Delegate() { }
21
22 virtual bool RunOnPluginThread(
23 int delay_ms, void(function)(void*), void* data) = 0;
24 virtual bool IsPluginThread() = 0;
25 };
26
27 // Caller keeps ownership of delegate.
28 PluginMessageLoopProxy(Delegate* delegate);
29 virtual ~PluginMessageLoopProxy();
30
31 void Detach();
32
33 // base::MessageLoopProxy interface.
34 virtual bool PostTask(
35 const tracked_objects::Location& from_here,
36 Task* task) OVERRIDE;
37 virtual bool PostDelayedTask(
38 const tracked_objects::Location& from_here,
39 Task* task,
40 int64 delay_ms) OVERRIDE;
41 virtual bool PostNonNestableTask(
42 const tracked_objects::Location& from_here,
43 Task* task) OVERRIDE;
44 virtual bool PostNonNestableDelayedTask(
45 const tracked_objects::Location& from_here,
46 Task* task,
47 int64 delay_ms) OVERRIDE;
48
49 virtual bool PostTask(
50 const tracked_objects::Location& from_here,
51 const base::Closure& task) OVERRIDE;
52 virtual bool PostDelayedTask(
53 const tracked_objects::Location& from_here,
54 const base::Closure& task,
55 int64 delay_ms) OVERRIDE;
56 virtual bool PostNonNestableTask(
57 const tracked_objects::Location& from_here,
58 const base::Closure& task) OVERRIDE;
59 virtual bool PostNonNestableDelayedTask(
60 const tracked_objects::Location& from_here,
61 const base::Closure& task,
62 int64 delay_ms) OVERRIDE;
63
64 virtual bool BelongsToCurrentThread() OVERRIDE;
65
66 private:
67 // |lock_| must be acquired when accessing |delegate_|.
68 base::Lock lock_;
69 Delegate* delegate_;
70
71 static void RunTask(void* data);
72 static void RunClosure(void* data);
73
74 DISALLOW_COPY_AND_ASSIGN(PluginMessageLoopProxy);
75 };
76
77 } // namespace remoting
78
79 #endif // REMOTING_BASE_PLUGIN_MESSAGE_LOOP_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/base/plugin_message_loop_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698