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