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

Side by Side Diff: third_party/WebKit/Source/core/fetch/MockFetchContext.h

Issue 2535383003: Collapse images disallowed by the Safe Browsing Subresource Filter. (Closed)
Patch Set: Rebase. Created 4 years 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 "core/fetch/FetchContext.h" 8 #include "core/fetch/FetchContext.h"
9 #include "core/fetch/FetchRequest.h" 9 #include "core/fetch/FetchRequest.h"
10 #include "platform/network/ResourceTimingInfo.h" 10 #include "platform/network/ResourceTimingInfo.h"
(...skipping 20 matching lines...) Expand all
31 }; 31 };
32 static MockFetchContext* create(LoadPolicy loadPolicy) { 32 static MockFetchContext* create(LoadPolicy loadPolicy) {
33 return new MockFetchContext(loadPolicy); 33 return new MockFetchContext(loadPolicy);
34 } 34 }
35 35
36 ~MockFetchContext() override {} 36 ~MockFetchContext() override {}
37 37
38 bool allowImage(bool imagesEnabled, const KURL&) const override { 38 bool allowImage(bool imagesEnabled, const KURL&) const override {
39 return true; 39 return true;
40 } 40 }
41 bool canRequest(Resource::Type, 41 ResourceRequestBlockedReason canRequest(
42 const ResourceRequest&, 42 Resource::Type,
43 const KURL&, 43 const ResourceRequest&,
44 const ResourceLoaderOptions&, 44 const KURL&,
45 bool forPreload, 45 const ResourceLoaderOptions&,
46 FetchRequest::OriginRestriction) const override { 46 bool forPreload,
47 return true; 47 FetchRequest::OriginRestriction) const override {
48 return ResourceRequestBlockedReason::None;
48 } 49 }
49 bool shouldLoadNewResource(Resource::Type) const override { 50 bool shouldLoadNewResource(Resource::Type) const override {
50 return m_loadPolicy == kShouldLoadNewResource; 51 return m_loadPolicy == kShouldLoadNewResource;
51 } 52 }
52 WebTaskRunner* loadingTaskRunner() const override { return m_runner.get(); } 53 WebTaskRunner* loadingTaskRunner() const override { return m_runner.get(); }
53 54
54 void setCachePolicy(CachePolicy policy) { m_policy = policy; } 55 void setCachePolicy(CachePolicy policy) { m_policy = policy; }
55 CachePolicy getCachePolicy() const override { return m_policy; } 56 CachePolicy getCachePolicy() const override { return m_policy; }
56 void setLoadComplete(bool complete) { m_complete = complete; } 57 void setLoadComplete(bool complete) { m_complete = complete; }
57 bool isLoadComplete() const override { return m_complete; } 58 bool isLoadComplete() const override { return m_complete; }
(...skipping 15 matching lines...) Expand all
73 enum LoadPolicy m_loadPolicy; 74 enum LoadPolicy m_loadPolicy;
74 CachePolicy m_policy; 75 CachePolicy m_policy;
75 std::unique_ptr<scheduler::FakeWebTaskRunner> m_runner; 76 std::unique_ptr<scheduler::FakeWebTaskRunner> m_runner;
76 bool m_complete; 77 bool m_complete;
77 long long m_transferSize; 78 long long m_transferSize;
78 }; 79 };
79 80
80 } // namespace blink 81 } // namespace blink
81 82
82 #endif 83 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResourceTest.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