| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 ResourceFetcher* fetcher) { | 39 ResourceFetcher* fetcher) { |
| 40 request.makeSynchronous(); | 40 request.makeSynchronous(); |
| 41 return toRawResource( | 41 return toRawResource( |
| 42 fetcher->requestResource(request, RawResourceFactory(Resource::Raw))); | 42 fetcher->requestResource(request, RawResourceFactory(Resource::Raw))); |
| 43 } | 43 } |
| 44 | 44 |
| 45 RawResource* RawResource::fetchImport(FetchRequest& request, | 45 RawResource* RawResource::fetchImport(FetchRequest& request, |
| 46 ResourceFetcher* fetcher) { | 46 ResourceFetcher* fetcher) { |
| 47 DCHECK_EQ(request.resourceRequest().frameType(), | 47 DCHECK_EQ(request.resourceRequest().frameType(), |
| 48 WebURLRequest::FrameTypeNone); | 48 WebURLRequest::FrameTypeNone); |
| 49 request.mutableResourceRequest().setRequestContext( | 49 request.setRequestContext(WebURLRequest::RequestContextImport); |
| 50 WebURLRequest::RequestContextImport); | |
| 51 return toRawResource(fetcher->requestResource( | 50 return toRawResource(fetcher->requestResource( |
| 52 request, RawResourceFactory(Resource::ImportResource))); | 51 request, RawResourceFactory(Resource::ImportResource))); |
| 53 } | 52 } |
| 54 | 53 |
| 55 RawResource* RawResource::fetch(FetchRequest& request, | 54 RawResource* RawResource::fetch(FetchRequest& request, |
| 56 ResourceFetcher* fetcher) { | 55 ResourceFetcher* fetcher) { |
| 57 DCHECK_EQ(request.resourceRequest().frameType(), | 56 DCHECK_EQ(request.resourceRequest().frameType(), |
| 58 WebURLRequest::FrameTypeNone); | 57 WebURLRequest::FrameTypeNone); |
| 59 DCHECK_NE(request.resourceRequest().requestContext(), | 58 DCHECK_NE(request.resourceRequest().requestContext(), |
| 60 WebURLRequest::RequestContextUnspecified); | 59 WebURLRequest::RequestContextUnspecified); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 request.resourceRequest().requestContext() == | 93 request.resourceRequest().requestContext() == |
| 95 WebURLRequest::RequestContextVideo); | 94 WebURLRequest::RequestContextVideo); |
| 96 return toRawResource( | 95 return toRawResource( |
| 97 fetcher->requestResource(request, RawResourceFactory(Resource::Media))); | 96 fetcher->requestResource(request, RawResourceFactory(Resource::Media))); |
| 98 } | 97 } |
| 99 | 98 |
| 100 RawResource* RawResource::fetchTextTrack(FetchRequest& request, | 99 RawResource* RawResource::fetchTextTrack(FetchRequest& request, |
| 101 ResourceFetcher* fetcher) { | 100 ResourceFetcher* fetcher) { |
| 102 DCHECK_EQ(request.resourceRequest().frameType(), | 101 DCHECK_EQ(request.resourceRequest().frameType(), |
| 103 WebURLRequest::FrameTypeNone); | 102 WebURLRequest::FrameTypeNone); |
| 104 request.mutableResourceRequest().setRequestContext( | 103 request.setRequestContext(WebURLRequest::RequestContextTrack); |
| 105 WebURLRequest::RequestContextTrack); | |
| 106 return toRawResource(fetcher->requestResource( | 104 return toRawResource(fetcher->requestResource( |
| 107 request, RawResourceFactory(Resource::TextTrack))); | 105 request, RawResourceFactory(Resource::TextTrack))); |
| 108 } | 106 } |
| 109 | 107 |
| 110 RawResource* RawResource::fetchManifest(FetchRequest& request, | 108 RawResource* RawResource::fetchManifest(FetchRequest& request, |
| 111 ResourceFetcher* fetcher) { | 109 ResourceFetcher* fetcher) { |
| 112 DCHECK_EQ(request.resourceRequest().frameType(), | 110 DCHECK_EQ(request.resourceRequest().frameType(), |
| 113 WebURLRequest::FrameTypeNone); | 111 WebURLRequest::FrameTypeNone); |
| 114 DCHECK_EQ(request.resourceRequest().requestContext(), | 112 DCHECK_EQ(request.resourceRequest().requestContext(), |
| 115 WebURLRequest::RequestContextManifest); | 113 WebURLRequest::RequestContextManifest); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 SECURITY_CHECK(m_state != NotAddedAsClient); | 356 SECURITY_CHECK(m_state != NotAddedAsClient); |
| 359 SECURITY_CHECK(m_state != NotifyFinished); | 357 SECURITY_CHECK(m_state != NotifyFinished); |
| 360 SECURITY_CHECK(resource->errorOccurred() || | 358 SECURITY_CHECK(resource->errorOccurred() || |
| 361 (m_state == ResponseReceived || | 359 (m_state == ResponseReceived || |
| 362 m_state == SetSerializedCachedMetadata || | 360 m_state == SetSerializedCachedMetadata || |
| 363 m_state == DataReceived || m_state == DataDownloaded)); | 361 m_state == DataReceived || m_state == DataDownloaded)); |
| 364 m_state = NotifyFinished; | 362 m_state = NotifyFinished; |
| 365 } | 363 } |
| 366 | 364 |
| 367 } // namespace blink | 365 } // namespace blink |
| OLD | NEW |