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

Side by Side Diff: net/socket_stream/socket_stream_job.cc

Issue 9415040: Refactor TransportSecurityState. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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_stream/socket_stream.cc ('k') | net/url_request/url_request_context_builder.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 (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_stream/socket_stream_job.h" 5 #include "net/socket_stream/socket_stream_job.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "net/base/ssl_config_service.h" 8 #include "net/base/ssl_config_service.h"
9 #include "net/base/transport_security_state.h" 9 #include "net/base/transport_security_state.h"
10 #include "net/socket_stream/socket_stream_job_manager.h" 10 #include "net/socket_stream/socket_stream_job_manager.h"
(...skipping 10 matching lines...) Expand all
21 21
22 // static 22 // static
23 SocketStreamJob* SocketStreamJob::CreateSocketStreamJob( 23 SocketStreamJob* SocketStreamJob::CreateSocketStreamJob(
24 const GURL& url, 24 const GURL& url,
25 SocketStream::Delegate* delegate, 25 SocketStream::Delegate* delegate,
26 TransportSecurityState* sts, 26 TransportSecurityState* sts,
27 SSLConfigService* ssl) { 27 SSLConfigService* ssl) {
28 GURL socket_url(url); 28 GURL socket_url(url);
29 TransportSecurityState::DomainState domain_state; 29 TransportSecurityState::DomainState domain_state;
30 if (url.scheme() == "ws" && sts && sts->GetDomainState( 30 if (url.scheme() == "ws" && sts && sts->GetDomainState(
31 &domain_state, url.host(), SSLConfigService::IsSNIAvailable(ssl)) && 31 url.host(), SSLConfigService::IsSNIAvailable(ssl), &domain_state) &&
32 domain_state.ShouldRedirectHTTPToHTTPS()) { 32 domain_state.ShouldRedirectHTTPToHTTPS()) {
33 url_canon::Replacements<char> replacements; 33 url_canon::Replacements<char> replacements;
34 static const char kNewScheme[] = "wss"; 34 static const char kNewScheme[] = "wss";
35 replacements.SetScheme(kNewScheme, 35 replacements.SetScheme(kNewScheme,
36 url_parse::Component(0, strlen(kNewScheme))); 36 url_parse::Component(0, strlen(kNewScheme)));
37 socket_url = url.ReplaceComponents(replacements); 37 socket_url = url.ReplaceComponents(replacements);
38 } 38 }
39 return SocketStreamJobManager::GetInstance()->CreateJob(socket_url, delegate); 39 return SocketStreamJobManager::GetInstance()->CreateJob(socket_url, delegate);
40 } 40 }
41 41
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 socket_->ContinueDespiteError(); 78 socket_->ContinueDespiteError();
79 } 79 }
80 80
81 void SocketStreamJob::DetachDelegate() { 81 void SocketStreamJob::DetachDelegate() {
82 socket_->DetachDelegate(); 82 socket_->DetachDelegate();
83 } 83 }
84 84
85 SocketStreamJob::~SocketStreamJob() {} 85 SocketStreamJob::~SocketStreamJob() {}
86 86
87 } // namespace net 87 } // namespace net
OLDNEW
« no previous file with comments | « net/socket_stream/socket_stream.cc ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698