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

Side by Side Diff: content/renderer/media/buffered_resource_loader.cc

Issue 69813010: Do not issue preflight for crossorigin media resource loads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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 | « content/renderer/media/android/media_info_loader.cc ('k') | 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/media/buffered_resource_loader.h" 5 #include "content/renderer/media/buffered_resource_loader.h"
6 6
7 #include "base/bits.h" 7 #include "base/bits.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if (test_loader_) { 181 if (test_loader_) {
182 loader = test_loader_.Pass(); 182 loader = test_loader_.Pass();
183 } else { 183 } else {
184 WebURLLoaderOptions options; 184 WebURLLoaderOptions options;
185 if (cors_mode_ == kUnspecified) { 185 if (cors_mode_ == kUnspecified) {
186 options.allowCredentials = true; 186 options.allowCredentials = true;
187 options.crossOriginRequestPolicy = 187 options.crossOriginRequestPolicy =
188 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; 188 WebURLLoaderOptions::CrossOriginRequestPolicyAllow;
189 } else { 189 } else {
190 options.exposeAllResponseHeaders = true; 190 options.exposeAllResponseHeaders = true;
191 // The author header set is empty, no preflight should go ahead.
192 options.preflightPolicy = WebURLLoaderOptions::PreventPreflight;
191 options.crossOriginRequestPolicy = 193 options.crossOriginRequestPolicy =
192 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; 194 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl;
193 if (cors_mode_ == kUseCredentials) 195 if (cors_mode_ == kUseCredentials)
194 options.allowCredentials = true; 196 options.allowCredentials = true;
195 } 197 }
196 loader.reset(frame->createAssociatedURLLoader(options)); 198 loader.reset(frame->createAssociatedURLLoader(options));
197 } 199 }
198 200
199 // Start the resource loading. 201 // Start the resource loading.
200 loader->loadAsynchronously(request, this); 202 loader->loadAsynchronously(request, this);
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 797
796 void BufferedResourceLoader::Log() { 798 void BufferedResourceLoader::Log() {
797 media_log_->AddEvent( 799 media_log_->AddEvent(
798 media_log_->CreateBufferedExtentsChangedEvent( 800 media_log_->CreateBufferedExtentsChangedEvent(
799 offset_ - buffer_.backward_bytes(), 801 offset_ - buffer_.backward_bytes(),
800 offset_, 802 offset_,
801 offset_ + buffer_.forward_bytes())); 803 offset_ + buffer_.forward_bytes()));
802 } 804 }
803 805
804 } // namespace content 806 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/android/media_info_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698