Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Side by Side Diff: ppapi/thunk/ppb_instance_api.h

Issue 11359063: Refactor the way singleton-style resources are exposed via PPB_Instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/thunk/ppb_gamepad_thunk.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_INSTANCE_API_H_ 5 #ifndef PPAPI_THUNK_INSTANCE_API_H_
6 #define PPAPI_THUNK_INSTANCE_API_H_ 6 #define PPAPI_THUNK_INSTANCE_API_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ppapi/c/dev/ppb_console_dev.h" 10 #include "ppapi/c/dev/ppb_console_dev.h"
11 #include "ppapi/c/dev/ppb_text_input_dev.h" 11 #include "ppapi/c/dev/ppb_text_input_dev.h"
12 #include "ppapi/c/dev/ppb_url_util_dev.h" 12 #include "ppapi/c/dev/ppb_url_util_dev.h"
13 #include "ppapi/c/pp_bool.h" 13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_completion_callback.h" 14 #include "ppapi/c/pp_completion_callback.h"
15 #include "ppapi/c/pp_size.h" 15 #include "ppapi/c/pp_size.h"
16 #include "ppapi/c/pp_time.h" 16 #include "ppapi/c/pp_time.h"
17 #include "ppapi/c/ppb_audio_config.h" 17 #include "ppapi/c/ppb_audio_config.h"
18 #include "ppapi/c/ppb_gamepad.h" 18 #include "ppapi/c/ppb_gamepad.h"
19 #include "ppapi/c/ppb_instance.h" 19 #include "ppapi/c/ppb_instance.h"
20 #include "ppapi/c/ppb_mouse_cursor.h" 20 #include "ppapi/c/ppb_mouse_cursor.h"
21 #include "ppapi/c/private/pp_content_decryptor.h" 21 #include "ppapi/c/private/pp_content_decryptor.h"
22 #include "ppapi/c/private/ppb_instance_private.h" 22 #include "ppapi/c/private/ppb_instance_private.h"
23 #include "ppapi/shared_impl/api_id.h" 23 #include "ppapi/shared_impl/api_id.h"
24 #include "ppapi/shared_impl/resource.h"
25 #include "ppapi/shared_impl/singleton_resource_id.h"
24 26
25 // Windows headers interfere with this file. 27 // Windows headers interfere with this file.
26 #ifdef PostMessage 28 #ifdef PostMessage
27 #undef PostMessage 29 #undef PostMessage
28 #endif 30 #endif
29 31
30 struct PP_DecryptedBlockInfo; 32 struct PP_DecryptedBlockInfo;
31 struct PP_DecryptedFrameInfo; 33 struct PP_DecryptedFrameInfo;
32 34
33 namespace ppapi { 35 namespace ppapi {
34 36
37 class Resource;
35 class TrackedCallback; 38 class TrackedCallback;
36 struct ViewData; 39 struct ViewData;
37 40
38 namespace thunk { 41 namespace thunk {
39 42
40 class PPB_Flash_API; 43 class PPB_Flash_API;
41 class PPB_Flash_Clipboard_API;
42 class PPB_Flash_Functions_API;
43 class PPB_Gamepad_API;
44 44
45 class PPB_Instance_API { 45 class PPB_Instance_API {
46 public: 46 public:
47 virtual ~PPB_Instance_API() {} 47 virtual ~PPB_Instance_API() {}
48 48
49 virtual PP_Bool BindGraphics(PP_Instance instance, PP_Resource device) = 0; 49 virtual PP_Bool BindGraphics(PP_Instance instance, PP_Resource device) = 0;
50 virtual PP_Bool IsFullFrame(PP_Instance instance) = 0; 50 virtual PP_Bool IsFullFrame(PP_Instance instance) = 0;
51 51
52 // Not an exposed PPAPI function, this returns the internal view data struct. 52 // Not an exposed PPAPI function, this returns the internal view data struct.
53 virtual const ViewData* GetViewData(PP_Instance instance) = 0; 53 virtual const ViewData* GetViewData(PP_Instance instance) = 0;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // Font. 85 // Font.
86 virtual PP_Var GetFontFamilies(PP_Instance instance) = 0; 86 virtual PP_Var GetFontFamilies(PP_Instance instance) = 0;
87 87
88 // Fullscreen. 88 // Fullscreen.
89 virtual PP_Bool SetFullscreen(PP_Instance instance, 89 virtual PP_Bool SetFullscreen(PP_Instance instance,
90 PP_Bool fullscreen) = 0; 90 PP_Bool fullscreen) = 0;
91 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) = 0; 91 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) = 0;
92 92
93 // Flash (Deprecated for Flash_Functions). 93 // Flash (Deprecated for Flash_Functions).
94 virtual PPB_Flash_API* GetFlashAPI() = 0; 94 virtual PPB_Flash_API* GetFlashAPI() = 0;
95 // Flash_Functions
96 virtual PPB_Flash_Functions_API* GetFlashFunctionsAPI(
97 PP_Instance instance) = 0;
98 95
99 // Flash_Clipboard. 96 // This is an implementation-only function which grabs an instance of a
100 virtual PPB_Flash_Clipboard_API* GetFlashClipboardAPI( 97 // "singleton resource". These are used to implement instance interfaces
101 PP_Instance instance) = 0; 98 // (functions which are associated with the instance itself as opposed to a
102 99 // resource).
103 // Gamepad. 100 virtual Resource* GetSingletonResource(
104 virtual PPB_Gamepad_API* GetGamepadAPI(PP_Instance instance) = 0; 101 PP_Instance instance, SingletonResourceID id) = 0;
105 102
106 // InputEvent. 103 // InputEvent.
107 virtual int32_t RequestInputEvents(PP_Instance instance, 104 virtual int32_t RequestInputEvents(PP_Instance instance,
108 uint32_t event_classes) = 0; 105 uint32_t event_classes) = 0;
109 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, 106 virtual int32_t RequestFilteringInputEvents(PP_Instance instance,
110 uint32_t event_classes) = 0; 107 uint32_t event_classes) = 0;
111 virtual void ClearInputEventRequest(PP_Instance instance, 108 virtual void ClearInputEventRequest(PP_Instance instance,
112 uint32_t event_classes) = 0; 109 uint32_t event_classes) = 0;
113 virtual void ClosePendingUserGesture(PP_Instance instance, 110 virtual void ClosePendingUserGesture(PP_Instance instance,
114 PP_TimeTicks timestamp) = 0; 111 PP_TimeTicks timestamp) = 0;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 PP_URLComponents_Dev* components) = 0; 196 PP_URLComponents_Dev* components) = 0;
200 #endif // !defined(OS_NACL) 197 #endif // !defined(OS_NACL)
201 198
202 static const ApiID kApiID = API_ID_PPB_INSTANCE; 199 static const ApiID kApiID = API_ID_PPB_INSTANCE;
203 }; 200 };
204 201
205 } // namespace thunk 202 } // namespace thunk
206 } // namespace ppapi 203 } // namespace ppapi
207 204
208 #endif // PPAPI_THUNK_INSTANCE_API_H_ 205 #endif // PPAPI_THUNK_INSTANCE_API_H_
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_gamepad_thunk.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698