| Index: content/browser/ssl/ssl_error_handler.cc
|
| diff --git a/content/browser/ssl/ssl_error_handler.cc b/content/browser/ssl/ssl_error_handler.cc
|
| index e3eceabddc6fdc51013e0f3da97ad09c0a3a8b8b..fe9a3fae52f86de6612b4361e18b4a4c33518725 100644
|
| --- a/content/browser/ssl/ssl_error_handler.cc
|
| +++ b/content/browser/ssl/ssl_error_handler.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.
|
|
|
| @@ -6,7 +6,6 @@
|
|
|
| #include "base/bind.h"
|
| #include "content/browser/renderer_host/render_view_host.h"
|
| -#include "content/browser/renderer_host/resource_dispatcher_host.h"
|
| #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
|
| #include "content/browser/ssl/ssl_cert_error_handler.h"
|
| #include "content/browser/tab_contents/navigation_controller_impl.h"
|
| @@ -17,26 +16,21 @@
|
|
|
| using content::BrowserThread;
|
| using content::WebContents;
|
| +using net::SSLInfo;
|
|
|
| -SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh,
|
| - net::URLRequest* request,
|
| - ResourceType::Type resource_type)
|
| +SSLErrorHandler::SSLErrorHandler(Delegate* delegate,
|
| + instance_id id)
|
| : manager_(NULL),
|
| - request_id_(0, 0),
|
| - resource_dispatcher_host_(rdh),
|
| - request_url_(request->url()),
|
| - resource_type_(resource_type),
|
| + instance_id_(id),
|
| + delegate_(delegate),
|
| + request_url_(delegate->URLForInstance(id)),
|
| + resource_type_(delegate->ResourceTypeForInstance(id)),
|
| request_has_been_notified_(false) {
|
| DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + DCHECK(delegate);
|
|
|
| - ResourceDispatcherHostRequestInfo* info =
|
| - ResourceDispatcherHost::InfoForRequest(request);
|
| - request_id_.child_id = info->child_id();
|
| - request_id_.request_id = info->request_id();
|
| -
|
| - if (!ResourceDispatcherHost::RenderViewForRequest(request,
|
| - &render_process_id_,
|
| - &render_view_id_))
|
| + if (!delegate->RenderViewForInstance(
|
| + id, &render_process_id_, &render_view_id_))
|
| NOTREACHED();
|
|
|
| // This makes sure we don't disappear on the IO thread until we've given an
|
| @@ -133,18 +127,11 @@ void SSLErrorHandler::CompleteCancelRequest(int error) {
|
| if (request_has_been_notified_)
|
| return;
|
|
|
| - net::URLRequest* request =
|
| - resource_dispatcher_host_->GetURLRequest(request_id_);
|
| - if (request) {
|
| - // The request can be NULL if it was cancelled by the renderer (as the
|
| - // result of the user navigating to a new page from the location bar).
|
| - DVLOG(1) << "CompleteCancelRequest() url: " << request->url().spec();
|
| - SSLCertErrorHandler* cert_error = AsSSLCertErrorHandler();
|
| - if (cert_error)
|
| - request->SimulateSSLError(error, cert_error->ssl_info());
|
| - else
|
| - request->SimulateError(error);
|
| - }
|
| + SSLCertErrorHandler* cert_error = AsSSLCertErrorHandler();
|
| + const SSLInfo* ssl_info = NULL;
|
| + if (cert_error)
|
| + ssl_info = &cert_error->ssl_info();
|
| + delegate_->CancelRequestForInstance(instance_id_, error, ssl_info);
|
| request_has_been_notified_ = true;
|
|
|
| // We're done with this object on the IO thread.
|
| @@ -161,14 +148,7 @@ void SSLErrorHandler::CompleteContinueRequest() {
|
| if (request_has_been_notified_)
|
| return;
|
|
|
| - net::URLRequest* request =
|
| - resource_dispatcher_host_->GetURLRequest(request_id_);
|
| - if (request) {
|
| - // The request can be NULL if it was cancelled by the renderer (as the
|
| - // result of the user navigating to a new page from the location bar).
|
| - DVLOG(1) << "CompleteContinueRequest() url: " << request->url().spec();
|
| - request->ContinueDespiteLastError();
|
| - }
|
| + delegate_->ContinueRequestForInstance(instance_id_);
|
| request_has_been_notified_ = true;
|
|
|
| // We're done with this object on the IO thread.
|
|
|