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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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&, const ResourceLoaderOp
tions&); | 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&, const Res
ourceLoaderOptions&); | 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 overrideTimeout(unsigned long timeout) OVERRIDE; | |
62 | |
63 virtual void cancel() OVERRIDE; | 61 virtual void cancel() OVERRIDE; |
64 void setDefersLoading(bool); | 62 void setDefersLoading(bool); |
65 | 63 |
66 private: | 64 private: |
67 enum BlockingBehavior { | 65 enum BlockingBehavior { |
68 LoadSynchronously, | 66 LoadSynchronously, |
69 LoadAsynchronously | 67 LoadAsynchronously |
70 }; | 68 }; |
71 | 69 |
72 DocumentThreadableLoader(Document&, ThreadableLoaderClient*, BlockingBeh
avior, const ResourceRequest&, const ThreadableLoaderOptions&, const ResourceLoa
derOptions&); | 70 DocumentThreadableLoader(Document&, ThreadableLoaderClient*, BlockingBeh
avior, const ResourceRequest&, const ThreadableLoaderOptions&, const ResourceLoa
derOptions&); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 bool m_simpleRequest; | 122 bool m_simpleRequest; |
125 bool m_async; | 123 bool m_async; |
126 | 124 |
127 // Holds the original request and options for it during preflight | 125 // Holds the original request and options for it during preflight |
128 // request handling phase. | 126 // request handling phase. |
129 OwnPtr<ResourceRequest> m_actualRequest; | 127 OwnPtr<ResourceRequest> m_actualRequest; |
130 OwnPtr<ResourceLoaderOptions> m_actualOptions; | 128 OwnPtr<ResourceLoaderOptions> m_actualOptions; |
131 | 129 |
132 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. | 130 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. |
133 Timer<DocumentThreadableLoader> m_timeoutTimer; | 131 Timer<DocumentThreadableLoader> m_timeoutTimer; |
134 double m_requestStartedSeconds; // Time an asynchronous fetch request is
started | |
135 }; | 132 }; |
136 | 133 |
137 } // namespace WebCore | 134 } // namespace WebCore |
138 | 135 |
139 #endif // DocumentThreadableLoader_h | 136 #endif // DocumentThreadableLoader_h |
OLD | NEW |