| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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&) OVERRI
DE; |
| 77 virtual void dataReceived(Resource*, const char* data, int dataLength) O
VERRIDE; | 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&); |
| 90 void handleReceivedData(const char* data, int 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 void makeCrossOriginAccessRequest(const ResourceRequest&); | 94 void makeCrossOriginAccessRequest(const ResourceRequest&); |
| 95 // Loads m_actualRequest. | 95 // Loads m_actualRequest. |
| 96 void loadActualRequest(); | 96 void loadActualRequest(); |
| 97 // Clears m_actualRequest and reports access control check failure to | 97 // Clears m_actualRequest and reports access control check failure to |
| 98 // m_client. | 98 // m_client. |
| 99 void handlePreflightFailure(const String& url, const String& errorDescri
ption); | 99 void handlePreflightFailure(const String& url, const String& errorDescri
ption); |
| 100 // Investigates the response for the preflight request. If successful, | 100 // Investigates the response for the preflight request. If successful, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 OwnPtr<ResourceLoaderOptions> m_actualOptions; | 133 OwnPtr<ResourceLoaderOptions> m_actualOptions; |
| 134 | 134 |
| 135 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. | 135 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i
n case of a cross-origin redirect. |
| 136 Timer<DocumentThreadableLoader> m_timeoutTimer; | 136 Timer<DocumentThreadableLoader> m_timeoutTimer; |
| 137 double m_requestStartedSeconds; // Time an asynchronous fetch request is
started | 137 double m_requestStartedSeconds; // Time an asynchronous fetch request is
started |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 } // namespace blink | 140 } // namespace blink |
| 141 | 141 |
| 142 #endif // DocumentThreadableLoader_h | 142 #endif // DocumentThreadableLoader_h |
| OLD | NEW |