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

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

Issue 1035803002: Remove ResourceFetcher's access to a real FetchContext at frame detach time (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved ASSERT(!m_importsController) to #if !ENABLE(OILPAN) block 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
57 ~FrameFetchContext(); 64 ~FrameFetchContext();
58 65
59 Document* document() const { return m_document; } // Can be null 66 bool isLiveContext() { return true; }
60 void setDocument(Document* document) { m_document = document; }
61 void clearDocumentLoader() { m_documentLoader = nullptr; }
62 67
63 void addAdditionalRequestHeaders(ResourceRequest&, FetchResourceType) overri de; 68 void addAdditionalRequestHeaders(ResourceRequest&, FetchResourceType) overri de;
64 void setFirstPartyForCookies(ResourceRequest&) override; 69 void setFirstPartyForCookies(ResourceRequest&) override;
65 CachePolicy cachePolicy() const override; 70 CachePolicy cachePolicy() const override;
66 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest& , Resource::Type) const override; 71 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest& , Resource::Type) const override;
67 void dispatchDidChangeResourcePriority(unsigned long identifier, ResourceLoa dPriority, int intraPriorityValue) override; 72 void dispatchDidChangeResourcePriority(unsigned long identifier, ResourceLoa dPriority, int intraPriorityValue) override;
68 void dispatchWillSendRequest(unsigned long identifier, ResourceRequest&, con st ResourceResponse& redirectResponse, const FetchInitiatorInfo& = FetchInitiato rInfo()) override; 73 void dispatchWillSendRequest(unsigned long identifier, ResourceRequest&, con st ResourceResponse& redirectResponse, const FetchInitiatorInfo& = FetchInitiato rInfo()) override;
69 void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const Re sourceResponse&) override; 74 void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const Re sourceResponse&) override;
70 void dispatchDidReceiveResponse(unsigned long identifier, const ResourceResp onse&, ResourceLoader* = 0) override; 75 void dispatchDidReceiveResponse(unsigned long identifier, const ResourceResp onse&, ResourceLoader* = 0) override;
71 void dispatchDidReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength) override; 76 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
112 // FIXME: Oilpan: Ideally this should just be a traced Member but that will 117 // FIXME: Oilpan: Ideally this should just be a traced Member but that will
113 // currently leak because ComputedStyle and its data are not on the heap. 118 // currently leak because ComputedStyle and its data are not on the heap.
114 // See crbug.com/383860 for details. 119 // See crbug.com/383860 for details.
115 RawPtrWillBeWeakMember<Document> m_document; 120 RawPtrWillBeWeakMember<Document> m_document;
116 DocumentLoader* m_documentLoader; 121 DocumentLoader* m_documentLoader;
117 }; 122 };
118 123
119 } 124 }
120 125
121 #endif 126 #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