| 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/broker_resource.h" | 5 #include "ppapi/proxy/broker_resource.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
| 8 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
| 9 | 11 |
| 10 namespace ppapi { | 12 namespace ppapi { |
| 11 namespace proxy { | 13 namespace proxy { |
| 12 | 14 |
| 13 BrokerResource::BrokerResource(Connection connection, PP_Instance instance) | 15 BrokerResource::BrokerResource(Connection connection, PP_Instance instance) |
| 14 : PluginResource(connection, instance) { | 16 : PluginResource(connection, instance) { |
| 15 SendCreate(BROWSER, PpapiHostMsg_Broker_Create()); | 17 SendCreate(BROWSER, PpapiHostMsg_Broker_Create()); |
| 16 } | 18 } |
| 17 | 19 |
| 18 BrokerResource::~BrokerResource() { | 20 BrokerResource::~BrokerResource() { |
| 19 } | 21 } |
| 20 | 22 |
| 21 thunk::PPB_Broker_Instance_API* BrokerResource::AsPPB_Broker_Instance_API() { | 23 thunk::PPB_Broker_Instance_API* BrokerResource::AsPPB_Broker_Instance_API() { |
| 22 return this; | 24 return this; |
| 23 } | 25 } |
| 24 | 26 |
| 25 PP_Bool BrokerResource::IsAllowed() { | 27 PP_Bool BrokerResource::IsAllowed() { |
| 26 int32_t result = | 28 int32_t result = |
| 27 SyncCall<IPC::Message>(BROWSER, PpapiHostMsg_Broker_IsAllowed()); | 29 SyncCall<IPC::Message>(BROWSER, PpapiHostMsg_Broker_IsAllowed()); |
| 28 return PP_FromBool(result == PP_OK); | 30 return PP_FromBool(result == PP_OK); |
| 29 } | 31 } |
| 30 | 32 |
| 31 } // namespace proxy | 33 } // namespace proxy |
| 32 } // namespace ppapi | 34 } // namespace ppapi |
| OLD | NEW |