| OLD | NEW |
| 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_COMMON_PLUGIN_MESSAGES_H__ |
| 11 #define CHROME_COMMON_PLUGIN_MESSAGES_H__ | 11 #define CHROME_COMMON_PLUGIN_MESSAGES_H__ |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 struct NPVariant_Param { | 95 struct NPVariant_Param { |
| 96 NPVariant_ParamEnum type; | 96 NPVariant_ParamEnum type; |
| 97 bool bool_value; | 97 bool bool_value; |
| 98 int int_value; | 98 int int_value; |
| 99 double double_value; | 99 double double_value; |
| 100 std::string string_value; | 100 std::string string_value; |
| 101 int npobject_routing_id; | 101 int npobject_routing_id; |
| 102 intptr_t npobject_pointer; | 102 intptr_t npobject_pointer; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 struct PluginMsg_UpdateGeometry_Param { |
| 106 gfx::Rect window_rect; |
| 107 gfx::Rect clip_rect; |
| 108 TransportDIB::Handle windowless_buffer; |
| 109 TransportDIB::Handle background_buffer; |
| 110 }; |
| 111 |
| 105 | 112 |
| 106 namespace IPC { | 113 namespace IPC { |
| 107 | 114 |
| 108 // Traits for PluginMsg_Init_Params structure to pack/unpack. | 115 // Traits for PluginMsg_Init_Params structure to pack/unpack. |
| 109 template <> | 116 template <> |
| 110 struct ParamTraits<PluginMsg_Init_Params> { | 117 struct ParamTraits<PluginMsg_Init_Params> { |
| 111 typedef PluginMsg_Init_Params param_type; | 118 typedef PluginMsg_Init_Params param_type; |
| 112 static void Write(Message* m, const param_type& p) { | 119 static void Write(Message* m, const param_type& p) { |
| 113 WriteParam(m, p.containing_window); | 120 WriteParam(m, p.containing_window); |
| 114 WriteParam(m, p.url); | 121 WriteParam(m, p.url); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 LogParam(p.string_value, l); | 407 LogParam(p.string_value, l); |
| 401 } else if (p.type == NPVARIANT_PARAM_OBJECT_ROUTING_ID) { | 408 } else if (p.type == NPVARIANT_PARAM_OBJECT_ROUTING_ID) { |
| 402 LogParam(p.npobject_routing_id, l); | 409 LogParam(p.npobject_routing_id, l); |
| 403 LogParam(p.npobject_pointer, l); | 410 LogParam(p.npobject_pointer, l); |
| 404 } else if (p.type == NPVARIANT_PARAM_OBJECT_POINTER) { | 411 } else if (p.type == NPVARIANT_PARAM_OBJECT_POINTER) { |
| 405 LogParam(p.npobject_pointer, l); | 412 LogParam(p.npobject_pointer, l); |
| 406 } | 413 } |
| 407 } | 414 } |
| 408 }; | 415 }; |
| 409 | 416 |
| 417 // For windowless plugins, windowless_buffer |
| 418 // contains a buffer that the plugin draws into. background_buffer is used |
| 419 // for transparent windowless plugins, and holds the background of the plugin |
| 420 // rectangle. |
| 421 template <> |
| 422 struct ParamTraits<PluginMsg_UpdateGeometry_Param> { |
| 423 typedef PluginMsg_UpdateGeometry_Param param_type; |
| 424 static void Write(Message* m, const param_type& p) { |
| 425 WriteParam(m, p.window_rect); |
| 426 WriteParam(m, p.clip_rect); |
| 427 WriteParam(m, p.windowless_buffer); |
| 428 WriteParam(m, p.background_buffer); |
| 429 } |
| 430 static bool Read(const Message* m, void** iter, param_type* r) { |
| 431 return |
| 432 ReadParam(m, iter, &r->window_rect) && |
| 433 ReadParam(m, iter, &r->clip_rect) && |
| 434 ReadParam(m, iter, &r->windowless_buffer) && |
| 435 ReadParam(m, iter, &r->background_buffer); |
| 436 } |
| 437 static void Log(const param_type& p, std::wstring* l) { |
| 438 l->append(L"("); |
| 439 LogParam(p.window_rect, l); |
| 440 l->append(L", "); |
| 441 LogParam(p.clip_rect, l); |
| 442 l->append(L", "); |
| 443 LogParam(p.windowless_buffer, l); |
| 444 l->append(L", "); |
| 445 LogParam(p.background_buffer, l); |
| 446 l->append(L")"); |
| 447 } |
| 448 }; |
| 449 |
| 410 } // namespace IPC | 450 } // namespace IPC |
| 411 | 451 |
| 412 | 452 |
| 413 #define MESSAGES_INTERNAL_FILE "chrome/common/plugin_messages_internal.h" | 453 #define MESSAGES_INTERNAL_FILE "chrome/common/plugin_messages_internal.h" |
| 414 #include "ipc/ipc_message_macros.h" | 454 #include "ipc/ipc_message_macros.h" |
| 415 | 455 |
| 416 #endif // CHROME_COMMON_PLUGIN_MESSAGES_H__ | 456 #endif // CHROME_COMMON_PLUGIN_MESSAGES_H__ |
| OLD | NEW |