OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/common/page_state_serialization.h" | 5 #include "content/common/page_state_serialization.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 ExplodedHttpBody::~ExplodedHttpBody() { | 689 ExplodedHttpBody::~ExplodedHttpBody() { |
690 } | 690 } |
691 | 691 |
692 ExplodedFrameState::ExplodedFrameState() | 692 ExplodedFrameState::ExplodedFrameState() |
693 : item_sequence_number(0), | 693 : item_sequence_number(0), |
694 document_sequence_number(0), | 694 document_sequence_number(0), |
695 page_scale_factor(0.0), | 695 page_scale_factor(0.0), |
696 referrer_policy(blink::WebReferrerPolicyDefault) { | 696 referrer_policy(blink::WebReferrerPolicyDefault) { |
697 } | 697 } |
698 | 698 |
| 699 ExplodedFrameState::ExplodedFrameState(const ExplodedFrameState& other) { |
| 700 assign(other); |
| 701 } |
| 702 |
699 ExplodedFrameState::~ExplodedFrameState() { | 703 ExplodedFrameState::~ExplodedFrameState() { |
700 } | 704 } |
701 | 705 |
| 706 void ExplodedFrameState::operator=(const ExplodedFrameState& other) { |
| 707 if (&other != this) |
| 708 assign(other); |
| 709 } |
| 710 |
| 711 void ExplodedFrameState::assign(const ExplodedFrameState& other) { |
| 712 url_string = other.url_string; |
| 713 referrer = other.referrer; |
| 714 target = other.target; |
| 715 state_object = other.state_object; |
| 716 document_state = other.document_state; |
| 717 pinch_viewport_scroll_offset = other.pinch_viewport_scroll_offset; |
| 718 scroll_offset = other.scroll_offset; |
| 719 item_sequence_number = other.item_sequence_number; |
| 720 document_sequence_number = other.document_sequence_number; |
| 721 page_scale_factor = other.page_scale_factor; |
| 722 referrer_policy = other.referrer_policy; |
| 723 http_body = other.http_body; |
| 724 children = other.children; |
| 725 } |
| 726 |
702 ExplodedPageState::ExplodedPageState() { | 727 ExplodedPageState::ExplodedPageState() { |
703 } | 728 } |
704 | 729 |
705 ExplodedPageState::~ExplodedPageState() { | 730 ExplodedPageState::~ExplodedPageState() { |
706 } | 731 } |
707 | 732 |
708 bool DecodePageState(const std::string& encoded, ExplodedPageState* exploded) { | 733 bool DecodePageState(const std::string& encoded, ExplodedPageState* exploded) { |
709 *exploded = ExplodedPageState(); | 734 *exploded = ExplodedPageState(); |
710 | 735 |
711 if (encoded.empty()) | 736 if (encoded.empty()) |
(...skipping 18 matching lines...) Expand all Loading... |
730 float device_scale_factor, | 755 float device_scale_factor, |
731 ExplodedPageState* exploded) { | 756 ExplodedPageState* exploded) { |
732 g_device_scale_factor_for_testing = device_scale_factor; | 757 g_device_scale_factor_for_testing = device_scale_factor; |
733 bool rv = DecodePageState(encoded, exploded); | 758 bool rv = DecodePageState(encoded, exploded); |
734 g_device_scale_factor_for_testing = 0.0; | 759 g_device_scale_factor_for_testing = 0.0; |
735 return rv; | 760 return rv; |
736 } | 761 } |
737 #endif | 762 #endif |
738 | 763 |
739 } // namespace content | 764 } // namespace content |
OLD | NEW |