| 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 #include "chrome/common/render_messages_params.h" | 5 #include "chrome/common/render_messages_params.h" |
| 6 | 6 |
| 7 #include "chrome/common/navigation_gesture.h" | 7 #include "chrome/common/navigation_gesture.h" |
| 8 #include "chrome/common/common_param_traits.h" | 8 #include "chrome/common/common_param_traits.h" |
| 9 #include "chrome/common/indexed_db_param_traits.h" | 9 #include "chrome/common/indexed_db_param_traits.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| 11 #include "net/base/upload_data.h" | 11 #include "net/base/upload_data.h" |
| 12 | 12 |
| 13 ViewMsg_Navigate_Params::ViewMsg_Navigate_Params() | 13 ViewMsg_Navigate_Params::ViewMsg_Navigate_Params() |
| 14 : page_id(-1), | 14 : page_id(-1), |
| 15 pending_history_list_offset(-1), | 15 pending_history_list_offset(-1), |
| 16 current_history_list_offset(-1), | 16 current_history_list_offset(-1), |
| 17 current_history_list_length(0), | 17 current_history_list_length(0), |
| 18 transition(PageTransition::LINK), | 18 transition(PageTransition::LINK), |
| 19 navigation_type(NORMAL) { | 19 navigation_type(NORMAL) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 ViewMsg_Navigate_Params::~ViewMsg_Navigate_Params() { | 22 ViewMsg_Navigate_Params::~ViewMsg_Navigate_Params() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 ViewHostMsg_FrameNavigate_Params::ViewHostMsg_FrameNavigate_Params() | 25 ViewHostMsg_FrameNavigate_Params::ViewHostMsg_FrameNavigate_Params() |
| 26 : page_id(0), | 26 : page_id(0), |
| 27 frame_id(0), |
| 27 transition(PageTransition::TYPED), | 28 transition(PageTransition::TYPED), |
| 28 should_update_history(false), | 29 should_update_history(false), |
| 29 gesture(NavigationGestureUser), | 30 gesture(NavigationGestureUser), |
| 30 is_post(false), | 31 is_post(false), |
| 31 is_content_filtered(false), | 32 is_content_filtered(false), |
| 32 was_within_same_page(false), | 33 was_within_same_page(false), |
| 33 http_status_code(0) { | 34 http_status_code(0) { |
| 34 } | 35 } |
| 35 | 36 |
| 36 ViewHostMsg_FrameNavigate_Params::~ViewHostMsg_FrameNavigate_Params() { | 37 ViewHostMsg_FrameNavigate_Params::~ViewHostMsg_FrameNavigate_Params() { |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 default: | 710 default: |
| 710 state = "UNKNOWN"; | 711 state = "UNKNOWN"; |
| 711 break; | 712 break; |
| 712 } | 713 } |
| 713 LogParam(state, l); | 714 LogParam(state, l); |
| 714 } | 715 } |
| 715 | 716 |
| 716 void ParamTraits<ViewHostMsg_FrameNavigate_Params>::Write(Message* m, | 717 void ParamTraits<ViewHostMsg_FrameNavigate_Params>::Write(Message* m, |
| 717 const param_type& p) { | 718 const param_type& p) { |
| 718 WriteParam(m, p.page_id); | 719 WriteParam(m, p.page_id); |
| 720 WriteParam(m, p.frame_id); |
| 719 WriteParam(m, p.url); | 721 WriteParam(m, p.url); |
| 720 WriteParam(m, p.referrer); | 722 WriteParam(m, p.referrer); |
| 721 WriteParam(m, p.transition); | 723 WriteParam(m, p.transition); |
| 722 WriteParam(m, p.redirects); | 724 WriteParam(m, p.redirects); |
| 723 WriteParam(m, p.should_update_history); | 725 WriteParam(m, p.should_update_history); |
| 724 WriteParam(m, p.searchable_form_url); | 726 WriteParam(m, p.searchable_form_url); |
| 725 WriteParam(m, p.searchable_form_encoding); | 727 WriteParam(m, p.searchable_form_encoding); |
| 726 WriteParam(m, p.password_form); | 728 WriteParam(m, p.password_form); |
| 727 WriteParam(m, p.security_info); | 729 WriteParam(m, p.security_info); |
| 728 WriteParam(m, p.gesture); | 730 WriteParam(m, p.gesture); |
| 729 WriteParam(m, p.contents_mime_type); | 731 WriteParam(m, p.contents_mime_type); |
| 730 WriteParam(m, p.is_post); | 732 WriteParam(m, p.is_post); |
| 731 WriteParam(m, p.is_content_filtered); | 733 WriteParam(m, p.is_content_filtered); |
| 732 WriteParam(m, p.was_within_same_page); | 734 WriteParam(m, p.was_within_same_page); |
| 733 WriteParam(m, p.http_status_code); | 735 WriteParam(m, p.http_status_code); |
| 734 } | 736 } |
| 735 | 737 |
| 736 bool ParamTraits<ViewHostMsg_FrameNavigate_Params>::Read(const Message* m, | 738 bool ParamTraits<ViewHostMsg_FrameNavigate_Params>::Read(const Message* m, |
| 737 void** iter, | 739 void** iter, |
| 738 param_type* p) { | 740 param_type* p) { |
| 739 return | 741 return |
| 740 ReadParam(m, iter, &p->page_id) && | 742 ReadParam(m, iter, &p->page_id) && |
| 743 ReadParam(m, iter, &p->frame_id) && |
| 741 ReadParam(m, iter, &p->url) && | 744 ReadParam(m, iter, &p->url) && |
| 742 ReadParam(m, iter, &p->referrer) && | 745 ReadParam(m, iter, &p->referrer) && |
| 743 ReadParam(m, iter, &p->transition) && | 746 ReadParam(m, iter, &p->transition) && |
| 744 ReadParam(m, iter, &p->redirects) && | 747 ReadParam(m, iter, &p->redirects) && |
| 745 ReadParam(m, iter, &p->should_update_history) && | 748 ReadParam(m, iter, &p->should_update_history) && |
| 746 ReadParam(m, iter, &p->searchable_form_url) && | 749 ReadParam(m, iter, &p->searchable_form_url) && |
| 747 ReadParam(m, iter, &p->searchable_form_encoding) && | 750 ReadParam(m, iter, &p->searchable_form_encoding) && |
| 748 ReadParam(m, iter, &p->password_form) && | 751 ReadParam(m, iter, &p->password_form) && |
| 749 ReadParam(m, iter, &p->security_info) && | 752 ReadParam(m, iter, &p->security_info) && |
| 750 ReadParam(m, iter, &p->gesture) && | 753 ReadParam(m, iter, &p->gesture) && |
| 751 ReadParam(m, iter, &p->contents_mime_type) && | 754 ReadParam(m, iter, &p->contents_mime_type) && |
| 752 ReadParam(m, iter, &p->is_post) && | 755 ReadParam(m, iter, &p->is_post) && |
| 753 ReadParam(m, iter, &p->is_content_filtered) && | 756 ReadParam(m, iter, &p->is_content_filtered) && |
| 754 ReadParam(m, iter, &p->was_within_same_page) && | 757 ReadParam(m, iter, &p->was_within_same_page) && |
| 755 ReadParam(m, iter, &p->http_status_code); | 758 ReadParam(m, iter, &p->http_status_code); |
| 756 } | 759 } |
| 757 | 760 |
| 758 void ParamTraits<ViewHostMsg_FrameNavigate_Params>::Log(const param_type& p, | 761 void ParamTraits<ViewHostMsg_FrameNavigate_Params>::Log(const param_type& p, |
| 759 std::string* l) { | 762 std::string* l) { |
| 760 l->append("("); | 763 l->append("("); |
| 761 LogParam(p.page_id, l); | 764 LogParam(p.page_id, l); |
| 762 l->append(", "); | 765 l->append(", "); |
| 766 LogParam(p.frame_id, l); |
| 767 l->append(", "); |
| 763 LogParam(p.url, l); | 768 LogParam(p.url, l); |
| 764 l->append(", "); | 769 l->append(", "); |
| 765 LogParam(p.referrer, l); | 770 LogParam(p.referrer, l); |
| 766 l->append(", "); | 771 l->append(", "); |
| 767 LogParam(p.transition, l); | 772 LogParam(p.transition, l); |
| 768 l->append(", "); | 773 l->append(", "); |
| 769 LogParam(p.redirects, l); | 774 LogParam(p.redirects, l); |
| 770 l->append(", "); | 775 l->append(", "); |
| 771 LogParam(p.should_update_history, l); | 776 LogParam(p.should_update_history, l); |
| 772 l->append(", "); | 777 l->append(", "); |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1874 const param_type& p, | 1879 const param_type& p, |
| 1875 std::string* l) { | 1880 std::string* l) { |
| 1876 l->append("("); | 1881 l->append("("); |
| 1877 LogParam(p.notification_type, l); | 1882 LogParam(p.notification_type, l); |
| 1878 l->append(", "); | 1883 l->append(", "); |
| 1879 LogParam(p.acc_obj, l); | 1884 LogParam(p.acc_obj, l); |
| 1880 l->append(")"); | 1885 l->append(")"); |
| 1881 } | 1886 } |
| 1882 | 1887 |
| 1883 } // namespace IPC | 1888 } // namespace IPC |
| OLD | NEW |