| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "public/platform/WebURLLoaderTestDelegate.h" | 5 #include "public/platform/WebURLLoaderTestDelegate.h" |
| 6 | 6 |
| 7 #include "public/platform/WebURLError.h" | 7 #include "public/platform/WebURLError.h" |
| 8 #include "public/platform/WebURLLoader.h" | 8 #include "public/platform/WebURLLoader.h" |
| 9 #include "public/platform/WebURLLoaderClient.h" | 9 #include "public/platform/WebURLLoaderClient.h" |
| 10 #include "public/platform/WebURLRequest.h" | 10 #include "public/platform/WebURLRequest.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 WebURLLoaderTestDelegate::WebURLLoaderTestDelegate() {} | 14 WebURLLoaderTestDelegate::WebURLLoaderTestDelegate() {} |
| 15 | 15 |
| 16 WebURLLoaderTestDelegate::~WebURLLoaderTestDelegate() {} | 16 WebURLLoaderTestDelegate::~WebURLLoaderTestDelegate() {} |
| 17 | 17 |
| 18 void WebURLLoaderTestDelegate::didReceiveResponse( | 18 void WebURLLoaderTestDelegate::didReceiveResponse( |
| 19 WebURLLoaderClient* originalClient, | 19 WebURLLoaderClient* originalClient, |
| 20 const WebURLResponse& response) { | 20 const WebURLResponse& response) { |
| 21 originalClient->didReceiveResponse(response); | 21 originalClient->didReceiveResponse(response); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void WebURLLoaderTestDelegate::didReceiveData( | 24 void WebURLLoaderTestDelegate::didReceiveData( |
| 25 WebURLLoaderClient* originalClient, | 25 WebURLLoaderClient* originalClient, |
| 26 const char* data, | 26 const char* data, |
| 27 int dataLength, | 27 int dataLength) { |
| 28 int encodedDataLength) { | 28 originalClient->didReceiveData(data, dataLength); |
| 29 originalClient->didReceiveData(data, dataLength, encodedDataLength); | |
| 30 } | 29 } |
| 31 | 30 |
| 32 void WebURLLoaderTestDelegate::didFail(WebURLLoaderClient* originalClient, | 31 void WebURLLoaderTestDelegate::didFail(WebURLLoaderClient* originalClient, |
| 33 const WebURLError& error, | 32 const WebURLError& error, |
| 34 int64_t totalEncodedDataLength, | 33 int64_t totalEncodedDataLength, |
| 35 int64_t totalEncodedBodyLength) { | 34 int64_t totalEncodedBodyLength) { |
| 36 originalClient->didFail(error, totalEncodedDataLength, | 35 originalClient->didFail(error, totalEncodedDataLength, |
| 37 totalEncodedBodyLength); | 36 totalEncodedBodyLength); |
| 38 } | 37 } |
| 39 | 38 |
| 40 void WebURLLoaderTestDelegate::didFinishLoading( | 39 void WebURLLoaderTestDelegate::didFinishLoading( |
| 41 WebURLLoaderClient* originalClient, | 40 WebURLLoaderClient* originalClient, |
| 42 double finishTime, | 41 double finishTime, |
| 43 int64_t totalEncodedDataLength, | 42 int64_t totalEncodedDataLength, |
| 44 int64_t totalEncodedBodyLength) { | 43 int64_t totalEncodedBodyLength) { |
| 45 originalClient->didFinishLoading(finishTime, totalEncodedDataLength, | 44 originalClient->didFinishLoading(finishTime, totalEncodedDataLength, |
| 46 totalEncodedBodyLength); | 45 totalEncodedBodyLength); |
| 47 } | 46 } |
| 48 | 47 |
| 49 } // namespace blink | 48 } // namespace blink |
| OLD | NEW |