| 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 "web/tests/sim/SimNetwork.h" | 5 #include "web/tests/sim/SimNetwork.h" |
| 6 | 6 |
| 7 #include "public/platform/Platform.h" | 7 #include "public/platform/Platform.h" |
| 8 #include "public/platform/WebURLError.h" | 8 #include "public/platform/WebURLError.h" |
| 9 #include "public/platform/WebURLLoader.h" | 9 #include "public/platform/WebURLLoader.h" |
| 10 #include "public/platform/WebURLLoaderClient.h" | 10 #include "public/platform/WebURLLoaderClient.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return; | 50 return; |
| 51 } | 51 } |
| 52 DCHECK(it->value); | 52 DCHECK(it->value); |
| 53 m_currentRequest = it->value; | 53 m_currentRequest = it->value; |
| 54 m_currentRequest->didReceiveResponse(client, loader, response); | 54 m_currentRequest->didReceiveResponse(client, loader, response); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void SimNetwork::didReceiveData(WebURLLoaderClient* client, WebURLLoader* loader
, const char* data, int dataLength, int encodedDataLength) | 57 void SimNetwork::didReceiveData(WebURLLoaderClient* client, WebURLLoader* loader
, const char* data, int dataLength, int encodedDataLength) |
| 58 { | 58 { |
| 59 if (!m_currentRequest) | 59 if (!m_currentRequest) |
| 60 client->didReceiveData(loader, data, dataLength, encodedDataLength); | 60 client->didReceiveData(loader, data, dataLength, encodedDataLength, data
Length); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void SimNetwork::didFail(WebURLLoaderClient* client, WebURLLoader* loader, const
WebURLError& error) | 63 void SimNetwork::didFail(WebURLLoaderClient* client, WebURLLoader* loader, const
WebURLError& error) |
| 64 { | 64 { |
| 65 if (!m_currentRequest) { | 65 if (!m_currentRequest) { |
| 66 client->didFail(loader, error); | 66 client->didFail(loader, error); |
| 67 return; | 67 return; |
| 68 } | 68 } |
| 69 m_currentRequest->didFail(error); | 69 m_currentRequest->didFail(error); |
| 70 } | 70 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 82 { | 82 { |
| 83 m_requests.add(request.url(), &request); | 83 m_requests.add(request.url(), &request); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void SimNetwork::removeRequest(SimRequest& request) | 86 void SimNetwork::removeRequest(SimRequest& request) |
| 87 { | 87 { |
| 88 m_requests.remove(request.url()); | 88 m_requests.remove(request.url()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| OLD | NEW |