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

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

Issue 8951014: Change the DidChangeView update to take a new ViewChanged resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More nacl fixes Created 8 years, 11 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/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/pp_var.h" 8 #include "ppapi/c/pp_var.h"
9 #include "ppapi/c/ppb_instance.h" 9 #include "ppapi/c/ppb_instance.h"
10 #include "ppapi/c/ppb_messaging.h" 10 #include "ppapi/c/ppb_messaging.h"
11 #include "ppapi/c/ppb_mouse_lock.h" 11 #include "ppapi/c/ppb_mouse_lock.h"
12 #include "ppapi/proxy/enter_proxy.h" 12 #include "ppapi/proxy/enter_proxy.h"
13 #include "ppapi/proxy/host_dispatcher.h" 13 #include "ppapi/proxy/host_dispatcher.h"
14 #include "ppapi/proxy/plugin_dispatcher.h" 14 #include "ppapi/proxy/plugin_dispatcher.h"
15 #include "ppapi/proxy/ppapi_messages.h" 15 #include "ppapi/proxy/ppapi_messages.h"
16 #include "ppapi/proxy/serialized_var.h" 16 #include "ppapi/proxy/serialized_var.h"
17 #include "ppapi/shared_impl/ppapi_globals.h" 17 #include "ppapi/shared_impl/ppapi_globals.h"
18 #include "ppapi/shared_impl/ppb_url_util_shared.h" 18 #include "ppapi/shared_impl/ppb_url_util_shared.h"
19 #include "ppapi/shared_impl/ppb_view_shared.h"
19 #include "ppapi/thunk/enter.h" 20 #include "ppapi/thunk/enter.h"
20 #include "ppapi/thunk/thunk.h" 21 #include "ppapi/thunk/thunk.h"
21 22
22 // Windows headers interfere with this file. 23 // Windows headers interfere with this file.
23 #ifdef PostMessage 24 #ifdef PostMessage
24 #undef PostMessage 25 #undef PostMessage
25 #endif 26 #endif
26 27
27 using ppapi::thunk::EnterFunctionNoLock; 28 using ppapi::thunk::EnterFunctionNoLock;
28 using ppapi::thunk::EnterResourceNoLock; 29 using ppapi::thunk::EnterResourceNoLock;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // Prevent the dispatcher from going away during a call to ExecuteScript. 66 // Prevent the dispatcher from going away during a call to ExecuteScript.
66 // This must happen OUTSIDE of ExecuteScript since the SerializedVars use 67 // This must happen OUTSIDE of ExecuteScript since the SerializedVars use
67 // the dispatcher upon return of the function (converting the 68 // the dispatcher upon return of the function (converting the
68 // SerializedVarReturnValue/OutParam to a SerializedVar in the destructor). 69 // SerializedVarReturnValue/OutParam to a SerializedVar in the destructor).
69 ScopedModuleReference death_grip(dispatcher()); 70 ScopedModuleReference death_grip(dispatcher());
70 71
71 bool handled = true; 72 bool handled = true;
72 IPC_BEGIN_MESSAGE_MAP(PPB_Instance_Proxy, msg) 73 IPC_BEGIN_MESSAGE_MAP(PPB_Instance_Proxy, msg)
73 // Plugin -> Host messages. 74 // Plugin -> Host messages.
74 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetWindowObject, 75 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetWindowObject,
75 OnMsgGetWindowObject) 76 OnHostMsgGetWindowObject)
76 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetOwnerElementObject, 77 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetOwnerElementObject,
77 OnMsgGetOwnerElementObject) 78 OnHostMsgGetOwnerElementObject)
78 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_BindGraphics, 79 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_BindGraphics,
79 OnMsgBindGraphics) 80 OnHostMsgBindGraphics)
80 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_IsFullFrame, 81 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_IsFullFrame,
81 OnMsgIsFullFrame) 82 OnHostMsgIsFullFrame)
82 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ExecuteScript, 83 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ExecuteScript,
83 OnMsgExecuteScript) 84 OnHostMsgExecuteScript)
84 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDefaultCharSet, 85 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDefaultCharSet,
85 OnMsgGetDefaultCharSet) 86 OnHostMsgGetDefaultCharSet)
86 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_Log, 87 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_Log,
87 OnMsgLog) 88 OnHostMsgLog)
88 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_LogWithSource, 89 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_LogWithSource,
89 OnMsgLogWithSource) 90 OnHostMsgLogWithSource)
90 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PostMessage, 91 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PostMessage,
91 OnMsgPostMessage) 92 OnHostMsgPostMessage)
92 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_FlashSetFullscreen, 93 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_FlashSetFullscreen,
93 OnMsgFlashSetFullscreen) 94 OnHostMsgFlashSetFullscreen)
94 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_FlashGetScreenSize, 95 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_FlashGetScreenSize,
95 OnMsgFlashGetScreenSize) 96 OnHostMsgFlashGetScreenSize)
96 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetFullscreen, 97 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetFullscreen,
97 OnMsgSetFullscreen) 98 OnHostMsgSetFullscreen)
98 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetScreenSize, 99 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetScreenSize,
99 OnMsgGetScreenSize) 100 OnHostMsgGetScreenSize)
100 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_RequestInputEvents, 101 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_RequestInputEvents,
101 OnMsgRequestInputEvents) 102 OnHostMsgRequestInputEvents)
102 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ClearInputEvents, 103 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ClearInputEvents,
103 OnMsgClearInputEvents) 104 OnHostMsgClearInputEvents)
104 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_LockMouse, 105 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_LockMouse,
105 OnMsgLockMouse) 106 OnHostMsgLockMouse)
106 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_UnlockMouse, 107 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_UnlockMouse,
107 OnMsgUnlockMouse) 108 OnHostMsgUnlockMouse)
108 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ResolveRelativeToDocument, 109 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ResolveRelativeToDocument,
109 OnMsgResolveRelativeToDocument) 110 OnHostMsgResolveRelativeToDocument)
110 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanRequest, 111 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanRequest,
111 OnMsgDocumentCanRequest) 112 OnHostMsgDocumentCanRequest)
112 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanAccessDocument, 113 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanAccessDocument,
113 OnMsgDocumentCanAccessDocument) 114 OnHostMsgDocumentCanAccessDocument)
114 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDocumentURL, 115 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDocumentURL,
115 OnMsgGetDocumentURL) 116 OnHostMsgGetDocumentURL)
116 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginInstanceURL, 117 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginInstanceURL,
117 OnMsgGetPluginInstanceURL) 118 OnHostMsgGetPluginInstanceURL)
118 119
119 // Host -> Plugin messages. 120 // Host -> Plugin messages.
120 IPC_MESSAGE_HANDLER(PpapiMsg_PPBInstance_MouseLockComplete, 121 IPC_MESSAGE_HANDLER(PpapiMsg_PPBInstance_MouseLockComplete,
121 OnMsgMouseLockComplete) 122 OnPluginMsgMouseLockComplete)
122 123
123 IPC_MESSAGE_UNHANDLED(handled = false) 124 IPC_MESSAGE_UNHANDLED(handled = false)
124 IPC_END_MESSAGE_MAP() 125 IPC_END_MESSAGE_MAP()
125 return handled; 126 return handled;
126 } 127 }
127 128
128 PPB_Instance_FunctionAPI* PPB_Instance_Proxy::AsPPB_Instance_FunctionAPI() { 129 PPB_Instance_FunctionAPI* PPB_Instance_Proxy::AsPPB_Instance_FunctionAPI() {
129 return this; 130 return this;
130 } 131 }
131 132
(...skipping 11 matching lines...) Expand all
143 return result; 144 return result;
144 } 145 }
145 146
146 PP_Bool PPB_Instance_Proxy::IsFullFrame(PP_Instance instance) { 147 PP_Bool PPB_Instance_Proxy::IsFullFrame(PP_Instance instance) {
147 PP_Bool result = PP_FALSE; 148 PP_Bool result = PP_FALSE;
148 dispatcher()->Send(new PpapiHostMsg_PPBInstance_IsFullFrame( 149 dispatcher()->Send(new PpapiHostMsg_PPBInstance_IsFullFrame(
149 API_ID_PPB_INSTANCE, instance, &result)); 150 API_ID_PPB_INSTANCE, instance, &result));
150 return result; 151 return result;
151 } 152 }
152 153
154 const ViewData* PPB_Instance_Proxy::GetViewData(PP_Instance instance) {
155 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
156 GetInstanceData(instance);
157 if (!data)
158 return NULL;
159 return &data->view;
160 }
161
153 PP_Var PPB_Instance_Proxy::GetWindowObject(PP_Instance instance) { 162 PP_Var PPB_Instance_Proxy::GetWindowObject(PP_Instance instance) {
154 ReceiveSerializedVarReturnValue result; 163 ReceiveSerializedVarReturnValue result;
155 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetWindowObject( 164 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetWindowObject(
156 API_ID_PPB_INSTANCE, instance, &result)); 165 API_ID_PPB_INSTANCE, instance, &result));
157 return result.Return(dispatcher()); 166 return result.Return(dispatcher());
158 } 167 }
159 168
160 PP_Var PPB_Instance_Proxy::GetOwnerElementObject(PP_Instance instance) { 169 PP_Var PPB_Instance_Proxy::GetOwnerElementObject(PP_Instance instance) {
161 ReceiveSerializedVarReturnValue result; 170 ReceiveSerializedVarReturnValue result;
162 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetOwnerElementObject( 171 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetOwnerElementObject(
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 int32_t total, 220 int32_t total,
212 PP_Bool final_result) { 221 PP_Bool final_result) {
213 NOTIMPLEMENTED(); // Not proxied yet. 222 NOTIMPLEMENTED(); // Not proxied yet.
214 } 223 }
215 224
216 void PPB_Instance_Proxy::SelectedFindResultChanged(PP_Instance instance, 225 void PPB_Instance_Proxy::SelectedFindResultChanged(PP_Instance instance,
217 int32_t index) { 226 int32_t index) {
218 NOTIMPLEMENTED(); // Not proxied yet. 227 NOTIMPLEMENTED(); // Not proxied yet.
219 } 228 }
220 229
221 PP_Bool PPB_Instance_Proxy::IsFullscreen(PP_Instance instance) {
222 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
223 GetInstanceData(instance);
224 if (!data)
225 return PP_FALSE;
226 return data->fullscreen;
227 }
228
229 PP_Bool PPB_Instance_Proxy::FlashIsFullscreen(PP_Instance instance) { 230 PP_Bool PPB_Instance_Proxy::FlashIsFullscreen(PP_Instance instance) {
230 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 231 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
231 GetInstanceData(instance); 232 GetInstanceData(instance);
232 if (!data) 233 if (!data)
233 return PP_FALSE; 234 return PP_FALSE;
234 return data->flash_fullscreen; 235 return data->flash_fullscreen;
235 } 236 }
236 237
237 PP_Bool PPB_Instance_Proxy::SetFullscreen(PP_Instance instance, 238 PP_Bool PPB_Instance_Proxy::SetFullscreen(PP_Instance instance,
238 PP_Bool fullscreen) { 239 PP_Bool fullscreen) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 dispatcher()->Send(new PpapiHostMsg_PPBInstance_LockMouse( 386 dispatcher()->Send(new PpapiHostMsg_PPBInstance_LockMouse(
386 API_ID_PPB_INSTANCE, instance)); 387 API_ID_PPB_INSTANCE, instance));
387 return PP_OK_COMPLETIONPENDING; 388 return PP_OK_COMPLETIONPENDING;
388 } 389 }
389 390
390 void PPB_Instance_Proxy::UnlockMouse(PP_Instance instance) { 391 void PPB_Instance_Proxy::UnlockMouse(PP_Instance instance) {
391 dispatcher()->Send(new PpapiHostMsg_PPBInstance_UnlockMouse( 392 dispatcher()->Send(new PpapiHostMsg_PPBInstance_UnlockMouse(
392 API_ID_PPB_INSTANCE, instance)); 393 API_ID_PPB_INSTANCE, instance));
393 } 394 }
394 395
395 void PPB_Instance_Proxy::OnMsgGetWindowObject( 396 void PPB_Instance_Proxy::OnHostMsgGetWindowObject(
396 PP_Instance instance, 397 PP_Instance instance,
397 SerializedVarReturnValue result) { 398 SerializedVarReturnValue result) {
398 EnterInstanceNoLock enter(instance, false); 399 EnterInstanceNoLock enter(instance, false);
399 if (enter.succeeded()) 400 if (enter.succeeded())
400 result.Return(dispatcher(), enter.functions()->GetWindowObject(instance)); 401 result.Return(dispatcher(), enter.functions()->GetWindowObject(instance));
401 } 402 }
402 403
403 void PPB_Instance_Proxy::OnMsgGetOwnerElementObject( 404 void PPB_Instance_Proxy::OnHostMsgGetOwnerElementObject(
404 PP_Instance instance, 405 PP_Instance instance,
405 SerializedVarReturnValue result) { 406 SerializedVarReturnValue result) {
406 EnterInstanceNoLock enter(instance, false); 407 EnterInstanceNoLock enter(instance, false);
407 if (enter.succeeded()) { 408 if (enter.succeeded()) {
408 result.Return(dispatcher(), 409 result.Return(dispatcher(),
409 enter.functions()->GetOwnerElementObject(instance)); 410 enter.functions()->GetOwnerElementObject(instance));
410 } 411 }
411 } 412 }
412 413
413 void PPB_Instance_Proxy::OnMsgBindGraphics(PP_Instance instance, 414 void PPB_Instance_Proxy::OnHostMsgBindGraphics(PP_Instance instance,
414 const HostResource& device, 415 const HostResource& device,
415 PP_Bool* result) { 416 PP_Bool* result) {
416 EnterInstanceNoLock enter(instance, false); 417 EnterInstanceNoLock enter(instance, false);
417 if (enter.succeeded()) { 418 if (enter.succeeded()) {
418 *result = enter.functions()->BindGraphics(instance, 419 *result = enter.functions()->BindGraphics(instance,
419 device.host_resource()); 420 device.host_resource());
420 } 421 }
421 } 422 }
422 423
423 void PPB_Instance_Proxy::OnMsgIsFullFrame(PP_Instance instance, 424 void PPB_Instance_Proxy::OnHostMsgIsFullFrame(PP_Instance instance,
424 PP_Bool* result) { 425 PP_Bool* result) {
425 EnterInstanceNoLock enter(instance, false); 426 EnterInstanceNoLock enter(instance, false);
426 if (enter.succeeded()) 427 if (enter.succeeded())
427 *result = enter.functions()->IsFullFrame(instance); 428 *result = enter.functions()->IsFullFrame(instance);
428 } 429 }
429 430
430 void PPB_Instance_Proxy::OnMsgExecuteScript( 431 void PPB_Instance_Proxy::OnHostMsgExecuteScript(
431 PP_Instance instance, 432 PP_Instance instance,
432 SerializedVarReceiveInput script, 433 SerializedVarReceiveInput script,
433 SerializedVarOutParam out_exception, 434 SerializedVarOutParam out_exception,
434 SerializedVarReturnValue result) { 435 SerializedVarReturnValue result) {
435 EnterInstanceNoLock enter(instance, false); 436 EnterInstanceNoLock enter(instance, false);
436 if (enter.failed()) 437 if (enter.failed())
437 return; 438 return;
438 439
439 if (dispatcher()->IsPlugin()) 440 if (dispatcher()->IsPlugin())
440 NOTREACHED(); 441 NOTREACHED();
441 else 442 else
442 static_cast<HostDispatcher*>(dispatcher())->set_allow_plugin_reentrancy(); 443 static_cast<HostDispatcher*>(dispatcher())->set_allow_plugin_reentrancy();
443 444
444 result.Return(dispatcher(), enter.functions()->ExecuteScript( 445 result.Return(dispatcher(), enter.functions()->ExecuteScript(
445 instance, 446 instance,
446 script.Get(dispatcher()), 447 script.Get(dispatcher()),
447 out_exception.OutParam(dispatcher()))); 448 out_exception.OutParam(dispatcher())));
448 } 449 }
449 450
450 void PPB_Instance_Proxy::OnMsgGetDefaultCharSet( 451 void PPB_Instance_Proxy::OnHostMsgGetDefaultCharSet(
451 PP_Instance instance, 452 PP_Instance instance,
452 SerializedVarReturnValue result) { 453 SerializedVarReturnValue result) {
453 EnterInstanceNoLock enter(instance, false); 454 EnterInstanceNoLock enter(instance, false);
454 if (enter.succeeded()) 455 if (enter.succeeded())
455 result.Return(dispatcher(), enter.functions()->GetDefaultCharSet(instance)); 456 result.Return(dispatcher(), enter.functions()->GetDefaultCharSet(instance));
456 } 457 }
457 458
458 void PPB_Instance_Proxy::OnMsgLog(PP_Instance instance, 459 void PPB_Instance_Proxy::OnHostMsgLog(PP_Instance instance,
459 int log_level, 460 int log_level,
460 SerializedVarReceiveInput value) { 461 SerializedVarReceiveInput value) {
461 EnterInstanceNoLock enter(instance, false); 462 EnterInstanceNoLock enter(instance, false);
462 if (enter.succeeded()) 463 if (enter.succeeded())
463 enter.functions()->Log(instance, log_level, value.Get(dispatcher())); 464 enter.functions()->Log(instance, log_level, value.Get(dispatcher()));
464 } 465 }
465 466
466 void PPB_Instance_Proxy::OnMsgLogWithSource(PP_Instance instance, 467 void PPB_Instance_Proxy::OnHostMsgLogWithSource(
467 int log_level, 468 PP_Instance instance,
468 SerializedVarReceiveInput source, 469 int log_level,
469 SerializedVarReceiveInput value) { 470 SerializedVarReceiveInput source,
471 SerializedVarReceiveInput value) {
470 EnterInstanceNoLock enter(instance, false); 472 EnterInstanceNoLock enter(instance, false);
471 if (enter.succeeded()) { 473 if (enter.succeeded()) {
472 enter.functions()->LogWithSource(instance, log_level, 474 enter.functions()->LogWithSource(instance, log_level,
473 source.Get(dispatcher()), 475 source.Get(dispatcher()),
474 value.Get(dispatcher())); 476 value.Get(dispatcher()));
475 } 477 }
476 } 478 }
477 479
478 void PPB_Instance_Proxy::OnMsgSetFullscreen(PP_Instance instance, 480 void PPB_Instance_Proxy::OnHostMsgSetFullscreen(PP_Instance instance,
479 PP_Bool fullscreen, 481 PP_Bool fullscreen,
480 PP_Bool* result) { 482 PP_Bool* result) {
481 EnterInstanceNoLock enter(instance, false); 483 EnterInstanceNoLock enter(instance, false);
482 if (enter.succeeded()) 484 if (enter.succeeded())
483 *result = enter.functions()->SetFullscreen(instance, fullscreen); 485 *result = enter.functions()->SetFullscreen(instance, fullscreen);
484 } 486 }
485 487
486 488
487 void PPB_Instance_Proxy::OnMsgFlashSetFullscreen(PP_Instance instance, 489 void PPB_Instance_Proxy::OnHostMsgFlashSetFullscreen(PP_Instance instance,
488 PP_Bool fullscreen, 490 PP_Bool fullscreen,
489 PP_Bool* result) { 491 PP_Bool* result) {
490 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); 492 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false);
491 if (enter.succeeded()) 493 if (enter.succeeded())
492 *result = enter.functions()->FlashSetFullscreen(instance, fullscreen); 494 *result = enter.functions()->FlashSetFullscreen(instance, fullscreen);
493 } 495 }
494 496
495 void PPB_Instance_Proxy::OnMsgGetScreenSize(PP_Instance instance, 497 void PPB_Instance_Proxy::OnHostMsgGetScreenSize(PP_Instance instance,
496 PP_Bool* result, 498 PP_Bool* result,
497 PP_Size* size) { 499 PP_Size* size) {
498 EnterInstanceNoLock enter(instance, false); 500 EnterInstanceNoLock enter(instance, false);
499 if (enter.succeeded()) 501 if (enter.succeeded())
500 *result = enter.functions()->GetScreenSize(instance, size); 502 *result = enter.functions()->GetScreenSize(instance, size);
501 } 503 }
502 504
503 void PPB_Instance_Proxy::OnMsgFlashGetScreenSize(PP_Instance instance, 505 void PPB_Instance_Proxy::OnHostMsgFlashGetScreenSize(PP_Instance instance,
504 PP_Bool* result, 506 PP_Bool* result,
505 PP_Size* size) { 507 PP_Size* size) {
506 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); 508 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false);
507 if (enter.succeeded()) 509 if (enter.succeeded())
508 *result = enter.functions()->FlashGetScreenSize(instance, size); 510 *result = enter.functions()->FlashGetScreenSize(instance, size);
509 } 511 }
510 512
511 void PPB_Instance_Proxy::OnMsgRequestInputEvents(PP_Instance instance, 513 void PPB_Instance_Proxy::OnHostMsgRequestInputEvents(PP_Instance instance,
512 bool is_filtering, 514 bool is_filtering,
513 uint32_t event_classes) { 515 uint32_t event_classes) {
514 EnterInstanceNoLock enter(instance, false); 516 EnterInstanceNoLock enter(instance, false);
515 if (enter.succeeded()) { 517 if (enter.succeeded()) {
516 if (is_filtering) 518 if (is_filtering)
517 enter.functions()->RequestFilteringInputEvents(instance, event_classes); 519 enter.functions()->RequestFilteringInputEvents(instance, event_classes);
518 else 520 else
519 enter.functions()->RequestInputEvents(instance, event_classes); 521 enter.functions()->RequestInputEvents(instance, event_classes);
520 } 522 }
521 } 523 }
522 524
523 void PPB_Instance_Proxy::OnMsgClearInputEvents(PP_Instance instance, 525 void PPB_Instance_Proxy::OnHostMsgClearInputEvents(PP_Instance instance,
524 uint32_t event_classes) { 526 uint32_t event_classes) {
525 EnterInstanceNoLock enter(instance, false); 527 EnterInstanceNoLock enter(instance, false);
526 if (enter.succeeded()) 528 if (enter.succeeded())
527 enter.functions()->ClearInputEventRequest(instance, event_classes); 529 enter.functions()->ClearInputEventRequest(instance, event_classes);
528 } 530 }
529 531
530 void PPB_Instance_Proxy::OnMsgPostMessage(PP_Instance instance, 532 void PPB_Instance_Proxy::OnHostMsgPostMessage(PP_Instance instance,
531 SerializedVarReceiveInput message) { 533 SerializedVarReceiveInput message) {
532 EnterInstanceNoLock enter(instance, false); 534 EnterInstanceNoLock enter(instance, false);
533 if (enter.succeeded()) 535 if (enter.succeeded())
534 enter.functions()->PostMessage(instance, message.Get(dispatcher())); 536 enter.functions()->PostMessage(instance, message.Get(dispatcher()));
535 } 537 }
536 538
537 void PPB_Instance_Proxy::OnMsgLockMouse(PP_Instance instance) { 539 void PPB_Instance_Proxy::OnHostMsgLockMouse(PP_Instance instance) {
538 EnterHostFunctionForceCallback<PPB_Instance_FunctionAPI> enter( 540 EnterHostFunctionForceCallback<PPB_Instance_FunctionAPI> enter(
539 instance, callback_factory_, 541 instance, callback_factory_,
540 &PPB_Instance_Proxy::MouseLockCompleteInHost, instance); 542 &PPB_Instance_Proxy::MouseLockCompleteInHost, instance);
541 if (enter.succeeded()) 543 if (enter.succeeded())
542 enter.SetResult(enter.functions()->LockMouse(instance, enter.callback())); 544 enter.SetResult(enter.functions()->LockMouse(instance, enter.callback()));
543 } 545 }
544 546
545 void PPB_Instance_Proxy::OnMsgUnlockMouse(PP_Instance instance) { 547 void PPB_Instance_Proxy::OnHostMsgUnlockMouse(PP_Instance instance) {
546 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true); 548 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true);
547 if (enter.succeeded()) 549 if (enter.succeeded())
548 enter.functions()->UnlockMouse(instance); 550 enter.functions()->UnlockMouse(instance);
549 } 551 }
550 552
551 void PPB_Instance_Proxy::OnMsgResolveRelativeToDocument( 553 void PPB_Instance_Proxy::OnHostMsgResolveRelativeToDocument(
552 PP_Instance instance, 554 PP_Instance instance,
553 SerializedVarReceiveInput relative, 555 SerializedVarReceiveInput relative,
554 SerializedVarReturnValue result) { 556 SerializedVarReturnValue result) {
555 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true); 557 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true);
556 if (enter.succeeded()) { 558 if (enter.succeeded()) {
557 result.Return(dispatcher(), 559 result.Return(dispatcher(),
558 enter.functions()->ResolveRelativeToDocument( 560 enter.functions()->ResolveRelativeToDocument(
559 instance, relative.Get(dispatcher()), NULL)); 561 instance, relative.Get(dispatcher()), NULL));
560 } 562 }
561 } 563 }
562 564
563 void PPB_Instance_Proxy::OnMsgDocumentCanRequest(PP_Instance instance, 565 void PPB_Instance_Proxy::OnHostMsgDocumentCanRequest(
564 SerializedVarReceiveInput url, 566 PP_Instance instance,
565 PP_Bool* result) { 567 SerializedVarReceiveInput url,
568 PP_Bool* result) {
566 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true); 569 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true);
567 if (enter.succeeded()) { 570 if (enter.succeeded()) {
568 *result = enter.functions()->DocumentCanRequest(instance, 571 *result = enter.functions()->DocumentCanRequest(instance,
569 url.Get(dispatcher())); 572 url.Get(dispatcher()));
570 } 573 }
571 } 574 }
572 575
573 void PPB_Instance_Proxy::OnMsgDocumentCanAccessDocument(PP_Instance active, 576 void PPB_Instance_Proxy::OnHostMsgDocumentCanAccessDocument(PP_Instance active,
574 PP_Instance target, 577 PP_Instance target,
575 PP_Bool* result) { 578 PP_Bool* result) {
576 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(active, true); 579 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(active, true);
577 if (enter.succeeded()) 580 if (enter.succeeded())
578 *result = enter.functions()->DocumentCanAccessDocument(active, target); 581 *result = enter.functions()->DocumentCanAccessDocument(active, target);
579 } 582 }
580 583
581 void PPB_Instance_Proxy::OnMsgGetDocumentURL(PP_Instance instance, 584 void PPB_Instance_Proxy::OnHostMsgGetDocumentURL(PP_Instance instance,
582 SerializedVarReturnValue result) { 585 SerializedVarReturnValue result ) {
583 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true); 586 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true);
584 if (enter.succeeded()) { 587 if (enter.succeeded()) {
585 result.Return(dispatcher(), 588 result.Return(dispatcher(),
586 enter.functions()->GetDocumentURL(instance, NULL)); 589 enter.functions()->GetDocumentURL(instance, NULL));
587 } 590 }
588 } 591 }
589 592
590 void PPB_Instance_Proxy::OnMsgGetPluginInstanceURL( 593 void PPB_Instance_Proxy::OnHostMsgGetPluginInstanceURL(
591 PP_Instance instance, 594 PP_Instance instance,
592 SerializedVarReturnValue result) { 595 SerializedVarReturnValue result) {
593 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true); 596 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, true);
594 if (enter.succeeded()) { 597 if (enter.succeeded()) {
595 result.Return(dispatcher(), 598 result.Return(dispatcher(),
596 enter.functions()->GetPluginInstanceURL(instance, NULL)); 599 enter.functions()->GetPluginInstanceURL(instance, NULL));
597 } 600 }
598 } 601 }
599 602
600 void PPB_Instance_Proxy::OnMsgMouseLockComplete(PP_Instance instance, 603 void PPB_Instance_Proxy::OnPluginMsgMouseLockComplete(PP_Instance instance,
601 int32_t result) { 604 int32_t result) {
602 // Save the mouse callback on the instance data. 605 // Save the mouse callback on the instance data.
603 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 606 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
604 GetInstanceData(instance); 607 GetInstanceData(instance);
605 if (!data) 608 if (!data)
606 return; // Instance was probably deleted. 609 return; // Instance was probably deleted.
607 if (!data->mouse_lock_callback.func) { 610 if (!data->mouse_lock_callback.func) {
608 NOTREACHED(); 611 NOTREACHED();
609 return; 612 return;
610 } 613 }
611 PP_RunAndClearCompletionCallback(&data->mouse_lock_callback, result); 614 PP_RunAndClearCompletionCallback(&data->mouse_lock_callback, result);
612 } 615 }
613 616
614 void PPB_Instance_Proxy::MouseLockCompleteInHost(int32_t result, 617 void PPB_Instance_Proxy::MouseLockCompleteInHost(int32_t result,
615 PP_Instance instance) { 618 PP_Instance instance) {
616 dispatcher()->Send(new PpapiMsg_PPBInstance_MouseLockComplete( 619 dispatcher()->Send(new PpapiMsg_PPBInstance_MouseLockComplete(
617 API_ID_PPB_INSTANCE, instance, result)); 620 API_ID_PPB_INSTANCE, instance, result));
618 } 621 }
619 622
620 } // namespace proxy 623 } // namespace proxy
621 } // namespace ppapi 624 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698