OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_PLUGIN_PLUGIN_CHANNEL_BASE_H_ | 5 #ifndef CHROME_PLUGIN_PLUGIN_CHANNEL_BASE_H_ |
6 #define CHROME_PLUGIN_PLUGIN_CHANNEL_BASE_H_ | 6 #define CHROME_PLUGIN_PLUGIN_CHANNEL_BASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 // Sends a message to all instances. | 83 // Sends a message to all instances. |
84 static void Broadcast(IPC::Message* message); | 84 static void Broadcast(IPC::Message* message); |
85 | 85 |
86 // Called on the worker thread | 86 // Called on the worker thread |
87 PluginChannelBase(); | 87 PluginChannelBase(); |
88 | 88 |
89 virtual void CleanUp() { } | 89 virtual void CleanUp() { } |
90 | 90 |
91 // Implemented by derived classes to handle control messages | 91 // Implemented by derived classes to handle control messages |
92 virtual void OnControlMessageReceived(const IPC::Message& msg); | 92 virtual bool OnControlMessageReceived(const IPC::Message& msg); |
93 | 93 |
94 // IPC::Channel::Listener implementation: | 94 // IPC::Channel::Listener implementation: |
95 virtual void OnMessageReceived(const IPC::Message& msg); | 95 virtual bool OnMessageReceived(const IPC::Message& msg); |
96 virtual void OnChannelConnected(int32 peer_pid); | 96 virtual void OnChannelConnected(int32 peer_pid); |
97 virtual void OnChannelError(); | 97 virtual void OnChannelError(); |
98 | 98 |
99 void set_send_unblocking_only_during_unblock_dispatch() { | 99 void set_send_unblocking_only_during_unblock_dispatch() { |
100 send_unblocking_only_during_unblock_dispatch_ = true; | 100 send_unblocking_only_during_unblock_dispatch_ = true; |
101 } | 101 } |
102 | 102 |
103 virtual bool Init(MessageLoop* ipc_message_loop, bool create_pipe_now); | 103 virtual bool Init(MessageLoop* ipc_message_loop, bool create_pipe_now); |
104 | 104 |
105 scoped_ptr<IPC::SyncChannel> channel_; | 105 scoped_ptr<IPC::SyncChannel> channel_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // renderer. We additionally have to do this for async messages from the | 140 // renderer. We additionally have to do this for async messages from the |
141 // renderer that have the unblock flag set, since they could be followed by a | 141 // renderer that have the unblock flag set, since they could be followed by a |
142 // sync message that won't get dispatched until the call to the renderer is | 142 // sync message that won't get dispatched until the call to the renderer is |
143 // complete. | 143 // complete. |
144 bool send_unblocking_only_during_unblock_dispatch_; | 144 bool send_unblocking_only_during_unblock_dispatch_; |
145 | 145 |
146 DISALLOW_COPY_AND_ASSIGN(PluginChannelBase); | 146 DISALLOW_COPY_AND_ASSIGN(PluginChannelBase); |
147 }; | 147 }; |
148 | 148 |
149 #endif // CHROME_PLUGIN_PLUGIN_CHANNEL_BASE_H_ | 149 #endif // CHROME_PLUGIN_PLUGIN_CHANNEL_BASE_H_ |
OLD | NEW |