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

Side by Side Diff: content/test/net/url_request_mock_http_job.cc

Issue 10020051: Open a login tab on captive portal detection on SSL loads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix typo in comment, forward declare CaptivePortalTabReloader in the TabHelper Created 8 years, 6 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 | « content/test/net/url_request_mock_http_job.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) 2011 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 "content/test/net/url_request_mock_http_job.h" 5 #include "content/test/net/url_request_mock_http_job.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 ReplaceSubstringsAfterOffset(&raw_headers, 0, "\n", std::string("\0", 1)); 113 ReplaceSubstringsAfterOffset(&raw_headers, 0, "\n", std::string("\0", 1));
114 info->headers = new net::HttpResponseHeaders(raw_headers); 114 info->headers = new net::HttpResponseHeaders(raw_headers);
115 } 115 }
116 116
117 bool URLRequestMockHTTPJob::GetMimeType(std::string* mime_type) const { 117 bool URLRequestMockHTTPJob::GetMimeType(std::string* mime_type) const {
118 net::HttpResponseInfo info; 118 net::HttpResponseInfo info;
119 GetResponseInfoConst(&info); 119 GetResponseInfoConst(&info);
120 return info.headers && info.headers->GetMimeType(mime_type); 120 return info.headers && info.headers->GetMimeType(mime_type);
121 } 121 }
122 122
123 int URLRequestMockHTTPJob::GetResponseCode() const {
124 net::HttpResponseInfo info;
125 GetResponseInfoConst(&info);
126 // If we have headers, get the response code from them.
127 if (info.headers)
128 return info.headers->response_code();
129 return net::URLRequestJob::GetResponseCode();
130 }
131
123 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) { 132 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) {
124 net::HttpResponseInfo info; 133 net::HttpResponseInfo info;
125 GetResponseInfo(&info); 134 GetResponseInfo(&info);
126 return info.headers && info.headers->GetCharset(charset); 135 return info.headers && info.headers->GetCharset(charset);
127 } 136 }
OLDNEW
« no previous file with comments | « content/test/net/url_request_mock_http_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698