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

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

Issue 1063913002: Revert of Remove ResourceFetcher's access to a real FetchContext at frame detach time (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/DocumentLoader.cpp ('k') | Source/core/loader/FrameFetchContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 class ResourceResponse; 47 class ResourceResponse;
48 class ResourceRequest; 48 class ResourceRequest;
49 49
50 class FrameFetchContext final : public FetchContext { 50 class FrameFetchContext final : public FetchContext {
51 public: 51 public:
52 static PassRefPtrWillBeRawPtr<ResourceFetcher> createContextAndFetcher(Docum entLoader* loader) 52 static PassRefPtrWillBeRawPtr<ResourceFetcher> createContextAndFetcher(Docum entLoader* loader)
53 { 53 {
54 return ResourceFetcher::create(adoptPtrWillBeNoop(new FrameFetchContext( loader))); 54 return ResourceFetcher::create(adoptPtrWillBeNoop(new FrameFetchContext( loader)));
55 } 55 }
56 56
57 static void provideDocumentToContext(FetchContext& context, Document* docume nt)
58 {
59 ASSERT(document);
60 RELEASE_ASSERT(context.isLiveContext());
61 static_cast<FrameFetchContext&>(context).m_document = document;
62 }
63
64 ~FrameFetchContext(); 57 ~FrameFetchContext();
65 58
66 bool isLiveContext() { return true; } 59 Document* document() const { return m_document; } // Can be null
60 void setDocument(Document* document) { m_document = document; }
61 void clearDocumentLoader() { m_documentLoader = nullptr; }
67 62
68 void addAdditionalRequestHeaders(ResourceRequest&, FetchResourceType) overri de; 63 void addAdditionalRequestHeaders(ResourceRequest&, FetchResourceType) overri de;
69 void setFirstPartyForCookies(ResourceRequest&) override; 64 void setFirstPartyForCookies(ResourceRequest&) override;
70 CachePolicy cachePolicy() const override; 65 CachePolicy cachePolicy() const override;
71 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest& , Resource::Type) const override; 66 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest& , Resource::Type) const override;
72 void dispatchDidChangeResourcePriority(unsigned long identifier, ResourceLoa dPriority, int intraPriorityValue) override; 67 void dispatchDidChangeResourcePriority(unsigned long identifier, ResourceLoa dPriority, int intraPriorityValue) override;
73 void dispatchWillSendRequest(unsigned long identifier, ResourceRequest&, con st ResourceResponse& redirectResponse, const FetchInitiatorInfo& = FetchInitiato rInfo()) override; 68 void dispatchWillSendRequest(unsigned long identifier, ResourceRequest&, con st ResourceResponse& redirectResponse, const FetchInitiatorInfo& = FetchInitiato rInfo()) override;
74 void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const Re sourceResponse&) override; 69 void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const Re sourceResponse&) override;
75 void dispatchDidReceiveResponse(unsigned long identifier, const ResourceResp onse&, ResourceLoader* = 0) override; 70 void dispatchDidReceiveResponse(unsigned long identifier, const ResourceResp onse&, ResourceLoader* = 0) override;
76 void dispatchDidReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength) override; 71 void dispatchDidReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength) override;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // FIXME: Oilpan: Ideally this should just be a traced Member but that will 112 // FIXME: Oilpan: Ideally this should just be a traced Member but that will
118 // currently leak because ComputedStyle and its data are not on the heap. 113 // currently leak because ComputedStyle and its data are not on the heap.
119 // See crbug.com/383860 for details. 114 // See crbug.com/383860 for details.
120 RawPtrWillBeWeakMember<Document> m_document; 115 RawPtrWillBeWeakMember<Document> m_document;
121 DocumentLoader* m_documentLoader; 116 DocumentLoader* m_documentLoader;
122 }; 117 };
123 118
124 } 119 }
125 120
126 #endif 121 #endif
OLDNEW
« no previous file with comments | « Source/core/loader/DocumentLoader.cpp ('k') | Source/core/loader/FrameFetchContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698