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" |
22 #include "ppapi/proxy/plugin_dispatcher.h" | 23 #include "ppapi/proxy/plugin_dispatcher.h" |
23 #include "ppapi/proxy/plugin_globals.h" | 24 #include "ppapi/proxy/plugin_globals.h" |
24 #include "ppapi/proxy/ppapi_messages.h" | 25 #include "ppapi/proxy/ppapi_messages.h" |
25 #include "ppapi/proxy/proxy_module.h" | 26 #include "ppapi/proxy/proxy_module.h" |
26 #include "ppapi/proxy/serialized_var.h" | 27 #include "ppapi/proxy/serialized_var.h" |
| 28 #include "ppapi/shared_impl/dir_contents.h" |
| 29 #include "ppapi/shared_impl/file_type_conversion.h" |
27 #include "ppapi/shared_impl/ppapi_globals.h" | 30 #include "ppapi/shared_impl/ppapi_globals.h" |
28 #include "ppapi/shared_impl/proxy_lock.h" | 31 #include "ppapi/shared_impl/proxy_lock.h" |
29 #include "ppapi/shared_impl/resource.h" | 32 #include "ppapi/shared_impl/resource.h" |
30 #include "ppapi/shared_impl/resource_tracker.h" | 33 #include "ppapi/shared_impl/resource_tracker.h" |
31 #include "ppapi/shared_impl/scoped_pp_resource.h" | 34 #include "ppapi/shared_impl/scoped_pp_resource.h" |
32 #include "ppapi/shared_impl/time_conversion.h" | 35 #include "ppapi/shared_impl/time_conversion.h" |
33 #include "ppapi/shared_impl/var.h" | 36 #include "ppapi/shared_impl/var.h" |
34 #include "ppapi/shared_impl/var_tracker.h" | 37 #include "ppapi/shared_impl/var_tracker.h" |
35 #include "ppapi/thunk/enter.h" | 38 #include "ppapi/thunk/enter.h" |
36 #include "ppapi/thunk/ppb_instance_api.h" | 39 #include "ppapi/thunk/ppb_instance_api.h" |
37 #include "ppapi/thunk/ppb_url_request_info_api.h" | 40 #include "ppapi/thunk/ppb_url_request_info_api.h" |
38 #include "ppapi/thunk/resource_creation_api.h" | 41 #include "ppapi/thunk/resource_creation_api.h" |
39 | 42 |
40 using ppapi::thunk::EnterInstanceNoLock; | 43 using ppapi::thunk::EnterInstanceNoLock; |
41 using ppapi::thunk::EnterResourceNoLock; | 44 using ppapi::thunk::EnterResourceNoLock; |
42 | 45 |
43 namespace ppapi { | 46 namespace ppapi { |
44 namespace proxy { | 47 namespace proxy { |
45 | 48 |
46 namespace { | 49 namespace { |
47 | 50 |
48 // Returns true if |t1| and |t2| are times in the same minute. | 51 // Returns true if |t1| and |t2| are times in the same minute. |
49 bool InSameMinute(PP_Time t1, PP_Time t2) { | 52 bool InSameMinute(PP_Time t1, PP_Time t2) { |
50 return floor(t1 / 60.0) == floor(t2 / 60.0); | 53 return floor(t1 / 60.0) == floor(t2 / 60.0); |
51 } | 54 } |
52 | 55 |
| 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 |
53 void InvokePrinting(PP_Instance instance) { | 69 void InvokePrinting(PP_Instance instance) { |
54 ProxyAutoLock lock; | 70 ProxyAutoLock lock; |
55 | 71 |
56 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 72 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
57 if (dispatcher) { | 73 if (dispatcher) { |
58 dispatcher->Send(new PpapiHostMsg_PPBFlash_InvokePrinting( | 74 dispatcher->Send(new PpapiHostMsg_PPBFlash_InvokePrinting( |
59 API_ID_PPB_FLASH, instance)); | 75 API_ID_PPB_FLASH, instance)); |
60 } | 76 } |
61 } | 77 } |
62 | 78 |
(...skipping 25 matching lines...) Expand all Loading... |
88 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) | 104 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) |
89 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, | 105 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, |
90 OnHostMsgSetInstanceAlwaysOnTop) | 106 OnHostMsgSetInstanceAlwaysOnTop) |
91 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DrawGlyphs, | 107 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DrawGlyphs, |
92 OnHostMsgDrawGlyphs) | 108 OnHostMsgDrawGlyphs) |
93 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_Navigate, OnHostMsgNavigate) | 109 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_Navigate, OnHostMsgNavigate) |
94 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetLocalTimeZoneOffset, | 110 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetLocalTimeZoneOffset, |
95 OnHostMsgGetLocalTimeZoneOffset) | 111 OnHostMsgGetLocalTimeZoneOffset) |
96 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_IsRectTopmost, | 112 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_IsRectTopmost, |
97 OnHostMsgIsRectTopmost) | 113 OnHostMsgIsRectTopmost) |
| 114 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_OpenFileRef, |
| 115 OnHostMsgOpenFileRef) |
| 116 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QueryFileRef, |
| 117 OnHostMsgQueryFileRef) |
98 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_InvokePrinting, | 118 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_InvokePrinting, |
99 OnHostMsgInvokePrinting) | 119 OnHostMsgInvokePrinting) |
100 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetSetting, | 120 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetSetting, |
101 OnHostMsgGetSetting) | 121 OnHostMsgGetSetting) |
102 IPC_MESSAGE_UNHANDLED(handled = false) | 122 IPC_MESSAGE_UNHANDLED(handled = false) |
103 IPC_END_MESSAGE_MAP() | 123 IPC_END_MESSAGE_MAP() |
104 // TODO(brettw) handle bad messages! | 124 // TODO(brettw) handle bad messages! |
105 return handled; | 125 return handled; |
106 } | 126 } |
107 | 127 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 case PP_FLASHSETTING_LSORESTRICTIONS: { | 273 case PP_FLASHSETTING_LSORESTRICTIONS: { |
254 ReceiveSerializedVarReturnValue result; | 274 ReceiveSerializedVarReturnValue result; |
255 dispatcher()->Send(new PpapiHostMsg_PPBFlash_GetSetting( | 275 dispatcher()->Send(new PpapiHostMsg_PPBFlash_GetSetting( |
256 API_ID_PPB_FLASH, instance, setting, &result)); | 276 API_ID_PPB_FLASH, instance, setting, &result)); |
257 return result.Return(dispatcher()); | 277 return result.Return(dispatcher()); |
258 } | 278 } |
259 } | 279 } |
260 return PP_MakeUndefined(); | 280 return PP_MakeUndefined(); |
261 } | 281 } |
262 | 282 |
| 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 |
263 void PPB_Flash_Proxy::OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, | 464 void PPB_Flash_Proxy::OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, |
264 PP_Bool on_top) { | 465 PP_Bool on_top) { |
265 EnterInstanceNoLock enter(instance); | 466 EnterInstanceNoLock enter(instance); |
266 if (enter.succeeded()) | 467 if (enter.succeeded()) |
267 enter.functions()->GetFlashAPI()->SetInstanceAlwaysOnTop(instance, on_top); | 468 enter.functions()->GetFlashAPI()->SetInstanceAlwaysOnTop(instance, on_top); |
268 } | 469 } |
269 | 470 |
270 void PPB_Flash_Proxy::OnHostMsgDrawGlyphs( | 471 void PPB_Flash_Proxy::OnHostMsgDrawGlyphs( |
271 PP_Instance instance, | 472 PP_Instance instance, |
272 const PPBFlash_DrawGlyphs_Params& params, | 473 const PPBFlash_DrawGlyphs_Params& params, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 void PPB_Flash_Proxy::OnHostMsgIsRectTopmost(PP_Instance instance, | 544 void PPB_Flash_Proxy::OnHostMsgIsRectTopmost(PP_Instance instance, |
344 PP_Rect rect, | 545 PP_Rect rect, |
345 PP_Bool* result) { | 546 PP_Bool* result) { |
346 EnterInstanceNoLock enter(instance); | 547 EnterInstanceNoLock enter(instance); |
347 if (enter.succeeded()) | 548 if (enter.succeeded()) |
348 *result = enter.functions()->GetFlashAPI()->IsRectTopmost(instance, &rect); | 549 *result = enter.functions()->GetFlashAPI()->IsRectTopmost(instance, &rect); |
349 else | 550 else |
350 *result = PP_FALSE; | 551 *result = PP_FALSE; |
351 } | 552 } |
352 | 553 |
| 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 |
353 void PPB_Flash_Proxy::OnHostMsgGetSetting(PP_Instance instance, | 587 void PPB_Flash_Proxy::OnHostMsgGetSetting(PP_Instance instance, |
354 PP_FlashSetting setting, | 588 PP_FlashSetting setting, |
355 SerializedVarReturnValue id) { | 589 SerializedVarReturnValue id) { |
356 EnterInstanceNoLock enter(instance); | 590 EnterInstanceNoLock enter(instance); |
357 if (enter.succeeded()) { | 591 if (enter.succeeded()) { |
358 id.Return(dispatcher(), | 592 id.Return(dispatcher(), |
359 enter.functions()->GetFlashAPI()->GetSetting( | 593 enter.functions()->GetFlashAPI()->GetSetting( |
360 instance, setting)); | 594 instance, setting)); |
361 } else { | 595 } else { |
362 id.Return(dispatcher(), PP_MakeUndefined()); | 596 id.Return(dispatcher(), PP_MakeUndefined()); |
363 } | 597 } |
364 } | 598 } |
365 | 599 |
366 void PPB_Flash_Proxy::OnHostMsgInvokePrinting(PP_Instance instance) { | 600 void PPB_Flash_Proxy::OnHostMsgInvokePrinting(PP_Instance instance) { |
367 // This function is actually implemented in the PPB_Flash_Print interface. | 601 // This function is actually implemented in the PPB_Flash_Print interface. |
368 // It's rarely used enough that we just request this interface when needed. | 602 // It's rarely used enough that we just request this interface when needed. |
369 const PPB_Flash_Print_1_0* print_interface = | 603 const PPB_Flash_Print_1_0* print_interface = |
370 static_cast<const PPB_Flash_Print_1_0*>( | 604 static_cast<const PPB_Flash_Print_1_0*>( |
371 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); | 605 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); |
372 if (print_interface) | 606 if (print_interface) |
373 print_interface->InvokePrinting(instance); | 607 print_interface->InvokePrinting(instance); |
374 } | 608 } |
375 | 609 |
376 } // namespace proxy | 610 } // namespace proxy |
377 } // namespace ppapi | 611 } // namespace ppapi |
OLD | NEW |