Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 2716583003: Rename Origin.unique() to opaque().
Patch Set: Mac fixes Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "content/browser/appcache/appcache_navigation_handle.h" 10 #include "content/browser/appcache/appcache_navigation_handle.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 // Tack an 'Upgrade-Insecure-Requests' header to outgoing navigational 156 // Tack an 'Upgrade-Insecure-Requests' header to outgoing navigational
157 // requests, as described in 157 // requests, as described in
158 // https://w3c.github.io/webappsec/specs/upgrade/#feature-detect 158 // https://w3c.github.io/webappsec/specs/upgrade/#feature-detect
159 headers->AddHeaderFromString("Upgrade-Insecure-Requests: 1"); 159 headers->AddHeaderFromString("Upgrade-Insecure-Requests: 1");
160 160
161 // Next, set the HTTP Origin if needed. 161 // Next, set the HTTP Origin if needed.
162 if (!NeedsHTTPOrigin(headers, method)) 162 if (!NeedsHTTPOrigin(headers, method))
163 return; 163 return;
164 164
165 // Create a unique origin. 165 // Create a unique opaque origin.
166 url::Origin origin; 166 url::Origin origin;
167 if (frame_tree_node->IsMainFrame()) { 167 if (frame_tree_node->IsMainFrame()) {
168 // For main frame, the origin is the url currently loading. 168 // For main frame, the origin is the url currently loading.
169 origin = url::Origin(url); 169 origin = url::Origin(url);
170 } else if ((frame_tree_node->effective_sandbox_flags() & 170 } else if ((frame_tree_node->effective_sandbox_flags() &
171 blink::WebSandboxFlags::Origin) == blink::WebSandboxFlags::None) { 171 blink::WebSandboxFlags::Origin) == blink::WebSandboxFlags::None) {
172 // The origin should be the origin of the root, except for sandboxed 172 // The origin should be the origin of the root, except for sandboxed
173 // frames which have a unique origin. 173 // frames which have a unique opaque origin.
174 origin = frame_tree_node->frame_tree()->root()->current_origin(); 174 origin = frame_tree_node->frame_tree()->root()->current_origin();
175 } 175 }
176 176
177 headers->SetHeader(net::HttpRequestHeaders::kOrigin, origin.Serialize()); 177 headers->SetHeader(net::HttpRequestHeaders::kOrigin, origin.Serialize());
178 } 178 }
179 179
180 } // namespace 180 } // namespace
181 181
182 // static 182 // static
183 std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated( 183 std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 763 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
764 764
765 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 765 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
766 common_params_, request_params_, 766 common_params_, request_params_,
767 is_view_source_); 767 is_view_source_);
768 768
769 frame_tree_node_->ResetNavigationRequest(true); 769 frame_tree_node_->ResetNavigationRequest(true);
770 } 770 }
771 771
772 } // namespace content 772 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698