| 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/browser/frame_host/navigation_request.h" | 5 #include "content/browser/frame_host/navigation_request.h" |
| 6 | 6 |
| 7 #include "content/browser/frame_host/frame_tree.h" | 7 #include "content/browser/frame_host/frame_tree.h" |
| 8 #include "content/browser/frame_host/frame_tree_node.h" | 8 #include "content/browser/frame_host/frame_tree_node.h" |
| 9 #include "content/browser/frame_host/navigation_controller_impl.h" | 9 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 10 #include "content/browser/frame_host/navigation_request_info.h" | 10 #include "content/browser/frame_host/navigation_request_info.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 default: | 45 default: |
| 46 break; | 46 break; |
| 47 } | 47 } |
| 48 return load_flags; | 48 return load_flags; |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 // static | 53 // static |
| 54 bool NavigationRequest::ShouldMakeNetworkRequest(const GURL& url) { | 54 bool NavigationRequest::ShouldMakeNetworkRequest(const GURL& url) { |
| 55 // Data urls should not make network requests. | 55 // Data and Javascript urls should not make network requests. |
| 56 // TODO(clamy): same document navigations should not make network requests. | 56 // TODO(clamy): same document navigations should not make network requests. |
| 57 return !url.SchemeIs(url::kDataScheme) && url != GURL(url::kAboutBlankURL); | 57 return !url.SchemeIs(url::kDataScheme) && url != GURL(url::kAboutBlankURL) && |
| 58 !url.SchemeIs(url::kJavaScriptScheme); |
| 58 } | 59 } |
| 59 | 60 |
| 60 // static | 61 // static |
| 61 scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated( | 62 scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated( |
| 62 FrameTreeNode* frame_tree_node, | 63 FrameTreeNode* frame_tree_node, |
| 63 const NavigationEntryImpl& entry, | 64 const NavigationEntryImpl& entry, |
| 64 FrameMsg_Navigate_Type::Value navigation_type, | 65 FrameMsg_Navigate_Type::Value navigation_type, |
| 65 base::TimeTicks navigation_start, | 66 base::TimeTicks navigation_start, |
| 66 NavigationControllerImpl* controller) { | 67 NavigationControllerImpl* controller) { |
| 67 std::string method = entry.GetHasPostData() ? "POST" : "GET"; | 68 std::string method = entry.GetHasPostData() ? "POST" : "GET"; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 frame_tree_node_->navigator()->FailedNavigation( | 215 frame_tree_node_->navigator()->FailedNavigation( |
| 215 frame_tree_node_, has_stale_copy_in_cache, net_error); | 216 frame_tree_node_, has_stale_copy_in_cache, net_error); |
| 216 } | 217 } |
| 217 | 218 |
| 218 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { | 219 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { |
| 219 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, | 220 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, |
| 220 common_params_.url); | 221 common_params_.url); |
| 221 } | 222 } |
| 222 | 223 |
| 223 } // namespace content | 224 } // namespace content |
| OLD | NEW |