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

Side by Side Diff: net/spdy/spdy_test_util.cc

Issue 3192011: Make sure the key into the spdy session pool identifies the actual proxy used... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rework some comments Created 10 years, 3 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
« net/http/http_stream_request.cc ('K') | « net/spdy/spdy_test_util.h ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/spdy/spdy_test_util.h" 5 #include "net/spdy/spdy_test_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 DCHECK_LE(total_len, buff_len); 738 DCHECK_LE(total_len, buff_len);
739 char* ptr = buff; 739 char* ptr = buff;
740 for (int i = 0; i < num_frames; ++i) { 740 for (int i = 0; i < num_frames; ++i) {
741 int len = frames[i]->length() + spdy::SpdyFrame::size(); 741 int len = frames[i]->length() + spdy::SpdyFrame::size();
742 memcpy(ptr, frames[i]->data(), len); 742 memcpy(ptr, frames[i]->data(), len);
743 ptr += len; 743 ptr += len;
744 } 744 }
745 return total_len; 745 return total_len;
746 } 746 }
747 747
748 // This creates a proxy for testing purposes.
749 // |proxy| should be in the form "myproxy:70".
750 ProxyService* SpdyCreateFixedProxyService(const std::string& proxy) {
751 net::ProxyConfig proxy_config;
752 proxy_config.proxy_rules().ParseFromString(proxy);
753 return ProxyService::CreateFixed(proxy_config);
754 }
755
756 const SpdyHeaderInfo make_spdy_header(spdy::SpdyControlType type) { 748 const SpdyHeaderInfo make_spdy_header(spdy::SpdyControlType type) {
757 const SpdyHeaderInfo kHeader = { 749 const SpdyHeaderInfo kHeader = {
758 type, // Kind = Syn 750 type, // Kind = Syn
759 1, // Stream ID 751 1, // Stream ID
760 0, // Associated stream ID 752 0, // Associated stream ID
761 2, // Priority 753 2, // Priority
762 spdy::CONTROL_FLAG_FIN, // Control Flags 754 spdy::CONTROL_FLAG_FIN, // Control Flags
763 false, // Compressed 755 false, // Compressed
764 spdy::INVALID, // Status 756 spdy::INVALID, // Status
765 NULL, // Data 757 NULL, // Data
766 0, // Length 758 0, // Length
767 spdy::DATA_FLAG_NONE // Data Flags 759 spdy::DATA_FLAG_NONE // Data Flags
768 }; 760 };
769 return kHeader; 761 return kHeader;
770 } 762 }
771 } // namespace net 763 } // namespace net
OLDNEW
« net/http/http_stream_request.cc ('K') | « net/spdy/spdy_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698