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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 private: | 66 private: |
67 enum BlockingBehavior { | 67 enum BlockingBehavior { |
68 LoadSynchronously, | 68 LoadSynchronously, |
69 LoadAsynchronously | 69 LoadAsynchronously |
70 }; | 70 }; |
71 | 71 |
72 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&); |
73 | 73 |
74 // RawResourceClient implementation | 74 // RawResourceClient implementation |
75 virtual void dataSent(Resource*, unsigned long long bytesSent, unsigned
long long totalBytesToBeSent) override; | 75 virtual void dataSent(Resource*, unsigned long long bytesSent, unsigned
long long totalBytesToBeSent) override; |
76 virtual void responseReceived(Resource*, const ResourceResponse&) overri
de; | 76 virtual void responseReceived(Resource*, const ResourceResponse&, PassOw
nPtr<WebDataConsumerHandle>) override; |
77 virtual void dataReceived(Resource*, const char* data, unsigned dataLeng
th) override; | 77 virtual void dataReceived(Resource*, const char* data, unsigned dataLeng
th) override; |
78 virtual void redirectReceived(Resource*, ResourceRequest&, const Resourc
eResponse&) override; | 78 virtual void redirectReceived(Resource*, ResourceRequest&, const Resourc
eResponse&) override; |
79 virtual void notifyFinished(Resource*) override; | 79 virtual void notifyFinished(Resource*) override; |
80 virtual void dataDownloaded(Resource*, int) override; | 80 virtual void dataDownloaded(Resource*, int) override; |
81 | 81 |
82 void cancelWithError(const ResourceError&); | 82 void cancelWithError(const ResourceError&); |
83 | 83 |
84 // Notify Inspector about resource response. Use this method if response
is not going to be finished normally. | 84 // Notify Inspector about resource response. Use this method if response
is not going to be finished normally. |
85 void notifyResponseReceived(unsigned long identifier, const ResourceResp
onse&); | 85 void notifyResponseReceived(unsigned long identifier, const ResourceResp
onse&); |
86 | 86 |
87 // Methods containing code to handle resource fetch results which is | 87 // Methods containing code to handle resource fetch results which is |
88 // common to both sync and async mode. | 88 // common to both sync and async mode. |
89 void handleResponse(unsigned long identifier, const ResourceResponse&); | 89 void handleResponse(unsigned long identifier, const ResourceResponse&, P
assOwnPtr<WebDataConsumerHandle>); |
90 void handleReceivedData(const char* data, unsigned dataLength); | 90 void handleReceivedData(const char* data, unsigned dataLength); |
91 void handleSuccessfulFinish(unsigned long identifier, double finishTime)
; | 91 void handleSuccessfulFinish(unsigned long identifier, double finishTime)
; |
92 | 92 |
93 void didTimeout(Timer<DocumentThreadableLoader>*); | 93 void didTimeout(Timer<DocumentThreadableLoader>*); |
94 // Calls the appropriate loading method according to policy and data | 94 // Calls the appropriate loading method according to policy and data |
95 // about origin. Only for handling the initial load (including fallback | 95 // about origin. Only for handling the initial load (including fallback |
96 // after consulting ServiceWorker). | 96 // after consulting ServiceWorker). |
97 void dispatchInitialRequest(const ResourceRequest&); | 97 void dispatchInitialRequest(const ResourceRequest&); |
98 void makeCrossOriginAccessRequest(const ResourceRequest&); | 98 void makeCrossOriginAccessRequest(const ResourceRequest&); |
99 // Loads m_fallbackRequestForServiceWorker. | 99 // Loads m_fallbackRequestForServiceWorker. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 OwnPtr<ResourceLoaderOptions> m_actualOptions; | 142 OwnPtr<ResourceLoaderOptions> m_actualOptions; |
143 | 143 |
144 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. | 144 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. |
145 Timer<DocumentThreadableLoader> m_timeoutTimer; | 145 Timer<DocumentThreadableLoader> m_timeoutTimer; |
146 double m_requestStartedSeconds; // Time an asynchronous fetch request is
started | 146 double m_requestStartedSeconds; // Time an asynchronous fetch request is
started |
147 }; | 147 }; |
148 | 148 |
149 } // namespace blink | 149 } // namespace blink |
150 | 150 |
151 #endif // DocumentThreadableLoader_h | 151 #endif // DocumentThreadableLoader_h |
OLD | NEW |