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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 if (m_actualRequest) | 586 if (m_actualRequest) |
587 resourceLoaderOptions.dataBufferingPolicy = BufferData; | 587 resourceLoaderOptions.dataBufferingPolicy = BufferData; |
588 | 588 |
589 if (m_options.timeoutMilliseconds > 0) | 589 if (m_options.timeoutMilliseconds > 0) |
590 m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0,
FROM_HERE); | 590 m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0,
FROM_HERE); |
591 | 591 |
592 FetchRequest newRequest(request, m_options.initiator, resourceLoaderOpti
ons); | 592 FetchRequest newRequest(request, m_options.initiator, resourceLoaderOpti
ons); |
593 if (m_options.crossOriginRequestPolicy == AllowCrossOriginRequests) | 593 if (m_options.crossOriginRequestPolicy == AllowCrossOriginRequests) |
594 newRequest.setOriginRestriction(FetchRequest::NoOriginRestriction); | 594 newRequest.setOriginRestriction(FetchRequest::NoOriginRestriction); |
595 ASSERT(!resource()); | 595 ASSERT(!resource()); |
| 596 |
596 if (request.requestContext() == WebURLRequest::RequestContextVideo || re
quest.requestContext() == WebURLRequest::RequestContextAudio) | 597 if (request.requestContext() == WebURLRequest::RequestContextVideo || re
quest.requestContext() == WebURLRequest::RequestContextAudio) |
597 setResource(RawResource::fetchMedia(newRequest, m_document.fetcher()
)); | 598 setResource(RawResource::fetchMedia(newRequest, m_document.fetcher()
)); |
598 else | 599 else |
599 setResource(RawResource::fetch(newRequest, m_document.fetcher())); | 600 setResource(RawResource::fetch(newRequest, m_document.fetcher())); |
600 if (resource() && resource()->loader()) { | 601 |
| 602 if (!resource()) { |
| 603 m_client->didFail(ResourceError(errorDomainBlinkInternal, 0, request
URL.string(), "Failed to start loading.")); |
| 604 return; |
| 605 } |
| 606 |
| 607 if (resource()->loader()) { |
601 unsigned long identifier = resource()->identifier(); | 608 unsigned long identifier = resource()->identifier(); |
602 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC
lient(&m_document, identifier, m_client); | 609 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC
lient(&m_document, identifier, m_client); |
603 } | 610 } |
604 return; | 611 return; |
605 } | 612 } |
606 | 613 |
607 FetchRequest fetchRequest(request, m_options.initiator, resourceLoaderOption
s); | 614 FetchRequest fetchRequest(request, m_options.initiator, resourceLoaderOption
s); |
608 if (m_options.crossOriginRequestPolicy == AllowCrossOriginRequests) | 615 if (m_options.crossOriginRequestPolicy == AllowCrossOriginRequests) |
609 fetchRequest.setOriginRestriction(FetchRequest::NoOriginRestriction); | 616 fetchRequest.setOriginRestriction(FetchRequest::NoOriginRestriction); |
610 ResourcePtr<Resource> resource = RawResource::fetchSynchronously(fetchReques
t, m_document.fetcher()); | 617 ResourcePtr<Resource> resource = RawResource::fetchSynchronously(fetchReques
t, m_document.fetcher()); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 return DoNotAllowStoredCredentials; | 671 return DoNotAllowStoredCredentials; |
665 return m_resourceLoaderOptions.allowCredentials; | 672 return m_resourceLoaderOptions.allowCredentials; |
666 } | 673 } |
667 | 674 |
668 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const | 675 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const |
669 { | 676 { |
670 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin
(); | 677 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin
(); |
671 } | 678 } |
672 | 679 |
673 } // namespace blink | 680 } // namespace blink |
OLD | NEW |