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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.h

Issue 2545023002: Clean up around FrameFetchContext (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 /* 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 class Document; 44 class Document;
45 class DocumentLoader; 45 class DocumentLoader;
46 class LocalFrame; 46 class LocalFrame;
47 class ResourceError; 47 class ResourceError;
48 class ResourceResponse; 48 class ResourceResponse;
49 class ResourceRequest; 49 class ResourceRequest;
50 50
51 class CORE_EXPORT FrameFetchContext final : public FetchContext { 51 class CORE_EXPORT FrameFetchContext final : public FetchContext {
52 public: 52 public:
53 static ResourceFetcher* createContextAndFetcher(DocumentLoader* loader, 53 static ResourceFetcher* createFetcherFromDocumentLoader(
54 Document* document) { 54 DocumentLoader* loader) {
55 return ResourceFetcher::create(new FrameFetchContext(loader, document)); 55 return ResourceFetcher::create(new FrameFetchContext(loader, nullptr));
56 }
57 static ResourceFetcher* createFetcherFromDocument(Document* document) {
58 return ResourceFetcher::create(new FrameFetchContext(nullptr, document));
56 } 59 }
57 60
58 static void provideDocumentToContext(FetchContext& context, 61 static void provideDocumentToContext(FetchContext& context,
59 Document* document) { 62 Document* document) {
60 DCHECK(document); 63 DCHECK(document);
61 CHECK(context.isLiveContext()); 64 CHECK(context.isLiveContext());
62 static_cast<FrameFetchContext&>(context).m_document = document; 65 static_cast<FrameFetchContext&>(context).m_document = document;
63 } 66 }
64 67
65 ~FrameFetchContext(); 68 ~FrameFetchContext();
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 151
149 void countClientHintsDPR() override; 152 void countClientHintsDPR() override;
150 void countClientHintsResourceWidth() override; 153 void countClientHintsResourceWidth() override;
151 void countClientHintsViewportWidth() override; 154 void countClientHintsViewportWidth() override;
152 155
153 WebTaskRunner* loadingTaskRunner() const override; 156 WebTaskRunner* loadingTaskRunner() const override;
154 157
155 DECLARE_VIRTUAL_TRACE(); 158 DECLARE_VIRTUAL_TRACE();
156 159
157 private: 160 private:
158 explicit FrameFetchContext(DocumentLoader*, Document*); 161 FrameFetchContext(DocumentLoader*, Document*);
159 inline DocumentLoader* masterDocumentLoader() const; 162 inline DocumentLoader* masterDocumentLoader() const;
160 163
161 LocalFrame* frame() const; // Can be null 164 LocalFrame* frameOfImportsController() const;
165 LocalFrame* frame() const;
162 void printAccessDeniedMessage(const KURL&) const; 166 void printAccessDeniedMessage(const KURL&) const;
163 ResourceRequestBlockedReason canRequestInternal( 167 ResourceRequestBlockedReason canRequestInternal(
164 Resource::Type, 168 Resource::Type,
165 const ResourceRequest&, 169 const ResourceRequest&,
166 const KURL&, 170 const KURL&,
167 const ResourceLoaderOptions&, 171 const ResourceLoaderOptions&,
168 bool forPreload, 172 bool forPreload,
169 FetchRequest::OriginRestriction, 173 FetchRequest::OriginRestriction,
170 ResourceRequest::RedirectStatus) const; 174 ResourceRequest::RedirectStatus) const;
171 175
172 void prepareRequest(ResourceRequest&); 176 void prepareRequest(ResourceRequest&);
173 177
174 void dispatchDidReceiveResponseInternal(unsigned long identifier, 178 void dispatchDidReceiveResponseInternal(unsigned long identifier,
175 const ResourceResponse&, 179 const ResourceResponse&,
176 WebURLRequest::FrameType, 180 WebURLRequest::FrameType,
177 WebURLRequest::RequestContext, 181 WebURLRequest::RequestContext,
178 Resource*, 182 Resource*,
179 LinkLoader::CanLoadResources); 183 LinkLoader::CanLoadResources);
180 184
181 // FIXME: Oilpan: Ideally this should just be a traced Member but that will 185 // FIXME: Oilpan: Ideally this should just be a traced Member but that will
182 // currently leak because ComputedStyle and its data are not on the heap. 186 // currently leak because ComputedStyle and its data are not on the heap.
183 // See crbug.com/383860 for details. 187 // See crbug.com/383860 for details.
184 WeakMember<Document> m_document; 188 WeakMember<Document> m_document;
185 Member<DocumentLoader> m_documentLoader; 189 Member<DocumentLoader> m_documentLoader;
186 }; 190 };
187 191
188 } // namespace blink 192 } // namespace blink
189 193
190 #endif 194 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | third_party/WebKit/Source/core/loader/FrameFetchContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698