Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp

Issue 2540023003: Dispatch encoded_data_length separately in content/child (Closed)
Patch Set: fix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 client->didReceiveResponse(response); 44 client->didReceiveResponse(response);
45 return; 45 return;
46 } 46 }
47 DCHECK(it->value); 47 DCHECK(it->value);
48 m_currentRequest = it->value; 48 m_currentRequest = it->value;
49 m_currentRequest->didReceiveResponse(client, response); 49 m_currentRequest->didReceiveResponse(client, response);
50 } 50 }
51 51
52 void SimNetwork::didReceiveData(WebURLLoaderClient* client, 52 void SimNetwork::didReceiveData(WebURLLoaderClient* client,
53 const char* data, 53 const char* data,
54 int dataLength, 54 int dataLength) {
55 int encodedDataLength) {
56 if (!m_currentRequest) 55 if (!m_currentRequest)
57 client->didReceiveData(data, dataLength, encodedDataLength); 56 client->didReceiveData(data, dataLength);
58 } 57 }
59 58
60 void SimNetwork::didFail(WebURLLoaderClient* client, 59 void SimNetwork::didFail(WebURLLoaderClient* client,
61 const WebURLError& error, 60 const WebURLError& error,
62 int64_t totalEncodedDataLength, 61 int64_t totalEncodedDataLength,
63 int64_t totalEncodedBodyLength) { 62 int64_t totalEncodedBodyLength) {
64 if (!m_currentRequest) { 63 if (!m_currentRequest) {
65 client->didFail(error, totalEncodedDataLength, totalEncodedBodyLength); 64 client->didFail(error, totalEncodedDataLength, totalEncodedBodyLength);
66 return; 65 return;
67 } 66 }
(...skipping 14 matching lines...) Expand all
82 81
83 void SimNetwork::addRequest(SimRequest& request) { 82 void SimNetwork::addRequest(SimRequest& request) {
84 m_requests.add(request.url(), &request); 83 m_requests.add(request.url(), &request);
85 } 84 }
86 85
87 void SimNetwork::removeRequest(SimRequest& request) { 86 void SimNetwork::removeRequest(SimRequest& request) {
88 m_requests.remove(request.url()); 87 m_requests.remove(request.url());
89 } 88 }
90 89
91 } // namespace blink 90 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698