Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/navigation_params.h" | 5 #include "content/common/navigation_params.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted_memory.h" | 7 #include "base/memory/ref_counted_memory.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | |
| 11 bool ShouldMakeNetworkRequestForNavigation(const GURL& url) { | |
| 12 // Data urls should not make network requests. | |
| 13 if (url.SchemeIs(url::kDataScheme)) | |
| 14 return false; | |
| 15 return true; | |
|
carlosk
2015/02/17 12:35:09
Suggestion: return !url.SchemeIs(url::kDataScheme)
clamy
2015/02/20 17:05:59
Done.
| |
| 16 } | |
| 17 | |
| 10 CommonNavigationParams::CommonNavigationParams() | 18 CommonNavigationParams::CommonNavigationParams() |
| 11 : transition(ui::PAGE_TRANSITION_LINK), | 19 : transition(ui::PAGE_TRANSITION_LINK), |
| 12 navigation_type(FrameMsg_Navigate_Type::NORMAL), | 20 navigation_type(FrameMsg_Navigate_Type::NORMAL), |
| 13 allow_download(true), | 21 allow_download(true), |
| 14 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT) { | 22 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT) { |
| 15 } | 23 } |
| 16 | 24 |
| 17 CommonNavigationParams::CommonNavigationParams( | 25 CommonNavigationParams::CommonNavigationParams( |
| 18 const GURL& url, | 26 const GURL& url, |
| 19 const Referrer& referrer, | 27 const Referrer& referrer, |
| 20 ui::PageTransition transition, | 28 ui::PageTransition transition, |
| 21 FrameMsg_Navigate_Type::Value navigation_type, | 29 FrameMsg_Navigate_Type::Value navigation_type, |
| 22 bool allow_download, | 30 bool allow_download, |
| 23 base::TimeTicks ui_timestamp, | 31 base::TimeTicks ui_timestamp, |
| 24 FrameMsg_UILoadMetricsReportType::Value report_type) | 32 FrameMsg_UILoadMetricsReportType::Value report_type, |
| 33 const GURL& base_url_for_data_url, | |
| 34 const GURL& history_url_for_data_url) | |
| 25 : url(url), | 35 : url(url), |
| 26 referrer(referrer), | 36 referrer(referrer), |
| 27 transition(transition), | 37 transition(transition), |
| 28 navigation_type(navigation_type), | 38 navigation_type(navigation_type), |
| 29 allow_download(allow_download), | 39 allow_download(allow_download), |
| 30 ui_timestamp(ui_timestamp), | 40 ui_timestamp(ui_timestamp), |
| 31 report_type(report_type) { | 41 report_type(report_type), |
| 42 base_url_for_data_url(base_url_for_data_url), | |
| 43 history_url_for_data_url(history_url_for_data_url) { | |
| 32 } | 44 } |
| 33 | 45 |
| 34 CommonNavigationParams::~CommonNavigationParams() { | 46 CommonNavigationParams::~CommonNavigationParams() { |
| 35 } | 47 } |
| 36 | 48 |
| 37 BeginNavigationParams::BeginNavigationParams() | 49 BeginNavigationParams::BeginNavigationParams() |
| 38 : load_flags(0), | 50 : load_flags(0), |
| 39 has_user_gesture(false) { | 51 has_user_gesture(false) { |
| 40 } | 52 } |
| 41 | 53 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 57 bool is_overriding_user_agent, | 69 bool is_overriding_user_agent, |
| 58 base::TimeTicks navigation_start) | 70 base::TimeTicks navigation_start) |
| 59 : page_state(page_state), | 71 : page_state(page_state), |
| 60 is_overriding_user_agent(is_overriding_user_agent), | 72 is_overriding_user_agent(is_overriding_user_agent), |
| 61 browser_navigation_start(navigation_start) { | 73 browser_navigation_start(navigation_start) { |
| 62 } | 74 } |
| 63 | 75 |
| 64 CommitNavigationParams::~CommitNavigationParams() {} | 76 CommitNavigationParams::~CommitNavigationParams() {} |
| 65 | 77 |
| 66 } // namespace content | 78 } // namespace content |
| OLD | NEW |