OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "ppapi/c/dev/ppb_font_dev.h" | 15 #include "ppapi/c/dev/ppb_font_dev.h" |
16 #include "ppapi/c/dev/ppb_var_deprecated.h" | 16 #include "ppapi/c/dev/ppb_var_deprecated.h" |
17 #include "ppapi/c/pp_errors.h" | 17 #include "ppapi/c/pp_errors.h" |
18 #include "ppapi/c/pp_resource.h" | 18 #include "ppapi/c/pp_resource.h" |
19 #include "ppapi/c/private/ppb_flash.h" | 19 #include "ppapi/c/private/ppb_flash.h" |
20 #include "ppapi/c/private/ppb_flash_print.h" | 20 #include "ppapi/c/private/ppb_flash_print.h" |
21 #include "ppapi/proxy/host_dispatcher.h" | 21 #include "ppapi/proxy/host_dispatcher.h" |
22 #include "ppapi/proxy/pepper_file_messages.h" | |
23 #include "ppapi/proxy/plugin_dispatcher.h" | 22 #include "ppapi/proxy/plugin_dispatcher.h" |
24 #include "ppapi/proxy/plugin_globals.h" | 23 #include "ppapi/proxy/plugin_globals.h" |
25 #include "ppapi/proxy/ppapi_messages.h" | 24 #include "ppapi/proxy/ppapi_messages.h" |
26 #include "ppapi/proxy/proxy_module.h" | 25 #include "ppapi/proxy/proxy_module.h" |
27 #include "ppapi/proxy/serialized_var.h" | 26 #include "ppapi/proxy/serialized_var.h" |
28 #include "ppapi/shared_impl/dir_contents.h" | |
29 #include "ppapi/shared_impl/file_type_conversion.h" | |
30 #include "ppapi/shared_impl/ppapi_globals.h" | 27 #include "ppapi/shared_impl/ppapi_globals.h" |
31 #include "ppapi/shared_impl/proxy_lock.h" | 28 #include "ppapi/shared_impl/proxy_lock.h" |
32 #include "ppapi/shared_impl/resource.h" | 29 #include "ppapi/shared_impl/resource.h" |
33 #include "ppapi/shared_impl/resource_tracker.h" | 30 #include "ppapi/shared_impl/resource_tracker.h" |
34 #include "ppapi/shared_impl/scoped_pp_resource.h" | 31 #include "ppapi/shared_impl/scoped_pp_resource.h" |
35 #include "ppapi/shared_impl/time_conversion.h" | 32 #include "ppapi/shared_impl/time_conversion.h" |
36 #include "ppapi/shared_impl/var.h" | 33 #include "ppapi/shared_impl/var.h" |
37 #include "ppapi/shared_impl/var_tracker.h" | 34 #include "ppapi/shared_impl/var_tracker.h" |
38 #include "ppapi/thunk/enter.h" | 35 #include "ppapi/thunk/enter.h" |
39 #include "ppapi/thunk/ppb_instance_api.h" | 36 #include "ppapi/thunk/ppb_instance_api.h" |
40 #include "ppapi/thunk/ppb_url_request_info_api.h" | 37 #include "ppapi/thunk/ppb_url_request_info_api.h" |
41 #include "ppapi/thunk/resource_creation_api.h" | 38 #include "ppapi/thunk/resource_creation_api.h" |
42 | 39 |
43 using ppapi::thunk::EnterInstanceNoLock; | 40 using ppapi::thunk::EnterInstanceNoLock; |
44 using ppapi::thunk::EnterResourceNoLock; | 41 using ppapi::thunk::EnterResourceNoLock; |
45 | 42 |
46 namespace ppapi { | 43 namespace ppapi { |
47 namespace proxy { | 44 namespace proxy { |
48 | 45 |
49 namespace { | 46 namespace { |
50 | 47 |
51 // Returns true if |t1| and |t2| are times in the same minute. | 48 // Returns true if |t1| and |t2| are times in the same minute. |
52 bool InSameMinute(PP_Time t1, PP_Time t2) { | 49 bool InSameMinute(PP_Time t1, PP_Time t2) { |
53 return floor(t1 / 60.0) == floor(t2 / 60.0); | 50 return floor(t1 / 60.0) == floor(t2 / 60.0); |
54 } | 51 } |
55 | 52 |
56 IPC::PlatformFileForTransit PlatformFileToPlatformFileForTransit( | |
57 Dispatcher* dispatcher, | |
58 int32_t* error, | |
59 base::PlatformFile file) { | |
60 if (*error != PP_OK) | |
61 return IPC::InvalidPlatformFileForTransit(); | |
62 IPC::PlatformFileForTransit out_handle = | |
63 dispatcher->ShareHandleWithRemote(file, true); | |
64 if (out_handle == IPC::InvalidPlatformFileForTransit()) | |
65 *error = PP_ERROR_NOACCESS; | |
66 return out_handle; | |
67 } | |
68 | |
69 void InvokePrinting(PP_Instance instance) { | 53 void InvokePrinting(PP_Instance instance) { |
70 ProxyAutoLock lock; | 54 ProxyAutoLock lock; |
71 | 55 |
72 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 56 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
73 if (dispatcher) { | 57 if (dispatcher) { |
74 dispatcher->Send(new PpapiHostMsg_PPBFlash_InvokePrinting( | 58 dispatcher->Send(new PpapiHostMsg_PPBFlash_InvokePrinting( |
75 API_ID_PPB_FLASH, instance)); | 59 API_ID_PPB_FLASH, instance)); |
76 } | 60 } |
77 } | 61 } |
78 | 62 |
(...skipping 25 matching lines...) Expand all Loading... |
104 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) | 88 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) |
105 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, | 89 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, |
106 OnHostMsgSetInstanceAlwaysOnTop) | 90 OnHostMsgSetInstanceAlwaysOnTop) |
107 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DrawGlyphs, | 91 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DrawGlyphs, |
108 OnHostMsgDrawGlyphs) | 92 OnHostMsgDrawGlyphs) |
109 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_Navigate, OnHostMsgNavigate) | 93 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_Navigate, OnHostMsgNavigate) |
110 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetLocalTimeZoneOffset, | 94 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetLocalTimeZoneOffset, |
111 OnHostMsgGetLocalTimeZoneOffset) | 95 OnHostMsgGetLocalTimeZoneOffset) |
112 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_IsRectTopmost, | 96 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_IsRectTopmost, |
113 OnHostMsgIsRectTopmost) | 97 OnHostMsgIsRectTopmost) |
114 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_OpenFileRef, | |
115 OnHostMsgOpenFileRef) | |
116 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QueryFileRef, | |
117 OnHostMsgQueryFileRef) | |
118 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_InvokePrinting, | 98 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_InvokePrinting, |
119 OnHostMsgInvokePrinting) | 99 OnHostMsgInvokePrinting) |
120 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetSetting, | 100 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetSetting, |
121 OnHostMsgGetSetting) | 101 OnHostMsgGetSetting) |
122 IPC_MESSAGE_UNHANDLED(handled = false) | 102 IPC_MESSAGE_UNHANDLED(handled = false) |
123 IPC_END_MESSAGE_MAP() | 103 IPC_END_MESSAGE_MAP() |
124 // TODO(brettw) handle bad messages! | 104 // TODO(brettw) handle bad messages! |
125 return handled; | 105 return handled; |
126 } | 106 } |
127 | 107 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 case PP_FLASHSETTING_LSORESTRICTIONS: { | 253 case PP_FLASHSETTING_LSORESTRICTIONS: { |
274 ReceiveSerializedVarReturnValue result; | 254 ReceiveSerializedVarReturnValue result; |
275 dispatcher()->Send(new PpapiHostMsg_PPBFlash_GetSetting( | 255 dispatcher()->Send(new PpapiHostMsg_PPBFlash_GetSetting( |
276 API_ID_PPB_FLASH, instance, setting, &result)); | 256 API_ID_PPB_FLASH, instance, setting, &result)); |
277 return result.Return(dispatcher()); | 257 return result.Return(dispatcher()); |
278 } | 258 } |
279 } | 259 } |
280 return PP_MakeUndefined(); | 260 return PP_MakeUndefined(); |
281 } | 261 } |
282 | 262 |
283 bool PPB_Flash_Proxy::CreateThreadAdapterForInstance(PP_Instance instance) { | |
284 return true; | |
285 } | |
286 | |
287 void PPB_Flash_Proxy::ClearThreadAdapterForInstance(PP_Instance instance) { | |
288 } | |
289 | |
290 int32_t PPB_Flash_Proxy::OpenFile(PP_Instance, | |
291 const char* path, | |
292 int32_t mode, | |
293 PP_FileHandle* file) { | |
294 int flags = 0; | |
295 if (!path || | |
296 !ppapi::PepperFileOpenFlagsToPlatformFileFlags(mode, &flags) || | |
297 !file) | |
298 return PP_ERROR_BADARGUMENT; | |
299 | |
300 base::PlatformFileError error; | |
301 IPC::PlatformFileForTransit transit_file; | |
302 ppapi::PepperFilePath pepper_path(ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, | |
303 FilePath::FromUTF8Unsafe(path)); | |
304 | |
305 if (PluginGlobals::Get()->GetBrowserSender()->Send( | |
306 new PepperFileMsg_OpenFile(pepper_path, flags, | |
307 &error, &transit_file))) { | |
308 *file = IPC::PlatformFileForTransitToPlatformFile(transit_file); | |
309 } else { | |
310 *file = base::kInvalidPlatformFileValue; | |
311 error = base::PLATFORM_FILE_ERROR_FAILED; | |
312 } | |
313 | |
314 return ppapi::PlatformFileErrorToPepperError(error); | |
315 } | |
316 | |
317 int32_t PPB_Flash_Proxy::RenameFile(PP_Instance, | |
318 const char* from_path, | |
319 const char* to_path) { | |
320 base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; | |
321 ppapi::PepperFilePath pepper_from(ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, | |
322 FilePath::FromUTF8Unsafe(from_path)); | |
323 ppapi::PepperFilePath pepper_to(ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, | |
324 FilePath::FromUTF8Unsafe(to_path)); | |
325 | |
326 PluginGlobals::Get()->GetBrowserSender()->Send( | |
327 new PepperFileMsg_RenameFile(pepper_from, pepper_to, &error)); | |
328 | |
329 return ppapi::PlatformFileErrorToPepperError(error); | |
330 } | |
331 | |
332 int32_t PPB_Flash_Proxy::DeleteFileOrDir(PP_Instance, | |
333 const char* path, | |
334 PP_Bool recursive) { | |
335 base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; | |
336 ppapi::PepperFilePath pepper_path(ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, | |
337 FilePath::FromUTF8Unsafe(path)); | |
338 | |
339 PluginGlobals::Get()->GetBrowserSender()->Send( | |
340 new PepperFileMsg_DeleteFileOrDir(pepper_path, | |
341 PP_ToBool(recursive), | |
342 &error)); | |
343 | |
344 return ppapi::PlatformFileErrorToPepperError(error); | |
345 } | |
346 | |
347 int32_t PPB_Flash_Proxy::CreateDir(PP_Instance, const char* path) { | |
348 base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; | |
349 ppapi::PepperFilePath pepper_path(ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, | |
350 FilePath::FromUTF8Unsafe(path)); | |
351 | |
352 PluginGlobals::Get()->GetBrowserSender()->Send( | |
353 new PepperFileMsg_CreateDir(pepper_path, &error)); | |
354 | |
355 return ppapi::PlatformFileErrorToPepperError(error); | |
356 } | |
357 | |
358 int32_t PPB_Flash_Proxy::QueryFile(PP_Instance, | |
359 const char* path, | |
360 PP_FileInfo* info) { | |
361 base::PlatformFileInfo file_info; | |
362 base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; | |
363 ppapi::PepperFilePath pepper_path(ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, | |
364 FilePath::FromUTF8Unsafe(path)); | |
365 | |
366 PluginGlobals::Get()->GetBrowserSender()->Send( | |
367 new PepperFileMsg_QueryFile(pepper_path, &file_info, &error)); | |
368 | |
369 if (error == base::PLATFORM_FILE_OK) { | |
370 info->size = file_info.size; | |
371 info->creation_time = TimeToPPTime(file_info.creation_time); | |
372 info->last_access_time = TimeToPPTime(file_info.last_accessed); | |
373 info->last_modified_time = TimeToPPTime(file_info.last_modified); | |
374 info->system_type = PP_FILESYSTEMTYPE_EXTERNAL; | |
375 if (file_info.is_directory) | |
376 info->type = PP_FILETYPE_DIRECTORY; | |
377 else | |
378 info->type = PP_FILETYPE_REGULAR; | |
379 } | |
380 | |
381 return ppapi::PlatformFileErrorToPepperError(error); | |
382 } | |
383 | |
384 int32_t PPB_Flash_Proxy::GetDirContents(PP_Instance, | |
385 const char* path, | |
386 PP_DirContents_Dev** contents) { | |
387 ppapi::DirContents entries; | |
388 base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; | |
389 ppapi::PepperFilePath pepper_path(ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, | |
390 FilePath::FromUTF8Unsafe(path)); | |
391 | |
392 PluginGlobals::Get()->GetBrowserSender()->Send( | |
393 new PepperFileMsg_GetDirContents(pepper_path, &entries, &error)); | |
394 | |
395 if (error == base::PLATFORM_FILE_OK) { | |
396 // Copy the serialized dir entries to the output struct. | |
397 *contents = new PP_DirContents_Dev; | |
398 (*contents)->count = static_cast<int32_t>(entries.size()); | |
399 (*contents)->entries = new PP_DirEntry_Dev[entries.size()]; | |
400 for (size_t i = 0; i < entries.size(); i++) { | |
401 const ppapi::DirEntry& source = entries[i]; | |
402 PP_DirEntry_Dev* dest = &(*contents)->entries[i]; | |
403 std::string name = source.name.AsUTF8Unsafe(); | |
404 char* name_copy = new char[name.size() + 1]; | |
405 memcpy(name_copy, name.c_str(), name.size() + 1); | |
406 dest->name = name_copy; | |
407 dest->is_dir = PP_FromBool(source.is_dir); | |
408 } | |
409 } | |
410 | |
411 return ppapi::PlatformFileErrorToPepperError(error); | |
412 } | |
413 | |
414 int32_t PPB_Flash_Proxy::CreateTemporaryFile(PP_Instance instance, | |
415 PP_FileHandle* file) { | |
416 if (!file) | |
417 return PP_ERROR_BADARGUMENT; | |
418 | |
419 base::PlatformFileError error; | |
420 IPC::PlatformFileForTransit transit_file; | |
421 | |
422 if (PluginGlobals::Get()->GetBrowserSender()->Send( | |
423 new PepperFileMsg_CreateTemporaryFile(&error, &transit_file))) { | |
424 *file = IPC::PlatformFileForTransitToPlatformFile(transit_file); | |
425 } else { | |
426 error = base::PLATFORM_FILE_ERROR_FAILED; | |
427 *file = base::kInvalidPlatformFileValue; | |
428 } | |
429 | |
430 return ppapi::PlatformFileErrorToPepperError(error); | |
431 } | |
432 | |
433 int32_t PPB_Flash_Proxy::OpenFileRef(PP_Instance instance, | |
434 PP_Resource file_ref_id, | |
435 int32_t mode, | |
436 PP_FileHandle* file) { | |
437 EnterResourceNoLock<thunk::PPB_FileRef_API> enter(file_ref_id, true); | |
438 if (enter.failed()) | |
439 return PP_ERROR_BADRESOURCE; | |
440 | |
441 int32_t result = PP_ERROR_FAILED; | |
442 IPC::PlatformFileForTransit transit; | |
443 dispatcher()->Send(new PpapiHostMsg_PPBFlash_OpenFileRef( | |
444 API_ID_PPB_FLASH, instance, enter.resource()->host_resource(), mode, | |
445 &transit, &result)); | |
446 *file = IPC::PlatformFileForTransitToPlatformFile(transit); | |
447 return result; | |
448 } | |
449 | |
450 int32_t PPB_Flash_Proxy::QueryFileRef(PP_Instance instance, | |
451 PP_Resource file_ref_id, | |
452 PP_FileInfo* info) { | |
453 EnterResourceNoLock<thunk::PPB_FileRef_API> enter(file_ref_id, true); | |
454 if (enter.failed()) | |
455 return PP_ERROR_BADRESOURCE; | |
456 | |
457 int32_t result = PP_ERROR_FAILED; | |
458 dispatcher()->Send(new PpapiHostMsg_PPBFlash_QueryFileRef( | |
459 API_ID_PPB_FLASH, instance, enter.resource()->host_resource(), info, | |
460 &result)); | |
461 return result; | |
462 } | |
463 | |
464 void PPB_Flash_Proxy::OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, | 263 void PPB_Flash_Proxy::OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, |
465 PP_Bool on_top) { | 264 PP_Bool on_top) { |
466 EnterInstanceNoLock enter(instance); | 265 EnterInstanceNoLock enter(instance); |
467 if (enter.succeeded()) | 266 if (enter.succeeded()) |
468 enter.functions()->GetFlashAPI()->SetInstanceAlwaysOnTop(instance, on_top); | 267 enter.functions()->GetFlashAPI()->SetInstanceAlwaysOnTop(instance, on_top); |
469 } | 268 } |
470 | 269 |
471 void PPB_Flash_Proxy::OnHostMsgDrawGlyphs( | 270 void PPB_Flash_Proxy::OnHostMsgDrawGlyphs( |
472 PP_Instance instance, | 271 PP_Instance instance, |
473 const PPBFlash_DrawGlyphs_Params& params, | 272 const PPBFlash_DrawGlyphs_Params& params, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 void PPB_Flash_Proxy::OnHostMsgIsRectTopmost(PP_Instance instance, | 343 void PPB_Flash_Proxy::OnHostMsgIsRectTopmost(PP_Instance instance, |
545 PP_Rect rect, | 344 PP_Rect rect, |
546 PP_Bool* result) { | 345 PP_Bool* result) { |
547 EnterInstanceNoLock enter(instance); | 346 EnterInstanceNoLock enter(instance); |
548 if (enter.succeeded()) | 347 if (enter.succeeded()) |
549 *result = enter.functions()->GetFlashAPI()->IsRectTopmost(instance, &rect); | 348 *result = enter.functions()->GetFlashAPI()->IsRectTopmost(instance, &rect); |
550 else | 349 else |
551 *result = PP_FALSE; | 350 *result = PP_FALSE; |
552 } | 351 } |
553 | 352 |
554 void PPB_Flash_Proxy::OnHostMsgOpenFileRef( | |
555 PP_Instance instance, | |
556 const HostResource& host_resource, | |
557 int32_t mode, | |
558 IPC::PlatformFileForTransit* file_handle, | |
559 int32_t* result) { | |
560 EnterInstanceNoLock enter(instance); | |
561 if (enter.failed()) { | |
562 *result = PP_ERROR_BADARGUMENT; | |
563 return; | |
564 } | |
565 | |
566 base::PlatformFile file; | |
567 *result = enter.functions()->GetFlashAPI()->OpenFileRef( | |
568 instance, host_resource.host_resource(), mode, &file); | |
569 *file_handle = PlatformFileToPlatformFileForTransit(dispatcher(), | |
570 result, file); | |
571 } | |
572 | |
573 void PPB_Flash_Proxy::OnHostMsgQueryFileRef( | |
574 PP_Instance instance, | |
575 const HostResource& host_resource, | |
576 PP_FileInfo* info, | |
577 int32_t* result) { | |
578 EnterInstanceNoLock enter(instance); | |
579 if (enter.failed()) { | |
580 *result = PP_ERROR_BADARGUMENT; | |
581 return; | |
582 } | |
583 *result = enter.functions()->GetFlashAPI()->QueryFileRef( | |
584 instance, host_resource.host_resource(), info); | |
585 } | |
586 | |
587 void PPB_Flash_Proxy::OnHostMsgGetSetting(PP_Instance instance, | 353 void PPB_Flash_Proxy::OnHostMsgGetSetting(PP_Instance instance, |
588 PP_FlashSetting setting, | 354 PP_FlashSetting setting, |
589 SerializedVarReturnValue id) { | 355 SerializedVarReturnValue id) { |
590 EnterInstanceNoLock enter(instance); | 356 EnterInstanceNoLock enter(instance); |
591 if (enter.succeeded()) { | 357 if (enter.succeeded()) { |
592 id.Return(dispatcher(), | 358 id.Return(dispatcher(), |
593 enter.functions()->GetFlashAPI()->GetSetting( | 359 enter.functions()->GetFlashAPI()->GetSetting( |
594 instance, setting)); | 360 instance, setting)); |
595 } else { | 361 } else { |
596 id.Return(dispatcher(), PP_MakeUndefined()); | 362 id.Return(dispatcher(), PP_MakeUndefined()); |
597 } | 363 } |
598 } | 364 } |
599 | 365 |
600 void PPB_Flash_Proxy::OnHostMsgInvokePrinting(PP_Instance instance) { | 366 void PPB_Flash_Proxy::OnHostMsgInvokePrinting(PP_Instance instance) { |
601 // This function is actually implemented in the PPB_Flash_Print interface. | 367 // This function is actually implemented in the PPB_Flash_Print interface. |
602 // It's rarely used enough that we just request this interface when needed. | 368 // It's rarely used enough that we just request this interface when needed. |
603 const PPB_Flash_Print_1_0* print_interface = | 369 const PPB_Flash_Print_1_0* print_interface = |
604 static_cast<const PPB_Flash_Print_1_0*>( | 370 static_cast<const PPB_Flash_Print_1_0*>( |
605 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); | 371 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); |
606 if (print_interface) | 372 if (print_interface) |
607 print_interface->InvokePrinting(instance); | 373 print_interface->InvokePrinting(instance); |
608 } | 374 } |
609 | 375 |
610 } // namespace proxy | 376 } // namespace proxy |
611 } // namespace ppapi | 377 } // namespace ppapi |
OLD | NEW |