OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Defines messages between the browser and plugin process, as well as between | 5 // Defines messages between the browser and plugin process, as well as between |
6 // the renderer and plugin process. | 6 // the renderer and plugin process. |
7 // | 7 // |
8 // See render_message* for information about the multi-pass include of headers. | 8 // See render_message* for information about the multi-pass include of headers. |
9 | 9 |
10 #ifndef CHROME_COMMON_PLUGIN_MESSAGES_H_ | 10 // Multiply-included file, no traditional include guard |
11 #define CHROME_COMMON_PLUGIN_MESSAGES_H_ | |
12 #pragma once | |
13 | |
14 #include <string> | 11 #include <string> |
15 #include <vector> | 12 #include <vector> |
16 | 13 |
17 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/shared_memory.h" |
18 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 17 #include "base/utf_string_conversions.h" |
| 18 #include "build/build_config.h" |
19 #include "chrome/common/common_param_traits.h" | 19 #include "chrome/common/common_param_traits.h" |
20 #include "chrome/common/webkit_param_traits.h" | 20 #include "chrome/common/webkit_param_traits.h" |
| 21 #include "content/common/common_param_traits.h" |
21 #include "googleurl/src/gurl.h" | 22 #include "googleurl/src/gurl.h" |
| 23 #include "ipc/ipc_channel_handle.h" |
| 24 #include "ipc/ipc_message_macros.h" |
22 #include "ipc/ipc_message_utils.h" | 25 #include "ipc/ipc_message_utils.h" |
23 #include "third_party/npapi/bindings/npapi.h" | |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 28 #include "third_party/npapi/bindings/npapi.h" |
26 #include "ui/gfx/native_widget_types.h" | 29 #include "ui/gfx/native_widget_types.h" |
27 #include "ui/gfx/rect.h" | 30 #include "ui/gfx/rect.h" |
28 #include "webkit/glue/npruntime_util.h" | 31 #include "webkit/glue/npruntime_util.h" |
| 32 #include "webkit/glue/webcursor.h" |
| 33 |
| 34 #if defined(OS_POSIX) |
| 35 #include "base/file_descriptor_posix.h" |
| 36 #endif |
| 37 |
| 38 #define IPC_MESSAGE_START PluginMsgStart |
| 39 |
| 40 // Singly-included section not yet converted. |
| 41 #ifndef CHROME_COMMON_PLUGIN_MESSAGES_H_ |
| 42 #define CHROME_COMMON_PLUGIN_MESSAGES_H_ |
29 | 43 |
30 // Name prefix of the event handle when a message box is displayed. | 44 // Name prefix of the event handle when a message box is displayed. |
31 #define kMessageBoxEventPrefix L"message_box_active" | 45 #define kMessageBoxEventPrefix L"message_box_active" |
32 | 46 |
33 // Structures for messages that have too many parameters to be put in a | 47 // Structures for messages that have too many parameters to be put in a |
34 // predefined IPC message. | 48 // predefined IPC message. |
35 | 49 |
36 struct PluginMsg_Init_Params { | 50 struct PluginMsg_Init_Params { |
37 PluginMsg_Init_Params(); | 51 PluginMsg_Init_Params(); |
38 ~PluginMsg_Init_Params(); | 52 ~PluginMsg_Init_Params(); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 template <> | 243 template <> |
230 struct ParamTraits<PluginMsg_UpdateGeometry_Param> { | 244 struct ParamTraits<PluginMsg_UpdateGeometry_Param> { |
231 typedef PluginMsg_UpdateGeometry_Param param_type; | 245 typedef PluginMsg_UpdateGeometry_Param param_type; |
232 static void Write(Message* m, const param_type& p); | 246 static void Write(Message* m, const param_type& p); |
233 static bool Read(const Message* m, void** iter, param_type* r); | 247 static bool Read(const Message* m, void** iter, param_type* r); |
234 static void Log(const param_type& p, std::string* l); | 248 static void Log(const param_type& p, std::string* l); |
235 }; | 249 }; |
236 | 250 |
237 } // namespace IPC | 251 } // namespace IPC |
238 | 252 |
239 #include "chrome/common/plugin_messages_internal.h" | |
240 | |
241 #endif // CHROME_COMMON_PLUGIN_MESSAGES_H_ | 253 #endif // CHROME_COMMON_PLUGIN_MESSAGES_H_ |
| 254 |
| 255 //----------------------------------------------------------------------------- |
| 256 // PluginProcess messages |
| 257 // These are messages sent from the browser to the plugin process. |
| 258 // Tells the plugin process to create a new channel for communication with a |
| 259 // given renderer. The channel name is returned in a |
| 260 // PluginProcessHostMsg_ChannelCreated message. The renderer ID is passed so |
| 261 // that the plugin process reuses an existing channel to that process if it |
| 262 // exists. This ID is a unique opaque identifier generated by the browser |
| 263 // process. |
| 264 IPC_MESSAGE_CONTROL2(PluginProcessMsg_CreateChannel, |
| 265 int /* renderer_id */, |
| 266 bool /* off_the_record */) |
| 267 |
| 268 // Allows a chrome plugin loaded in the browser process to send arbitrary |
| 269 // data to an instance of the same plugin loaded in a plugin process. |
| 270 IPC_MESSAGE_CONTROL1(PluginProcessMsg_PluginMessage, |
| 271 std::vector<uint8> /* opaque data */) |
| 272 |
| 273 // Tells the plugin process to notify every connected renderer of the pending |
| 274 // shutdown, so we don't mistake it for a crash. |
| 275 IPC_MESSAGE_CONTROL0(PluginProcessMsg_NotifyRenderersOfPendingShutdown) |
| 276 |
| 277 |
| 278 //----------------------------------------------------------------------------- |
| 279 // PluginProcessHost messages |
| 280 // These are messages sent from the plugin process to the browser process. |
| 281 // Response to a PluginProcessMsg_CreateChannel message. |
| 282 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, |
| 283 IPC::ChannelHandle /* channel_handle */) |
| 284 |
| 285 IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, |
| 286 std::string /* plugin finder URL */) |
| 287 |
| 288 // Allows a chrome plugin loaded in a plugin process to send arbitrary |
| 289 // data to an instance of the same plugin loaded in the browser process. |
| 290 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginMessage, |
| 291 std::vector<uint8> /* opaque data */) |
| 292 |
| 293 // Allows a chrome plugin loaded in a plugin process to send arbitrary |
| 294 // data to an instance of the same plugin loaded in the browser process. |
| 295 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_PluginSyncMessage, |
| 296 std::vector<uint8> /* opaque data */, |
| 297 std::vector<uint8> /* opaque data response */) |
| 298 |
| 299 // Used to get cookies for the given URL. The request_context is a |
| 300 // CPBrowsingContext, but is passed as int32 to avoid compilation errors. |
| 301 IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_GetCookies, |
| 302 int32 /* request_context */, |
| 303 GURL /* url */, |
| 304 std::string /* cookies */) |
| 305 |
| 306 // Used by the plugin process to verify that its renderer |renderer_id| has |
| 307 // permission to access the given |files|. |
| 308 IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_AccessFiles, |
| 309 int /* renderer_id */, |
| 310 std::vector<std::string> /* files */, |
| 311 bool /* allowed */) |
| 312 |
| 313 // Get the list of proxies to use for |url|, as a semicolon delimited list |
| 314 // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also ViewHostMsg_ResolveProxy |
| 315 // which does the same thing. |
| 316 IPC_SYNC_MESSAGE_CONTROL1_2(PluginProcessHostMsg_ResolveProxy, |
| 317 GURL /* url */, |
| 318 int /* network error */, |
| 319 std::string /* proxy list */) |
| 320 |
| 321 #if defined(OS_WIN) |
| 322 // Creates a child window of the given parent window on the UI thread. |
| 323 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_CreateWindow, |
| 324 HWND /* parent */, |
| 325 HWND /* child */) |
| 326 |
| 327 // Destroys the given window's parent on the UI thread. |
| 328 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginWindowDestroyed, |
| 329 HWND /* window */, |
| 330 HWND /* parent */) |
| 331 |
| 332 IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, |
| 333 std::string /* URL */, |
| 334 int /* process id */, |
| 335 HWND /* caller window */) |
| 336 #endif |
| 337 |
| 338 #if defined(USE_X11) |
| 339 // On X11, the mapping between NativeViewId and X window ids |
| 340 // is known only to the browser. This message lets the plugin process |
| 341 // ask about a NativeViewId that was provided by the renderer. |
| 342 // It will get 0 back if it's a bogus input. |
| 343 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_MapNativeViewId, |
| 344 gfx::NativeViewId /* input: native view id */, |
| 345 gfx::PluginWindowHandle /* output: X window id */) |
| 346 #endif |
| 347 |
| 348 #if defined(OS_MACOSX) |
| 349 // On Mac OS X, we need the browser to keep track of plugin windows so |
| 350 // that it can add and remove them from stacking groups, hide and show the |
| 351 // menu bar, etc. We pass the window rect for convenience so that the |
| 352 // browser can easily tell if the window is fullscreen. |
| 353 |
| 354 // Notifies the browser that the plugin has selected a window (i.e., brought |
| 355 // it to the front and wants it to have keyboard focus). |
| 356 IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginSelectWindow, |
| 357 uint32 /* window ID */, |
| 358 gfx::Rect /* window rect */, |
| 359 bool /* modal */) |
| 360 |
| 361 // Notifies the browser that the plugin has shown a window. |
| 362 IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginShowWindow, |
| 363 uint32 /* window ID */, |
| 364 gfx::Rect /* window rect */, |
| 365 bool /* modal */) |
| 366 |
| 367 // Notifies the browser that the plugin has hidden a window. |
| 368 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginHideWindow, |
| 369 uint32 /* window ID */, |
| 370 gfx::Rect /* window rect */) |
| 371 |
| 372 // Notifies the browser that a plugin instance has requested a cursor |
| 373 // visibility change. |
| 374 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginSetCursorVisibility, |
| 375 bool /* cursor visibility */) |
| 376 #endif |
| 377 |
| 378 |
| 379 //----------------------------------------------------------------------------- |
| 380 // Plugin messages |
| 381 // These are messages sent from the renderer process to the plugin process. |
| 382 // Tells the plugin process to create a new plugin instance with the given |
| 383 // id. A corresponding WebPluginDelegateStub is created which hosts the |
| 384 // WebPluginDelegateImpl. |
| 385 IPC_SYNC_MESSAGE_CONTROL1_1(PluginMsg_CreateInstance, |
| 386 std::string /* mime_type */, |
| 387 int /* instance_id */) |
| 388 |
| 389 // The WebPluginDelegateProxy sends this to the WebPluginDelegateStub in its |
| 390 // destructor, so that the stub deletes the actual WebPluginDelegateImpl |
| 391 // object that it's hosting. |
| 392 IPC_SYNC_MESSAGE_CONTROL1_0(PluginMsg_DestroyInstance, |
| 393 int /* instance_id */) |
| 394 |
| 395 IPC_SYNC_MESSAGE_CONTROL0_1(PluginMsg_GenerateRouteID, |
| 396 int /* id */) |
| 397 |
| 398 // The messages below all map to WebPluginDelegate methods. |
| 399 IPC_SYNC_MESSAGE_ROUTED1_1(PluginMsg_Init, |
| 400 PluginMsg_Init_Params, |
| 401 bool /* result */) |
| 402 |
| 403 // Used to synchronously request a paint for windowless plugins. |
| 404 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_Paint, |
| 405 gfx::Rect /* damaged_rect */) |
| 406 |
| 407 // Sent by the renderer after it paints from its backing store so that the |
| 408 // plugin knows it can send more invalidates. |
| 409 IPC_MESSAGE_ROUTED0(PluginMsg_DidPaint) |
| 410 |
| 411 IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_Print, |
| 412 base::SharedMemoryHandle /* shared_memory*/, |
| 413 uint32 /* size */) |
| 414 |
| 415 IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_GetPluginScriptableObject, |
| 416 int /* route_id */) |
| 417 |
| 418 IPC_MESSAGE_ROUTED3(PluginMsg_DidFinishLoadWithReason, |
| 419 GURL /* url */, |
| 420 int /* reason */, |
| 421 int /* notify_id */) |
| 422 |
| 423 // Updates the plugin location. |
| 424 IPC_MESSAGE_ROUTED1(PluginMsg_UpdateGeometry, |
| 425 PluginMsg_UpdateGeometry_Param) |
| 426 |
| 427 // A synchronous version of above. |
| 428 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_UpdateGeometrySync, |
| 429 PluginMsg_UpdateGeometry_Param) |
| 430 |
| 431 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_SetFocus, |
| 432 bool /* focused */) |
| 433 |
| 434 IPC_SYNC_MESSAGE_ROUTED1_2(PluginMsg_HandleInputEvent, |
| 435 IPC::WebInputEventPointer /* event */, |
| 436 bool /* handled */, |
| 437 WebCursor /* cursor type*/) |
| 438 |
| 439 IPC_MESSAGE_ROUTED1(PluginMsg_SetContentAreaFocus, |
| 440 bool /* has_focus */) |
| 441 |
| 442 #if defined(OS_MACOSX) |
| 443 IPC_MESSAGE_ROUTED1(PluginMsg_SetWindowFocus, |
| 444 bool /* has_focus */) |
| 445 |
| 446 IPC_MESSAGE_ROUTED0(PluginMsg_ContainerHidden) |
| 447 |
| 448 IPC_MESSAGE_ROUTED3(PluginMsg_ContainerShown, |
| 449 gfx::Rect /* window_frame */, |
| 450 gfx::Rect /* view_frame */, |
| 451 bool /* has_focus */) |
| 452 |
| 453 IPC_MESSAGE_ROUTED2(PluginMsg_WindowFrameChanged, |
| 454 gfx::Rect /* window_frame */, |
| 455 gfx::Rect /* view_frame */) |
| 456 |
| 457 IPC_MESSAGE_ROUTED1(PluginMsg_ImeCompositionCompleted, |
| 458 string16 /* text */) |
| 459 #endif |
| 460 |
| 461 IPC_SYNC_MESSAGE_ROUTED3_0(PluginMsg_WillSendRequest, |
| 462 unsigned long /* id */, |
| 463 GURL /* url */, |
| 464 int /* http_status_code */) |
| 465 |
| 466 IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveResponse, |
| 467 PluginMsg_DidReceiveResponseParams) |
| 468 |
| 469 IPC_MESSAGE_ROUTED3(PluginMsg_DidReceiveData, |
| 470 unsigned long /* id */, |
| 471 std::vector<char> /* buffer */, |
| 472 int /* data_offset */) |
| 473 |
| 474 IPC_MESSAGE_ROUTED1(PluginMsg_DidFinishLoading, |
| 475 unsigned long /* id */) |
| 476 |
| 477 IPC_MESSAGE_ROUTED1(PluginMsg_DidFail, |
| 478 unsigned long /* id */) |
| 479 |
| 480 IPC_MESSAGE_ROUTED4(PluginMsg_SendJavaScriptStream, |
| 481 GURL /* url */, |
| 482 std::string /* result */, |
| 483 bool /* success */, |
| 484 int /* notify_id */) |
| 485 |
| 486 IPC_MESSAGE_ROUTED2(PluginMsg_DidReceiveManualResponse, |
| 487 GURL /* url */, |
| 488 PluginMsg_DidReceiveResponseParams) |
| 489 |
| 490 IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveManualData, |
| 491 std::vector<char> /* buffer */) |
| 492 |
| 493 IPC_MESSAGE_ROUTED0(PluginMsg_DidFinishManualLoading) |
| 494 |
| 495 IPC_MESSAGE_ROUTED0(PluginMsg_DidManualLoadFail) |
| 496 |
| 497 IPC_MESSAGE_ROUTED0(PluginMsg_InstallMissingPlugin) |
| 498 |
| 499 IPC_MESSAGE_ROUTED3(PluginMsg_HandleURLRequestReply, |
| 500 unsigned long /* resource_id */, |
| 501 GURL /* url */, |
| 502 int /* notify_id */) |
| 503 |
| 504 IPC_MESSAGE_ROUTED2(PluginMsg_HTTPRangeRequestReply, |
| 505 unsigned long /* resource_id */, |
| 506 int /* range_request_id */) |
| 507 |
| 508 IPC_MESSAGE_CONTROL1(PluginMsg_SignalModalDialogEvent, |
| 509 gfx::NativeViewId /* containing_window */) |
| 510 |
| 511 IPC_MESSAGE_CONTROL1(PluginMsg_ResetModalDialogEvent, |
| 512 gfx::NativeViewId /* containing_window */) |
| 513 |
| 514 #if defined(OS_MACOSX) |
| 515 // This message, used only on 10.6 and later, transmits the "fake" |
| 516 // window handle allocated by the browser on behalf of the renderer |
| 517 // to the GPU plugin. |
| 518 IPC_MESSAGE_ROUTED1(PluginMsg_SetFakeAcceleratedSurfaceWindowHandle, |
| 519 gfx::PluginWindowHandle /* window */) |
| 520 #endif |
| 521 |
| 522 IPC_MESSAGE_CONTROL3(PluginMsg_ClearSiteData, |
| 523 std::string, /* site */ |
| 524 uint64, /* flags */ |
| 525 base::Time /* begin_time */) |
| 526 |
| 527 |
| 528 //----------------------------------------------------------------------------- |
| 529 // PluginHost messages |
| 530 // These are messages sent from the plugin process to the renderer process. |
| 531 // They all map to the corresponding WebPlugin methods. |
| 532 // Sends the plugin window information to the renderer. |
| 533 // The window parameter is a handle to the window if the plugin is a windowed |
| 534 // plugin. It is NULL for windowless plugins. |
| 535 IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindow, |
| 536 gfx::PluginWindowHandle /* window */) |
| 537 |
| 538 #if defined(OS_WIN) |
| 539 // The modal_loop_pump_messages_event parameter is an event handle which is |
| 540 // passed in for windowless plugins and is used to indicate if messages |
| 541 // are to be pumped in sync calls to the plugin process. Currently used |
| 542 // in HandleEvent calls. |
| 543 IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindowlessPumpEvent, |
| 544 HANDLE /* modal_loop_pump_messages_event */) |
| 545 #endif |
| 546 |
| 547 IPC_MESSAGE_ROUTED1(PluginHostMsg_URLRequest, |
| 548 PluginHostMsg_URLRequest_Params) |
| 549 |
| 550 IPC_MESSAGE_ROUTED1(PluginHostMsg_CancelResource, |
| 551 int /* id */) |
| 552 |
| 553 IPC_MESSAGE_ROUTED1(PluginHostMsg_InvalidateRect, |
| 554 gfx::Rect /* rect */) |
| 555 |
| 556 IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetWindowScriptNPObject, |
| 557 int /* route id */, |
| 558 bool /* success */) |
| 559 |
| 560 IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetPluginElement, |
| 561 int /* route id */, |
| 562 bool /* success */) |
| 563 |
| 564 IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, |
| 565 GURL /* url */, |
| 566 GURL /* first_party_for_cookies */, |
| 567 std::string /* cookie */) |
| 568 |
| 569 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies, |
| 570 GURL /* url */, |
| 571 GURL /* first_party_for_cookies */, |
| 572 std::string /* cookies */) |
| 573 |
| 574 // Asks the browser to show a modal HTML dialog. The dialog is passed the |
| 575 // given arguments as a JSON string, and returns its result as a JSON string |
| 576 // through json_retval. |
| 577 IPC_SYNC_MESSAGE_ROUTED4_1(PluginHostMsg_ShowModalHTMLDialog, |
| 578 GURL /* url */, |
| 579 int /* width */, |
| 580 int /* height */, |
| 581 std::string /* json_arguments */, |
| 582 std::string /* json_retval */) |
| 583 |
| 584 IPC_SYNC_MESSAGE_ROUTED2_2(PluginHostMsg_GetDragData, |
| 585 NPVariant_Param /* event */, |
| 586 bool /* add_data */, |
| 587 std::vector<NPVariant_Param> /* result_values */, |
| 588 bool /* result_success */) |
| 589 |
| 590 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_SetDropEffect, |
| 591 NPVariant_Param /* event */, |
| 592 int /* effect */, |
| 593 bool /* result_success */) |
| 594 |
| 595 IPC_MESSAGE_ROUTED1(PluginHostMsg_MissingPluginStatus, |
| 596 int /* status */) |
| 597 |
| 598 IPC_SYNC_MESSAGE_ROUTED0_1(PluginHostMsg_GetCPBrowsingContext, |
| 599 uint32 /* context */) |
| 600 |
| 601 IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad) |
| 602 |
| 603 IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest, |
| 604 std::string /* url */, |
| 605 std::string /* range_info */, |
| 606 int /* range_request_id */) |
| 607 |
| 608 IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading, |
| 609 unsigned long /* resource_id */, |
| 610 bool /* defer */) |
| 611 |
| 612 IPC_SYNC_MESSAGE_CONTROL1_0(PluginHostMsg_SetException, |
| 613 std::string /* message */) |
| 614 |
| 615 IPC_MESSAGE_CONTROL0(PluginHostMsg_PluginShuttingDown) |
| 616 |
| 617 #if defined(OS_MACOSX) |
| 618 IPC_MESSAGE_ROUTED1(PluginHostMsg_UpdateGeometry_ACK, |
| 619 int /* ack_key */) |
| 620 |
| 621 IPC_MESSAGE_ROUTED1(PluginHostMsg_FocusChanged, |
| 622 bool /* focused */) |
| 623 |
| 624 IPC_MESSAGE_ROUTED0(PluginHostMsg_StartIme) |
| 625 |
| 626 // This message, used in Mac OS X 10.5 and earlier, is sent from the plug-in |
| 627 // process to the renderer process to indicate that the plug-in allocated a |
| 628 // new TransportDIB that holds the GPU's rendered image. This information is |
| 629 // then forwarded to the browser process via a similar message. |
| 630 IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetTransportDIB, |
| 631 gfx::PluginWindowHandle /* window */, |
| 632 int32 /* width */, |
| 633 int32 /* height */, |
| 634 TransportDIB::Handle /* handle to the TransportDIB */) |
| 635 |
| 636 // Synthesize a fake window handle for the plug-in to identify the instance |
| 637 // to the browser, allowing mapping to a surface for hardware accelleration |
| 638 // of plug-in content. The browser generates the handle which is then set on |
| 639 // the plug-in. |opaque| indicates whether the content should be treated as |
| 640 // opaque. |
| 641 IPC_MESSAGE_ROUTED1(PluginHostMsg_BindFakePluginWindowHandle, |
| 642 bool /* opaque */) |
| 643 |
| 644 // This message, used only on 10.6 and later, is sent from the plug-in process |
| 645 // to the renderer process to indicate that the plugin allocated a new |
| 646 // IOSurface object of the given width and height. This information is then |
| 647 // forwarded on to the browser process. |
| 648 // |
| 649 // NOTE: the original intent was to pass a mach port as the IOSurface |
| 650 // identifier but it looks like that will be a lot of work. For now we pass an |
| 651 // ID from IOSurfaceGetID. |
| 652 IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetIOSurface, |
| 653 gfx::PluginWindowHandle /* window */, |
| 654 int32 /* width */, |
| 655 int32 /* height */, |
| 656 uint64 /* surface_id */) |
| 657 |
| 658 |
| 659 // On the Mac, shared memory can't be allocated in the sandbox, so |
| 660 // the TransportDIB used by the plug-in for rendering has to be allocated |
| 661 // and managed by the browser. This is a synchronous message, use with care. |
| 662 IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_AllocTransportDIB, |
| 663 size_t /* requested memory size */, |
| 664 TransportDIB::Handle /* output: DIB handle */) |
| 665 |
| 666 // Since the browser keeps handles to the allocated transport DIBs, this |
| 667 // message is sent to tell the browser that it may release them when the |
| 668 // renderer is finished with them. |
| 669 IPC_MESSAGE_ROUTED1(PluginHostMsg_FreeTransportDIB, |
| 670 TransportDIB::Id /* DIB id */) |
| 671 |
| 672 // This message notifies the renderer process (and from there the |
| 673 // browser process) that the plug-in swapped the buffers associated |
| 674 // with the given "window", which should cause the browser to redraw |
| 675 // the various plug-ins' contents. |
| 676 IPC_MESSAGE_ROUTED2(PluginHostMsg_AcceleratedSurfaceBuffersSwapped, |
| 677 gfx::PluginWindowHandle /* window */, |
| 678 uint64 /* surface_id */) |
| 679 #endif |
| 680 |
| 681 IPC_MESSAGE_CONTROL1(PluginHostMsg_ClearSiteDataResult, |
| 682 bool /* success */) |
| 683 |
| 684 IPC_MESSAGE_ROUTED2(PluginHostMsg_URLRedirectResponse, |
| 685 bool /* allow */, |
| 686 int /* resource_id */) |
| 687 |
| 688 |
| 689 //----------------------------------------------------------------------------- |
| 690 // NPObject messages |
| 691 // These are messages used to marshall NPObjects. They are sent both from the |
| 692 // plugin to the renderer and from the renderer to the plugin. |
| 693 IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Release) |
| 694 |
| 695 IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasMethod, |
| 696 NPIdentifier_Param /* name */, |
| 697 bool /* result */) |
| 698 |
| 699 IPC_SYNC_MESSAGE_ROUTED3_2(NPObjectMsg_Invoke, |
| 700 bool /* is_default */, |
| 701 NPIdentifier_Param /* method */, |
| 702 std::vector<NPVariant_Param> /* args */, |
| 703 NPVariant_Param /* result_param */, |
| 704 bool /* result */) |
| 705 |
| 706 IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasProperty, |
| 707 NPIdentifier_Param /* name */, |
| 708 bool /* result */) |
| 709 |
| 710 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_GetProperty, |
| 711 NPIdentifier_Param /* name */, |
| 712 NPVariant_Param /* property */, |
| 713 bool /* result */) |
| 714 |
| 715 IPC_SYNC_MESSAGE_ROUTED2_1(NPObjectMsg_SetProperty, |
| 716 NPIdentifier_Param /* name */, |
| 717 NPVariant_Param /* property */, |
| 718 bool /* result */) |
| 719 |
| 720 IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_RemoveProperty, |
| 721 NPIdentifier_Param /* name */, |
| 722 bool /* result */) |
| 723 |
| 724 IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Invalidate) |
| 725 |
| 726 IPC_SYNC_MESSAGE_ROUTED0_2(NPObjectMsg_Enumeration, |
| 727 std::vector<NPIdentifier_Param> /* value */, |
| 728 bool /* result */) |
| 729 |
| 730 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct, |
| 731 std::vector<NPVariant_Param> /* args */, |
| 732 NPVariant_Param /* result_param */, |
| 733 bool /* result */) |
| 734 |
| 735 IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate, |
| 736 std::string /* script */, |
| 737 bool /* popups_allowed */, |
| 738 NPVariant_Param /* result_param */, |
| 739 bool /* result */) |
| 740 |
OLD | NEW |