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 <queue> | 7 #include <queue> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 | 147 |
148 void NavigationEntryImpl::SetBaseURLForDataURL(const GURL& url) { | 148 void NavigationEntryImpl::SetBaseURLForDataURL(const GURL& url) { |
149 base_url_for_data_url_ = url; | 149 base_url_for_data_url_ = url; |
150 } | 150 } |
151 | 151 |
152 const GURL& NavigationEntryImpl::GetBaseURLForDataURL() const { | 152 const GURL& NavigationEntryImpl::GetBaseURLForDataURL() const { |
153 return base_url_for_data_url_; | 153 return base_url_for_data_url_; |
154 } | 154 } |
155 | 155 |
| 156 void NavigationEntryImpl::SetDataURLWithBaseURL(const GURL& url) { |
| 157 data_url_with_base_url_ = url; |
| 158 } |
| 159 |
| 160 const GURL& NavigationEntryImpl::GetDataURLWithBaseURL() const { |
| 161 return data_url_with_base_url_; |
| 162 } |
| 163 |
156 void NavigationEntryImpl::SetReferrer(const Referrer& referrer) { | 164 void NavigationEntryImpl::SetReferrer(const Referrer& referrer) { |
157 frame_tree_->frame_entry->set_referrer(referrer); | 165 frame_tree_->frame_entry->set_referrer(referrer); |
158 } | 166 } |
159 | 167 |
160 const Referrer& NavigationEntryImpl::GetReferrer() const { | 168 const Referrer& NavigationEntryImpl::GetReferrer() const { |
161 return frame_tree_->frame_entry->referrer(); | 169 return frame_tree_->frame_entry->referrer(); |
162 } | 170 } |
163 | 171 |
164 void NavigationEntryImpl::SetVirtualURL(const GURL& url) { | 172 void NavigationEntryImpl::SetVirtualURL(const GURL& url) { |
165 virtual_url_ = (url == GetURL()) ? GURL() : url; | 173 virtual_url_ = (url == GetURL()) ? GURL() : url; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 copy->restore_type_ = restore_type_; | 438 copy->restore_type_ = restore_type_; |
431 copy->original_request_url_ = original_request_url_; | 439 copy->original_request_url_ = original_request_url_; |
432 copy->is_overriding_user_agent_ = is_overriding_user_agent_; | 440 copy->is_overriding_user_agent_ = is_overriding_user_agent_; |
433 copy->timestamp_ = timestamp_; | 441 copy->timestamp_ = timestamp_; |
434 copy->http_status_code_ = http_status_code_; | 442 copy->http_status_code_ = http_status_code_; |
435 // ResetForCommit: browser_initiated_post_data_ | 443 // ResetForCommit: browser_initiated_post_data_ |
436 copy->screenshot_ = screenshot_; | 444 copy->screenshot_ = screenshot_; |
437 copy->extra_headers_ = extra_headers_; | 445 copy->extra_headers_ = extra_headers_; |
438 // ResetForCommit: source_site_instance_ | 446 // ResetForCommit: source_site_instance_ |
439 copy->base_url_for_data_url_ = base_url_for_data_url_; | 447 copy->base_url_for_data_url_ = base_url_for_data_url_; |
| 448 copy->data_url_with_base_url_ = data_url_with_base_url_; |
440 // ResetForCommit: is_renderer_initiated_ | 449 // ResetForCommit: is_renderer_initiated_ |
441 copy->cached_display_title_ = cached_display_title_; | 450 copy->cached_display_title_ = cached_display_title_; |
442 // ResetForCommit: transferred_global_request_id_ | 451 // ResetForCommit: transferred_global_request_id_ |
443 // ResetForCommit: should_replace_entry_ | 452 // ResetForCommit: should_replace_entry_ |
444 copy->redirect_chain_ = redirect_chain_; | 453 copy->redirect_chain_ = redirect_chain_; |
445 // ResetForCommit: should_clear_history_list_ | 454 // ResetForCommit: should_clear_history_list_ |
446 // ResetForCommit: frame_tree_node_id_ | 455 // ResetForCommit: frame_tree_node_id_ |
447 // ResetForCommit: intent_received_timestamp_ | 456 // ResetForCommit: intent_received_timestamp_ |
448 copy->extra_data_ = extra_data_; | 457 copy->extra_data_ = extra_data_; |
449 | 458 |
(...skipping 12 matching lines...) Expand all Loading... |
462 base::TimeTicks ui_timestamp = base::TimeTicks(); | 471 base::TimeTicks ui_timestamp = base::TimeTicks(); |
463 #if defined(OS_ANDROID) | 472 #if defined(OS_ANDROID) |
464 if (!intent_received_timestamp().is_null()) | 473 if (!intent_received_timestamp().is_null()) |
465 report_type = FrameMsg_UILoadMetricsReportType::REPORT_INTENT; | 474 report_type = FrameMsg_UILoadMetricsReportType::REPORT_INTENT; |
466 ui_timestamp = intent_received_timestamp(); | 475 ui_timestamp = intent_received_timestamp(); |
467 #endif | 476 #endif |
468 | 477 |
469 return CommonNavigationParams( | 478 return CommonNavigationParams( |
470 dest_url, dest_referrer, GetTransitionType(), navigation_type, | 479 dest_url, dest_referrer, GetTransitionType(), navigation_type, |
471 !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type, | 480 !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type, |
472 GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state, | 481 GetDataURLWithBaseURL(), GetHistoryURLForDataURL(), lofi_state, |
473 navigation_start); | 482 navigation_start); |
474 } | 483 } |
475 | 484 |
476 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() | 485 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() |
477 const { | 486 const { |
478 std::vector<unsigned char> browser_initiated_post_data; | 487 std::vector<unsigned char> browser_initiated_post_data; |
479 if (GetBrowserInitiatedPostData()) { | 488 if (GetBrowserInitiatedPostData()) { |
480 browser_initiated_post_data.assign( | 489 browser_initiated_post_data.assign( |
481 GetBrowserInitiatedPostData()->front(), | 490 GetBrowserInitiatedPostData()->front(), |
482 GetBrowserInitiatedPostData()->front() + | 491 GetBrowserInitiatedPostData()->front() + |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 return node; | 631 return node; |
623 } | 632 } |
624 // Enqueue any children and keep looking. | 633 // Enqueue any children and keep looking. |
625 for (auto& child : node->children) | 634 for (auto& child : node->children) |
626 work_queue.push(child); | 635 work_queue.push(child); |
627 } | 636 } |
628 return nullptr; | 637 return nullptr; |
629 } | 638 } |
630 | 639 |
631 } // namespace content | 640 } // namespace content |
OLD | NEW |