• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef PPAPI_THUNK_PPB_BROKER_API_H_
6 #define PPAPI_THUNK_PPB_BROKER_API_H_
7 
8 #include "base/memory/ref_counted.h"
9 #include "ppapi/c/pp_bool.h"
10 #include "ppapi/c/pp_completion_callback.h"
11 #include "ppapi/c/pp_stdint.h"
12 #include "ppapi/shared_impl/singleton_resource_id.h"
13 
14 namespace ppapi {
15 
16 class TrackedCallback;
17 
18 namespace thunk {
19 
20 class PPB_Broker_API {
21  public:
~PPB_Broker_API()22   virtual ~PPB_Broker_API() {}
23 
24   virtual int32_t Connect(scoped_refptr<TrackedCallback> connect_callback) = 0;
25   virtual int32_t GetHandle(int32_t* handle) = 0;
26 };
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:
~PPB_Broker_Instance_API()34   virtual ~PPB_Broker_Instance_API() {}
35 
36   virtual PP_Bool IsAllowed() = 0;
37 
38   static const SingletonResourceID kSingletonResourceID = BROKER_SINGLETON_ID;
39 };
40 
41 }  // namespace thunk
42 }  // namespace ppapi
43 
44 #endif  // PPAPI_THUNK_PPB_BROKER_API_H_
45