OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013, Intel Corporation | 3 * Copyright (C) 2013, Intel Corporation |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 if (m_actualRequest) { | 390 if (m_actualRequest) { |
391 options.sniffContent = DoNotSniffContent; | 391 options.sniffContent = DoNotSniffContent; |
392 options.dataBufferingPolicy = BufferData; | 392 options.dataBufferingPolicy = BufferData; |
393 } | 393 } |
394 | 394 |
395 if (m_options.timeoutMilliseconds > 0) | 395 if (m_options.timeoutMilliseconds > 0) |
396 m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0); | 396 m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0); |
397 | 397 |
398 FetchRequest newRequest(request, m_options.initiator, options); | 398 FetchRequest newRequest(request, m_options.initiator, options); |
399 ASSERT(!resource()); | 399 ASSERT(!resource()); |
400 setResource(m_document->fetcher()->fetchRawResource(newRequest)); | 400 if (request.targetType() == ResourceRequest::TargetIsMedia) |
| 401 setResource(m_document->fetcher()->fetchMedia(newRequest)); |
| 402 else |
| 403 setResource(m_document->fetcher()->fetchRawResource(newRequest)); |
401 if (resource() && resource()->loader()) { | 404 if (resource() && resource()->loader()) { |
402 unsigned long identifier = resource()->identifier(); | 405 unsigned long identifier = resource()->identifier(); |
403 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC
lient(m_document, identifier, m_client); | 406 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC
lient(m_document, identifier, m_client); |
404 } | 407 } |
405 return; | 408 return; |
406 } | 409 } |
407 | 410 |
408 FetchRequest fetchRequest(request, m_options.initiator, options); | 411 FetchRequest fetchRequest(request, m_options.initiator, options); |
409 ResourcePtr<Resource> resource = m_document->fetcher()->fetchSynchronously(f
etchRequest); | 412 ResourcePtr<Resource> resource = m_document->fetcher()->fetchSynchronously(f
etchRequest); |
410 ResourceResponse response = resource ? resource->response() : ResourceRespon
se(); | 413 ResourceResponse response = resource ? resource->response() : ResourceRespon
se(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 474 |
472 if (!(requestUrl.user().isEmpty() && requestUrl.pass().isEmpty())) { | 475 if (!(requestUrl.user().isEmpty() && requestUrl.pass().isEmpty())) { |
473 errorDescription = "The request was redirected to a URL ('" + requestUrl
.string() + "') containing userinfo, which is disallowed for cross-origin reques
ts."; | 476 errorDescription = "The request was redirected to a URL ('" + requestUrl
.string() + "') containing userinfo, which is disallowed for cross-origin reques
ts."; |
474 return false; | 477 return false; |
475 } | 478 } |
476 | 479 |
477 return true; | 480 return true; |
478 } | 481 } |
479 | 482 |
480 } // namespace WebCore | 483 } // namespace WebCore |
OLD | NEW |