OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void didReceiveCachedMetadata(WebURLLoader*, const char* data, int length) o
verride; | 82 void didReceiveCachedMetadata(WebURLLoader*, const char* data, int length) o
verride; |
83 void didFinishLoading(WebURLLoader*, double finishTime, int64_t encodedDataL
ength) override; | 83 void didFinishLoading(WebURLLoader*, double finishTime, int64_t encodedDataL
ength) override; |
84 void didFail(WebURLLoader*, const WebURLError&) override; | 84 void didFail(WebURLLoader*, const WebURLError&) override; |
85 void didDownloadData(WebURLLoader*, int, int) override; | 85 void didDownloadData(WebURLLoader*, int, int) override; |
86 | 86 |
87 const KURL& url() const { return m_request.url(); } | 87 const KURL& url() const { return m_request.url(); } |
88 bool isLoadedBy(ResourceFetcher*) const; | 88 bool isLoadedBy(ResourceFetcher*) const; |
89 | 89 |
90 bool reachedTerminalState() const { return m_state == Terminated; } | 90 bool reachedTerminalState() const { return m_state == Terminated; } |
91 const ResourceRequest& request() const { return m_request; } | 91 const ResourceRequest& request() const { return m_request; } |
92 | 92 void didFinishLoadingOnePart(double finishTime, int64_t encodedDataLength); |
93 bool loadingMultipartContent() const { return m_loadingMultipartContent; } | |
94 | 93 |
95 private: | 94 private: |
96 // Assumes ResourceFetcher and Resource are non-null. | 95 // Assumes ResourceFetcher and Resource are non-null. |
97 ResourceLoader(ResourceFetcher*, Resource*, const ResourceLoaderOptions&); | 96 ResourceLoader(ResourceFetcher*, Resource*, const ResourceLoaderOptions&); |
98 | 97 |
99 void init(const ResourceRequest&); | 98 void init(const ResourceRequest&); |
100 void requestSynchronously(); | 99 void requestSynchronously(); |
101 | 100 |
102 void didFinishLoadingOnePart(double finishTime, int64_t encodedDataLength); | |
103 | |
104 bool responseNeedsAccessControlCheck() const; | 101 bool responseNeedsAccessControlCheck() const; |
105 | 102 |
106 ResourceRequest& applyOptions(ResourceRequest&) const; | 103 ResourceRequest& applyOptions(ResourceRequest&) const; |
107 | 104 |
108 OwnPtr<WebURLLoader> m_loader; | 105 OwnPtr<WebURLLoader> m_loader; |
109 Member<ResourceFetcher> m_fetcher; | 106 Member<ResourceFetcher> m_fetcher; |
110 | 107 |
111 ResourceRequest m_request; | 108 ResourceRequest m_request; |
112 ResourceRequest m_originalRequest; // Before redirects. | 109 ResourceRequest m_originalRequest; // Before redirects. |
113 | 110 |
114 bool m_notifiedLoadComplete; | 111 bool m_notifiedLoadComplete; |
115 | 112 |
116 bool m_defersLoading; | 113 bool m_defersLoading; |
117 bool m_loadingMultipartContent; | |
118 ResourceRequest m_deferredRequest; | 114 ResourceRequest m_deferredRequest; |
119 ResourceLoaderOptions m_options; | 115 ResourceLoaderOptions m_options; |
120 | 116 |
121 enum ResourceLoaderState { | 117 enum ResourceLoaderState { |
122 Initialized, | 118 Initialized, |
123 Finishing, | 119 Finishing, |
124 Terminated | 120 Terminated |
125 }; | 121 }; |
126 | 122 |
127 enum ConnectionState { | 123 enum ConnectionState { |
(...skipping 10 matching lines...) Expand all Loading... |
138 ResourceLoaderState m_state; | 134 ResourceLoaderState m_state; |
139 | 135 |
140 // Used for sanity checking to make sure we don't experience illegal state | 136 // Used for sanity checking to make sure we don't experience illegal state |
141 // transitions. | 137 // transitions. |
142 ConnectionState m_connectionState; | 138 ConnectionState m_connectionState; |
143 }; | 139 }; |
144 | 140 |
145 } // namespace blink | 141 } // namespace blink |
146 | 142 |
147 #endif | 143 #endif |
OLD | NEW |