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 #ifndef PPAPI_THUNK_PPB_BROKER_API_H_ | 5 #ifndef PPAPI_THUNK_PPB_BROKER_API_H_ |
6 #define PPAPI_THUNK_PPB_BROKER_API_H_ | 6 #define PPAPI_THUNK_PPB_BROKER_API_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 10 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/pp_stdint.h" | 11 #include "ppapi/c/pp_stdint.h" |
| 12 #include "ppapi/shared_impl/singleton_resource_id.h" |
11 | 13 |
12 namespace ppapi { | 14 namespace ppapi { |
13 | 15 |
14 class TrackedCallback; | 16 class TrackedCallback; |
15 | 17 |
16 namespace thunk { | 18 namespace thunk { |
17 | 19 |
18 class PPB_Broker_API { | 20 class PPB_Broker_API { |
19 public: | 21 public: |
20 virtual ~PPB_Broker_API() {} | 22 virtual ~PPB_Broker_API() {} |
21 | 23 |
22 virtual int32_t Connect(scoped_refptr<TrackedCallback> connect_callback) = 0; | 24 virtual int32_t Connect(scoped_refptr<TrackedCallback> connect_callback) = 0; |
23 virtual int32_t GetHandle(int32_t* handle) = 0; | 25 virtual int32_t GetHandle(int32_t* handle) = 0; |
24 }; | 26 }; |
25 | 27 |
| 28 // TODO(raymes): Merge this into PPB_Broker_API when the PPB_Broker proxy is |
| 29 // refactored to the new resource model. The IsAllowed function should be |
| 30 // attached to the resource implementing the PPB_Broker_API. However in order to |
| 31 // implement this quickly, the function is added in a new instance API. |
| 32 class PPB_Broker_Instance_API { |
| 33 public: |
| 34 virtual ~PPB_Broker_Instance_API() {} |
| 35 |
| 36 virtual PP_Bool IsAllowed() = 0; |
| 37 |
| 38 static const SingletonResourceID kSingletonResourceID = BROKER_SINGLETON_ID; |
| 39 }; |
| 40 |
26 } // namespace thunk | 41 } // namespace thunk |
27 } // namespace ppapi | 42 } // namespace ppapi |
28 | 43 |
29 #endif // PPAPI_THUNK_PPB_BROKER_API_H_ | 44 #endif // PPAPI_THUNK_PPB_BROKER_API_H_ |
OLD | NEW |