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

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

Issue 8316008: Add a new globals object for PPAPI tracking information. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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
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/ppb_instance_proxy.h" 5 #include "ppapi/proxy/ppb_instance_proxy.h"
6 6
7 #include "ppapi/c/dev/ppb_mouse_lock_dev.h" 7 #include "ppapi/c/dev/ppb_mouse_lock_dev.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/pp_var.h" 9 #include "ppapi/c/pp_var.h"
10 #include "ppapi/c/ppb_instance.h" 10 #include "ppapi/c/ppb_instance.h"
11 #include "ppapi/c/ppb_messaging.h" 11 #include "ppapi/c/ppb_messaging.h"
12 #include "ppapi/proxy/host_dispatcher.h" 12 #include "ppapi/proxy/host_dispatcher.h"
13 #include "ppapi/proxy/plugin_dispatcher.h" 13 #include "ppapi/proxy/plugin_dispatcher.h"
14 #include "ppapi/proxy/plugin_resource_tracker.h"
15 #include "ppapi/proxy/ppapi_messages.h" 14 #include "ppapi/proxy/ppapi_messages.h"
16 #include "ppapi/proxy/serialized_var.h" 15 #include "ppapi/proxy/serialized_var.h"
16 #include "ppapi/shared_impl/ppapi_globals.h"
17 #include "ppapi/shared_impl/url_util_impl.h" 17 #include "ppapi/shared_impl/url_util_impl.h"
18 #include "ppapi/thunk/enter.h" 18 #include "ppapi/thunk/enter.h"
19 #include "ppapi/thunk/thunk.h" 19 #include "ppapi/thunk/thunk.h"
20 20
21 // Windows headers interfere with this file. 21 // Windows headers interfere with this file.
22 #ifdef PostMessage 22 #ifdef PostMessage
23 #undef PostMessage 23 #undef PostMessage
24 #endif 24 #endif
25 25
26 using ppapi::thunk::EnterFunctionNoLock; 26 using ppapi::thunk::EnterFunctionNoLock;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 IPC_END_MESSAGE_MAP() 116 IPC_END_MESSAGE_MAP()
117 return handled; 117 return handled;
118 } 118 }
119 119
120 PPB_Instance_FunctionAPI* PPB_Instance_Proxy::AsPPB_Instance_FunctionAPI() { 120 PPB_Instance_FunctionAPI* PPB_Instance_Proxy::AsPPB_Instance_FunctionAPI() {
121 return this; 121 return this;
122 } 122 }
123 123
124 PP_Bool PPB_Instance_Proxy::BindGraphics(PP_Instance instance, 124 PP_Bool PPB_Instance_Proxy::BindGraphics(PP_Instance instance,
125 PP_Resource device) { 125 PP_Resource device) {
126 Resource* object = PluginResourceTracker::GetInstance()->GetResource(device); 126 Resource* object =
127 PpapiGlobals::Get()->GetResourceTracker()->GetResource(device);
127 if (!object || object->pp_instance() != instance) 128 if (!object || object->pp_instance() != instance)
128 return PP_FALSE; 129 return PP_FALSE;
129 130
130 PP_Bool result = PP_FALSE; 131 PP_Bool result = PP_FALSE;
131 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( 132 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics(
132 INTERFACE_ID_PPB_INSTANCE, instance, object->host_resource(), 133 INTERFACE_ID_PPB_INSTANCE, instance, object->host_resource(),
133 &result)); 134 &result));
134 return result; 135 return result;
135 } 136 }
136 137
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 SerializedVarReturnValue result) { 580 SerializedVarReturnValue result) {
580 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true); 581 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true);
581 if (enter.succeeded()) { 582 if (enter.succeeded()) {
582 result.Return(dispatcher(), 583 result.Return(dispatcher(),
583 enter.functions()->GetPluginInstanceURL(instance, NULL)); 584 enter.functions()->GetPluginInstanceURL(instance, NULL));
584 } 585 }
585 } 586 }
586 587
587 } // namespace proxy 588 } // namespace proxy
588 } // namespace ppapi 589 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698