| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 l->append(", "); | 259 l->append(", "); |
| 260 LogParam(p.send_end, l); | 260 LogParam(p.send_end, l); |
| 261 l->append(", "); | 261 l->append(", "); |
| 262 LogParam(p.receive_headers_start, l); | 262 LogParam(p.receive_headers_start, l); |
| 263 l->append(", "); | 263 l->append(", "); |
| 264 LogParam(p.receive_headers_end, l); | 264 LogParam(p.receive_headers_end, l); |
| 265 l->append(")"); | 265 l->append(")"); |
| 266 } | 266 } |
| 267 }; | 267 }; |
| 268 | 268 |
| 269 template <> |
| 270 struct ParamTraits< |
| 271 scoped_refptr<webkit_glue::ResourceLoaderBridge::DevToolsInfo> > { |
| 272 typedef scoped_refptr<webkit_glue::ResourceLoaderBridge::DevToolsInfo> |
| 273 param_type; |
| 274 static void Write(Message* m, const param_type& p) { |
| 275 WriteParam(m, p.get() != NULL); |
| 276 if (p.get()) { |
| 277 WriteParam(m, p->request_headers); |
| 278 WriteParam(m, p->response_headers); |
| 279 } |
| 280 } |
| 281 static bool Read(const Message* m, void** iter, param_type* r) { |
| 282 bool has_object; |
| 283 if (!ReadParam(m, iter, &has_object)) |
| 284 return false; |
| 285 if (!has_object) |
| 286 return true; |
| 287 *r = new webkit_glue::ResourceLoaderBridge::DevToolsInfo(); |
| 288 return |
| 289 ReadParam(m, iter, &(*r)->request_headers) && |
| 290 ReadParam(m, iter, &(*r)->response_headers); |
| 291 } |
| 292 static void Log(const param_type& p, std::string* l) { |
| 293 l->append("("); |
| 294 if (p) { |
| 295 LogParam(p->request_headers, l); |
| 296 l->append(", "); |
| 297 LogParam(p->response_headers, l); |
| 298 } |
| 299 l->append(")"); |
| 300 } |
| 301 }; |
| 302 |
| 269 // Traits for webkit_glue::ResourceLoaderBridge::ResponseInfo | 303 // Traits for webkit_glue::ResourceLoaderBridge::ResponseInfo |
| 270 template <> | 304 template <> |
| 271 struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> { | 305 struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> { |
| 272 typedef webkit_glue::ResourceLoaderBridge::ResponseInfo param_type; | 306 typedef webkit_glue::ResourceLoaderBridge::ResponseInfo param_type; |
| 273 static void Write(Message* m, const param_type& p) { | 307 static void Write(Message* m, const param_type& p) { |
| 274 WriteParam(m, p.request_time); | 308 WriteParam(m, p.request_time); |
| 275 WriteParam(m, p.response_time); | 309 WriteParam(m, p.response_time); |
| 276 WriteParam(m, p.headers); | 310 WriteParam(m, p.headers); |
| 277 WriteParam(m, p.mime_type); | 311 WriteParam(m, p.mime_type); |
| 278 WriteParam(m, p.charset); | 312 WriteParam(m, p.charset); |
| 279 WriteParam(m, p.security_info); | 313 WriteParam(m, p.security_info); |
| 280 WriteParam(m, p.content_length); | 314 WriteParam(m, p.content_length); |
| 281 WriteParam(m, p.appcache_id); | 315 WriteParam(m, p.appcache_id); |
| 282 WriteParam(m, p.appcache_manifest_url); | 316 WriteParam(m, p.appcache_manifest_url); |
| 283 WriteParam(m, p.connection_id); | 317 WriteParam(m, p.connection_id); |
| 284 WriteParam(m, p.connection_reused); | 318 WriteParam(m, p.connection_reused); |
| 285 WriteParam(m, p.load_timing); | 319 WriteParam(m, p.load_timing); |
| 320 WriteParam(m, p.devtools_info); |
| 286 WriteParam(m, p.download_file_path); | 321 WriteParam(m, p.download_file_path); |
| 287 WriteParam(m, p.was_fetched_via_spdy); | 322 WriteParam(m, p.was_fetched_via_spdy); |
| 288 WriteParam(m, p.was_npn_negotiated); | 323 WriteParam(m, p.was_npn_negotiated); |
| 289 WriteParam(m, p.was_alternate_protocol_available); | 324 WriteParam(m, p.was_alternate_protocol_available); |
| 290 WriteParam(m, p.was_fetched_via_proxy); | 325 WriteParam(m, p.was_fetched_via_proxy); |
| 291 } | 326 } |
| 292 static bool Read(const Message* m, void** iter, param_type* r) { | 327 static bool Read(const Message* m, void** iter, param_type* r) { |
| 293 return | 328 return |
| 294 ReadParam(m, iter, &r->request_time) && | 329 ReadParam(m, iter, &r->request_time) && |
| 295 ReadParam(m, iter, &r->response_time) && | 330 ReadParam(m, iter, &r->response_time) && |
| 296 ReadParam(m, iter, &r->headers) && | 331 ReadParam(m, iter, &r->headers) && |
| 297 ReadParam(m, iter, &r->mime_type) && | 332 ReadParam(m, iter, &r->mime_type) && |
| 298 ReadParam(m, iter, &r->charset) && | 333 ReadParam(m, iter, &r->charset) && |
| 299 ReadParam(m, iter, &r->security_info) && | 334 ReadParam(m, iter, &r->security_info) && |
| 300 ReadParam(m, iter, &r->content_length) && | 335 ReadParam(m, iter, &r->content_length) && |
| 301 ReadParam(m, iter, &r->appcache_id) && | 336 ReadParam(m, iter, &r->appcache_id) && |
| 302 ReadParam(m, iter, &r->appcache_manifest_url) && | 337 ReadParam(m, iter, &r->appcache_manifest_url) && |
| 303 ReadParam(m, iter, &r->connection_id) && | 338 ReadParam(m, iter, &r->connection_id) && |
| 304 ReadParam(m, iter, &r->connection_reused) && | 339 ReadParam(m, iter, &r->connection_reused) && |
| 305 ReadParam(m, iter, &r->load_timing) && | 340 ReadParam(m, iter, &r->load_timing) && |
| 341 ReadParam(m, iter, &r->devtools_info) && |
| 306 ReadParam(m, iter, &r->download_file_path) && | 342 ReadParam(m, iter, &r->download_file_path) && |
| 307 ReadParam(m, iter, &r->was_fetched_via_spdy) && | 343 ReadParam(m, iter, &r->was_fetched_via_spdy) && |
| 308 ReadParam(m, iter, &r->was_npn_negotiated) && | 344 ReadParam(m, iter, &r->was_npn_negotiated) && |
| 309 ReadParam(m, iter, &r->was_alternate_protocol_available) && | 345 ReadParam(m, iter, &r->was_alternate_protocol_available) && |
| 310 ReadParam(m, iter, &r->was_fetched_via_proxy); | 346 ReadParam(m, iter, &r->was_fetched_via_proxy); |
| 311 } | 347 } |
| 312 static void Log(const param_type& p, std::string* l) { | 348 static void Log(const param_type& p, std::string* l) { |
| 313 l->append("("); | 349 l->append("("); |
| 314 LogParam(p.request_time, l); | 350 LogParam(p.request_time, l); |
| 315 l->append(", "); | 351 l->append(", "); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 328 LogParam(p.appcache_id, l); | 364 LogParam(p.appcache_id, l); |
| 329 l->append(", "); | 365 l->append(", "); |
| 330 LogParam(p.appcache_manifest_url, l); | 366 LogParam(p.appcache_manifest_url, l); |
| 331 l->append(", "); | 367 l->append(", "); |
| 332 LogParam(p.connection_id, l); | 368 LogParam(p.connection_id, l); |
| 333 l->append(", "); | 369 l->append(", "); |
| 334 LogParam(p.connection_reused, l); | 370 LogParam(p.connection_reused, l); |
| 335 l->append(", "); | 371 l->append(", "); |
| 336 LogParam(p.load_timing, l); | 372 LogParam(p.load_timing, l); |
| 337 l->append(", "); | 373 l->append(", "); |
| 374 LogParam(p.devtools_info, l); |
| 375 l->append(", "); |
| 338 LogParam(p.download_file_path, l); | 376 LogParam(p.download_file_path, l); |
| 339 l->append(", "); | 377 l->append(", "); |
| 340 LogParam(p.was_fetched_via_spdy, l); | 378 LogParam(p.was_fetched_via_spdy, l); |
| 341 l->append(", "); | 379 l->append(", "); |
| 342 LogParam(p.was_npn_negotiated, l); | 380 LogParam(p.was_npn_negotiated, l); |
| 343 l->append(", "); | 381 l->append(", "); |
| 344 LogParam(p.was_alternate_protocol_available, l); | 382 LogParam(p.was_alternate_protocol_available, l); |
| 345 l->append(", "); | 383 l->append(", "); |
| 346 LogParam(p.was_fetched_via_proxy, l); | 384 LogParam(p.was_fetched_via_proxy, l); |
| 347 l->append(")"); | 385 l->append(")"); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 static bool Read(const Message* m, void** iter, param_type* p); | 794 static bool Read(const Message* m, void** iter, param_type* p); |
| 757 static void Log(const param_type& p, std::string* l); | 795 static void Log(const param_type& p, std::string* l); |
| 758 }; | 796 }; |
| 759 | 797 |
| 760 } // namespace IPC | 798 } // namespace IPC |
| 761 | 799 |
| 762 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 800 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
| 763 #include "ipc/ipc_message_macros.h" | 801 #include "ipc/ipc_message_macros.h" |
| 764 | 802 |
| 765 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 803 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
| OLD | NEW |