Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: third_party/WebKit/Source/core/fetch/RawResource.cpp

Issue 2072613002: Make ResourceLoadPriority calculation simpler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchRequest.cpp ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698