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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void cancelWithError(const ResourceError&); | 80 void cancelWithError(const ResourceError&); |
81 | 81 |
82 // Methods containing code to handle resource fetch results which is | 82 // Methods containing code to handle resource fetch results which is |
83 // common to both sync and async mode. | 83 // common to both sync and async mode. |
84 void handleResponse(unsigned long identifier, const ResourceResponse&); | 84 void handleResponse(unsigned long identifier, const ResourceResponse&); |
85 void handleReceivedData(const char* data, int dataLength); | 85 void handleReceivedData(const char* data, int dataLength); |
86 void handleSuccessfulFinish(unsigned long identifier, double finishTime)
; | 86 void handleSuccessfulFinish(unsigned long identifier, double finishTime)
; |
87 | 87 |
88 void didTimeout(Timer<DocumentThreadableLoader>*); | 88 void didTimeout(Timer<DocumentThreadableLoader>*); |
89 void makeCrossOriginAccessRequest(const ResourceRequest&); | 89 void makeCrossOriginAccessRequest(const ResourceRequest&); |
90 void preflightSuccess(); | 90 // Loads m_actualRequest. |
91 void preflightFailure(const String& url, const String& errorDescription)
; | 91 void loadActualRequest(); |
| 92 // Clears m_actualRequest and reports access control check failure to |
| 93 // m_client. |
| 94 void handlePreflightFailure(const String& url, const String& errorDescri
ption); |
92 // Investigates the response for the preflight request. If successful, | 95 // Investigates the response for the preflight request. If successful, |
93 // the actual request will be made later in didFinishLoading(). | 96 // the actual request will be made later in handleSuccessfulFinish(). |
94 void handlePreflightResponse(unsigned long identifier, const ResourceRes
ponse&); | 97 void handlePreflightResponse(unsigned long identifier, const ResourceRes
ponse&); |
95 | 98 |
96 void loadRequest(const ResourceRequest&); | 99 void loadRequest(const ResourceRequest&); |
97 bool isAllowedRedirect(const KURL&) const; | 100 bool isAllowedRedirect(const KURL&) const; |
98 bool isAllowedByPolicy(const KURL&) const; | 101 bool isAllowedByPolicy(const KURL&) const; |
99 | 102 |
100 SecurityOrigin* securityOrigin() const; | 103 SecurityOrigin* securityOrigin() const; |
101 | 104 |
102 ThreadableLoaderClient* m_client; | 105 ThreadableLoaderClient* m_client; |
103 Document& m_document; | 106 Document& m_document; |
104 ThreadableLoaderOptions m_options; | 107 ThreadableLoaderOptions m_options; |
105 bool m_sameOriginRequest; | 108 bool m_sameOriginRequest; |
106 bool m_simpleRequest; | 109 bool m_simpleRequest; |
107 bool m_async; | 110 bool m_async; |
108 OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Contr
ol preflight checks | 111 OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Contr
ol preflight checks |
109 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. | 112 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. |
110 Timer<DocumentThreadableLoader> m_timeoutTimer; | 113 Timer<DocumentThreadableLoader> m_timeoutTimer; |
111 }; | 114 }; |
112 | 115 |
113 } // namespace WebCore | 116 } // namespace WebCore |
114 | 117 |
115 #endif // DocumentThreadableLoader_h | 118 #endif // DocumentThreadableLoader_h |
OLD | NEW |