| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_CHILD_NPAPI_NP_CHANNEL_BASE_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_NP_CHANNEL_BASE_H_ |
| 6 #define CONTENT_CHILD_NPAPI_NP_CHANNEL_BASE_H_ | 6 #define CONTENT_CHILD_NPAPI_NP_CHANNEL_BASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void AddMappingForNPObjectOwner(int route_id, struct _NPP* owner); | 77 void AddMappingForNPObjectOwner(int route_id, struct _NPP* owner); |
| 78 void SetDefaultNPObjectOwner(struct _NPP* owner); | 78 void SetDefaultNPObjectOwner(struct _NPP* owner); |
| 79 void RemoveMappingForNPObjectOwner(int route_id); | 79 void RemoveMappingForNPObjectOwner(int route_id); |
| 80 | 80 |
| 81 NPObject* GetExistingNPObjectProxy(int route_id); | 81 NPObject* GetExistingNPObjectProxy(int route_id); |
| 82 int GetExistingRouteForNPObjectStub(NPObject* npobject); | 82 int GetExistingRouteForNPObjectStub(NPObject* npobject); |
| 83 struct _NPP* GetExistingNPObjectOwner(int route_id); | 83 struct _NPP* GetExistingNPObjectOwner(int route_id); |
| 84 int GetExistingRouteForNPObjectOwner(struct _NPP* owner); | 84 int GetExistingRouteForNPObjectOwner(struct _NPP* owner); |
| 85 | 85 |
| 86 // IPC::Sender implementation: | 86 // IPC::Sender implementation: |
| 87 virtual bool Send(IPC::Message* msg) OVERRIDE; | 87 virtual bool Send(IPC::Message* msg) override; |
| 88 | 88 |
| 89 base::ProcessId peer_pid() { return channel_->GetPeerPID(); } | 89 base::ProcessId peer_pid() { return channel_->GetPeerPID(); } |
| 90 IPC::ChannelHandle channel_handle() const { return channel_handle_; } | 90 IPC::ChannelHandle channel_handle() const { return channel_handle_; } |
| 91 | 91 |
| 92 // Returns the number of open NPObject channels in this process. | 92 // Returns the number of open NPObject channels in this process. |
| 93 static int Count(); | 93 static int Count(); |
| 94 | 94 |
| 95 // Returns a new route id. | 95 // Returns a new route id. |
| 96 virtual int GenerateRouteID() = 0; | 96 virtual int GenerateRouteID() = 0; |
| 97 | 97 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 // Called on the worker thread | 139 // Called on the worker thread |
| 140 NPChannelBase(); | 140 NPChannelBase(); |
| 141 | 141 |
| 142 virtual void CleanUp() { } | 142 virtual void CleanUp() { } |
| 143 | 143 |
| 144 // Implemented by derived classes to handle control messages | 144 // Implemented by derived classes to handle control messages |
| 145 virtual bool OnControlMessageReceived(const IPC::Message& msg); | 145 virtual bool OnControlMessageReceived(const IPC::Message& msg); |
| 146 | 146 |
| 147 // IPC::Listener implementation: | 147 // IPC::Listener implementation: |
| 148 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 148 virtual bool OnMessageReceived(const IPC::Message& msg) override; |
| 149 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 149 virtual void OnChannelConnected(int32 peer_pid) override; |
| 150 virtual void OnChannelError() OVERRIDE; | 150 virtual void OnChannelError() override; |
| 151 | 151 |
| 152 void set_send_unblocking_only_during_unblock_dispatch() { | 152 void set_send_unblocking_only_during_unblock_dispatch() { |
| 153 send_unblocking_only_during_unblock_dispatch_ = true; | 153 send_unblocking_only_during_unblock_dispatch_ = true; |
| 154 } | 154 } |
| 155 | 155 |
| 156 virtual bool Init(base::MessageLoopProxy* ipc_message_loop, | 156 virtual bool Init(base::MessageLoopProxy* ipc_message_loop, |
| 157 bool create_pipe_now, | 157 bool create_pipe_now, |
| 158 base::WaitableEvent* shutdown_event); | 158 base::WaitableEvent* shutdown_event); |
| 159 | 159 |
| 160 scoped_ptr<IPC::SyncChannel> channel_; | 160 scoped_ptr<IPC::SyncChannel> channel_; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // have the unblock flag set, since they could be followed by a sync message | 215 // have the unblock flag set, since they could be followed by a sync message |
| 216 // that won't get dispatched until the call to the renderer is complete. | 216 // that won't get dispatched until the call to the renderer is complete. |
| 217 bool send_unblocking_only_during_unblock_dispatch_; | 217 bool send_unblocking_only_during_unblock_dispatch_; |
| 218 | 218 |
| 219 DISALLOW_COPY_AND_ASSIGN(NPChannelBase); | 219 DISALLOW_COPY_AND_ASSIGN(NPChannelBase); |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 } // namespace content | 222 } // namespace content |
| 223 | 223 |
| 224 #endif // CONTENT_CHILD_NPAPI_NP_CHANNEL_BASE_H_ | 224 #endif // CONTENT_CHILD_NPAPI_NP_CHANNEL_BASE_H_ |
| OLD | NEW |