| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 PassRefPtrWillBeRawPtr<ResourceFetcher> createContextAndFetcher(Docum
entLoader* loader) | 53 static PassRefPtrWillBeRawPtr<ResourceFetcher> createContextAndFetcher(Docum
entLoader* loader) |
| 54 { | 54 { |
| 55 return ResourceFetcher::create(adoptPtrWillBeNoop(new FrameFetchContext(
loader))); | 55 return ResourceFetcher::create(adoptPtrWillBeNoop(new FrameFetchContext(
loader))); |
| 56 } | 56 } |
| 57 | 57 |
| 58 static void provideDocumentToContext(FetchContext& context, Document* docume
nt) |
| 59 { |
| 60 ASSERT(document); |
| 61 RELEASE_ASSERT(context.isLiveContext()); |
| 62 static_cast<FrameFetchContext&>(context).m_document = document; |
| 63 } |
| 64 |
| 58 ~FrameFetchContext(); | 65 ~FrameFetchContext(); |
| 59 | 66 |
| 60 Document* document() const { return m_document; } // Can be null | 67 bool isLiveContext() { return true; } |
| 61 void setDocument(Document* document) { m_document = document; } | |
| 62 void clearDocumentLoader() { m_documentLoader = nullptr; } | |
| 63 | 68 |
| 64 void addAdditionalRequestHeaders(ResourceRequest&, FetchResourceType) overri
de; | 69 void addAdditionalRequestHeaders(ResourceRequest&, FetchResourceType) overri
de; |
| 65 void setFirstPartyForCookies(ResourceRequest&) override; | 70 void setFirstPartyForCookies(ResourceRequest&) override; |
| 66 CachePolicy cachePolicy() const override; | 71 CachePolicy cachePolicy() const override; |
| 67 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest&
, Resource::Type) const override; | 72 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest&
, Resource::Type) const override; |
| 68 void dispatchDidChangeResourcePriority(unsigned long identifier, ResourceLoa
dPriority, int intraPriorityValue) override; | 73 void dispatchDidChangeResourcePriority(unsigned long identifier, ResourceLoa
dPriority, int intraPriorityValue) override; |
| 69 void dispatchWillSendRequest(unsigned long identifier, ResourceRequest&, con
st ResourceResponse& redirectResponse, const FetchInitiatorInfo& = FetchInitiato
rInfo()) override; | 74 void dispatchWillSendRequest(unsigned long identifier, ResourceRequest&, con
st ResourceResponse& redirectResponse, const FetchInitiatorInfo& = FetchInitiato
rInfo()) override; |
| 70 void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const Re
sourceResponse&) override; | 75 void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const Re
sourceResponse&) override; |
| 71 void dispatchDidReceiveResponse(unsigned long identifier, const ResourceResp
onse&, ResourceLoader* = 0) override; | 76 void dispatchDidReceiveResponse(unsigned long identifier, const ResourceResp
onse&, ResourceLoader* = 0) override; |
| 72 void dispatchDidReceiveData(unsigned long identifier, const char* data, int
dataLength, int encodedDataLength) override; | 77 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 Loading... |
| 113 // FIXME: Oilpan: Ideally this should just be a traced Member but that will | 118 // FIXME: Oilpan: Ideally this should just be a traced Member but that will |
| 114 // currently leak because ComputedStyle and its data are not on the heap. | 119 // currently leak because ComputedStyle and its data are not on the heap. |
| 115 // See crbug.com/383860 for details. | 120 // See crbug.com/383860 for details. |
| 116 RawPtrWillBeWeakMember<Document> m_document; | 121 RawPtrWillBeWeakMember<Document> m_document; |
| 117 DocumentLoader* m_documentLoader; | 122 DocumentLoader* m_documentLoader; |
| 118 }; | 123 }; |
| 119 | 124 |
| 120 } | 125 } |
| 121 | 126 |
| 122 #endif | 127 #endif |
| OLD | NEW |