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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 class Document; | 48 class Document; |
49 class KURL; | 49 class KURL; |
50 class ResourceRequest; | 50 class ResourceRequest; |
51 class SecurityOrigin; | 51 class SecurityOrigin; |
52 class ThreadableLoaderClient; | 52 class ThreadableLoaderClient; |
53 | 53 |
54 class DocumentThreadableLoader FINAL : public ThreadableLoader, private Resource
Owner<RawResource> { | 54 class DocumentThreadableLoader FINAL : public ThreadableLoader, private Resource
Owner<RawResource> { |
55 WTF_MAKE_FAST_ALLOCATED; | 55 WTF_MAKE_FAST_ALLOCATED; |
56 public: | 56 public: |
57 static void loadResourceSynchronously(Document&, const ResourceRequest&,
ThreadableLoaderClient&, const ThreadableLoaderOptions&); | 57 static void loadResourceSynchronously(Document&, const ResourceRequest&,
ThreadableLoaderClient&, const ThreadableLoaderOptions&, const ResourceLoaderOp
tions&); |
58 static PassRefPtr<DocumentThreadableLoader> create(Document&, Threadable
LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&); | 58 static PassRefPtr<DocumentThreadableLoader> create(Document&, Threadable
LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&, const Res
ourceLoaderOptions&); |
59 virtual ~DocumentThreadableLoader(); | 59 virtual ~DocumentThreadableLoader(); |
60 | 60 |
61 virtual void cancel() OVERRIDE; | 61 virtual void cancel() OVERRIDE; |
62 void setDefersLoading(bool); | 62 void setDefersLoading(bool); |
63 | 63 |
64 private: | 64 private: |
65 enum BlockingBehavior { | 65 enum BlockingBehavior { |
66 LoadSynchronously, | 66 LoadSynchronously, |
67 LoadAsynchronously | 67 LoadAsynchronously |
68 }; | 68 }; |
69 | 69 |
70 DocumentThreadableLoader(Document&, ThreadableLoaderClient*, BlockingBeh
avior, const ResourceRequest&, const ThreadableLoaderOptions&); | 70 DocumentThreadableLoader(Document&, ThreadableLoaderClient*, BlockingBeh
avior, const ResourceRequest&, const ThreadableLoaderOptions&, const ResourceLoa
derOptions&); |
71 | 71 |
72 // RawResourceClient implementation | 72 // RawResourceClient implementation |
73 virtual void dataSent(Resource*, unsigned long long bytesSent, unsigned
long long totalBytesToBeSent) OVERRIDE; | 73 virtual void dataSent(Resource*, unsigned long long bytesSent, unsigned
long long totalBytesToBeSent) OVERRIDE; |
74 virtual void responseReceived(Resource*, const ResourceResponse&) OVERRI
DE; | 74 virtual void responseReceived(Resource*, const ResourceResponse&) OVERRI
DE; |
75 virtual void dataReceived(Resource*, const char* data, int dataLength) O
VERRIDE; | 75 virtual void dataReceived(Resource*, const char* data, int dataLength) O
VERRIDE; |
76 virtual void redirectReceived(Resource*, ResourceRequest&, const Resourc
eResponse&) OVERRIDE; | 76 virtual void redirectReceived(Resource*, ResourceRequest&, const Resourc
eResponse&) OVERRIDE; |
77 virtual void notifyFinished(Resource*) OVERRIDE; | 77 virtual void notifyFinished(Resource*) OVERRIDE; |
78 virtual void dataDownloaded(Resource*, int) OVERRIDE; | 78 virtual void dataDownloaded(Resource*, int) OVERRIDE; |
79 | 79 |
80 void cancelWithError(const ResourceError&); | 80 void cancelWithError(const ResourceError&); |
(...skipping 16 matching lines...) Expand all Loading... |
97 void handlePreflightResponse(unsigned long identifier, const ResourceRes
ponse&); | 97 void handlePreflightResponse(unsigned long identifier, const ResourceRes
ponse&); |
98 | 98 |
99 void loadRequest(const ResourceRequest&); | 99 void loadRequest(const ResourceRequest&); |
100 bool isAllowedRedirect(const KURL&) const; | 100 bool isAllowedRedirect(const KURL&) const; |
101 bool isAllowedByPolicy(const KURL&) const; | 101 bool isAllowedByPolicy(const KURL&) const; |
102 | 102 |
103 SecurityOrigin* securityOrigin() const; | 103 SecurityOrigin* securityOrigin() const; |
104 | 104 |
105 ThreadableLoaderClient* m_client; | 105 ThreadableLoaderClient* m_client; |
106 Document& m_document; | 106 Document& m_document; |
107 ThreadableLoaderOptions m_options; | 107 |
| 108 const ThreadableLoaderOptions m_options; |
| 109 const ResourceLoaderOptions m_resourceLoaderOptions; |
| 110 |
| 111 StoredCredentials m_allowCredentials; |
| 112 RefPtr<SecurityOrigin> m_securityOrigin; |
| 113 |
108 bool m_sameOriginRequest; | 114 bool m_sameOriginRequest; |
109 bool m_simpleRequest; | 115 bool m_simpleRequest; |
110 bool m_async; | 116 bool m_async; |
111 OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Contr
ol preflight checks | 117 OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Contr
ol preflight checks |
112 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. | 118 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. |
113 Timer<DocumentThreadableLoader> m_timeoutTimer; | 119 Timer<DocumentThreadableLoader> m_timeoutTimer; |
114 }; | 120 }; |
115 | 121 |
116 } // namespace WebCore | 122 } // namespace WebCore |
117 | 123 |
118 #endif // DocumentThreadableLoader_h | 124 #endif // DocumentThreadableLoader_h |
OLD | NEW |