OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef FrameFetchContext_h | 31 #ifndef FrameFetchContext_h |
32 #define FrameFetchContext_h | 32 #define FrameFetchContext_h |
33 | 33 |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
35 #include "core/frame/csp/ContentSecurityPolicy.h" | 35 #include "core/frame/csp/ContentSecurityPolicy.h" |
36 #include "core/loader/BaseFetchContext.h" | 36 #include "core/loader/BaseFetchContext.h" |
| 37 #include "core/loader/NetworkQuietDetector.h" |
37 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
38 #include "platform/loader/fetch/FetchParameters.h" | 39 #include "platform/loader/fetch/FetchParameters.h" |
39 #include "platform/loader/fetch/ResourceFetcher.h" | 40 #include "platform/loader/fetch/ResourceFetcher.h" |
40 #include "platform/loader/fetch/ResourceRequest.h" | 41 #include "platform/loader/fetch/ResourceRequest.h" |
41 #include "platform/network/ContentSecurityPolicyParsers.h" | 42 #include "platform/network/ContentSecurityPolicyParsers.h" |
42 #include "platform/wtf/Forward.h" | 43 #include "platform/wtf/Forward.h" |
43 | 44 |
44 namespace blink { | 45 namespace blink { |
45 | 46 |
46 class ClientHintsPreferences; | 47 class ClientHintsPreferences; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 ResourceRequest&); | 151 ResourceRequest&); |
151 static float ClientHintsDeviceRAM(int64_t physical_memory_mb); | 152 static float ClientHintsDeviceRAM(int64_t physical_memory_mb); |
152 | 153 |
153 MHTMLArchive* Archive() const override; | 154 MHTMLArchive* Archive() const override; |
154 | 155 |
155 std::unique_ptr<WebURLLoader> CreateURLLoader( | 156 std::unique_ptr<WebURLLoader> CreateURLLoader( |
156 const ResourceRequest&) override; | 157 const ResourceRequest&) override; |
157 | 158 |
158 void Detach() override; | 159 void Detach() override; |
159 | 160 |
| 161 NetworkQuietDetector& GetNetworkQuietDetector() { |
| 162 return *network_quiet_detector_; |
| 163 } |
| 164 |
160 DECLARE_VIRTUAL_TRACE(); | 165 DECLARE_VIRTUAL_TRACE(); |
161 | 166 |
162 private: | 167 private: |
163 FrameFetchContext(DocumentLoader*, Document*); | 168 FrameFetchContext(DocumentLoader*, Document*); |
164 | 169 |
165 // m_documentLoader is null when loading resources from an HTML import | 170 // m_documentLoader is null when loading resources from an HTML import |
166 // and in such cases we use the document loader of the importing frame. | 171 // and in such cases we use the document loader of the importing frame. |
167 // Convenient accessors below can be used to transparently access the | 172 // Convenient accessors below can be used to transparently access the |
168 // relevant document loader or frame in either cases without null-checks. | 173 // relevant document loader or frame in either cases without null-checks. |
169 // TODO(kinuko): Remove constness, these return non-const members. | 174 // TODO(kinuko): Remove constness, these return non-const members. |
170 DocumentLoader* MasterDocumentLoader() const; | 175 DocumentLoader* MasterDocumentLoader() const; |
171 Document* GetDocument() const; | 176 Document* GetDocument() const; |
| 177 void SetDocument(Document*); |
172 LocalFrame* GetFrame() const; | 178 LocalFrame* GetFrame() const; |
173 LocalFrameClient* GetLocalFrameClient() const; | 179 LocalFrameClient* GetLocalFrameClient() const; |
174 LocalFrame* FrameOfImportsController() const; | 180 LocalFrame* FrameOfImportsController() const; |
175 RefPtr<WebTaskRunner> GetTaskRunner() const; | 181 RefPtr<WebTaskRunner> GetTaskRunner() const; |
176 | 182 |
177 // BaseFetchContext overrides: | 183 // BaseFetchContext overrides: |
178 ContentSettingsClient* GetContentSettingsClient() const override; | 184 ContentSettingsClient* GetContentSettingsClient() const override; |
179 Settings* GetSettings() const override; | 185 Settings* GetSettings() const override; |
180 SubresourceFilter* GetSubresourceFilter() const override; | 186 SubresourceFilter* GetSubresourceFilter() const override; |
181 bool ShouldBlockRequestByInspector(const ResourceRequest&) const override; | 187 bool ShouldBlockRequestByInspector(const ResourceRequest&) const override; |
(...skipping 11 matching lines...) Expand all Loading... |
193 ReferrerPolicy GetReferrerPolicy() const override; | 199 ReferrerPolicy GetReferrerPolicy() const override; |
194 String GetOutgoingReferrer() const override; | 200 String GetOutgoingReferrer() const override; |
195 const KURL& Url() const override; | 201 const KURL& Url() const override; |
196 const SecurityOrigin* GetParentSecurityOrigin() const override; | 202 const SecurityOrigin* GetParentSecurityOrigin() const override; |
197 Optional<WebAddressSpace> GetAddressSpace() const override; | 203 Optional<WebAddressSpace> GetAddressSpace() const override; |
198 const ContentSecurityPolicy* GetContentSecurityPolicy() const override; | 204 const ContentSecurityPolicy* GetContentSecurityPolicy() const override; |
199 void AddConsoleMessage(ConsoleMessage*) const override; | 205 void AddConsoleMessage(ConsoleMessage*) const override; |
200 | 206 |
201 Member<DocumentLoader> document_loader_; | 207 Member<DocumentLoader> document_loader_; |
202 Member<Document> document_; | 208 Member<Document> document_; |
| 209 Member<NetworkQuietDetector> network_quiet_detector_; |
203 }; | 210 }; |
204 | 211 |
205 } // namespace blink | 212 } // namespace blink |
206 | 213 |
207 #endif | 214 #endif |
OLD | NEW |