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 * | 4 * |
4 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
6 * met: | 7 * met: |
7 * | 8 * |
8 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 11 * * Redistributions in binary form must reproduce the above |
11 * copyright notice, this list of conditions and the following disclaimer | 12 * copyright notice, this list of conditions and the following disclaimer |
12 * in the documentation and/or other materials provided with the | 13 * in the documentation and/or other materials provided with the |
(...skipping 15 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 30 */ |
30 | 31 |
31 #ifndef DocumentThreadableLoader_h | 32 #ifndef DocumentThreadableLoader_h |
32 #define DocumentThreadableLoader_h | 33 #define DocumentThreadableLoader_h |
33 | 34 |
34 #include "core/loader/FrameLoaderTypes.h" | 35 #include "core/loader/FrameLoaderTypes.h" |
35 #include "core/loader/ThreadableLoader.h" | 36 #include "core/loader/ThreadableLoader.h" |
36 #include "core/loader/cache/CachedRawResource.h" | 37 #include "core/loader/cache/CachedRawResource.h" |
37 #include "core/loader/cache/CachedResourceHandle.h" | 38 #include "core/loader/cache/CachedResourceHandle.h" |
| 39 #include "core/platform/Timer.h" |
| 40 #include "core/platform/network/ResourceError.h" |
38 #include <wtf/Forward.h> | 41 #include <wtf/Forward.h> |
39 #include <wtf/OwnPtr.h> | 42 #include <wtf/OwnPtr.h> |
40 #include <wtf/PassRefPtr.h> | 43 #include <wtf/PassRefPtr.h> |
41 #include <wtf/RefCounted.h> | 44 #include <wtf/RefCounted.h> |
42 #include <wtf/RefPtr.h> | 45 #include <wtf/RefPtr.h> |
43 #include <wtf/text/WTFString.h> | 46 #include <wtf/text/WTFString.h> |
44 | 47 |
45 namespace WebCore { | 48 namespace WebCore { |
46 class Document; | 49 class Document; |
47 class KURL; | 50 class KURL; |
(...skipping 29 matching lines...) Expand all Loading... |
77 void clearResource(); | 80 void clearResource(); |
78 | 81 |
79 // CachedRawResourceClient | 82 // CachedRawResourceClient |
80 virtual void dataSent(CachedResource*, unsigned long long bytesSent, uns
igned long long totalBytesToBeSent); | 83 virtual void dataSent(CachedResource*, unsigned long long bytesSent, uns
igned long long totalBytesToBeSent); |
81 virtual void responseReceived(CachedResource*, const ResourceResponse&); | 84 virtual void responseReceived(CachedResource*, const ResourceResponse&); |
82 virtual void dataReceived(CachedResource*, const char* data, int dataLen
gth); | 85 virtual void dataReceived(CachedResource*, const char* data, int dataLen
gth); |
83 virtual void redirectReceived(CachedResource*, ResourceRequest&, const R
esourceResponse&); | 86 virtual void redirectReceived(CachedResource*, ResourceRequest&, const R
esourceResponse&); |
84 virtual void notifyFinished(CachedResource*); | 87 virtual void notifyFinished(CachedResource*); |
85 virtual void dataDownloaded(CachedResource*, int); | 88 virtual void dataDownloaded(CachedResource*, int); |
86 | 89 |
| 90 void cancelWithError(const ResourceError&); |
87 void didReceiveResponse(unsigned long identifier, const ResourceResponse
&); | 91 void didReceiveResponse(unsigned long identifier, const ResourceResponse
&); |
88 void didReceiveData(unsigned long identifier, const char* data, int data
Length); | 92 void didReceiveData(unsigned long identifier, const char* data, int data
Length); |
89 void didFinishLoading(unsigned long identifier, double finishTime); | 93 void didFinishLoading(unsigned long identifier, double finishTime); |
90 void didFail(unsigned long identifier, const ResourceError&); | 94 void didFail(unsigned long identifier, const ResourceError&); |
| 95 void didTimeout(Timer<DocumentThreadableLoader>*); |
91 void makeCrossOriginAccessRequest(const ResourceRequest&); | 96 void makeCrossOriginAccessRequest(const ResourceRequest&); |
92 void makeSimpleCrossOriginAccessRequest(const ResourceRequest& request); | 97 void makeSimpleCrossOriginAccessRequest(const ResourceRequest& request); |
93 void makeCrossOriginAccessRequestWithPreflight(const ResourceRequest& re
quest); | 98 void makeCrossOriginAccessRequestWithPreflight(const ResourceRequest& re
quest); |
94 void preflightSuccess(); | 99 void preflightSuccess(); |
95 void preflightFailure(unsigned long identifier, const String& url, const
String& errorDescription); | 100 void preflightFailure(unsigned long identifier, const String& url, const
String& errorDescription); |
96 | 101 |
97 void loadRequest(const ResourceRequest&, SecurityCheckPolicy); | 102 void loadRequest(const ResourceRequest&, SecurityCheckPolicy); |
98 bool isAllowedRedirect(const KURL&) const; | 103 bool isAllowedRedirect(const KURL&) const; |
99 bool isAllowedByPolicy(const KURL&) const; | 104 bool isAllowedByPolicy(const KURL&) const; |
100 | 105 |
101 SecurityOrigin* securityOrigin() const; | 106 SecurityOrigin* securityOrigin() const; |
102 | 107 |
103 CachedResourceHandle<CachedRawResource> m_resource; | 108 CachedResourceHandle<CachedRawResource> m_resource; |
104 ThreadableLoaderClient* m_client; | 109 ThreadableLoaderClient* m_client; |
105 Document* m_document; | 110 Document* m_document; |
106 ThreadableLoaderOptions m_options; | 111 ThreadableLoaderOptions m_options; |
107 bool m_sameOriginRequest; | 112 bool m_sameOriginRequest; |
108 bool m_simpleRequest; | 113 bool m_simpleRequest; |
109 bool m_async; | 114 bool m_async; |
110 OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Cont
rol preflight checks | 115 OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Cont
rol preflight checks |
| 116 Timer<DocumentThreadableLoader> m_timeoutTimer; |
111 }; | 117 }; |
112 | 118 |
113 } // namespace WebCore | 119 } // namespace WebCore |
114 | 120 |
115 #endif // DocumentThreadableLoader_h | 121 #endif // DocumentThreadableLoader_h |
OLD | NEW |