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

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

Issue 2249913003: Remove blink::Resource::Type::LinkPrefetch and replace it by a flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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) 2012 Google, Inc. All rights reserved. 2 * Copyright (C) 2012 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/ResourceFetcher.h" 29 #include "core/fetch/ResourceFetcher.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, const AtomicS tring& initiator, const String& charset) 33 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, const AtomicS tring& initiator, const String& charset)
34 : m_resourceRequest(resourceRequest) 34 : m_resourceRequest(resourceRequest)
35 , m_charset(charset) 35 , m_charset(charset)
36 , m_options(ResourceFetcher::defaultResourceOptions()) 36 , m_options(ResourceFetcher::defaultResourceOptions())
37 , m_forPreload(false) 37 , m_forPreload(false)
38 , m_linkPreload(false) 38 , m_linkPreload(false)
39 , m_isPrefetch(false)
39 , m_preloadDiscoveryTime(0.0) 40 , m_preloadDiscoveryTime(0.0)
40 , m_defer(NoDefer) 41 , m_defer(NoDefer)
41 , m_originRestriction(UseDefaultOriginRestrictionForType) 42 , m_originRestriction(UseDefaultOriginRestrictionForType)
42 { 43 {
43 m_options.initiatorInfo.name = initiator; 44 m_options.initiatorInfo.name = initiator;
44 } 45 }
45 46
46 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, const AtomicS tring& initiator, const ResourceLoaderOptions& options) 47 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, const AtomicS tring& initiator, const ResourceLoaderOptions& options)
47 : m_resourceRequest(resourceRequest) 48 : m_resourceRequest(resourceRequest)
48 , m_options(options) 49 , m_options(options)
49 , m_forPreload(false) 50 , m_forPreload(false)
50 , m_linkPreload(false) 51 , m_linkPreload(false)
52 , m_isPrefetch(false)
51 , m_preloadDiscoveryTime(0.0) 53 , m_preloadDiscoveryTime(0.0)
52 , m_defer(NoDefer) 54 , m_defer(NoDefer)
53 , m_originRestriction(UseDefaultOriginRestrictionForType) 55 , m_originRestriction(UseDefaultOriginRestrictionForType)
54 { 56 {
55 m_options.initiatorInfo.name = initiator; 57 m_options.initiatorInfo.name = initiator;
56 } 58 }
57 59
58 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, const FetchIn itiatorInfo& initiator) 60 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, const FetchIn itiatorInfo& initiator)
59 : m_resourceRequest(resourceRequest) 61 : m_resourceRequest(resourceRequest)
60 , m_options(ResourceFetcher::defaultResourceOptions()) 62 , m_options(ResourceFetcher::defaultResourceOptions())
61 , m_forPreload(false) 63 , m_forPreload(false)
62 , m_linkPreload(false) 64 , m_linkPreload(false)
65 , m_isPrefetch(false)
63 , m_preloadDiscoveryTime(0.0) 66 , m_preloadDiscoveryTime(0.0)
64 , m_defer(NoDefer) 67 , m_defer(NoDefer)
65 , m_originRestriction(UseDefaultOriginRestrictionForType) 68 , m_originRestriction(UseDefaultOriginRestrictionForType)
66 { 69 {
67 m_options.initiatorInfo = initiator; 70 m_options.initiatorInfo = initiator;
68 } 71 }
69 72
70 FetchRequest::~FetchRequest() 73 FetchRequest::~FetchRequest()
71 { 74 {
72 } 75 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 109
107 void FetchRequest::makeSynchronous() 110 void FetchRequest::makeSynchronous()
108 { 111 {
109 // Synchronous requests should always be max priority, lest they hang the re nderer. 112 // Synchronous requests should always be max priority, lest they hang the re nderer.
110 m_resourceRequest.setPriority(ResourceLoadPriorityHighest); 113 m_resourceRequest.setPriority(ResourceLoadPriorityHighest);
111 m_resourceRequest.setTimeoutInterval(10); 114 m_resourceRequest.setTimeoutInterval(10);
112 m_options.synchronousPolicy = RequestSynchronously; 115 m_options.synchronousPolicy = RequestSynchronously;
113 } 116 }
114 117
115 } // namespace blink 118 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchRequest.h ('k') | third_party/WebKit/Source/core/fetch/LinkFetchResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698