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

Side by Side Diff: chrome/browser/renderer_host/offline_resource_handler.cc

Issue 6804032: Add TLS-SRP (RFC 5054) support Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: use system srp and mpi libs, not local copies Created 9 years, 8 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
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 "chrome/browser/renderer_host/offline_resource_handler.h" 5 #include "chrome/browser/renderer_host/offline_resource_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 void OfflineResourceHandler::ClearRequestInfo() { 119 void OfflineResourceHandler::ClearRequestInfo() {
120 deferred_url_ = GURL(); 120 deferred_url_ = GURL();
121 deferred_request_id_ = -1; 121 deferred_request_id_ = -1;
122 } 122 }
123 123
124 bool OfflineResourceHandler::IsRemote(const GURL& url) const { 124 bool OfflineResourceHandler::IsRemote(const GURL& url) const {
125 return url.SchemeIs(chrome::kFtpScheme) || 125 return url.SchemeIs(chrome::kFtpScheme) ||
126 url.SchemeIs(chrome::kHttpScheme) || 126 url.SchemeIs(chrome::kHttpScheme) ||
127 url.SchemeIs(chrome::kHttpsScheme); 127 url.SchemeIs(chrome::kHttpsScheme) ||
128 url.SchemeIs(chrome::kHttpsvScheme);
128 } 129 }
129 130
130 bool OfflineResourceHandler::ShouldShowOfflinePage(const GURL& url) const { 131 bool OfflineResourceHandler::ShouldShowOfflinePage(const GURL& url) const {
131 // Only check main frame. If the network is disconnected while 132 // Only check main frame. If the network is disconnected while
132 // loading other resources, we'll simply show broken link/images. 133 // loading other resources, we'll simply show broken link/images.
133 return IsRemote(url) && 134 return IsRemote(url) &&
134 !chromeos::NetworkStateNotifier::is_connected() && 135 !chromeos::NetworkStateNotifier::is_connected() &&
135 ResourceDispatcherHost::InfoForRequest(request_)->resource_type() 136 ResourceDispatcherHost::InfoForRequest(request_)->resource_type()
136 == ResourceType::MAIN_FRAME && 137 == ResourceType::MAIN_FRAME &&
137 !chromeos::OfflineLoadService::Get()->ShouldProceed( 138 !chromeos::OfflineLoadService::Get()->ShouldProceed(
(...skipping 13 matching lines...) Expand all
151 DVLOG(1) << "Resume load: this=" << this << ", request id=" << request_id; 152 DVLOG(1) << "Resume load: this=" << this << ", request id=" << request_id;
152 next_handler_->OnWillStart(request_id, url, &defer); 153 next_handler_->OnWillStart(request_id, url, &defer);
153 if (!defer) 154 if (!defer)
154 rdh_->StartDeferredRequest(process_host_id_, request_id); 155 rdh_->StartDeferredRequest(process_host_id_, request_id);
155 } 156 }
156 157
157 void OfflineResourceHandler::ShowOfflinePage() { 158 void OfflineResourceHandler::ShowOfflinePage() {
158 chromeos::OfflineLoadPage::Show( 159 chromeos::OfflineLoadPage::Show(
159 process_host_id_, render_view_id_, deferred_url_, this); 160 process_host_id_, render_view_id_, deferred_url_, this);
160 } 161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698