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

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/FetchContext.h

Issue 2676163002: Refactor the forPreload flag to mean speculative preload. (Closed)
Patch Set: Renamed ReportingPolicy and moved comments Created 3 years, 10 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 double finishTime, 117 double finishTime,
118 int64_t encodedDataLength); 118 int64_t encodedDataLength);
119 virtual void dispatchDidFail(unsigned long identifier, 119 virtual void dispatchDidFail(unsigned long identifier,
120 const ResourceError&, 120 const ResourceError&,
121 int64_t encodedDataLength, 121 int64_t encodedDataLength,
122 bool isInternalRequest); 122 bool isInternalRequest);
123 123
124 virtual bool shouldLoadNewResource(Resource::Type) const { return false; } 124 virtual bool shouldLoadNewResource(Resource::Type) const { return false; }
125 // Called when a resource load is first requested, which may not be when the 125 // Called when a resource load is first requested, which may not be when the
126 // load actually begins. 126 // load actually begins.
127 // TODO(toyoshim): Consider to use enum. See https://crbug.com/675883. 127 enum class V8ActivityLoggingPolicy { SuppressLogging, Log };
128 virtual void willStartLoadingResource(unsigned long identifier, 128 virtual void willStartLoadingResource(unsigned long identifier,
129 ResourceRequest&, 129 ResourceRequest&,
130 Resource::Type, 130 Resource::Type,
131 const AtomicString& fetchInitiatorName, 131 const AtomicString& fetchInitiatorName,
132 bool forPreload); 132 V8ActivityLoggingPolicy);
133 virtual void didLoadResource(Resource*); 133 virtual void didLoadResource(Resource*);
134 134
135 virtual void addResourceTiming(const ResourceTimingInfo&); 135 virtual void addResourceTiming(const ResourceTimingInfo&);
136 virtual bool allowImage(bool, const KURL&) const { return false; } 136 virtual bool allowImage(bool, const KURL&) const { return false; }
137 // TODO(toyoshim): Consider to use enum. See https://crbug.com/675883. 137 enum class SecurityViolationReportingPolicy { SuppressReporting, Report };
138 virtual ResourceRequestBlockedReason canRequest( 138 virtual ResourceRequestBlockedReason canRequest(
139 Resource::Type, 139 Resource::Type,
140 const ResourceRequest&, 140 const ResourceRequest&,
141 const KURL&, 141 const KURL&,
142 const ResourceLoaderOptions&, 142 const ResourceLoaderOptions&,
143 bool forPreload, 143 SecurityViolationReportingPolicy,
144 FetchRequest::OriginRestriction) const { 144 FetchRequest::OriginRestriction) const {
145 return ResourceRequestBlockedReason::Other; 145 return ResourceRequestBlockedReason::Other;
146 } 146 }
147 virtual ResourceRequestBlockedReason allowResponse( 147 virtual ResourceRequestBlockedReason allowResponse(
148 Resource::Type, 148 Resource::Type,
149 const ResourceRequest&, 149 const ResourceRequest&,
150 const KURL&, 150 const KURL&,
151 const ResourceLoaderOptions&) const { 151 const ResourceLoaderOptions&) const {
152 return ResourceRequestBlockedReason::Other; 152 return ResourceRequestBlockedReason::Other;
153 } 153 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 virtual RefPtr<WebTaskRunner> loadingTaskRunner() const { return nullptr; } 188 virtual RefPtr<WebTaskRunner> loadingTaskRunner() const { return nullptr; }
189 189
190 protected: 190 protected:
191 FetchContext() {} 191 FetchContext() {}
192 }; 192 };
193 193
194 } // namespace blink 194 } // namespace blink
195 195
196 #endif 196 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698