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

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/MockFetchContext.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MockFetchContext_h 5 #ifndef MockFetchContext_h
6 #define MockFetchContext_h 6 #define MockFetchContext_h
7 7
8 #include "platform/loader/fetch/FetchContext.h" 8 #include "platform/loader/fetch/FetchContext.h"
9 #include "platform/loader/fetch/FetchRequest.h" 9 #include "platform/loader/fetch/FetchRequest.h"
10 #include "platform/network/ResourceTimingInfo.h" 10 #include "platform/network/ResourceTimingInfo.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // FetchContext: 47 // FetchContext:
48 bool allowImage(bool imagesEnabled, const KURL&) const override { 48 bool allowImage(bool imagesEnabled, const KURL&) const override {
49 return true; 49 return true;
50 } 50 }
51 ResourceRequestBlockedReason canRequest( 51 ResourceRequestBlockedReason canRequest(
52 Resource::Type, 52 Resource::Type,
53 const ResourceRequest&, 53 const ResourceRequest&,
54 const KURL&, 54 const KURL&,
55 const ResourceLoaderOptions&, 55 const ResourceLoaderOptions&,
56 bool forPreload, 56 SecurityViolationReportingPolicy,
57 FetchRequest::OriginRestriction) const override { 57 FetchRequest::OriginRestriction) const override {
58 return ResourceRequestBlockedReason::None; 58 return ResourceRequestBlockedReason::None;
59 } 59 }
60 bool shouldLoadNewResource(Resource::Type) const override { 60 bool shouldLoadNewResource(Resource::Type) const override {
61 return m_loadPolicy == kShouldLoadNewResource; 61 return m_loadPolicy == kShouldLoadNewResource;
62 } 62 }
63 RefPtr<WebTaskRunner> loadingTaskRunner() const override { return m_runner; } 63 RefPtr<WebTaskRunner> loadingTaskRunner() const override { return m_runner; }
64 CachePolicy getCachePolicy() const override { return m_policy; } 64 CachePolicy getCachePolicy() const override { return m_policy; }
65 bool isLoadComplete() const override { return m_complete; } 65 bool isLoadComplete() const override { return m_complete; }
66 void addResourceTiming( 66 void addResourceTiming(
(...skipping 13 matching lines...) Expand all
80 enum LoadPolicy m_loadPolicy; 80 enum LoadPolicy m_loadPolicy;
81 CachePolicy m_policy; 81 CachePolicy m_policy;
82 RefPtr<WebTaskRunner> m_runner; 82 RefPtr<WebTaskRunner> m_runner;
83 bool m_complete; 83 bool m_complete;
84 long long m_transferSize; 84 long long m_transferSize;
85 }; 85 };
86 86
87 } // namespace blink 87 } // namespace blink
88 88
89 #endif 89 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698