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

Side by Side Diff: net/quic/test_tools/delayed_verify_strike_register_client.cc

Issue 268643008: Cleanup: Remove redundant string conversions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sending for review Created 6 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "net/quic/test_tools/delayed_verify_strike_register_client.h" 5 #include "net/quic/test_tools/delayed_verify_strike_register_client.h"
6 6
7 using base::StringPiece; 7 using base::StringPiece;
8 using std::string; 8 using std::string;
9 using std::vector; 9 using std::vector;
10 10
(...skipping 11 matching lines...) Expand all
22 delay_verifications_(false) { 22 delay_verifications_(false) {
23 } 23 }
24 24
25 DelayedVerifyStrikeRegisterClient::~DelayedVerifyStrikeRegisterClient() {} 25 DelayedVerifyStrikeRegisterClient::~DelayedVerifyStrikeRegisterClient() {}
26 26
27 void DelayedVerifyStrikeRegisterClient::VerifyNonceIsValidAndUnique( 27 void DelayedVerifyStrikeRegisterClient::VerifyNonceIsValidAndUnique(
28 StringPiece nonce, 28 StringPiece nonce,
29 QuicWallTime now, 29 QuicWallTime now,
30 ResultCallback* cb) { 30 ResultCallback* cb) {
31 if (delay_verifications_) { 31 if (delay_verifications_) {
32 pending_verifications_.push_back(VerifyArgs(nonce.as_string(), now, cb)); 32 pending_verifications_.push_back(VerifyArgs(nonce, now, cb));
33 } else { 33 } else {
34 LocalStrikeRegisterClient::VerifyNonceIsValidAndUnique(nonce, now, cb); 34 LocalStrikeRegisterClient::VerifyNonceIsValidAndUnique(nonce, now, cb);
35 } 35 }
36 } 36 }
37 37
38 int DelayedVerifyStrikeRegisterClient::PendingVerifications() const { 38 int DelayedVerifyStrikeRegisterClient::PendingVerifications() const {
39 return pending_verifications_.size(); 39 return pending_verifications_.size();
40 } 40 }
41 41
42 void DelayedVerifyStrikeRegisterClient::RunPendingVerifications() { 42 void DelayedVerifyStrikeRegisterClient::RunPendingVerifications() {
43 vector<VerifyArgs> pending; 43 vector<VerifyArgs> pending;
44 pending_verifications_.swap(pending); 44 pending_verifications_.swap(pending);
45 for (vector<VerifyArgs>::const_iterator it = pending.begin(), 45 for (vector<VerifyArgs>::const_iterator it = pending.begin(),
46 end = pending.end(); it != end; ++it) { 46 end = pending.end(); it != end; ++it) {
47 LocalStrikeRegisterClient::VerifyNonceIsValidAndUnique( 47 LocalStrikeRegisterClient::VerifyNonceIsValidAndUnique(
48 it->nonce, it->now, it->cb); 48 it->nonce, it->now, it->cb);
49 } 49 }
50 } 50 }
51 51
52 } // namespace test 52 } // namespace test
53 } // namespace net 53 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698