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

Side by Side Diff: ppapi/proxy/ppp_instance_private_proxy.cc

Issue 7740038: Use macros to define pepper interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New patch Created 9 years, 3 months 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/proxy/ppp_instance_private_proxy.h ('k') | ppapi/proxy/ppp_instance_proxy.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) 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 #include "ppapi/proxy/ppp_instance_private_proxy.h" 5 #include "ppapi/proxy/ppp_instance_private_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ppapi/c/pp_var.h" 9 #include "ppapi/c/pp_var.h"
10 #include "ppapi/c/private/ppp_instance_private.h" 10 #include "ppapi/c/private/ppp_instance_private.h"
(...skipping 12 matching lines...) Expand all
23 ReceiveSerializedVarReturnValue result; 23 ReceiveSerializedVarReturnValue result;
24 dispatcher->Send(new PpapiMsg_PPPInstancePrivate_GetInstanceObject( 24 dispatcher->Send(new PpapiMsg_PPPInstancePrivate_GetInstanceObject(
25 INTERFACE_ID_PPP_INSTANCE_PRIVATE, instance, &result)); 25 INTERFACE_ID_PPP_INSTANCE_PRIVATE, instance, &result));
26 return result.Return(dispatcher); 26 return result.Return(dispatcher);
27 } 27 }
28 28
29 static const PPP_Instance_Private instance_private_interface = { 29 static const PPP_Instance_Private instance_private_interface = {
30 &GetInstanceObject 30 &GetInstanceObject
31 }; 31 };
32 32
33 InterfaceProxy* CreateInstancePrivateProxy(Dispatcher* dispatcher, 33 InterfaceProxy* CreateInstancePrivateProxy(Dispatcher* dispatcher) {
34 const void* target_interface) { 34 return new PPP_Instance_Private_Proxy(dispatcher);
35 return new PPP_Instance_Private_Proxy(dispatcher, target_interface);
36 } 35 }
37 36
38 } // namespace 37 } // namespace
39 38
40 PPP_Instance_Private_Proxy::PPP_Instance_Private_Proxy( 39 PPP_Instance_Private_Proxy::PPP_Instance_Private_Proxy(Dispatcher* dispatcher)
41 Dispatcher* dispatcher, const void* target_interface) 40 : InterfaceProxy(dispatcher),
42 : InterfaceProxy(dispatcher, target_interface) { 41 ppp_instance_private_impl_(NULL) {
42 if (dispatcher->IsPlugin()) {
43 ppp_instance_private_impl_ = static_cast<const PPP_Instance_Private*>(
44 dispatcher->local_get_interface()(PPP_INSTANCE_PRIVATE_INTERFACE));
45 }
43 } 46 }
44 47
45 PPP_Instance_Private_Proxy::~PPP_Instance_Private_Proxy() { 48 PPP_Instance_Private_Proxy::~PPP_Instance_Private_Proxy() {
46 } 49 }
47 50
48 // static 51 // static
49 const InterfaceProxy::Info* PPP_Instance_Private_Proxy::GetInfo() { 52 const InterfaceProxy::Info* PPP_Instance_Private_Proxy::GetInfo() {
50 static const Info info = { 53 static const Info info = {
51 &instance_private_interface, 54 &instance_private_interface,
52 PPP_INSTANCE_PRIVATE_INTERFACE, 55 PPP_INSTANCE_PRIVATE_INTERFACE,
(...skipping 11 matching lines...) Expand all
64 OnMsgGetInstanceObject) 67 OnMsgGetInstanceObject)
65 IPC_MESSAGE_UNHANDLED(handled = false) 68 IPC_MESSAGE_UNHANDLED(handled = false)
66 IPC_END_MESSAGE_MAP() 69 IPC_END_MESSAGE_MAP()
67 return handled; 70 return handled;
68 } 71 }
69 72
70 void PPP_Instance_Private_Proxy::OnMsgGetInstanceObject( 73 void PPP_Instance_Private_Proxy::OnMsgGetInstanceObject(
71 PP_Instance instance, 74 PP_Instance instance,
72 SerializedVarReturnValue result) { 75 SerializedVarReturnValue result) {
73 result.Return(dispatcher(), 76 result.Return(dispatcher(),
74 ppp_instance_private_target()->GetInstanceObject(instance)); 77 ppp_instance_private_impl_->GetInstanceObject(instance));
75 } 78 }
76 79
77 } // namespace proxy 80 } // namespace proxy
78 } // namespace ppapi 81 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppp_instance_private_proxy.h ('k') | ppapi/proxy/ppp_instance_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698