| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/pepper/pepper_in_process_router.h" | 5 #include "content/renderer/pepper/pepper_in_process_router.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/public/renderer/render_thread.h" | 9 #include "content/public/renderer/render_thread.h" |
| 10 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 10 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| 11 #include "content/renderer/render_frame_impl.h" | 11 #include "content/renderer/render_frame_impl.h" |
| 12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
| 13 #include "ipc/ipc_sender.h" | 13 #include "ipc/ipc_sender.h" |
| 14 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
| 15 #include "ppapi/shared_impl/ppapi_globals.h" | 15 #include "ppapi/shared_impl/ppapi_globals.h" |
| 16 #include "ppapi/shared_impl/resource_tracker.h" | 16 #include "ppapi/shared_impl/resource_tracker.h" |
| 17 | 17 |
| 18 using ppapi::UnpackMessage; | 18 using ppapi::UnpackMessage; |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 class PepperInProcessRouter::Channel : public IPC::Sender { | 22 class PepperInProcessRouter::Channel : public IPC::Sender { |
| 23 public: | 23 public: |
| 24 Channel(const base::Callback<bool(IPC::Message*)>& callback) | 24 Channel(const base::Callback<bool(IPC::Message*)>& callback) |
| 25 : callback_(callback) {} | 25 : callback_(callback) {} |
| 26 | 26 |
| 27 virtual ~Channel() {} | 27 virtual ~Channel() {} |
| 28 | 28 |
| 29 virtual bool Send(IPC::Message* message) OVERRIDE { | 29 virtual bool Send(IPC::Message* message) override { |
| 30 return callback_.Run(message); | 30 return callback_.Run(message); |
| 31 } | 31 } |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 base::Callback<bool(IPC::Message*)> callback_; | 34 base::Callback<bool(IPC::Message*)> callback_; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 PepperInProcessRouter::PepperInProcessRouter(RendererPpapiHostImpl* host_impl) | 37 PepperInProcessRouter::PepperInProcessRouter(RendererPpapiHostImpl* host_impl) |
| 38 : host_impl_(host_impl), | 38 : host_impl_(host_impl), |
| 39 pending_message_id_(0), | 39 pending_message_id_(0), |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void PepperInProcessRouter::DispatchPluginMsg(IPC::Message* msg) { | 163 void PepperInProcessRouter::DispatchPluginMsg(IPC::Message* msg) { |
| 164 bool handled = OnPluginMsgReceived(*msg); | 164 bool handled = OnPluginMsgReceived(*msg); |
| 165 DCHECK(handled); | 165 DCHECK(handled); |
| 166 } | 166 } |
| 167 | 167 |
| 168 bool PepperInProcessRouter::SendToBrowser(IPC::Message* msg) { | 168 bool PepperInProcessRouter::SendToBrowser(IPC::Message* msg) { |
| 169 return RenderThread::Get()->Send(msg); | 169 return RenderThread::Get()->Send(msg); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace content | 172 } // namespace content |
| OLD | NEW |