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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 343273005: Set an empty HTTP origin header if needed in RenderFrame::willSendRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 2411
2412 // Add the default accept header for frame request if it has not been set 2412 // Add the default accept header for frame request if it has not been set
2413 // already. 2413 // already.
2414 if ((request.targetType() == blink::WebURLRequest::TargetIsMainFrame || 2414 if ((request.targetType() == blink::WebURLRequest::TargetIsMainFrame ||
2415 request.targetType() == blink::WebURLRequest::TargetIsSubframe) && 2415 request.targetType() == blink::WebURLRequest::TargetIsSubframe) &&
2416 request.httpHeaderField(WebString::fromUTF8(kAcceptHeader)).isEmpty()) { 2416 request.httpHeaderField(WebString::fromUTF8(kAcceptHeader)).isEmpty()) {
2417 request.setHTTPHeaderField(WebString::fromUTF8(kAcceptHeader), 2417 request.setHTTPHeaderField(WebString::fromUTF8(kAcceptHeader),
2418 WebString::fromUTF8(kDefaultAcceptHeader)); 2418 WebString::fromUTF8(kDefaultAcceptHeader));
2419 } 2419 }
2420 2420
2421 // Add an empty HTTP origin header for non GET methods if none is currently
2422 // present.
2423 request.addHTTPOriginIfNeeded(WebString());
2424
2421 // Attach |should_replace_current_entry| state to requests so that, should 2425 // Attach |should_replace_current_entry| state to requests so that, should
2422 // this navigation later require a request transfer, all state is preserved 2426 // this navigation later require a request transfer, all state is preserved
2423 // when it is re-created in the new process. 2427 // when it is re-created in the new process.
2424 bool should_replace_current_entry = false; 2428 bool should_replace_current_entry = false;
2425 if (navigation_state->is_content_initiated()) { 2429 if (navigation_state->is_content_initiated()) {
2426 should_replace_current_entry = data_source->replacesCurrentHistoryItem(); 2430 should_replace_current_entry = data_source->replacesCurrentHistoryItem();
2427 } else { 2431 } else {
2428 // If the navigation is browser-initiated, the NavigationState contains the 2432 // If the navigation is browser-initiated, the NavigationState contains the
2429 // correct value instead of the WebDataSource. 2433 // correct value instead of the WebDataSource.
2430 // 2434 //
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3564 3568
3565 #if defined(ENABLE_BROWSER_CDMS) 3569 #if defined(ENABLE_BROWSER_CDMS)
3566 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 3570 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
3567 if (!cdm_manager_) 3571 if (!cdm_manager_)
3568 cdm_manager_ = new RendererCdmManager(this); 3572 cdm_manager_ = new RendererCdmManager(this);
3569 return cdm_manager_; 3573 return cdm_manager_;
3570 } 3574 }
3571 #endif // defined(ENABLE_BROWSER_CDMS) 3575 #endif // defined(ENABLE_BROWSER_CDMS)
3572 3576
3573 } // namespace content 3577 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698