Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 class KURL; | 49 class KURL; |
| 50 class MHTMLArchive; | 50 class MHTMLArchive; |
| 51 class ResourceError; | 51 class ResourceError; |
| 52 class ResourceResponse; | 52 class ResourceResponse; |
| 53 class ResourceTimingInfo; | 53 class ResourceTimingInfo; |
| 54 class WebTaskRunner; | 54 class WebTaskRunner; |
| 55 enum class WebCachePolicy; | 55 enum class WebCachePolicy; |
| 56 | 56 |
| 57 enum FetchResourceType { FetchMainResource, FetchSubresource }; | 57 enum FetchResourceType { FetchMainResource, FetchSubresource }; |
| 58 | 58 |
| 59 enum class ResourceLoadStartType { kNotFromMemoryCache, kFromMemoryCache }; | |
|
Nate Chapin
2017/03/22 19:02:02
Nit: it's not really "LoadStart" for the kNotFromM
kinuko
2017/03/24 13:51:51
Good point, done.
| |
| 60 | |
| 59 // The FetchContext is an interface for performing context specific processing | 61 // The FetchContext is an interface for performing context specific processing |
| 60 // in response to events in the ResourceFetcher. The ResourceFetcher or its job | 62 // in response to events in the ResourceFetcher. The ResourceFetcher or its job |
| 61 // class, ResourceLoader, may call the methods on a FetchContext. | 63 // class, ResourceLoader, may call the methods on a FetchContext. |
| 62 // | 64 // |
| 63 // Any processing that depends on components outside platform/loader/fetch/ | 65 // Any processing that depends on components outside platform/loader/fetch/ |
| 64 // should be implemented on a subclass of this interface, and then exposed to | 66 // should be implemented on a subclass of this interface, and then exposed to |
| 65 // the ResourceFetcher via this interface. | 67 // the ResourceFetcher via this interface. |
| 66 class PLATFORM_EXPORT FetchContext | 68 class PLATFORM_EXPORT FetchContext |
| 67 : public GarbageCollectedFinalized<FetchContext> { | 69 : public GarbageCollectedFinalized<FetchContext> { |
| 68 WTF_MAKE_NONCOPYABLE(FetchContext); | 70 WTF_MAKE_NONCOPYABLE(FetchContext); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 89 | 91 |
| 90 virtual void dispatchDidChangeResourcePriority(unsigned long identifier, | 92 virtual void dispatchDidChangeResourcePriority(unsigned long identifier, |
| 91 ResourceLoadPriority, | 93 ResourceLoadPriority, |
| 92 int intraPriorityValue); | 94 int intraPriorityValue); |
| 93 // The last callback before a request is actually sent to the browser process. | 95 // The last callback before a request is actually sent to the browser process. |
| 94 virtual void dispatchWillSendRequest( | 96 virtual void dispatchWillSendRequest( |
| 95 unsigned long identifier, | 97 unsigned long identifier, |
| 96 ResourceRequest&, | 98 ResourceRequest&, |
| 97 const ResourceResponse& redirectResponse, | 99 const ResourceResponse& redirectResponse, |
| 98 const FetchInitiatorInfo& = FetchInitiatorInfo()); | 100 const FetchInitiatorInfo& = FetchInitiatorInfo()); |
| 99 virtual void dispatchDidLoadResourceFromMemoryCache( | 101 virtual void dispatchDidLoadResourceFromMemoryCache(unsigned long identifier, |
| 100 unsigned long identifier, | 102 const ResourceRequest&, |
| 101 Resource*, | 103 const ResourceResponse&); |
| 102 WebURLRequest::FrameType, | |
| 103 WebURLRequest::RequestContext); | |
| 104 virtual void dispatchDidReceiveResponse(unsigned long identifier, | 104 virtual void dispatchDidReceiveResponse(unsigned long identifier, |
| 105 const ResourceResponse&, | 105 const ResourceResponse&, |
| 106 WebURLRequest::FrameType, | 106 WebURLRequest::FrameType, |
| 107 WebURLRequest::RequestContext, | 107 WebURLRequest::RequestContext, |
| 108 Resource*); | 108 Resource*, |
| 109 ResourceLoadStartType); | |
| 109 virtual void dispatchDidReceiveData(unsigned long identifier, | 110 virtual void dispatchDidReceiveData(unsigned long identifier, |
| 110 const char* data, | 111 const char* data, |
| 111 int dataLength); | 112 int dataLength); |
| 112 virtual void dispatchDidReceiveEncodedData(unsigned long identifier, | 113 virtual void dispatchDidReceiveEncodedData(unsigned long identifier, |
| 113 int encodedDataLength); | 114 int encodedDataLength); |
| 114 virtual void dispatchDidDownloadData(unsigned long identifier, | 115 virtual void dispatchDidDownloadData(unsigned long identifier, |
| 115 int dataLength, | 116 int dataLength, |
| 116 int encodedDataLength); | 117 int encodedDataLength); |
| 117 virtual void dispatchDidFinishLoading(unsigned long identifier, | 118 virtual void dispatchDidFinishLoading(unsigned long identifier, |
| 118 double finishTime, | 119 double finishTime, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 | 189 |
| 189 virtual RefPtr<WebTaskRunner> loadingTaskRunner() const { return nullptr; } | 190 virtual RefPtr<WebTaskRunner> loadingTaskRunner() const { return nullptr; } |
| 190 | 191 |
| 191 protected: | 192 protected: |
| 192 FetchContext() {} | 193 FetchContext() {} |
| 193 }; | 194 }; |
| 194 | 195 |
| 195 } // namespace blink | 196 } // namespace blink |
| 196 | 197 |
| 197 #endif | 198 #endif |
| OLD | NEW |