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