| 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/browser/frame_host/navigation_entry_impl.h" | 5 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 | 700 |
| 701 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() | 701 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() |
| 702 const { | 702 const { |
| 703 return StartNavigationParams(extra_headers(), | 703 return StartNavigationParams(extra_headers(), |
| 704 transferred_global_request_id().child_id, | 704 transferred_global_request_id().child_id, |
| 705 transferred_global_request_id().request_id); | 705 transferred_global_request_id().request_id); |
| 706 } | 706 } |
| 707 | 707 |
| 708 RequestNavigationParams NavigationEntryImpl::ConstructRequestNavigationParams( | 708 RequestNavigationParams NavigationEntryImpl::ConstructRequestNavigationParams( |
| 709 const FrameNavigationEntry& frame_entry, | 709 const FrameNavigationEntry& frame_entry, |
| 710 bool is_same_document_navigation, |
| 710 bool is_same_document_history_load, | 711 bool is_same_document_history_load, |
| 711 bool is_history_navigation_in_new_child, | 712 bool is_history_navigation_in_new_child, |
| 712 const std::map<std::string, bool>& subframe_unique_names, | 713 const std::map<std::string, bool>& subframe_unique_names, |
| 713 bool has_committed_real_load, | 714 bool has_committed_real_load, |
| 714 bool intended_as_new_entry, | 715 bool intended_as_new_entry, |
| 715 int pending_history_list_offset, | 716 int pending_history_list_offset, |
| 716 int current_history_list_offset, | 717 int current_history_list_offset, |
| 717 int current_history_list_length) const { | 718 int current_history_list_length) const { |
| 718 // Set the redirect chain to the navigation's redirects, unless returning to a | 719 // Set the redirect chain to the navigation's redirects, unless returning to a |
| 719 // completed navigation (whose previous redirects don't apply). | 720 // completed navigation (whose previous redirects don't apply). |
| (...skipping 13 matching lines...) Expand all Loading... |
| 733 current_offset_to_send = -1; | 734 current_offset_to_send = -1; |
| 734 current_length_to_send = 0; | 735 current_length_to_send = 0; |
| 735 } | 736 } |
| 736 | 737 |
| 737 bool user_gesture = false; | 738 bool user_gesture = false; |
| 738 #if defined(OS_ANDROID) | 739 #if defined(OS_ANDROID) |
| 739 user_gesture = has_user_gesture(); | 740 user_gesture = has_user_gesture(); |
| 740 #endif | 741 #endif |
| 741 RequestNavigationParams request_params( | 742 RequestNavigationParams request_params( |
| 742 GetIsOverridingUserAgent(), redirects, GetCanLoadLocalResources(), | 743 GetIsOverridingUserAgent(), redirects, GetCanLoadLocalResources(), |
| 743 frame_entry.page_state(), GetUniqueID(), is_same_document_history_load, | 744 frame_entry.page_state(), GetUniqueID(), is_same_document_navigation, |
| 744 is_history_navigation_in_new_child, subframe_unique_names, | 745 is_same_document_history_load, is_history_navigation_in_new_child, |
| 745 has_committed_real_load, intended_as_new_entry, pending_offset_to_send, | 746 subframe_unique_names, has_committed_real_load, intended_as_new_entry, |
| 746 current_offset_to_send, current_length_to_send, IsViewSourceMode(), | 747 pending_offset_to_send, current_offset_to_send, current_length_to_send, |
| 747 should_clear_history_list(), user_gesture); | 748 IsViewSourceMode(), should_clear_history_list(), user_gesture); |
| 748 #if defined(OS_ANDROID) | 749 #if defined(OS_ANDROID) |
| 749 if (GetDataURLAsString() && | 750 if (GetDataURLAsString() && |
| 750 GetDataURLAsString()->size() <= kMaxLengthOfDataURLString) { | 751 GetDataURLAsString()->size() <= kMaxLengthOfDataURLString) { |
| 751 // The number of characters that is enough for validating a data: URI. From | 752 // The number of characters that is enough for validating a data: URI. From |
| 752 // the GURL's POV, the only important part here is scheme, it doesn't check | 753 // the GURL's POV, the only important part here is scheme, it doesn't check |
| 753 // the actual content. Thus we can take only the prefix of the url, to avoid | 754 // the actual content. Thus we can take only the prefix of the url, to avoid |
| 754 // unneeded copying of a potentially long string. | 755 // unneeded copying of a potentially long string. |
| 755 const size_t kDataUriPrefixMaxLen = 64; | 756 const size_t kDataUriPrefixMaxLen = 64; |
| 756 GURL data_url(std::string( | 757 GURL data_url(std::string( |
| 757 GetDataURLAsString()->front_as<char>(), | 758 GetDataURLAsString()->front_as<char>(), |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 return node; | 957 return node; |
| 957 | 958 |
| 958 // Enqueue any children and keep looking. | 959 // Enqueue any children and keep looking. |
| 959 for (auto* child : node->children) | 960 for (auto* child : node->children) |
| 960 work_queue.push(child); | 961 work_queue.push(child); |
| 961 } | 962 } |
| 962 return nullptr; | 963 return nullptr; |
| 963 } | 964 } |
| 964 | 965 |
| 965 } // namespace content | 966 } // namespace content |
| OLD | NEW |