diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 21:28:32 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 21:28:32 +0000 |
commit | e602696544fd704597a8ea2c907ffbcb0f688df4 (patch) | |
tree | 82c1032031c1e6cfe87ef43b367dd7bd24b5a4fa /content/test | |
parent | bcba8aa49bfc2db2a74b042a22784b58ed005fc0 (diff) | |
download | chromium_src-e602696544fd704597a8ea2c907ffbcb0f688df4.zip chromium_src-e602696544fd704597a8ea2c907ffbcb0f688df4.tar.gz chromium_src-e602696544fd704597a8ea2c907ffbcb0f688df4.tar.bz2 |
Captive portals intercept all HTTP requests until the user
has logged in, like at Starbucks and airports. When behind
one, all SSL requests timeout after a potentially
substantial delay.
This CL Adds a CaptivePortalTabHelper which triggers captive
portal checks when an SSL load is taking too long. If a
captive portal is found, opens a login tab. Whenever the
new tab is navigated, we check again for a captive portal.
Once we discover the portal is gone, we reload the original
tab.
design doc: https://docs.google.com/a/chromium.org/document/d/1k-gP2sswzYNvryu9NcgN7q5XrsMlUdlUdoW9WRaEmfM/edit
R=cbentzel@chromium.org,avi@chromium.org
BUG=87100, 115487
Review URL: https://chromiumcodereview.appspot.com/10020051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test')
-rw-r--r-- | content/test/net/url_request_mock_http_job.cc | 11 | ||||
-rw-r--r-- | content/test/net/url_request_mock_http_job.h | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/content/test/net/url_request_mock_http_job.cc b/content/test/net/url_request_mock_http_job.cc index 24e3436..805e9859 100644 --- a/content/test/net/url_request_mock_http_job.cc +++ b/content/test/net/url_request_mock_http_job.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -120,6 +120,15 @@ bool URLRequestMockHTTPJob::GetMimeType(std::string* mime_type) const { return info.headers && info.headers->GetMimeType(mime_type); } +int URLRequestMockHTTPJob::GetResponseCode() const { + net::HttpResponseInfo info; + GetResponseInfoConst(&info); + // If we have headers, get the response code from them. + if (info.headers) + return info.headers->response_code(); + return net::URLRequestJob::GetResponseCode(); +} + bool URLRequestMockHTTPJob::GetCharset(std::string* charset) { net::HttpResponseInfo info; GetResponseInfo(&info); diff --git a/content/test/net/url_request_mock_http_job.h b/content/test/net/url_request_mock_http_job.h index 21a84ee..4c311d7 100644 --- a/content/test/net/url_request_mock_http_job.h +++ b/content/test/net/url_request_mock_http_job.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -19,6 +19,7 @@ class URLRequestMockHTTPJob : public net::URLRequestFileJob { URLRequestMockHTTPJob(net::URLRequest* request, const FilePath& file_path); virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; + virtual int GetResponseCode() const OVERRIDE; virtual bool GetCharset(std::string* charset) OVERRIDE; virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; virtual bool IsRedirectResponse(GURL* location, |