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

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

Issue 8344025: Add a new globals object for PPAPI tracking information. (Closed) Base URL: svn://chrome-svn/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
« no previous file with comments | « ppapi/proxy/ppb_flash_file_proxy.cc ('k') | ppapi/proxy/ppb_graphics_2d_proxy.cc » ('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/ppb_flash_proxy.h" 5 #include "ppapi/proxy/ppb_flash_proxy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "ppapi/c/dev/ppb_font_dev.h" 10 #include "ppapi/c/dev/ppb_font_dev.h"
11 #include "ppapi/c/dev/ppb_var_deprecated.h" 11 #include "ppapi/c/dev/ppb_var_deprecated.h"
12 #include "ppapi/c/pp_errors.h" 12 #include "ppapi/c/pp_errors.h"
13 #include "ppapi/c/pp_resource.h" 13 #include "ppapi/c/pp_resource.h"
14 #include "ppapi/c/private/ppb_flash.h" 14 #include "ppapi/c/private/ppb_flash.h"
15 #include "ppapi/proxy/host_dispatcher.h" 15 #include "ppapi/proxy/host_dispatcher.h"
16 #include "ppapi/proxy/plugin_dispatcher.h" 16 #include "ppapi/proxy/plugin_dispatcher.h"
17 #include "ppapi/proxy/plugin_resource_tracker.h"
18 #include "ppapi/proxy/ppapi_messages.h" 17 #include "ppapi/proxy/ppapi_messages.h"
19 #include "ppapi/proxy/proxy_module.h" 18 #include "ppapi/proxy/proxy_module.h"
20 #include "ppapi/proxy/serialized_var.h" 19 #include "ppapi/proxy/serialized_var.h"
20 #include "ppapi/shared_impl/ppapi_globals.h"
21 #include "ppapi/shared_impl/resource.h" 21 #include "ppapi/shared_impl/resource.h"
22 #include "ppapi/shared_impl/resource_tracker.h"
22 #include "ppapi/shared_impl/scoped_pp_resource.h" 23 #include "ppapi/shared_impl/scoped_pp_resource.h"
23 #include "ppapi/shared_impl/var.h" 24 #include "ppapi/shared_impl/var.h"
24 #include "ppapi/thunk/enter.h" 25 #include "ppapi/thunk/enter.h"
25 #include "ppapi/thunk/ppb_url_request_info_api.h" 26 #include "ppapi/thunk/ppb_url_request_info_api.h"
26 #include "ppapi/thunk/resource_creation_api.h" 27 #include "ppapi/thunk/resource_creation_api.h"
27 28
28 namespace ppapi { 29 namespace ppapi {
29 namespace proxy { 30 namespace proxy {
30 31
31 namespace { 32 namespace {
32 33
33 void SetInstanceAlwaysOnTop(PP_Instance pp_instance, PP_Bool on_top) { 34 void SetInstanceAlwaysOnTop(PP_Instance pp_instance, PP_Bool on_top) {
34 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(pp_instance); 35 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(pp_instance);
35 if (dispatcher) { 36 if (dispatcher) {
36 dispatcher->Send(new PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop( 37 dispatcher->Send(new PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop(
37 INTERFACE_ID_PPB_FLASH, pp_instance, on_top)); 38 INTERFACE_ID_PPB_FLASH, pp_instance, on_top));
38 } 39 }
39 } 40 }
40 41
41 PP_Bool DrawGlyphs(PP_Instance instance, 42 PP_Bool DrawGlyphs(PP_Instance instance,
42 PP_Resource pp_image_data, 43 PP_Resource pp_image_data,
43 const PP_FontDescription_Dev* font_desc, 44 const PP_FontDescription_Dev* font_desc,
44 uint32_t color, 45 uint32_t color,
45 PP_Point position, 46 PP_Point position,
46 PP_Rect clip, 47 PP_Rect clip,
47 const float transformation[3][3], 48 const float transformation[3][3],
48 uint32_t glyph_count, 49 uint32_t glyph_count,
49 const uint16_t glyph_indices[], 50 const uint16_t glyph_indices[],
50 const PP_Point glyph_advances[]) { 51 const PP_Point glyph_advances[]) {
51 Resource* image_data = PluginResourceTracker::GetInstance()->GetResource( 52 Resource* image_data =
52 pp_image_data); 53 PpapiGlobals::Get()->GetResourceTracker()->GetResource(pp_image_data);
53 if (!image_data) 54 if (!image_data)
54 return PP_FALSE; 55 return PP_FALSE;
55 // The instance parameter isn't strictly necessary but we check that it 56 // The instance parameter isn't strictly necessary but we check that it
56 // matches anyway. 57 // matches anyway.
57 if (image_data->pp_instance() != instance) 58 if (image_data->pp_instance() != instance)
58 return PP_FALSE; 59 return PP_FALSE;
59 60
60 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance( 61 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(
61 image_data->pp_instance()); 62 image_data->pp_instance());
62 if (!dispatcher) 63 if (!dispatcher)
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 306 }
306 307
307 void PPB_Flash_Proxy::OnMsgGetLocalTimeZoneOffset(PP_Instance instance, 308 void PPB_Flash_Proxy::OnMsgGetLocalTimeZoneOffset(PP_Instance instance,
308 PP_Time t, 309 PP_Time t,
309 double* result) { 310 double* result) {
310 *result = ppb_flash_impl_->GetLocalTimeZoneOffset(instance, t); 311 *result = ppb_flash_impl_->GetLocalTimeZoneOffset(instance, t);
311 } 312 }
312 313
313 } // namespace proxy 314 } // namespace proxy
314 } // namespace ppapi 315 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_flash_file_proxy.cc ('k') | ppapi/proxy/ppb_graphics_2d_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698