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

Side by Side Diff: content/renderer/media/android/media_info_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 | « no previous file | content/renderer/media/buffered_resource_loader.cc » ('j') | 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/android/media_info_loader.h" 5 #include "content/renderer/media/android/media_info_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/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "third_party/WebKit/public/platform/WebURLError.h" 10 #include "third_party/WebKit/public/platform/WebURLError.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 if (test_loader_) { 51 if (test_loader_) {
52 loader = test_loader_.Pass(); 52 loader = test_loader_.Pass();
53 } else { 53 } else {
54 WebURLLoaderOptions options; 54 WebURLLoaderOptions options;
55 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUnspecified) { 55 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUnspecified) {
56 options.allowCredentials = true; 56 options.allowCredentials = true;
57 options.crossOriginRequestPolicy = 57 options.crossOriginRequestPolicy =
58 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; 58 WebURLLoaderOptions::CrossOriginRequestPolicyAllow;
59 } else { 59 } else {
60 options.exposeAllResponseHeaders = true; 60 options.exposeAllResponseHeaders = true;
61 // The author header set is empty, no preflight should go ahead.
62 options.preflightPolicy = WebURLLoaderOptions::PreventPreflight;
61 options.crossOriginRequestPolicy = 63 options.crossOriginRequestPolicy =
62 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; 64 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl;
63 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUseCredentials) 65 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUseCredentials)
64 options.allowCredentials = true; 66 options.allowCredentials = true;
65 } 67 }
66 loader.reset(frame->createAssociatedURLLoader(options)); 68 loader.reset(frame->createAssociatedURLLoader(options));
67 } 69 }
68 70
69 // Start the resource loading. 71 // Start the resource loading.
70 loader->loadAsynchronously(request, this); 72 loader->loadAsynchronously(request, this);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 179
178 void MediaInfoLoader::DidBecomeReady(Status status) { 180 void MediaInfoLoader::DidBecomeReady(Status status) {
179 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay", 181 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay",
180 base::TimeTicks::Now() - start_time_); 182 base::TimeTicks::Now() - start_time_);
181 active_loader_.reset(); 183 active_loader_.reset();
182 if (!ready_cb_.is_null()) 184 if (!ready_cb_.is_null())
183 base::ResetAndReturn(&ready_cb_).Run(status); 185 base::ResetAndReturn(&ready_cb_).Run(status);
184 } 186 }
185 187
186 } // namespace content 188 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/buffered_resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698