| 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 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ | 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
| 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ | 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 // Whether the content of the frame was replaced with some alternate content | 170 // Whether the content of the frame was replaced with some alternate content |
| 171 // (this can happen if the resource was insecure). | 171 // (this can happen if the resource was insecure). |
| 172 bool is_content_filtered; | 172 bool is_content_filtered; |
| 173 | 173 |
| 174 // The status code of the HTTP request. | 174 // The status code of the HTTP request. |
| 175 int http_status_code; | 175 int http_status_code; |
| 176 }; | 176 }; |
| 177 | 177 |
| 178 // Values that may be OR'd together to form the 'flags' parameter of a | 178 // Values that may be OR'd together to form the 'flags' parameter of a |
| 179 // ViewHostMsg_PaintRect message. | 179 // ViewHostMsg_UpdateRect_Params structure. |
| 180 struct ViewHostMsg_PaintRect_Flags { | 180 struct ViewHostMsg_UpdateRect_Flags { |
| 181 enum { | 181 enum { |
| 182 IS_RESIZE_ACK = 1 << 0, | 182 IS_RESIZE_ACK = 1 << 0, |
| 183 IS_RESTORE_ACK = 1 << 1, | 183 IS_RESTORE_ACK = 1 << 1, |
| 184 IS_REPAINT_ACK = 1 << 2, | 184 IS_REPAINT_ACK = 1 << 2, |
| 185 }; | 185 }; |
| 186 static bool is_resize_ack(int flags) { | 186 static bool is_resize_ack(int flags) { |
| 187 return (flags & IS_RESIZE_ACK) != 0; | 187 return (flags & IS_RESIZE_ACK) != 0; |
| 188 } | 188 } |
| 189 static bool is_restore_ack(int flags) { | 189 static bool is_restore_ack(int flags) { |
| 190 return (flags & IS_RESTORE_ACK) != 0; | 190 return (flags & IS_RESTORE_ACK) != 0; |
| 191 } | 191 } |
| 192 | |
| 193 static bool is_repaint_ack(int flags) { | 192 static bool is_repaint_ack(int flags) { |
| 194 return (flags & IS_REPAINT_ACK) != 0; | 193 return (flags & IS_REPAINT_ACK) != 0; |
| 195 } | 194 } |
| 196 }; | 195 }; |
| 197 | 196 |
| 198 struct ViewHostMsg_PaintRect_Params { | 197 struct ViewHostMsg_UpdateRect_Params { |
| 199 // The bitmap to be painted into the view at the locations specified by | 198 // The bitmap to be painted into the view at the locations specified by |
| 200 // update_rects. | 199 // update_rects. |
| 201 TransportDIB::Id bitmap; | 200 TransportDIB::Id bitmap; |
| 202 | 201 |
| 203 // The position and size of the bitmap. | 202 // The position and size of the bitmap. |
| 204 gfx::Rect bitmap_rect; | 203 gfx::Rect bitmap_rect; |
| 205 | 204 |
| 205 // The scroll offset. Only one of these can be non-zero, and if they are |
| 206 // both zero, then it means there is no scrolling and the scroll_rect is |
| 207 // ignored. |
| 208 int dx; |
| 209 int dy; |
| 210 |
| 211 // The rectangular region to scroll. |
| 212 gfx::Rect scroll_rect; |
| 213 |
| 206 // The regions of the bitmap (in view coords) that contain updated pixels. | 214 // The regions of the bitmap (in view coords) that contain updated pixels. |
| 207 std::vector<gfx::Rect> update_rects; | 215 // In the case of scrolling, this includes the scroll damage rect. |
| 216 std::vector<gfx::Rect> copy_rects; |
| 208 | 217 |
| 209 // The size of the RenderView when this message was generated. This is | 218 // The size of the RenderView when this message was generated. This is |
| 210 // included so the host knows how large the view is from the perspective of | 219 // included so the host knows how large the view is from the perspective of |
| 211 // the renderer process. This is necessary in case a resize operation is in | 220 // the renderer process. This is necessary in case a resize operation is in |
| 212 // progress. | 221 // progress. |
| 213 gfx::Size view_size; | 222 gfx::Size view_size; |
| 214 | 223 |
| 215 // New window locations for plugin child windows. | 224 // New window locations for plugin child windows. |
| 216 std::vector<webkit_glue::WebPluginGeometry> plugin_window_moves; | 225 std::vector<webkit_glue::WebPluginGeometry> plugin_window_moves; |
| 217 | 226 |
| 218 // The following describes the various bits that may be set in flags: | 227 // The following describes the various bits that may be set in flags: |
| 219 // | 228 // |
| 220 // ViewHostMsg_PaintRect_Flags::IS_RESIZE_ACK | 229 // ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK |
| 221 // Indicates that this is a response to a ViewMsg_Resize message. | 230 // Indicates that this is a response to a ViewMsg_Resize message. |
| 222 // | 231 // |
| 223 // ViewHostMsg_PaintRect_Flags::IS_RESTORE_ACK | 232 // ViewHostMsg_UpdateRect_Flags::IS_RESTORE_ACK |
| 224 // Indicates that this is a response to a ViewMsg_WasRestored message. | 233 // Indicates that this is a response to a ViewMsg_WasRestored message. |
| 225 // | 234 // |
| 235 // ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK |
| 236 // Indicates that this is a response to a ViewMsg_Repaint message. |
| 237 // |
| 226 // If flags is zero, then this message corresponds to an unsoliticed paint | 238 // If flags is zero, then this message corresponds to an unsoliticed paint |
| 227 // request by the render view. Both of the above bits may be set in flags, | 239 // request by the render view. Any of the above bits may be set in flags, |
| 228 // which would indicate that this paint message is an ACK for multiple | 240 // which would indicate that this paint message is an ACK for multiple |
| 229 // request messages. | 241 // request messages. |
| 230 int flags; | 242 int flags; |
| 231 }; | 243 }; |
| 232 | 244 |
| 233 // Parameters structure for ViewHostMsg_ScrollRect, which has too many data | |
| 234 // parameters to be reasonably put in a predefined IPC message. | |
| 235 struct ViewHostMsg_ScrollRect_Params { | |
| 236 // The bitmap to be painted into the rect exposed by scrolling. | |
| 237 TransportDIB::Id bitmap; | |
| 238 | |
| 239 // The position and size of the bitmap. | |
| 240 gfx::Rect bitmap_rect; | |
| 241 | |
| 242 // The scroll offset. Only one of these can be non-zero. | |
| 243 int dx; | |
| 244 int dy; | |
| 245 | |
| 246 // The rectangular region to scroll. | |
| 247 gfx::Rect clip_rect; | |
| 248 | |
| 249 // The size of the RenderView when this message was generated. | |
| 250 gfx::Size view_size; | |
| 251 | |
| 252 // New window locations for plugin child windows. | |
| 253 std::vector<webkit_glue::WebPluginGeometry> plugin_window_moves; | |
| 254 }; | |
| 255 | |
| 256 // Information on closing a tab. This is used both for ViewMsg_ClosePage, and | 245 // Information on closing a tab. This is used both for ViewMsg_ClosePage, and |
| 257 // the corresponding ViewHostMsg_ClosePage_ACK. | 246 // the corresponding ViewHostMsg_ClosePage_ACK. |
| 258 struct ViewMsg_ClosePage_Params { | 247 struct ViewMsg_ClosePage_Params { |
| 259 // The identifier of the RenderProcessHost for the currently closing view. | 248 // The identifier of the RenderProcessHost for the currently closing view. |
| 260 // | 249 // |
| 261 // These first two parameters are technically redundant since they are | 250 // These first two parameters are technically redundant since they are |
| 262 // needed only when processing the ACK message, and the processor | 251 // needed only when processing the ACK message, and the processor |
| 263 // theoretically knows both the process and route ID. However, this is | 252 // theoretically knows both the process and route ID. However, this is |
| 264 // difficult to figure out with our current implementation, so this | 253 // difficult to figure out with our current implementation, so this |
| 265 // information is duplicate here. | 254 // information is duplicate here. |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 ReadParam(m, iter, &p->edit_flags) && | 960 ReadParam(m, iter, &p->edit_flags) && |
| 972 ReadParam(m, iter, &p->security_info) && | 961 ReadParam(m, iter, &p->security_info) && |
| 973 ReadParam(m, iter, &p->frame_charset) && | 962 ReadParam(m, iter, &p->frame_charset) && |
| 974 ReadParam(m, iter, &p->custom_items); | 963 ReadParam(m, iter, &p->custom_items); |
| 975 } | 964 } |
| 976 static void Log(const param_type& p, std::wstring* l) { | 965 static void Log(const param_type& p, std::wstring* l) { |
| 977 l->append(L"<ContextMenuParams>"); | 966 l->append(L"<ContextMenuParams>"); |
| 978 } | 967 } |
| 979 }; | 968 }; |
| 980 | 969 |
| 981 // Traits for ViewHostMsg_PaintRect_Params structure to pack/unpack. | 970 // Traits for ViewHostMsg_UpdateRect_Params structure to pack/unpack. |
| 982 template <> | 971 template <> |
| 983 struct ParamTraits<ViewHostMsg_PaintRect_Params> { | 972 struct ParamTraits<ViewHostMsg_UpdateRect_Params> { |
| 984 typedef ViewHostMsg_PaintRect_Params param_type; | 973 typedef ViewHostMsg_UpdateRect_Params param_type; |
| 985 static void Write(Message* m, const param_type& p) { | 974 static void Write(Message* m, const param_type& p) { |
| 986 WriteParam(m, p.bitmap); | 975 WriteParam(m, p.bitmap); |
| 987 WriteParam(m, p.bitmap_rect); | 976 WriteParam(m, p.bitmap_rect); |
| 988 WriteParam(m, p.update_rects); | 977 WriteParam(m, p.dx); |
| 978 WriteParam(m, p.dy); |
| 979 WriteParam(m, p.scroll_rect); |
| 980 WriteParam(m, p.copy_rects); |
| 989 WriteParam(m, p.view_size); | 981 WriteParam(m, p.view_size); |
| 990 WriteParam(m, p.plugin_window_moves); | 982 WriteParam(m, p.plugin_window_moves); |
| 991 WriteParam(m, p.flags); | 983 WriteParam(m, p.flags); |
| 992 } | 984 } |
| 993 static bool Read(const Message* m, void** iter, param_type* p) { | 985 static bool Read(const Message* m, void** iter, param_type* p) { |
| 994 return | 986 return |
| 995 ReadParam(m, iter, &p->bitmap) && | |
| 996 ReadParam(m, iter, &p->bitmap_rect) && | |
| 997 ReadParam(m, iter, &p->update_rects) && | |
| 998 ReadParam(m, iter, &p->view_size) && | |
| 999 ReadParam(m, iter, &p->plugin_window_moves) && | |
| 1000 ReadParam(m, iter, &p->flags); | |
| 1001 } | |
| 1002 static void Log(const param_type& p, std::wstring* l) { | |
| 1003 l->append(L"("); | |
| 1004 LogParam(p.bitmap, l); | |
| 1005 l->append(L", "); | |
| 1006 LogParam(p.bitmap_rect, l); | |
| 1007 l->append(L", "); | |
| 1008 LogParam(p.update_rects, l); | |
| 1009 l->append(L", "); | |
| 1010 LogParam(p.view_size, l); | |
| 1011 l->append(L", "); | |
| 1012 LogParam(p.plugin_window_moves, l); | |
| 1013 l->append(L", "); | |
| 1014 LogParam(p.flags, l); | |
| 1015 l->append(L")"); | |
| 1016 } | |
| 1017 }; | |
| 1018 | |
| 1019 // Traits for ViewHostMsg_ScrollRect_Params structure to pack/unpack. | |
| 1020 template <> | |
| 1021 struct ParamTraits<ViewHostMsg_ScrollRect_Params> { | |
| 1022 typedef ViewHostMsg_ScrollRect_Params param_type; | |
| 1023 static void Write(Message* m, const param_type& p) { | |
| 1024 WriteParam(m, p.bitmap); | |
| 1025 WriteParam(m, p.bitmap_rect); | |
| 1026 WriteParam(m, p.dx); | |
| 1027 WriteParam(m, p.dy); | |
| 1028 WriteParam(m, p.clip_rect); | |
| 1029 WriteParam(m, p.view_size); | |
| 1030 WriteParam(m, p.plugin_window_moves); | |
| 1031 } | |
| 1032 static bool Read(const Message* m, void** iter, param_type* p) { | |
| 1033 return | |
| 1034 ReadParam(m, iter, &p->bitmap) && | 987 ReadParam(m, iter, &p->bitmap) && |
| 1035 ReadParam(m, iter, &p->bitmap_rect) && | 988 ReadParam(m, iter, &p->bitmap_rect) && |
| 1036 ReadParam(m, iter, &p->dx) && | 989 ReadParam(m, iter, &p->dx) && |
| 1037 ReadParam(m, iter, &p->dy) && | 990 ReadParam(m, iter, &p->dy) && |
| 1038 ReadParam(m, iter, &p->clip_rect) && | 991 ReadParam(m, iter, &p->scroll_rect) && |
| 992 ReadParam(m, iter, &p->copy_rects) && |
| 1039 ReadParam(m, iter, &p->view_size) && | 993 ReadParam(m, iter, &p->view_size) && |
| 1040 ReadParam(m, iter, &p->plugin_window_moves); | 994 ReadParam(m, iter, &p->plugin_window_moves) && |
| 995 ReadParam(m, iter, &p->flags); |
| 1041 } | 996 } |
| 1042 static void Log(const param_type& p, std::wstring* l) { | 997 static void Log(const param_type& p, std::wstring* l) { |
| 1043 l->append(L"("); | 998 l->append(L"("); |
| 1044 LogParam(p.bitmap, l); | 999 LogParam(p.bitmap, l); |
| 1045 l->append(L", "); | 1000 l->append(L", "); |
| 1046 LogParam(p.bitmap_rect, l); | 1001 LogParam(p.bitmap_rect, l); |
| 1047 l->append(L", "); | 1002 l->append(L", "); |
| 1048 LogParam(p.dx, l); | 1003 LogParam(p.dx, l); |
| 1049 l->append(L", "); | 1004 l->append(L", "); |
| 1050 LogParam(p.dy, l); | 1005 LogParam(p.dy, l); |
| 1051 l->append(L", "); | 1006 l->append(L", "); |
| 1052 LogParam(p.clip_rect, l); | 1007 LogParam(p.scroll_rect, l); |
| 1008 l->append(L", "); |
| 1009 LogParam(p.copy_rects, l); |
| 1053 l->append(L", "); | 1010 l->append(L", "); |
| 1054 LogParam(p.view_size, l); | 1011 LogParam(p.view_size, l); |
| 1055 l->append(L", "); | 1012 l->append(L", "); |
| 1056 LogParam(p.plugin_window_moves, l); | 1013 LogParam(p.plugin_window_moves, l); |
| 1014 l->append(L", "); |
| 1015 LogParam(p.flags, l); |
| 1057 l->append(L")"); | 1016 l->append(L")"); |
| 1058 } | 1017 } |
| 1059 }; | 1018 }; |
| 1060 | 1019 |
| 1061 template <> | 1020 template <> |
| 1062 struct ParamTraits<webkit_glue::WebPluginGeometry> { | 1021 struct ParamTraits<webkit_glue::WebPluginGeometry> { |
| 1063 typedef webkit_glue::WebPluginGeometry param_type; | 1022 typedef webkit_glue::WebPluginGeometry param_type; |
| 1064 static void Write(Message* m, const param_type& p) { | 1023 static void Write(Message* m, const param_type& p) { |
| 1065 WriteParam(m, p.window); | 1024 WriteParam(m, p.window); |
| 1066 WriteParam(m, p.window_rect); | 1025 WriteParam(m, p.window_rect); |
| (...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2284 } | 2243 } |
| 2285 }; | 2244 }; |
| 2286 | 2245 |
| 2287 } // namespace IPC | 2246 } // namespace IPC |
| 2288 | 2247 |
| 2289 | 2248 |
| 2290 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 2249 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
| 2291 #include "ipc/ipc_message_macros.h" | 2250 #include "ipc/ipc_message_macros.h" |
| 2292 | 2251 |
| 2293 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 2252 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
| OLD | NEW |