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

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

Issue 2649853003: Make Resource::setResponse() private
Patch Set: Rebase Created 3 years, 11 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org>
4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // FIXME: AssociatedURLLoader shouldn't be a DocumentThreadableLoader and 58 // FIXME: AssociatedURLLoader shouldn't be a DocumentThreadableLoader and
59 // therefore shouldn't use RawResource. However, it is, and it needs to be 59 // therefore shouldn't use RawResource. However, it is, and it needs to be
60 // able to defer loading. This can be fixed by splitting CORS preflighting out 60 // able to defer loading. This can be fixed by splitting CORS preflighting out
61 // of DocumentThreadableLoader. 61 // of DocumentThreadableLoader.
62 void setDefersLoading(bool); 62 void setDefersLoading(bool);
63 63
64 // Resource implementation 64 // Resource implementation
65 bool canReuse(const ResourceRequest&) const override; 65 bool canReuse(const ResourceRequest&) const override;
66 bool willFollowRedirect(const ResourceRequest&, 66 bool willFollowRedirect(const ResourceRequest&,
67 const ResourceResponse&) override; 67 const ResourceResponse&) override;
68 void responseReceived(const ResourceResponse&,
69 std::unique_ptr<WebDataConsumerHandle>) override;
68 70
69 private: 71 private:
70 class RawResourceFactory : public ResourceFactory { 72 class RawResourceFactory : public ResourceFactory {
71 public: 73 public:
72 explicit RawResourceFactory(Resource::Type type) : ResourceFactory(type) {} 74 explicit RawResourceFactory(Resource::Type type) : ResourceFactory(type) {}
73 75
74 Resource* create(const ResourceRequest& request, 76 Resource* create(const ResourceRequest& request,
75 const ResourceLoaderOptions& options, 77 const ResourceLoaderOptions& options,
76 const String& charset) const override { 78 const String& charset) const override {
77 return new RawResource(request, m_type, options); 79 return new RawResource(request, m_type, options);
78 } 80 }
79 }; 81 };
80 82
81 RawResource(const ResourceRequest&, Type, const ResourceLoaderOptions&); 83 RawResource(const ResourceRequest&, Type, const ResourceLoaderOptions&);
82 84
83 // Resource implementation 85 // Resource implementation
84 void didAddClient(ResourceClient*) override; 86 void didAddClient(ResourceClient*) override;
85 void appendData(const char*, size_t) override; 87 void appendData(const char*, size_t) override;
86 bool shouldIgnoreHTTPStatusCodeErrors() const override { 88 bool shouldIgnoreHTTPStatusCodeErrors() const override {
87 return !isLinkPreload(); 89 return !isLinkPreload();
88 } 90 }
89 void willNotFollowRedirect() override; 91 void willNotFollowRedirect() override;
90 void responseReceived(const ResourceResponse&,
91 std::unique_ptr<WebDataConsumerHandle>) override;
92 void setSerializedCachedMetadata(const char*, size_t) override; 92 void setSerializedCachedMetadata(const char*, size_t) override;
93 void didSendData(unsigned long long bytesSent, 93 void didSendData(unsigned long long bytesSent,
94 unsigned long long totalBytesToBeSent) override; 94 unsigned long long totalBytesToBeSent) override;
95 void didDownloadData(int) override; 95 void didDownloadData(int) override;
96 void reportResourceTimingToClients(const ResourceTimingInfo&) override; 96 void reportResourceTimingToClients(const ResourceTimingInfo&) override;
97 }; 97 };
98 98
99 #if ENABLE(SECURITY_ASSERT) 99 #if ENABLE(SECURITY_ASSERT)
100 inline bool isRawResource(const Resource& resource) { 100 inline bool isRawResource(const Resource& resource) {
101 Resource::Type type = resource.getType(); 101 Resource::Type type = resource.getType();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 DataReceived, 187 DataReceived,
188 DataDownloaded, 188 DataDownloaded,
189 NotifyFinished 189 NotifyFinished
190 }; 190 };
191 State m_state; 191 State m_state;
192 }; 192 };
193 193
194 } // namespace blink 194 } // namespace blink
195 195
196 #endif // RawResource_h 196 #endif // RawResource_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698