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

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

Issue 7844018: Revert 100748 - This patch tries to remove most of the manual registration for Pepper interfaces,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 return new PPP_Instance_Private_Proxy(dispatcher); 34 const void* target_interface) {
35 return new PPP_Instance_Private_Proxy(dispatcher, target_interface);
35 } 36 }
36 37
37 } // namespace 38 } // namespace
38 39
39 PPP_Instance_Private_Proxy::PPP_Instance_Private_Proxy(Dispatcher* dispatcher) 40 PPP_Instance_Private_Proxy::PPP_Instance_Private_Proxy(
40 : InterfaceProxy(dispatcher), 41 Dispatcher* dispatcher, const void* target_interface)
41 ppp_instance_private_impl_(NULL) { 42 : InterfaceProxy(dispatcher, target_interface) {
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 }
46 } 43 }
47 44
48 PPP_Instance_Private_Proxy::~PPP_Instance_Private_Proxy() { 45 PPP_Instance_Private_Proxy::~PPP_Instance_Private_Proxy() {
49 } 46 }
50 47
51 // static 48 // static
52 const InterfaceProxy::Info* PPP_Instance_Private_Proxy::GetInfo() { 49 const InterfaceProxy::Info* PPP_Instance_Private_Proxy::GetInfo() {
53 static const Info info = { 50 static const Info info = {
54 &instance_private_interface, 51 &instance_private_interface,
55 PPP_INSTANCE_PRIVATE_INTERFACE, 52 PPP_INSTANCE_PRIVATE_INTERFACE,
(...skipping 11 matching lines...) Expand all
67 OnMsgGetInstanceObject) 64 OnMsgGetInstanceObject)
68 IPC_MESSAGE_UNHANDLED(handled = false) 65 IPC_MESSAGE_UNHANDLED(handled = false)
69 IPC_END_MESSAGE_MAP() 66 IPC_END_MESSAGE_MAP()
70 return handled; 67 return handled;
71 } 68 }
72 69
73 void PPP_Instance_Private_Proxy::OnMsgGetInstanceObject( 70 void PPP_Instance_Private_Proxy::OnMsgGetInstanceObject(
74 PP_Instance instance, 71 PP_Instance instance,
75 SerializedVarReturnValue result) { 72 SerializedVarReturnValue result) {
76 result.Return(dispatcher(), 73 result.Return(dispatcher(),
77 ppp_instance_private_impl_->GetInstanceObject(instance)); 74 ppp_instance_private_target()->GetInstanceObject(instance));
78 } 75 }
79 76
80 } // namespace proxy 77 } // namespace proxy
81 } // namespace ppapi 78 } // 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