OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013, Intel Corporation | 3 * Copyright (C) 2013, Intel Corporation |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 void notifyResponseReceived(unsigned long identifier, const ResourceResp
onse&); | 85 void notifyResponseReceived(unsigned long identifier, const ResourceResp
onse&); |
86 | 86 |
87 // Methods containing code to handle resource fetch results which is | 87 // Methods containing code to handle resource fetch results which is |
88 // common to both sync and async mode. | 88 // common to both sync and async mode. |
89 void handleResponse(unsigned long identifier, const ResourceResponse&); | 89 void handleResponse(unsigned long identifier, const ResourceResponse&); |
90 void handleReceivedData(const char* data, unsigned dataLength); | 90 void handleReceivedData(const char* data, unsigned dataLength); |
91 void handleSuccessfulFinish(unsigned long identifier, double finishTime)
; | 91 void handleSuccessfulFinish(unsigned long identifier, double finishTime)
; |
92 | 92 |
93 void didTimeout(Timer<DocumentThreadableLoader>*); | 93 void didTimeout(Timer<DocumentThreadableLoader>*); |
94 void makeCrossOriginAccessRequest(const ResourceRequest&); | 94 void makeCrossOriginAccessRequest(const ResourceRequest&); |
| 95 // Loads m_fallbackRequestForServiceWorker. |
| 96 void loadFallbackRequestForServiceWorker(); |
95 // Loads m_actualRequest. | 97 // Loads m_actualRequest. |
96 void loadActualRequest(); | 98 void loadActualRequest(); |
97 // Clears m_actualRequest and reports access control check failure to | 99 // Clears m_actualRequest and reports access control check failure to |
98 // m_client. | 100 // m_client. |
99 void handlePreflightFailure(const String& url, const String& errorDescri
ption); | 101 void handlePreflightFailure(const String& url, const String& errorDescri
ption); |
100 // Investigates the response for the preflight request. If successful, | 102 // Investigates the response for the preflight request. If successful, |
101 // the actual request will be made later in handleSuccessfulFinish(). | 103 // the actual request will be made later in handleSuccessfulFinish(). |
102 void handlePreflightResponse(const ResourceResponse&); | 104 void handlePreflightResponse(const ResourceResponse&); |
103 | 105 |
104 void loadRequest(const ResourceRequest&, ResourceLoaderOptions); | 106 void loadRequest(const ResourceRequest&, ResourceLoaderOptions); |
(...skipping 15 matching lines...) Expand all Loading... |
120 // with up-to-date values from them and this variable, and use it. | 122 // with up-to-date values from them and this variable, and use it. |
121 const ResourceLoaderOptions m_resourceLoaderOptions; | 123 const ResourceLoaderOptions m_resourceLoaderOptions; |
122 | 124 |
123 bool m_forceDoNotAllowStoredCredentials; | 125 bool m_forceDoNotAllowStoredCredentials; |
124 RefPtr<SecurityOrigin> m_securityOrigin; | 126 RefPtr<SecurityOrigin> m_securityOrigin; |
125 | 127 |
126 bool m_sameOriginRequest; | 128 bool m_sameOriginRequest; |
127 bool m_simpleRequest; | 129 bool m_simpleRequest; |
128 bool m_async; | 130 bool m_async; |
129 | 131 |
| 132 // Holds the original request for fallback in case the Service Worker |
| 133 // does not respond. |
| 134 OwnPtr<ResourceRequest> m_fallbackRequestForServiceWorker; |
130 // Holds the original request and options for it during preflight | 135 // Holds the original request and options for it during preflight |
131 // request handling phase. | 136 // request handling phase. |
132 OwnPtr<ResourceRequest> m_actualRequest; | 137 OwnPtr<ResourceRequest> m_actualRequest; |
133 OwnPtr<ResourceLoaderOptions> m_actualOptions; | 138 OwnPtr<ResourceLoaderOptions> m_actualOptions; |
134 | 139 |
135 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. | 140 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. |
136 Timer<DocumentThreadableLoader> m_timeoutTimer; | 141 Timer<DocumentThreadableLoader> m_timeoutTimer; |
137 double m_requestStartedSeconds; // Time an asynchronous fetch request is
started | 142 double m_requestStartedSeconds; // Time an asynchronous fetch request is
started |
138 }; | 143 }; |
139 | 144 |
140 } // namespace blink | 145 } // namespace blink |
141 | 146 |
142 #endif // DocumentThreadableLoader_h | 147 #endif // DocumentThreadableLoader_h |
OLD | NEW |