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

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: Drop a default arg Created 4 years, 6 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 18 matching lines...) Expand all
29 #include "core/fetch/MemoryCache.h" 29 #include "core/fetch/MemoryCache.h"
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 34
35 namespace blink { 35 namespace blink {
36 36
37 Resource* RawResource::fetchSynchronously(FetchRequest& request, ResourceFetcher * fetcher) 37 Resource* RawResource::fetchSynchronously(FetchRequest& request, ResourceFetcher * fetcher)
38 { 38 {
39 request.mutableResourceRequest().setTimeoutInterval(10); 39 request.makeSynchronous();
40 ResourceLoaderOptions options(request.options());
41 options.synchronousPolicy = RequestSynchronously;
42 request.setOptions(options);
43 return fetcher->requestResource(request, RawResourceFactory(Resource::Raw)); 40 return fetcher->requestResource(request, RawResourceFactory(Resource::Raw));
44 } 41 }
45 42
46 RawResource* RawResource::fetchImport(FetchRequest& request, ResourceFetcher* fe tcher) 43 RawResource* RawResource::fetchImport(FetchRequest& request, ResourceFetcher* fe tcher)
47 { 44 {
48 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone ); 45 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone );
49 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon textImport); 46 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon textImport);
50 return toRawResource(fetcher->requestResource(request, RawResourceFactory(Re source::ImportResource))); 47 return toRawResource(fetcher->requestResource(request, RawResourceFactory(Re source::ImportResource)));
51 } 48 }
52 49
(...skipping 205 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

Powered by Google App Engine
This is Rietveld 408576698