| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PROXY_PPB_INSTANCE_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
| 10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
| 11 #include "ppapi/proxy/interface_proxy.h" | 11 #include "ppapi/proxy/interface_proxy.h" |
| 12 #include "ppapi/shared_impl/function_group_base.h" | 12 #include "ppapi/shared_impl/function_group_base.h" |
| 13 #include "ppapi/shared_impl/host_resource.h" | 13 #include "ppapi/shared_impl/host_resource.h" |
| 14 #include "ppapi/shared_impl/instance_impl.h" | 14 #include "ppapi/shared_impl/instance_impl.h" |
| 15 #include "ppapi/thunk/ppb_instance_api.h" | 15 #include "ppapi/thunk/ppb_instance_api.h" |
| 16 | 16 |
| 17 namespace ppapi { | 17 namespace ppapi { |
| 18 namespace proxy { | 18 namespace proxy { |
| 19 | 19 |
| 20 class SerializedVarReceiveInput; | 20 class SerializedVarReceiveInput; |
| 21 class SerializedVarOutParam; | 21 class SerializedVarOutParam; |
| 22 class SerializedVarReturnValue; | 22 class SerializedVarReturnValue; |
| 23 | 23 |
| 24 class PPB_Instance_Proxy : public InterfaceProxy, | 24 class PPB_Instance_Proxy : public InterfaceProxy, |
| 25 public ppapi::InstanceImpl, | 25 public ppapi::InstanceImpl, |
| 26 public ppapi::FunctionGroupBase, | |
| 27 public ppapi::thunk::PPB_Instance_FunctionAPI { | 26 public ppapi::thunk::PPB_Instance_FunctionAPI { |
| 28 public: | 27 public: |
| 29 PPB_Instance_Proxy(Dispatcher* dispatcher, const void* target_interface); | 28 PPB_Instance_Proxy(Dispatcher* dispatcher); |
| 30 virtual ~PPB_Instance_Proxy(); | 29 virtual ~PPB_Instance_Proxy(); |
| 31 | 30 |
| 32 static const Info* GetInfo0_5(); | |
| 33 static const Info* GetInfo1_0(); | |
| 34 static const Info* GetInfoMessaging(); | |
| 35 static const Info* GetInfoPrivate(); | 31 static const Info* GetInfoPrivate(); |
| 36 static const Info* GetInfoFullscreen(); | 32 static const Info* GetInfoFullscreen(); |
| 37 | 33 |
| 38 // InterfaceProxy implementation. | 34 // InterfaceProxy implementation. |
| 39 virtual bool OnMessageReceived(const IPC::Message& msg); | 35 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 40 | 36 |
| 41 // FunctionGroupBase overrides. | 37 // FunctionGroupBase overrides. |
| 42 ppapi::thunk::PPB_Instance_FunctionAPI* AsPPB_Instance_FunctionAPI() OVERRIDE; | 38 ppapi::thunk::PPB_Instance_FunctionAPI* AsPPB_Instance_FunctionAPI() OVERRIDE; |
| 43 | 39 |
| 44 // PPB_Instance_FunctionAPI implementation. | 40 // PPB_Instance_FunctionAPI implementation. |
| 45 virtual PP_Bool BindGraphics(PP_Instance instance, | 41 virtual PP_Bool BindGraphics(PP_Instance instance, |
| 46 PP_Resource device) OVERRIDE; | 42 PP_Resource device) OVERRIDE; |
| 47 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; | 43 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; |
| 48 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; | 44 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; |
| 49 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; | 45 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; |
| 50 virtual PP_Var ExecuteScript(PP_Instance instance, | 46 virtual PP_Var ExecuteScript(PP_Instance instance, |
| 51 PP_Var script, | 47 PP_Var script, |
| 52 PP_Var* exception) OVERRIDE; | 48 PP_Var* exception) OVERRIDE; |
| 49 virtual void Log(PP_Instance instance, |
| 50 int log_level, |
| 51 PP_Var value) OVERRIDE; |
| 52 virtual void LogWithSource(PP_Instance instance, |
| 53 int log_level, |
| 54 PP_Var source, |
| 55 PP_Var value) OVERRIDE; |
| 53 virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE; | 56 virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE; |
| 54 virtual PP_Bool SetFullscreen(PP_Instance instance, | 57 virtual PP_Bool SetFullscreen(PP_Instance instance, |
| 55 PP_Bool fullscreen) OVERRIDE; | 58 PP_Bool fullscreen) OVERRIDE; |
| 56 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) OVERRIDE; | 59 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) OVERRIDE; |
| 57 virtual int32_t RequestInputEvents(PP_Instance instance, | 60 virtual int32_t RequestInputEvents(PP_Instance instance, |
| 58 uint32_t event_classes) OVERRIDE; | 61 uint32_t event_classes) OVERRIDE; |
| 59 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, | 62 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, |
| 60 uint32_t event_classes) OVERRIDE; | 63 uint32_t event_classes) OVERRIDE; |
| 61 virtual void ClearInputEventRequest(PP_Instance instance, | 64 virtual void ClearInputEventRequest(PP_Instance instance, |
| 62 uint32_t event_classes) OVERRIDE; | 65 uint32_t event_classes) OVERRIDE; |
| 63 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; | 66 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; |
| 64 virtual void ZoomLimitsChanged(PP_Instance instance, | 67 virtual void ZoomLimitsChanged(PP_Instance instance, |
| 65 double minimum_factor, | 68 double minimum_factor, |
| 66 double maximium_factor) OVERRIDE; | 69 double maximium_factor) OVERRIDE; |
| 67 virtual void SubscribeToPolicyUpdates(PP_Instance instance) OVERRIDE; | 70 virtual void SubscribeToPolicyUpdates(PP_Instance instance) OVERRIDE; |
| 68 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; | 71 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; |
| 69 | 72 |
| 73 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_INSTANCE; |
| 74 |
| 70 private: | 75 private: |
| 71 // Message handlers. | 76 // Message handlers. |
| 72 void OnMsgGetWindowObject(PP_Instance instance, | 77 void OnMsgGetWindowObject(PP_Instance instance, |
| 73 SerializedVarReturnValue result); | 78 SerializedVarReturnValue result); |
| 74 void OnMsgGetOwnerElementObject(PP_Instance instance, | 79 void OnMsgGetOwnerElementObject(PP_Instance instance, |
| 75 SerializedVarReturnValue result); | 80 SerializedVarReturnValue result); |
| 76 void OnMsgBindGraphics(PP_Instance instance, | 81 void OnMsgBindGraphics(PP_Instance instance, |
| 77 const ppapi::HostResource& device, | 82 const ppapi::HostResource& device, |
| 78 PP_Bool* result); | 83 PP_Bool* result); |
| 79 void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); | 84 void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); |
| 80 void OnMsgExecuteScript(PP_Instance instance, | 85 void OnMsgExecuteScript(PP_Instance instance, |
| 81 SerializedVarReceiveInput script, | 86 SerializedVarReceiveInput script, |
| 82 SerializedVarOutParam out_exception, | 87 SerializedVarOutParam out_exception, |
| 83 SerializedVarReturnValue result); | 88 SerializedVarReturnValue result); |
| 89 void OnMsgLog(PP_Instance instance, |
| 90 int log_level, |
| 91 SerializedVarReceiveInput value); |
| 92 void OnMsgLogWithSource(PP_Instance instance, |
| 93 int log_level, |
| 94 SerializedVarReceiveInput source, |
| 95 SerializedVarReceiveInput value); |
| 84 void OnMsgSetFullscreen(PP_Instance instance, | 96 void OnMsgSetFullscreen(PP_Instance instance, |
| 85 PP_Bool fullscreen, | 97 PP_Bool fullscreen, |
| 86 PP_Bool* result); | 98 PP_Bool* result); |
| 87 void OnMsgGetScreenSize(PP_Instance instance, | 99 void OnMsgGetScreenSize(PP_Instance instance, |
| 88 PP_Bool* result, | 100 PP_Bool* result, |
| 89 PP_Size* size); | 101 PP_Size* size); |
| 90 void OnMsgRequestInputEvents(PP_Instance instance, | 102 void OnMsgRequestInputEvents(PP_Instance instance, |
| 91 bool is_filtering, | 103 bool is_filtering, |
| 92 uint32_t event_classes); | 104 uint32_t event_classes); |
| 93 void OnMsgClearInputEvents(PP_Instance instance, | 105 void OnMsgClearInputEvents(PP_Instance instance, |
| 94 uint32_t event_classes); | 106 uint32_t event_classes); |
| 95 void OnMsgPostMessage(PP_Instance instance, | 107 void OnMsgPostMessage(PP_Instance instance, |
| 96 SerializedVarReceiveInput message); | 108 SerializedVarReceiveInput message); |
| 97 }; | 109 }; |
| 98 | 110 |
| 99 } // namespace proxy | 111 } // namespace proxy |
| 100 } // namespace ppapi | 112 } // namespace ppapi |
| 101 | 113 |
| 102 #endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ | 114 #endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
| OLD | NEW |