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

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

Issue 9585026: Add a source id to global NetLog entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Move friend declaration Created 8 years, 9 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
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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 ssl_host_info, mock_ssl_data_.GetNext()); 629 ssl_host_info, mock_ssl_data_.GetNext());
630 return socket; 630 return socket;
631 } 631 }
632 632
633 void MockClientSocketFactory::ClearSSLSessionCache() { 633 void MockClientSocketFactory::ClearSSLSessionCache() {
634 } 634 }
635 635
636 MockClientSocket::MockClientSocket(net::NetLog* net_log) 636 MockClientSocket::MockClientSocket(net::NetLog* net_log)
637 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), 637 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
638 connected_(false), 638 connected_(false),
639 net_log_(net::NetLog::Source(), net_log) { 639 net_log_(BoundNetLog::Make(net_log, net::NetLog::SOURCE_NONE)) {
eroman 2012/03/14 21:53:48 How do you envision the javascript side of things
mmenke 2012/03/14 22:25:23 For emitting global entries, they should generally
640 } 640 }
641 641
642 bool MockClientSocket::SetReceiveBufferSize(int32 size) { 642 bool MockClientSocket::SetReceiveBufferSize(int32 size) {
643 return true; 643 return true;
644 } 644 }
645 645
646 bool MockClientSocket::SetSendBufferSize(int32 size) { 646 bool MockClientSocket::SetSendBufferSize(int32 size) {
647 return true; 647 return true;
648 } 648 }
649 649
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 1200
1201 MockUDPClientSocket::MockUDPClientSocket(SocketDataProvider* data, 1201 MockUDPClientSocket::MockUDPClientSocket(SocketDataProvider* data,
1202 net::NetLog* net_log) 1202 net::NetLog* net_log)
1203 : connected_(false), 1203 : connected_(false),
1204 data_(data), 1204 data_(data),
1205 read_offset_(0), 1205 read_offset_(0),
1206 read_data_(SYNCHRONOUS, ERR_UNEXPECTED), 1206 read_data_(SYNCHRONOUS, ERR_UNEXPECTED),
1207 need_read_data_(true), 1207 need_read_data_(true),
1208 pending_buf_(NULL), 1208 pending_buf_(NULL),
1209 pending_buf_len_(0), 1209 pending_buf_len_(0),
1210 net_log_(net::NetLog::Source(), net_log), 1210 net_log_(BoundNetLog::Make(net_log, net::NetLog::SOURCE_NONE)),
1211 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { 1211 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
1212 DCHECK(data_); 1212 DCHECK(data_);
1213 data_->Reset(); 1213 data_->Reset();
1214 } 1214 }
1215 1215
1216 MockUDPClientSocket::~MockUDPClientSocket() {} 1216 MockUDPClientSocket::~MockUDPClientSocket() {}
1217 1217
1218 int MockUDPClientSocket::Read(IOBuffer* buf, int buf_len, 1218 int MockUDPClientSocket::Read(IOBuffer* buf, int buf_len,
1219 const CompletionCallback& callback) { 1219 const CompletionCallback& callback) {
1220 if (!connected_) 1220 if (!connected_)
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 1619
1620 const char kSOCKS5OkRequest[] = 1620 const char kSOCKS5OkRequest[] =
1621 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; 1621 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 };
1622 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); 1622 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest);
1623 1623
1624 const char kSOCKS5OkResponse[] = 1624 const char kSOCKS5OkResponse[] =
1625 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; 1625 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 };
1626 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); 1626 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse);
1627 1627
1628 } // namespace net 1628 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698