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

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

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Initialise encoded_body_length for sync XHR to data: URLs Created 4 years, 5 months 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/SimRequest.h" 5 #include "web/tests/sim/SimRequest.h"
6 6
7 #include "platform/weborigin/KURL.h" 7 #include "platform/weborigin/KURL.h"
8 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "public/platform/WebURLLoaderClient.h" 9 #include "public/platform/WebURLLoaderClient.h"
10 #include "public/platform/WebURLLoaderMockFactory.h" 10 #include "public/platform/WebURLLoaderMockFactory.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 SimNetwork::current().servePendingRequests(); 50 SimNetwork::current().servePendingRequests();
51 DCHECK(m_isReady); 51 DCHECK(m_isReady);
52 m_client->didReceiveResponse(m_loader, m_response); 52 m_client->didReceiveResponse(m_loader, m_response);
53 } 53 }
54 54
55 void SimRequest::write(const String& data) 55 void SimRequest::write(const String& data)
56 { 56 {
57 DCHECK(m_isReady); 57 DCHECK(m_isReady);
58 DCHECK(!m_error.reason); 58 DCHECK(!m_error.reason);
59 m_totalEncodedDataLength += data.length(); 59 m_totalEncodedDataLength += data.length();
60 m_client->didReceiveData(m_loader, data.utf8().data(), data.length(), data.l ength()); 60 m_client->didReceiveData(m_loader, data.utf8().data(), data.length(), data.l ength(), data.length());
61 } 61 }
62 62
63 void SimRequest::finish() 63 void SimRequest::finish()
64 { 64 {
65 DCHECK(m_isReady); 65 DCHECK(m_isReady);
66 if (m_error.reason) { 66 if (m_error.reason) {
67 m_client->didFail(m_loader, m_error); 67 m_client->didFail(m_loader, m_error);
68 } else { 68 } else {
69 // TODO(esprehn): Is claiming a request time of 0 okay for tests? 69 // TODO(esprehn): Is claiming a request time of 0 okay for tests?
70 m_client->didFinishLoading(m_loader, 0, m_totalEncodedDataLength); 70 m_client->didFinishLoading(m_loader, 0, m_totalEncodedDataLength);
(...skipping 11 matching lines...) Expand all
82 82
83 void SimRequest::reset() 83 void SimRequest::reset()
84 { 84 {
85 m_isReady = false; 85 m_isReady = false;
86 m_client = nullptr; 86 m_client = nullptr;
87 m_loader = nullptr; 87 m_loader = nullptr;
88 SimNetwork::current().removeRequest(*this); 88 SimNetwork::current().removeRequest(*this);
89 } 89 }
90 90
91 } // namespace blink 91 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp ('k') | third_party/WebKit/public/platform/WebURLLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698