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 "ppapi/proxy/dispatcher.h" | 5 #include "ppapi/proxy/dispatcher.h" |
6 | 6 |
7 #include <string.h> // For memset. | 7 #include <string.h> // For memset. |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
15 #include "ppapi/proxy/var_serialization_rules.h" | 15 #include "ppapi/proxy/var_serialization_rules.h" |
16 | 16 |
17 namespace ppapi { | 17 namespace ppapi { |
18 namespace proxy { | 18 namespace proxy { |
19 | 19 |
20 Dispatcher::Dispatcher(base::ProcessHandle remote_process_handle, | 20 Dispatcher::Dispatcher(PP_GetInterface_Func local_get_interface) |
21 PP_GetInterface_Func local_get_interface) | 21 : disallow_trusted_interfaces_(false), // TODO(brettw) make this settable. |
22 : ProxyChannel(remote_process_handle), | |
23 disallow_trusted_interfaces_(false), // TODO(brettw) make this settable. | |
24 local_get_interface_(local_get_interface) { | 22 local_get_interface_(local_get_interface) { |
25 } | 23 } |
26 | 24 |
27 Dispatcher::~Dispatcher() { | 25 Dispatcher::~Dispatcher() { |
28 } | 26 } |
29 | 27 |
30 InterfaceProxy* Dispatcher::GetInterfaceProxy(ApiID id) { | 28 InterfaceProxy* Dispatcher::GetInterfaceProxy(ApiID id) { |
31 InterfaceProxy* proxy = proxies_[id].get(); | 29 InterfaceProxy* proxy = proxies_[id].get(); |
32 if (!proxy) { | 30 if (!proxy) { |
33 // Handle the first time for a given API by creating the proxy for it. | 31 // Handle the first time for a given API by creating the proxy for it. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void Dispatcher::SetSerializationRules( | 72 void Dispatcher::SetSerializationRules( |
75 VarSerializationRules* var_serialization_rules) { | 73 VarSerializationRules* var_serialization_rules) { |
76 serialization_rules_ = var_serialization_rules; | 74 serialization_rules_ = var_serialization_rules; |
77 } | 75 } |
78 | 76 |
79 void Dispatcher::OnInvalidMessageReceived() { | 77 void Dispatcher::OnInvalidMessageReceived() { |
80 } | 78 } |
81 | 79 |
82 } // namespace proxy | 80 } // namespace proxy |
83 } // namespace ppapi | 81 } // namespace ppapi |
OLD | NEW |