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

Side by Side Diff: chrome/browser/net/network_stats.h

Issue 168203003: NetworkStats: fix use after free. Don't call socket_->Read if tests are (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: handle random packet being received before the test Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/net/network_stats.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #ifndef CHROME_BROWSER_NET_NETWORK_STATS_H_ 5 #ifndef CHROME_BROWSER_NET_NETWORK_STATS_H_
6 #define CHROME_BROWSER_NET_NETWORK_STATS_H_ 6 #define CHROME_BROWSER_NET_NETWORK_STATS_H_
7 7
8 #include <bitset> 8 #include <bitset>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 // Called when the StartReadDataTimer fires. |test_index| specifies 175 // Called when the StartReadDataTimer fires. |test_index| specifies
176 // the index of the test. If |current_test_index_| has changed to a 176 // the index of the test. If |current_test_index_| has changed to a
177 // different value, it indicates |test_index| has completed, then 177 // different value, it indicates |test_index| has completed, then
178 // this method is a no-op. 178 // this method is a no-op.
179 void OnReadDataTimeout(uint32 test_index); 179 void OnReadDataTimeout(uint32 test_index);
180 180
181 // Collect network connectivity stats. This is called when all the data from 181 // Collect network connectivity stats. This is called when all the data from
182 // server is read or when there is a failure during connect/read/write. It 182 // server is read or when there is a failure during connect/read/write. It
183 // will either start the next phase of the test, or it will self destruct 183 // will either start the next phase of the test, or it will self destruct
184 // at the end of this method. 184 // at the end of this method. Returns true if a new test wasn't started and it
185 void TestPhaseComplete(Status status, int result); 185 // was self destructed.
186 bool TestPhaseComplete(Status status, int result);
186 187
187 // This method is called from TestPhaseComplete() and calls 188 // This method is called from TestPhaseComplete() and calls
188 // |finished_callback_| callback to indicate that the test has finished. 189 // |finished_callback_| callback to indicate that the test has finished.
189 void DoFinishCallback(int result); 190 void DoFinishCallback(int result);
190 191
191 // Update counters/metrics for the given |probe_packet|. 192 // Update counters/metrics for the given |probe_packet|.
192 // Return true if all packets for the current test are received and 193 // Return true if all packets for the current test are received and
193 // false otherwise. 194 // false otherwise.
194 bool UpdateReception(const ProbePacket& probe_packet); 195 bool UpdateReception(const ProbePacket& probe_packet);
195 196
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 // This starts a series of tests randomly selected among one of the three 381 // This starts a series of tests randomly selected among one of the three
381 // choices of probe packet sizes: 100 Bytes, 500 Bytes, 1200 Bytes. 382 // choices of probe packet sizes: 100 Bytes, 500 Bytes, 1200 Bytes.
382 void StartNetworkStatsTest(net::HostResolver* host_resolver, 383 void StartNetworkStatsTest(net::HostResolver* host_resolver,
383 const net::HostPortPair& server_address, 384 const net::HostPortPair& server_address,
384 uint16 histogram_port, 385 uint16 histogram_port,
385 bool has_proxy_server); 386 bool has_proxy_server);
386 387
387 } // namespace chrome_browser_net 388 } // namespace chrome_browser_net
388 389
389 #endif // CHROME_BROWSER_NET_NETWORK_STATS_H_ 390 #endif // CHROME_BROWSER_NET_NETWORK_STATS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/network_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698