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

Side by Side Diff: net/socket/socket_test_util.cc

Issue 10066045: RefCounted types should not have public destructors, net/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deprecated cookiestore fix Created 8 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/socket/socket_test_util.h ('k') | net/socket/ssl_error_params.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "net/socket/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 OrderedSocketData::~OrderedSocketData() {} 417 OrderedSocketData::~OrderedSocketData() {}
418 418
419 DeterministicSocketData::DeterministicSocketData(MockRead* reads, 419 DeterministicSocketData::DeterministicSocketData(MockRead* reads,
420 size_t reads_count, MockWrite* writes, size_t writes_count) 420 size_t reads_count, MockWrite* writes, size_t writes_count)
421 : StaticSocketDataProvider(reads, reads_count, writes, writes_count), 421 : StaticSocketDataProvider(reads, reads_count, writes, writes_count),
422 sequence_number_(0), 422 sequence_number_(0),
423 current_read_(), 423 current_read_(),
424 current_write_(), 424 current_write_(),
425 stopping_sequence_number_(0), 425 stopping_sequence_number_(0),
426 stopped_(false), 426 stopped_(false),
427 print_debug_(false) {} 427 print_debug_(false) {
428 428 }
429 DeterministicSocketData::~DeterministicSocketData() {}
430 429
431 void DeterministicSocketData::Run() { 430 void DeterministicSocketData::Run() {
432 SetStopped(false); 431 SetStopped(false);
433 int counter = 0; 432 int counter = 0;
434 // Continue to consume data until all data has run out, or the stopped_ flag 433 // Continue to consume data until all data has run out, or the stopped_ flag
435 // has been set. Consuming data requires two separate operations -- running 434 // has been set. Consuming data requires two separate operations -- running
436 // the tasks in the message loop, and explicitly invoking the read/write 435 // the tasks in the message loop, and explicitly invoking the read/write
437 // callbacks (simulating network I/O). We check our conditions between each, 436 // callbacks (simulating network I/O). We check our conditions between each,
438 // since they can change in either. 437 // since they can change in either.
439 while ((!at_write_eof() || !at_read_eof()) && !stopped()) { 438 while ((!at_write_eof() || !at_read_eof()) && !stopped()) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 } 546 }
548 547
549 void DeterministicSocketData::Reset() { 548 void DeterministicSocketData::Reset() {
550 NET_TRACE(INFO, " *** ") << "Stage " 549 NET_TRACE(INFO, " *** ") << "Stage "
551 << sequence_number_ << ": Reset()"; 550 << sequence_number_ << ": Reset()";
552 sequence_number_ = 0; 551 sequence_number_ = 0;
553 StaticSocketDataProvider::Reset(); 552 StaticSocketDataProvider::Reset();
554 NOTREACHED(); 553 NOTREACHED();
555 } 554 }
556 555
556 DeterministicSocketData::~DeterministicSocketData() {}
557
557 void DeterministicSocketData::InvokeCallbacks() { 558 void DeterministicSocketData::InvokeCallbacks() {
558 if (socket_ && socket_->write_pending() && 559 if (socket_ && socket_->write_pending() &&
559 (current_write().sequence_number == sequence_number())) { 560 (current_write().sequence_number == sequence_number())) {
560 socket_->CompleteWrite(); 561 socket_->CompleteWrite();
561 NextStep(); 562 NextStep();
562 return; 563 return;
563 } 564 }
564 if (socket_ && socket_->read_pending() && 565 if (socket_ && socket_->read_pending() &&
565 (current_read().sequence_number == sequence_number())) { 566 (current_read().sequence_number == sequence_number())) {
566 socket_->CompleteRead(); 567 socket_->CompleteRead();
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 1621
1621 const char kSOCKS5OkRequest[] = 1622 const char kSOCKS5OkRequest[] =
1622 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; 1623 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 };
1623 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); 1624 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest);
1624 1625
1625 const char kSOCKS5OkResponse[] = 1626 const char kSOCKS5OkResponse[] =
1626 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; 1627 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 };
1627 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); 1628 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse);
1628 1629
1629 } // namespace net 1630 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/ssl_error_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698