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/ppb_core_proxy.h" | 5 #include "ppapi/proxy/ppb_core_proxy.h" |
6 | 6 |
7 #include <stdlib.h> // For malloc | 7 #include <stdlib.h> // For malloc |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 PPB_Core_Proxy::~PPB_Core_Proxy() { | 97 PPB_Core_Proxy::~PPB_Core_Proxy() { |
98 } | 98 } |
99 | 99 |
100 // static | 100 // static |
101 const PPB_Core* PPB_Core_Proxy::GetPPB_Core_Interface() { | 101 const PPB_Core* PPB_Core_Proxy::GetPPB_Core_Interface() { |
102 return &core_interface; | 102 return &core_interface; |
103 } | 103 } |
104 | 104 |
105 bool PPB_Core_Proxy::OnMessageReceived(const IPC::Message& msg) { | 105 bool PPB_Core_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 106 #if defined(OS_NACL) |
| 107 return false; |
| 108 #else |
106 bool handled = true; | 109 bool handled = true; |
107 IPC_BEGIN_MESSAGE_MAP(PPB_Core_Proxy, msg) | 110 IPC_BEGIN_MESSAGE_MAP(PPB_Core_Proxy, msg) |
108 #if !defined(OS_NACL) | |
109 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_AddRefResource, | 111 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_AddRefResource, |
110 OnMsgAddRefResource) | 112 OnMsgAddRefResource) |
111 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_ReleaseResource, | 113 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_ReleaseResource, |
112 OnMsgReleaseResource) | 114 OnMsgReleaseResource) |
113 #endif | |
114 IPC_MESSAGE_UNHANDLED(handled = false) | 115 IPC_MESSAGE_UNHANDLED(handled = false) |
115 IPC_END_MESSAGE_MAP() | 116 IPC_END_MESSAGE_MAP() |
116 // TODO(brettw) handle bad messages! | 117 // TODO(brettw) handle bad messages! |
117 return handled; | 118 return handled; |
| 119 #endif |
118 } | 120 } |
119 | 121 |
120 #if !defined(OS_NACL) | 122 #if !defined(OS_NACL) |
121 void PPB_Core_Proxy::OnMsgAddRefResource(const HostResource& resource) { | 123 void PPB_Core_Proxy::OnMsgAddRefResource(const HostResource& resource) { |
122 ppb_core_impl_->AddRefResource(resource.host_resource()); | 124 ppb_core_impl_->AddRefResource(resource.host_resource()); |
123 } | 125 } |
124 | 126 |
125 void PPB_Core_Proxy::OnMsgReleaseResource(const HostResource& resource) { | 127 void PPB_Core_Proxy::OnMsgReleaseResource(const HostResource& resource) { |
126 ppb_core_impl_->ReleaseResource(resource.host_resource()); | 128 ppb_core_impl_->ReleaseResource(resource.host_resource()); |
127 } | 129 } |
128 #endif // !defined(OS_NACL) | 130 #endif // !defined(OS_NACL) |
129 | 131 |
130 } // namespace proxy | 132 } // namespace proxy |
131 } // namespace ppapi | 133 } // namespace ppapi |
OLD | NEW |