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

Side by Side Diff: net/url_request/https_prober.cc

Issue 6730034: Remove all "net::" prefixes under net/url_request for code that's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed indentation Created 9 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
« no previous file with comments | « net/url_request/https_prober.h ('k') | net/url_request/url_request.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/singleton.h" 5 #include "base/singleton.h"
6 #include "net/url_request/https_prober.h" 6 #include "net/url_request/https_prober.h"
7 7
8 #include "net/url_request/url_request.h" 8 #include "net/url_request/url_request.h"
9 #include "net/url_request/url_request_context.h" 9 #include "net/url_request/url_request_context.h"
10 10
11 namespace net { 11 namespace net {
(...skipping 15 matching lines...) Expand all
27 HTTPSProberDelegate* delegate) { 27 HTTPSProberDelegate* delegate) {
28 if (HaveProbed(host) || InFlight(host)) { 28 if (HaveProbed(host) || InFlight(host)) {
29 return false; 29 return false;
30 } 30 }
31 31
32 inflight_probes_[host] = delegate; 32 inflight_probes_[host] = delegate;
33 33
34 GURL url("https://" + host); 34 GURL url("https://" + host);
35 DCHECK_EQ(url.host(), host); 35 DCHECK_EQ(url.host(), host);
36 36
37 net::URLRequest* req = new net::URLRequest(url, this); 37 URLRequest* req = new URLRequest(url, this);
38 req->set_context(ctx); 38 req->set_context(ctx);
39 req->Start(); 39 req->Start();
40 return true; 40 return true;
41 } 41 }
42 42
43 void HTTPSProber::OnAuthRequired(net::URLRequest* request, 43 void HTTPSProber::OnAuthRequired(URLRequest* request,
44 net::AuthChallengeInfo* auth_info) { 44 AuthChallengeInfo* auth_info) {
45 Success(request); 45 Success(request);
46 } 46 }
47 47
48 void HTTPSProber::OnSSLCertificateError(net::URLRequest* request, 48 void HTTPSProber::OnSSLCertificateError(URLRequest* request,
49 int cert_error, 49 int cert_error,
50 net::X509Certificate* cert) { 50 X509Certificate* cert) {
51 request->ContinueDespiteLastError(); 51 request->ContinueDespiteLastError();
52 } 52 }
53 53
54 void HTTPSProber::OnResponseStarted(net::URLRequest* request) { 54 void HTTPSProber::OnResponseStarted(URLRequest* request) {
55 if (request->status().status() == URLRequestStatus::SUCCESS) { 55 if (request->status().status() == URLRequestStatus::SUCCESS) {
56 Success(request); 56 Success(request);
57 } else { 57 } else {
58 Failure(request); 58 Failure(request);
59 } 59 }
60 } 60 }
61 61
62 void HTTPSProber::OnReadCompleted(net::URLRequest* request, int bytes_read) { 62 void HTTPSProber::OnReadCompleted(URLRequest* request, int bytes_read) {
63 NOTREACHED(); 63 NOTREACHED();
64 } 64 }
65 65
66 HTTPSProber::HTTPSProber() { 66 HTTPSProber::HTTPSProber() {
67 } 67 }
68 68
69 HTTPSProber::~HTTPSProber() { 69 HTTPSProber::~HTTPSProber() {
70 } 70 }
71 71
72 void HTTPSProber::Success(net::URLRequest* request) { 72 void HTTPSProber::Success(URLRequest* request) {
73 DoCallback(request, true); 73 DoCallback(request, true);
74 } 74 }
75 75
76 void HTTPSProber::Failure(net::URLRequest* request) { 76 void HTTPSProber::Failure(URLRequest* request) {
77 DoCallback(request, false); 77 DoCallback(request, false);
78 } 78 }
79 79
80 void HTTPSProber::DoCallback(net::URLRequest* request, bool result) { 80 void HTTPSProber::DoCallback(URLRequest* request, bool result) {
81 std::map<std::string, HTTPSProberDelegate*>::iterator i = 81 std::map<std::string, HTTPSProberDelegate*>::iterator i =
82 inflight_probes_.find(request->original_url().host()); 82 inflight_probes_.find(request->original_url().host());
83 DCHECK(i != inflight_probes_.end()); 83 DCHECK(i != inflight_probes_.end());
84 84
85 HTTPSProberDelegate* delegate = i->second; 85 HTTPSProberDelegate* delegate = i->second;
86 inflight_probes_.erase(i); 86 inflight_probes_.erase(i);
87 probed_.insert(request->original_url().host()); 87 probed_.insert(request->original_url().host());
88 delete request; 88 delete request;
89 delegate->ProbeComplete(result); 89 delegate->ProbeComplete(result);
90 } 90 }
91 91
92 } // namespace net 92 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/https_prober.h ('k') | net/url_request/url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698