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

Side by Side Diff: content/child/test_request_peer.cc

Issue 2835123005: Send the decoded size when response completed and stop summing in ResourceLoader::DidReceiveData() (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « content/child/test_request_peer.h ('k') | content/child/url_response_body_consumer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/child/test_request_peer.h" 5 #include "content/child/test_request_peer.h"
6 6
7 #include "content/child/resource_dispatcher.h" 7 #include "content/child/resource_dispatcher.h"
8 #include "net/url_request/redirect_info.h" 8 #include "net/url_request/redirect_info.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 if (context_->cancelled) 78 if (context_->cancelled)
79 return; 79 return;
80 context_->cached_metadata = std::vector<char>(data, data + len); 80 context_->cached_metadata = std::vector<char>(data, data + len);
81 } 81 }
82 82
83 void TestRequestPeer::OnCompletedRequest(int error_code, 83 void TestRequestPeer::OnCompletedRequest(int error_code,
84 bool was_ignored_by_handler, 84 bool was_ignored_by_handler,
85 bool stale_copy_in_cache, 85 bool stale_copy_in_cache,
86 const base::TimeTicks& completion_time, 86 const base::TimeTicks& completion_time,
87 int64_t total_transfer_size, 87 int64_t total_transfer_size,
88 int64_t encoded_body_size) { 88 int64_t encoded_body_size,
89 int64_t decoded_body_size) {
89 if (context_->cancelled) 90 if (context_->cancelled)
90 return; 91 return;
91 EXPECT_TRUE(context_->received_response); 92 EXPECT_TRUE(context_->received_response);
92 EXPECT_FALSE(context_->complete); 93 EXPECT_FALSE(context_->complete);
93 context_->complete = true; 94 context_->complete = true;
94 } 95 }
95 96
96 TestRequestPeer::Context::Context() = default; 97 TestRequestPeer::Context::Context() = default;
97 TestRequestPeer::Context::~Context() = default; 98 TestRequestPeer::Context::~Context() = default;
98 99
99 } // namespace content 100 } // namespace content
OLDNEW
« no previous file with comments | « content/child/test_request_peer.h ('k') | content/child/url_response_body_consumer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698