OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/media/buffered_resource_loader.h" | 5 #include "webkit/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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 scoped_ptr<WebURLLoader> loader; | 184 scoped_ptr<WebURLLoader> loader; |
185 if (test_loader_.get()) { | 185 if (test_loader_.get()) { |
186 loader = test_loader_.Pass(); | 186 loader = test_loader_.Pass(); |
187 } else { | 187 } else { |
188 WebURLLoaderOptions options; | 188 WebURLLoaderOptions options; |
189 if (cors_mode_ == kUnspecified) { | 189 if (cors_mode_ == kUnspecified) { |
190 options.allowCredentials = true; | 190 options.allowCredentials = true; |
191 options.crossOriginRequestPolicy = | 191 options.crossOriginRequestPolicy = |
192 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; | 192 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; |
193 } else { | 193 } else { |
| 194 options.exposeAllResponseHeaders = true; |
194 options.crossOriginRequestPolicy = | 195 options.crossOriginRequestPolicy = |
195 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; | 196 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; |
196 if (cors_mode_ == kUseCredentials) | 197 if (cors_mode_ == kUseCredentials) |
197 options.allowCredentials = true; | 198 options.allowCredentials = true; |
198 } | 199 } |
199 loader.reset(frame->createAssociatedURLLoader(options)); | 200 loader.reset(frame->createAssociatedURLLoader(options)); |
200 } | 201 } |
201 | 202 |
202 // Start the resource loading. | 203 // Start the resource loading. |
203 loader->loadAsynchronously(request, this); | 204 loader->loadAsynchronously(request, this); |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 | 855 |
855 void BufferedResourceLoader::Log() { | 856 void BufferedResourceLoader::Log() { |
856 media_log_->AddEvent( | 857 media_log_->AddEvent( |
857 media_log_->CreateBufferedExtentsChangedEvent( | 858 media_log_->CreateBufferedExtentsChangedEvent( |
858 offset_ - buffer_.backward_bytes(), | 859 offset_ - buffer_.backward_bytes(), |
859 offset_, | 860 offset_, |
860 offset_ + buffer_.forward_bytes())); | 861 offset_ + buffer_.forward_bytes())); |
861 } | 862 } |
862 | 863 |
863 } // namespace webkit_media | 864 } // namespace webkit_media |
OLD | NEW |