| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/fetch/ResourceClientOrObserverWalker.h" | 30 #include "core/fetch/ResourceClientOrObserverWalker.h" |
| 31 #include "core/fetch/ResourceFetcher.h" | 31 #include "core/fetch/ResourceFetcher.h" |
| 32 #include "core/fetch/ResourceLoader.h" | 32 #include "core/fetch/ResourceLoader.h" |
| 33 #include "platform/HTTPNames.h" | 33 #include "platform/HTTPNames.h" |
| 34 #include <memory> | 34 #include <memory> |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 Resource* RawResource::fetchSynchronously(FetchRequest& request, ResourceFetcher
* fetcher) | 38 Resource* RawResource::fetchSynchronously(FetchRequest& request, ResourceFetcher
* fetcher) |
| 39 { | 39 { |
| 40 request.mutableResourceRequest().setTimeoutInterval(10); | 40 request.makeSynchronous(); |
| 41 ResourceLoaderOptions options(request.options()); | |
| 42 options.synchronousPolicy = RequestSynchronously; | |
| 43 request.setOptions(options); | |
| 44 return fetcher->requestResource(request, RawResourceFactory(Resource::Raw)); | 41 return fetcher->requestResource(request, RawResourceFactory(Resource::Raw)); |
| 45 } | 42 } |
| 46 | 43 |
| 47 RawResource* RawResource::fetchImport(FetchRequest& request, ResourceFetcher* fe
tcher) | 44 RawResource* RawResource::fetchImport(FetchRequest& request, ResourceFetcher* fe
tcher) |
| 48 { | 45 { |
| 49 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone
); | 46 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone
); |
| 50 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon
textImport); | 47 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon
textImport); |
| 51 return toRawResource(fetcher->requestResource(request, RawResourceFactory(Re
source::ImportResource))); | 48 return toRawResource(fetcher->requestResource(request, RawResourceFactory(Re
source::ImportResource))); |
| 52 } | 49 } |
| 53 | 50 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 for (const auto& header : oldHeaders) { | 255 for (const auto& header : oldHeaders) { |
| 259 AtomicString headerName = header.key; | 256 AtomicString headerName = header.key; |
| 260 if (!shouldIgnoreHeaderForCacheReuse(headerName) && header.value != newH
eaders.get(headerName)) | 257 if (!shouldIgnoreHeaderForCacheReuse(headerName) && header.value != newH
eaders.get(headerName)) |
| 261 return false; | 258 return false; |
| 262 } | 259 } |
| 263 | 260 |
| 264 return true; | 261 return true; |
| 265 } | 262 } |
| 266 | 263 |
| 267 } // namespace blink | 264 } // namespace blink |
| OLD | NEW |