| 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 "base/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/proxy/connection.h" | 10 #include "ppapi/proxy/connection.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // the plugin->renderer sender as well as a dummy sender to the browser | 64 // the plugin->renderer sender as well as a dummy sender to the browser |
| 65 // process. See the class comment above about the dummy sender. | 65 // process. See the class comment above about the dummy sender. |
| 66 ppapi::proxy::Connection GetPluginConnection(PP_Instance instance); | 66 ppapi::proxy::Connection GetPluginConnection(PP_Instance instance); |
| 67 | 67 |
| 68 // Handles resource reply messages from the host. | 68 // Handles resource reply messages from the host. |
| 69 static bool OnPluginMsgReceived(const IPC::Message& msg); | 69 static bool OnPluginMsgReceived(const IPC::Message& msg); |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 bool SendToHost(IPC::Message *msg); | 72 bool SendToHost(IPC::Message *msg); |
| 73 bool SendToPlugin(IPC::Message *msg); | 73 bool SendToPlugin(IPC::Message *msg); |
| 74 void DispatchHostMsg(IPC::Message* msg); |
| 74 void DispatchPluginMsg(IPC::Message* msg); | 75 void DispatchPluginMsg(IPC::Message* msg); |
| 75 bool SendToBrowser(IPC::Message *msg); | 76 bool SendToBrowser(IPC::Message *msg); |
| 76 | 77 |
| 77 RendererPpapiHostImpl* host_impl_; | 78 RendererPpapiHostImpl* host_impl_; |
| 78 | 79 |
| 79 class Channel; | 80 class Channel; |
| 80 scoped_ptr<Channel> browser_channel_; | 81 scoped_ptr<Channel> browser_channel_; |
| 81 | 82 |
| 82 // Renderer -> plugin channel. | 83 // Renderer -> plugin channel. |
| 83 scoped_ptr<Channel> host_to_plugin_router_; | 84 scoped_ptr<Channel> host_to_plugin_router_; |
| 84 | 85 |
| 85 // Plugin -> renderer channel. | 86 // Plugin -> renderer channel. |
| 86 scoped_ptr<Channel> plugin_to_host_router_; | 87 scoped_ptr<Channel> plugin_to_host_router_; |
| 87 | 88 |
| 88 // Pending sync message id. | 89 // Pending sync message id. |
| 89 int pending_message_id_; | 90 int pending_message_id_; |
| 90 | 91 |
| 91 // Reply deserializer of the pending sync message. | 92 // Reply deserializer of the pending sync message. |
| 92 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; | 93 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; |
| 93 | 94 |
| 94 // Reply result of the pending sync message. | 95 // Reply result of the pending sync message. |
| 95 bool reply_result_; | 96 bool reply_result_; |
| 96 | 97 |
| 97 base::WeakPtrFactory<PepperInProcessRouter> weak_factory_; | 98 base::WeakPtrFactory<PepperInProcessRouter> weak_factory_; |
| 98 | 99 |
| 99 DISALLOW_COPY_AND_ASSIGN(PepperInProcessRouter); | 100 DISALLOW_COPY_AND_ASSIGN(PepperInProcessRouter); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 } // namespace content | 103 } // namespace content |
| OLD | NEW |