summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/renderer_host/async_resource_handler.cc10
-rw-r--r--chrome/browser/renderer_host/async_resource_handler.h6
-rw-r--r--chrome/browser/renderer_host/buffered_resource_handler.cc11
-rw-r--r--chrome/browser/renderer_host/buffered_resource_handler.h4
-rw-r--r--chrome/browser/renderer_host/cross_site_resource_handler.cc15
-rw-r--r--chrome/browser/renderer_host/cross_site_resource_handler.h5
-rw-r--r--chrome/browser/renderer_host/download_resource_handler.cc3
-rw-r--r--chrome/browser/renderer_host/download_resource_handler.h4
-rw-r--r--chrome/browser/renderer_host/download_throttling_resource_handler.cc6
-rw-r--r--chrome/browser/renderer_host/download_throttling_resource_handler.h3
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.cc24
-rw-r--r--chrome/browser/renderer_host/resource_handler.h5
-rw-r--r--chrome/browser/renderer_host/safe_browsing_resource_handler.cc14
-rw-r--r--chrome/browser/renderer_host/safe_browsing_resource_handler.h7
-rw-r--r--chrome/browser/renderer_host/save_file_resource_handler.cc3
-rw-r--r--chrome/browser/renderer_host/save_file_resource_handler.h4
-rw-r--r--chrome/browser/renderer_host/sync_resource_handler.cc6
-rw-r--r--chrome/browser/renderer_host/sync_resource_handler.h6
-rw-r--r--chrome/browser/ssl/ssl_manager.cc9
-rw-r--r--chrome/browser/ssl/ssl_manager.h13
-rw-r--r--chrome/common/render_messages_internal.h5
-rw-r--r--chrome/common/resource_dispatcher.cc5
-rw-r--r--chrome/common/resource_dispatcher.h4
-rw-r--r--chrome/common/resource_dispatcher_unittest.cc3
-rw-r--r--chrome/common/security_filter_peer.cc16
-rw-r--r--chrome/common/security_filter_peer.h9
-rw-r--r--chrome/plugin/chrome_plugin_host.cc3
-rw-r--r--chrome/renderer/chrome_plugin_host.cc3
-rw-r--r--net/url_request/url_request.cc18
-rw-r--r--net/url_request/url_request.h17
-rw-r--r--net/url_request/url_request_job.h3
-rw-r--r--webkit/glue/resource_handle_impl.cc8
-rw-r--r--webkit/glue/resource_loader_bridge.h3
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc12
34 files changed, 72 insertions, 195 deletions
diff --git a/chrome/browser/renderer_host/async_resource_handler.cc b/chrome/browser/renderer_host/async_resource_handler.cc
index 650c7c3..881d686 100644
--- a/chrome/browser/renderer_host/async_resource_handler.cc
+++ b/chrome/browser/renderer_host/async_resource_handler.cc
@@ -116,14 +116,10 @@ bool AsyncResourceHandler::OnReadCompleted(int request_id, int* bytes_read) {
return true;
}
-bool AsyncResourceHandler::OnResponseCompleted(
- int request_id,
- const URLRequestStatus& status,
- const std::string& security_info) {
+bool AsyncResourceHandler::OnResponseCompleted(int request_id,
+ const URLRequestStatus& status) {
receiver_->Send(new ViewMsg_Resource_RequestComplete(routing_id_,
- request_id,
- status,
- security_info));
+ request_id, status));
// If we still have a read buffer, then see about caching it for later...
if (spare_read_buffer_) {
diff --git a/chrome/browser/renderer_host/async_resource_handler.h b/chrome/browser/renderer_host/async_resource_handler.h
index 7407e6d..e966a80 100644
--- a/chrome/browser/renderer_host/async_resource_handler.h
+++ b/chrome/browser/renderer_host/async_resource_handler.h
@@ -5,8 +5,6 @@
#ifndef CHROME_BROWSER_RENDERER_HOST_ASYNC_RESOURCE_HANDLER_H_
#define CHROME_BROWSER_RENDERER_HOST_ASYNC_RESOURCE_HANDLER_H_
-#include <string>
-
#include "base/process.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/renderer_host/resource_handler.h"
@@ -31,9 +29,7 @@ class AsyncResourceHandler : public ResourceHandler {
bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size,
int min_size);
bool OnReadCompleted(int request_id, int* bytes_read);
- bool OnResponseCompleted(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info);
+ bool OnResponseCompleted(int request_id, const URLRequestStatus& status);
static void GlobalCleanup();
diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc
index c49666c7..e1144c2 100644
--- a/chrome/browser/renderer_host/buffered_resource_handler.cc
+++ b/chrome/browser/renderer_host/buffered_resource_handler.cc
@@ -72,10 +72,8 @@ bool BufferedResourceHandler::OnResponseStarted(int request_id,
bool BufferedResourceHandler::OnResponseCompleted(
- int request_id,
- const URLRequestStatus& status,
- const std::string& security_info) {
- return real_handler_->OnResponseCompleted(request_id, status, security_info);
+ int request_id, const URLRequestStatus& status) {
+ return real_handler_->OnResponseCompleted(request_id, status);
}
// We'll let the original event handler provide a buffer, and reuse it for
@@ -244,7 +242,7 @@ bool BufferedResourceHandler::CompleteResponseStarted(int request_id,
// own error page instead of triggering a download.
// TODO(abarth): We should abstract the response_code test, but this kind
// of check is scattered throughout our codebase.
- request_->SimulateError(net::ERR_FILE_NOT_FOUND);
+ request_->CancelWithError(net::ERR_FILE_NOT_FOUND);
return false;
}
@@ -272,8 +270,7 @@ bool BufferedResourceHandler::CompleteResponseStarted(int request_id,
// handled by an external source (the browser's DownloadManager).
real_handler_->OnResponseStarted(info->request_id, response_);
URLRequestStatus status(URLRequestStatus::HANDLED_EXTERNALLY, 0);
- real_handler_->OnResponseCompleted(info->request_id, status,
- std::string());
+ real_handler_->OnResponseCompleted(info->request_id, status);
// Ditch the old async handler that talks to the renderer for the new
// download handler that talks to the DownloadManager.
diff --git a/chrome/browser/renderer_host/buffered_resource_handler.h b/chrome/browser/renderer_host/buffered_resource_handler.h
index e553aca..97907b5 100644
--- a/chrome/browser/renderer_host/buffered_resource_handler.h
+++ b/chrome/browser/renderer_host/buffered_resource_handler.h
@@ -26,9 +26,7 @@ class BufferedResourceHandler : public ResourceHandler {
bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size,
int min_size);
bool OnReadCompleted(int request_id, int* bytes_read);
- bool OnResponseCompleted(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info);
+ bool OnResponseCompleted(int request_id, const URLRequestStatus& status);
private:
// Returns true if we should delay OnResponseStarted forwarding.
diff --git a/chrome/browser/renderer_host/cross_site_resource_handler.cc b/chrome/browser/renderer_host/cross_site_resource_handler.cc
index 1e25f17..363d451 100644
--- a/chrome/browser/renderer_host/cross_site_resource_handler.cc
+++ b/chrome/browser/renderer_host/cross_site_resource_handler.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <string>
-
#include "chrome/browser/renderer_host/cross_site_resource_handler.h"
#include "chrome/browser/renderer_host/render_view_host.h"
@@ -131,13 +129,11 @@ bool CrossSiteResourceHandler::OnReadCompleted(int request_id,
bool CrossSiteResourceHandler::OnResponseCompleted(
int request_id,
- const URLRequestStatus& status,
- const std::string& security_info) {
+ const URLRequestStatus& status) {
if (!in_cross_site_transition_) {
if (has_started_response_) {
// We've already completed the transition, so just pass it through.
- return next_handler_->OnResponseCompleted(request_id, status,
- security_info);
+ return next_handler_->OnResponseCompleted(request_id, status);
} else {
// Some types of failures will call OnResponseCompleted without calling
// CrossSiteResourceHandler::OnResponseStarted.
@@ -149,8 +145,7 @@ bool CrossSiteResourceHandler::OnResponseCompleted(
new CancelPendingRenderViewTask(render_process_host_id_,
render_view_id_);
rdh_->ui_loop()->PostTask(FROM_HERE, task);
- return next_handler_->OnResponseCompleted(request_id, status,
- security_info);
+ return next_handler_->OnResponseCompleted(request_id, status);
} else {
// An error occured, we should wait now for the cross-site transition,
// so that the error message (e.g., 404) can be displayed to the user.
@@ -166,7 +161,6 @@ bool CrossSiteResourceHandler::OnResponseCompleted(
// We have to buffer the call until after the transition completes.
completed_during_transition_ = true;
completed_status_ = status;
- completed_security_info_ = security_info;
// Return false to tell RDH not to notify the world or clean up the
// pending request. We will do so in ResumeResponse.
@@ -207,8 +201,7 @@ void CrossSiteResourceHandler::ResumeResponse() {
// If the response completed during the transition, notify the next
// event handler.
if (completed_during_transition_) {
- next_handler_->OnResponseCompleted(request_id_, completed_status_,
- completed_security_info_);
+ next_handler_->OnResponseCompleted(request_id_, completed_status_);
// Since we didn't notify the world or clean up the pending request in
// RDH::OnResponseCompleted during the transition, we should do it now.
diff --git a/chrome/browser/renderer_host/cross_site_resource_handler.h b/chrome/browser/renderer_host/cross_site_resource_handler.h
index 2ae2c75..7d57c76 100644
--- a/chrome/browser/renderer_host/cross_site_resource_handler.h
+++ b/chrome/browser/renderer_host/cross_site_resource_handler.h
@@ -27,9 +27,7 @@ class CrossSiteResourceHandler : public ResourceHandler {
bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size,
int min_size);
bool OnReadCompleted(int request_id, int* bytes_read);
- bool OnResponseCompleted(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info);
+ bool OnResponseCompleted(int request_id, const URLRequestStatus& status);
// We can now send the response to the new renderer, which will cause
// WebContents to swap in the new renderer and destroy the old one.
@@ -51,7 +49,6 @@ class CrossSiteResourceHandler : public ResourceHandler {
int request_id_;
bool completed_during_transition_;
URLRequestStatus completed_status_;
- std::string completed_security_info_;
ResourceResponse* response_;
ResourceDispatcherHost* rdh_;
diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc
index 2187506..37e7e89 100644
--- a/chrome/browser/renderer_host/download_resource_handler.cc
+++ b/chrome/browser/renderer_host/download_resource_handler.cc
@@ -113,8 +113,7 @@ bool DownloadResourceHandler::OnReadCompleted(int request_id, int* bytes_read) {
bool DownloadResourceHandler::OnResponseCompleted(
int request_id,
- const URLRequestStatus& status,
- const std::string& security_info) {
+ const URLRequestStatus& status) {
download_manager_->file_loop()->PostTask(FROM_HERE,
NewRunnableMethod(download_manager_,
&DownloadFileManager::DownloadFinished,
diff --git a/chrome/browser/renderer_host/download_resource_handler.h b/chrome/browser/renderer_host/download_resource_handler.h
index d9afa42..dfc047e 100644
--- a/chrome/browser/renderer_host/download_resource_handler.h
+++ b/chrome/browser/renderer_host/download_resource_handler.h
@@ -37,9 +37,7 @@ class DownloadResourceHandler : public ResourceHandler {
bool OnReadCompleted(int request_id, int* bytes_read);
- bool OnResponseCompleted(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info);
+ bool OnResponseCompleted(int request_id, const URLRequestStatus& status);
// If the content-length header is not present (or contains something other
// than numbers), the incoming content_length is -1 (unknown size).
diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.cc b/chrome/browser/renderer_host/download_throttling_resource_handler.cc
index 2e8042b..f049788 100644
--- a/chrome/browser/renderer_host/download_throttling_resource_handler.cc
+++ b/chrome/browser/renderer_host/download_throttling_resource_handler.cc
@@ -99,11 +99,9 @@ bool DownloadThrottlingResourceHandler::OnReadCompleted(int request_id,
bool DownloadThrottlingResourceHandler::OnResponseCompleted(
int request_id,
- const URLRequestStatus& status,
- const std::string& security_info) {
+ const URLRequestStatus& status) {
if (download_handler_.get())
- return download_handler_->OnResponseCompleted(request_id, status,
- security_info);
+ return download_handler_->OnResponseCompleted(request_id, status);
NOTREACHED();
return true;
}
diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.h b/chrome/browser/renderer_host/download_throttling_resource_handler.h
index 5a2eea9..3306475 100644
--- a/chrome/browser/renderer_host/download_throttling_resource_handler.h
+++ b/chrome/browser/renderer_host/download_throttling_resource_handler.h
@@ -46,8 +46,7 @@ class DownloadThrottlingResourceHandler
int min_size);
virtual bool OnReadCompleted(int request_id, int* bytes_read);
virtual bool OnResponseCompleted(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info);
+ const URLRequestStatus& status);
// DownloadRequestManager::Callback implementation:
void CancelDownload();
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc
index 4245054..ba161e4 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc
@@ -205,8 +205,7 @@ bool ResourceDispatcherHost::HandleExternalProtocol(int request_id,
handler->OnResponseCompleted(request_id, URLRequestStatus(
URLRequestStatus::FAILED,
- net::ERR_ABORTED),
- std::string()); // No security info necessary.
+ net::ERR_ABORTED));
return true;
}
@@ -225,9 +224,7 @@ void ResourceDispatcherHost::BeginRequest(
receiver->Send(new ViewMsg_Resource_RequestComplete(
render_view_id,
request_id,
- URLRequestStatus(URLRequestStatus::FAILED, net::ERR_ABORTED),
- std::string())); // No security info needed, connection was not
- // established.
+ URLRequestStatus(URLRequestStatus::FAILED, net::ERR_ABORTED)));
return;
}
@@ -235,7 +232,7 @@ void ResourceDispatcherHost::BeginRequest(
// requests. Does nothing if they are already loaded.
// TODO(mpcomplete): This takes 200 ms! Investigate parallelizing this by
// starting the load earlier in a BG thread.
- // plugin_service_->LoadChromePlugins(this);
+ plugin_service_->LoadChromePlugins(this);
// Construct the event handler.
scoped_refptr<ResourceHandler> handler;
@@ -922,7 +919,7 @@ void ResourceDispatcherHost::BeginRequestInternal(URLRequest* request,
if (memory_cost > max_outstanding_requests_cost_per_process_) {
// We call "CancelWithError()" as a way of setting the URLRequest's
// status -- it has no effect beyond this, since the request hasn't started.
- request->SimulateError(net::ERR_INSUFFICIENT_RESOURCES);
+ request->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES);
// TODO(eroman): this is kinda funky -- we insert the unstarted request into
// |pending_requests_| simply to please OnResponseCompleted().
@@ -1124,19 +1121,8 @@ void ResourceDispatcherHost::OnResponseCompleted(URLRequest* request) {
RESOURCE_LOG("OnResponseCompleted: " << request->url().spec());
ExtraRequestInfo* info = ExtraInfoForRequest(request);
- std::string security_info;
- const net::SSLInfo& ssl_info = request->ssl_info();
- if (ssl_info.cert != NULL) {
- int cert_id = CertStore::GetSharedInstance()->
- StoreCert(ssl_info.cert, info->render_process_host_id);
- security_info = SSLManager::SerializeSecurityInfo(cert_id,
- ssl_info.cert_status,
- ssl_info.security_bits);
- }
-
if (info->resource_handler->OnResponseCompleted(info->request_id,
- request->status(),
- security_info)) {
+ request->status())) {
NotifyResponseCompleted(request, info->render_process_host_id);
// The request is complete so we can remove it.
diff --git a/chrome/browser/renderer_host/resource_handler.h b/chrome/browser/renderer_host/resource_handler.h
index 2b843f9..01abcb5 100644
--- a/chrome/browser/renderer_host/resource_handler.h
+++ b/chrome/browser/renderer_host/resource_handler.h
@@ -12,8 +12,6 @@
#ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_
#define CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_
-#include <string>
-
#include "chrome/common/filter_policy.h"
#include "net/url_request/url_request_status.h"
#include "webkit/glue/resource_loader_bridge.h"
@@ -85,8 +83,7 @@ class ResourceHandler : public base::RefCounted<ResourceHandler> {
// The response is complete. The final response status is given.
// Returns false if the handler is deferring the call to a later time.
virtual bool OnResponseCompleted(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info) = 0;
+ const URLRequestStatus& status) = 0;
};
#endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_
diff --git a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
index 0d0d058..7ee4661 100644
--- a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
+++ b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
@@ -101,8 +101,7 @@ bool SafeBrowsingResourceHandler::OnReadCompleted(int request_id,
}
bool SafeBrowsingResourceHandler::OnResponseCompleted(
- int request_id, const URLRequestStatus& status,
- const std::string& security_info) {
+ int request_id, const URLRequestStatus& status) {
if ((in_safe_browsing_check_ ||
safe_browsing_result_ != SafeBrowsingService::URL_SAFE) &&
status.status() == URLRequestStatus::FAILED &&
@@ -112,11 +111,10 @@ bool SafeBrowsingResourceHandler::OnResponseCompleted(
// page.
queued_error_.reset(new URLRequestStatus(status));
queued_error_request_id_ = request_id;
- queued_security_info_ = security_info;
return true;
}
- return next_handler_->OnResponseCompleted(request_id, status, security_info);
+ return next_handler_->OnResponseCompleted(request_id, status);
}
// SafeBrowsingService::Client implementation, called on the IO thread once
@@ -142,10 +140,8 @@ void SafeBrowsingResourceHandler::OnUrlCheckResult(
if (queued_error_.get()) {
next_handler_->OnResponseCompleted(
- queued_error_request_id_, *queued_error_.get(),
- queued_security_info_);
+ queued_error_request_id_, *queued_error_.get());
queued_error_.reset();
- queued_security_info_.clear();
}
Release();
@@ -172,10 +168,8 @@ void SafeBrowsingResourceHandler::OnBlockingPageComplete(bool proceed) {
if (queued_error_.get()) {
next_handler_->OnResponseCompleted(
- queued_error_request_id_, *queued_error_.get(),
- queued_security_info_);
+ queued_error_request_id_, *queued_error_.get());
queued_error_.reset();
- queued_security_info_.clear();
}
} else {
rdh_->CancelRequest(render_process_host_id_, paused_request_id_, false);
diff --git a/chrome/browser/renderer_host/safe_browsing_resource_handler.h b/chrome/browser/renderer_host/safe_browsing_resource_handler.h
index a3c74ba..92e0040 100644
--- a/chrome/browser/renderer_host/safe_browsing_resource_handler.h
+++ b/chrome/browser/renderer_host/safe_browsing_resource_handler.h
@@ -5,8 +5,6 @@
#ifndef CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_
#define CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_
-#include <string>
-
#include "base/time.h"
#include "chrome/browser/renderer_host/resource_handler.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
@@ -33,9 +31,7 @@ class SafeBrowsingResourceHandler : public ResourceHandler,
bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size,
int min_size);
bool OnReadCompleted(int request_id, int* bytes_read);
- bool OnResponseCompleted(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info);
+ bool OnResponseCompleted(int request_id, const URLRequestStatus& status);
// SafeBrowsingService::Client implementation, called on the IO thread once
// the URL has been classified.
@@ -56,7 +52,6 @@ class SafeBrowsingResourceHandler : public ResourceHandler,
SafeBrowsingService::UrlCheckResult safe_browsing_result_;
scoped_refptr<SafeBrowsingService> safe_browsing_;
scoped_ptr<URLRequestStatus> queued_error_;
- std::string queued_security_info_;
int queued_error_request_id_;
ResourceDispatcherHost* rdh_;
base::Time pause_time_;
diff --git a/chrome/browser/renderer_host/save_file_resource_handler.cc b/chrome/browser/renderer_host/save_file_resource_handler.cc
index 2f469f1..c4db4a2 100644
--- a/chrome/browser/renderer_host/save_file_resource_handler.cc
+++ b/chrome/browser/renderer_host/save_file_resource_handler.cc
@@ -74,8 +74,7 @@ bool SaveFileResourceHandler::OnReadCompleted(int request_id, int* bytes_read) {
bool SaveFileResourceHandler::OnResponseCompleted(
int request_id,
- const URLRequestStatus& status,
- const std::string& security_info) {
+ const URLRequestStatus& status) {
save_manager_->GetSaveLoop()->PostTask(FROM_HERE,
NewRunnableMethod(save_manager_,
&SaveFileManager::SaveFinished,
diff --git a/chrome/browser/renderer_host/save_file_resource_handler.h b/chrome/browser/renderer_host/save_file_resource_handler.h
index bc3548c..03f4a02 100644
--- a/chrome/browser/renderer_host/save_file_resource_handler.h
+++ b/chrome/browser/renderer_host/save_file_resource_handler.h
@@ -34,9 +34,7 @@ class SaveFileResourceHandler : public ResourceHandler {
// Passes the buffer to the download file writer.
bool OnReadCompleted(int request_id, int* bytes_read);
- bool OnResponseCompleted(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info);
+ bool OnResponseCompleted(int request_id, const URLRequestStatus& status);
// If the content-length header is not present (or contains something other
// than numbers), StringToInt64 returns 0, which indicates 'unknown size' and
diff --git a/chrome/browser/renderer_host/sync_resource_handler.cc b/chrome/browser/renderer_host/sync_resource_handler.cc
index 5be45a9..cc74b2d 100644
--- a/chrome/browser/renderer_host/sync_resource_handler.cc
+++ b/chrome/browser/renderer_host/sync_resource_handler.cc
@@ -54,10 +54,8 @@ bool SyncResourceHandler::OnReadCompleted(int request_id, int* bytes_read) {
return true;
}
-bool SyncResourceHandler::OnResponseCompleted(
- int request_id,
- const URLRequestStatus& status,
- const std::string& security_info) {
+bool SyncResourceHandler::OnResponseCompleted(int request_id,
+ const URLRequestStatus& status) {
result_.status = status;
ViewHostMsg_SyncLoad::WriteReplyParams(result_message_, result_);
diff --git a/chrome/browser/renderer_host/sync_resource_handler.h b/chrome/browser/renderer_host/sync_resource_handler.h
index 8aa4681..deb7746 100644
--- a/chrome/browser/renderer_host/sync_resource_handler.h
+++ b/chrome/browser/renderer_host/sync_resource_handler.h
@@ -5,8 +5,6 @@
#ifndef CHROME_BROWSER_RENDERER_HOST_SYNC_RESOURCE_HANDLER_H_
#define CHROME_BROWSER_RENDERER_HOST_SYNC_RESOURCE_HANDLER_H_
-#include <string>
-
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/renderer_host/resource_handler.h"
#include "net/base/io_buffer.h"
@@ -25,9 +23,7 @@ class SyncResourceHandler : public ResourceHandler {
bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size,
int min_size);
bool OnReadCompleted(int request_id, int* bytes_read);
- bool OnResponseCompleted(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info);
+ bool OnResponseCompleted(int request_id, const URLRequestStatus& status);
private:
enum { kReadBufSize = 3840 };
diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc
index 58d7acb..bc95a53 100644
--- a/chrome/browser/ssl/ssl_manager.cc
+++ b/chrome/browser/ssl/ssl_manager.cc
@@ -338,11 +338,7 @@ void SSLManager::ErrorHandler::CompleteCancelRequest(int error) {
// 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).
DLOG(INFO) << "CompleteCancelRequest() url: " << request->url().spec();
- SSLManager::CertError* cert_error = AsCertError();
- if (cert_error)
- request->SimulateSSLError(error, cert_error->ssl_info());
- else
- request->SimulateError(error);
+ request->CancelWithError(error);
}
request_has_been_notified_ = true;
@@ -595,8 +591,7 @@ void SSLManager::DidCommitProvisionalLoad(
// An HTTPS response may not have a certificate for some reason. When that
// happens, use the unauthenticated (HTTP) rather than the authentication
// broken security style so that we can detect this error condition.
- if (net::IsCertStatusError(ssl_cert_status) &&
- !details->is_content_filtered) {
+ if (net::IsCertStatusError(ssl_cert_status)) {
changed |= SetMaxSecurityStyle(SECURITY_STYLE_AUTHENTICATION_BROKEN);
if (!details->is_main_frame &&
!details->entry->ssl().has_unsafe_content()) {
diff --git a/chrome/browser/ssl/ssl_manager.h b/chrome/browser/ssl/ssl_manager.h
index 63cfce4..0b1842e 100644
--- a/chrome/browser/ssl/ssl_manager.h
+++ b/chrome/browser/ssl/ssl_manager.h
@@ -49,8 +49,6 @@ class WebContents;
class SSLManager : public NotificationObserver {
public:
- class CertError;
-
// An ErrorHandler carries information from the IO thread to the UI thread
// and is dispatched to the appropriate SSLManager when it arrives on the
// UI thread. Subclasses should override the OnDispatched/OnDispatchFailed
@@ -65,8 +63,6 @@ class SSLManager : public NotificationObserver {
public:
virtual ~ErrorHandler() { }
- virtual CertError* AsCertError() { return NULL; }
-
// Find the appropriate SSLManager for the URLRequest and begin handling
// this error.
//
@@ -171,7 +167,7 @@ class SSLManager : public NotificationObserver {
bool request_has_been_notified_; // A flag to make sure we notify the
// URLRequest exactly once.
- DISALLOW_COPY_AND_ASSIGN(ErrorHandler);
+ DISALLOW_EVIL_CONSTRUCTORS(ErrorHandler);
};
// A CertError represents an error that occurred with the certificate in an
@@ -179,9 +175,6 @@ class SSLManager : public NotificationObserver {
// thread and allows us to cancel/continue a request it is associated with.
class CertError : public ErrorHandler {
public:
-
- virtual CertError* AsCertError() { return this; }
-
// These accessors are available on either thread
const net::SSLInfo& ssl_info() const { return ssl_info_; }
int cert_error() const { return cert_error_; }
@@ -213,7 +206,7 @@ class SSLManager : public NotificationObserver {
// that error.
ResourceType::Type resource_type_;
- DISALLOW_COPY_AND_ASSIGN(CertError);
+ DISALLOW_EVIL_CONSTRUCTORS(CertError);
};
// The MixedContentHandler class is used to query what to do with
@@ -231,7 +224,7 @@ class SSLManager : public NotificationObserver {
virtual void OnDispatched() { manager()->OnMixedContent(this); }
private:
- DISALLOW_COPY_AND_ASSIGN(MixedContentHandler);
+ DISALLOW_EVIL_CONSTRUCTORS(MixedContentHandler);
};
// The SSLManager will ask its delegate to decide how to handle events
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index e0fd20c..d8418e8 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -193,10 +193,9 @@ IPC_BEGIN_MESSAGES(View)
int /* data_len */)
// Sent when the request has been completed.
- IPC_MESSAGE_ROUTED3(ViewMsg_Resource_RequestComplete,
+ IPC_MESSAGE_ROUTED2(ViewMsg_Resource_RequestComplete,
int /* request_id */,
- URLRequestStatus /* status */,
- std::string /* security info */)
+ URLRequestStatus /* status */)
// Request for the renderer to evaluate an xpath to a frame and execute a
// javascript: url in that frame's context. The message is completely
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc
index 76942ec..e9db613 100644
--- a/chrome/common/resource_dispatcher.cc
+++ b/chrome/common/resource_dispatcher.cc
@@ -382,8 +382,7 @@ void ResourceDispatcher::OnReceivedRedirect(int request_id,
}
void ResourceDispatcher::OnRequestComplete(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info) {
+ const URLRequestStatus& status) {
PendingRequestList::iterator it = pending_requests_.find(request_id);
if (it == pending_requests_.end()) {
// this might happen for kill()ed requests on the webkit end, so perhaps
@@ -415,7 +414,7 @@ void ResourceDispatcher::OnRequestComplete(int request_id,
// The request ID will be removed from our pending list in the destructor.
// Normally, dispatching this message causes the reference-counted request to
// die immediately.
- peer->OnCompletedRequest(status, security_info);
+ peer->OnCompletedRequest(status);
webkit_glue::NotifyCacheStats();
}
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index b4e7fb1..a6b73d5 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -108,9 +108,7 @@ class ResourceDispatcher : public base::RefCounted<ResourceDispatcher> {
void OnReceivedRedirect(int request_id, const GURL& new_url);
void OnReceivedData(int request_id, base::SharedMemoryHandle data,
int data_len);
- void OnRequestComplete(int request_id,
- const URLRequestStatus& status,
- const std::string& security_info);
+ void OnRequestComplete(int request_id, const URLRequestStatus& status);
// Dispatch the message to one of the message response handlers.
void DispatchMessage(const IPC::Message& message);
diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc
index e4c8792..43628b8 100644
--- a/chrome/common/resource_dispatcher_unittest.cc
+++ b/chrome/common/resource_dispatcher_unittest.cc
@@ -44,8 +44,7 @@ class TestRequestCallback : public ResourceLoaderBridge::Peer {
data_.append(data, len);
}
- virtual void OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info) {
+ virtual void OnCompletedRequest(const URLRequestStatus& status) {
EXPECT_FALSE(complete_);
complete_ = true;
}
diff --git a/chrome/common/security_filter_peer.cc b/chrome/common/security_filter_peer.cc
index 30d6d1e..aef72ebb 100644
--- a/chrome/common/security_filter_peer.cc
+++ b/chrome/common/security_filter_peer.cc
@@ -114,8 +114,7 @@ void SecurityFilterPeer::OnReceivedData(const char* data, int len) {
NOTREACHED();
}
-void SecurityFilterPeer::OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info) {
+void SecurityFilterPeer::OnCompletedRequest(const URLRequestStatus& status) {
NOTREACHED();
}
@@ -176,8 +175,7 @@ void BufferedPeer::OnReceivedData(const char* data, int len) {
data_.append(data, len);
}
-void BufferedPeer::OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info) {
+void BufferedPeer::OnCompletedRequest(const URLRequestStatus& status) {
// Make sure we delete ourselves at the end of this call.
scoped_ptr<BufferedPeer> this_deleter(this);
@@ -186,7 +184,7 @@ void BufferedPeer::OnCompletedRequest(const URLRequestStatus& status,
// Pretend we failed to load the resource.
original_peer_->OnReceivedResponse(response_info_, true);
URLRequestStatus status(URLRequestStatus::CANCELED, 0);
- original_peer_->OnCompletedRequest(status, security_info);
+ original_peer_->OnCompletedRequest(status);
return;
}
@@ -194,7 +192,7 @@ void BufferedPeer::OnCompletedRequest(const URLRequestStatus& status,
if (!data_.empty())
original_peer_->OnReceivedData(data_.data(),
static_cast<int>(data_.size()));
- original_peer_->OnCompletedRequest(status, security_info);
+ original_peer_->OnCompletedRequest(status);
}
////////////////////////////////////////////////////////////////////////////////
@@ -223,17 +221,15 @@ void ReplaceContentPeer::OnReceivedData(const char* data, int len) {
// Ignore this, we'll serve some alternate content in OnCompletedRequest.
}
-void ReplaceContentPeer::OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info) {
+void ReplaceContentPeer::OnCompletedRequest(const URLRequestStatus& status) {
webkit_glue::ResourceLoaderBridge::ResponseInfo info;
ProcessResponseInfo(info, &info, mime_type_);
- info.security_info = security_info;
info.content_length = static_cast<int>(data_.size());
original_peer_->OnReceivedResponse(info, true);
if (!data_.empty())
original_peer_->OnReceivedData(data_.data(),
static_cast<int>(data_.size()));
- original_peer_->OnCompletedRequest(URLRequestStatus(), security_info);
+ original_peer_->OnCompletedRequest(URLRequestStatus());
// The request processing is complete, we must delete ourselves.
delete this;
diff --git a/chrome/common/security_filter_peer.h b/chrome/common/security_filter_peer.h
index 816f9da..ef08426 100644
--- a/chrome/common/security_filter_peer.h
+++ b/chrome/common/security_filter_peer.h
@@ -43,8 +43,7 @@ class SecurityFilterPeer : public webkit_glue::ResourceLoaderBridge::Peer {
const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
bool content_filtered);
virtual void OnReceivedData(const char* data, int len);
- virtual void OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info);
+ virtual void OnCompletedRequest(const URLRequestStatus& status);
virtual std::string GetURLForDebugging();
protected:
@@ -72,8 +71,7 @@ class BufferedPeer : public SecurityFilterPeer {
const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
bool content_filtered);
virtual void OnReceivedData(const char* data, int len);
- virtual void OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info);
+ virtual void OnCompletedRequest(const URLRequestStatus& status);
protected:
// Invoked when the entire request has been processed before the data is sent
@@ -111,8 +109,7 @@ class ReplaceContentPeer : public SecurityFilterPeer {
const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
bool content_filtered);
void OnReceivedData(const char* data, int len);
- void OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info);
+ void OnCompletedRequest(const URLRequestStatus& status);
private:
webkit_glue::ResourceLoaderBridge::ResponseInfo response_info_;
std::string mime_type_;
diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc
index 9a070e9..f1d2794 100644
--- a/chrome/plugin/chrome_plugin_host.cc
+++ b/chrome/plugin/chrome_plugin_host.cc
@@ -86,8 +86,7 @@ class PluginRequestHandlerProxy
}
}
- virtual void OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info) {
+ virtual void OnCompletedRequest(const URLRequestStatus& status) {
completed_ = true;
if (!status.is_success()) {
diff --git a/chrome/renderer/chrome_plugin_host.cc b/chrome/renderer/chrome_plugin_host.cc
index 81317c5..9b3fea9 100644
--- a/chrome/renderer/chrome_plugin_host.cc
+++ b/chrome/renderer/chrome_plugin_host.cc
@@ -86,8 +86,7 @@ class PluginRequestHandlerProxy
}
}
- virtual void OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info) {
+ virtual void OnCompletedRequest(const URLRequestStatus& status) {
completed_ = true;
if (!status.is_success()) {
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 3de8439..fefd24c 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -260,23 +260,10 @@ void URLRequest::Start() {
}
void URLRequest::Cancel() {
- DoCancel(net::ERR_ABORTED, net::SSLInfo());
+ CancelWithError(net::ERR_ABORTED);
}
-void URLRequest::SimulateError(int os_error) {
- DoCancel(os_error, net::SSLInfo());
-}
-
-void URLRequest::SimulateSSLError(int os_error, const net::SSLInfo& ssl_info) {
- // This should only be called on a started request.
- if (!is_pending_ || !job_ || job_->has_response_started()) {
- NOTREACHED();
- return;
- }
- DoCancel(os_error, ssl_info);
-}
-
-void URLRequest::DoCancel(int os_error, const net::SSLInfo& ssl_info) {
+void URLRequest::CancelWithError(int os_error) {
DCHECK(os_error < 0);
// If the URL request already has an error status, then canceling is a no-op.
@@ -284,7 +271,6 @@ void URLRequest::DoCancel(int os_error, const net::SSLInfo& ssl_info) {
if (status_.is_success()) {
status_.set_status(URLRequestStatus::CANCELED);
status_.set_os_error(os_error);
- response_info_.ssl_info = ssl_info;
}
// There's nothing to do if we are not waiting on a Job.
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index 4309689..f4aee3a 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -354,15 +354,10 @@ class URLRequest {
// no effect once the response has completed.
void Cancel();
- // Cancels the request and sets the error to |os_error| (see net_error_list.h
- // for values).
- void SimulateError(int os_error);
-
- // Cancels the request and sets the error to |os_error| (see net_error_list.h
- // for values) and attaches |ssl_info| as the SSLInfo for that request. This
- // is useful to attach a certificate and certificate error to a canceled
- // request.
- void SimulateSSLError(int os_error, const net::SSLInfo& ssl_info);
+ // Similar to Cancel but sets the error to |os_error| (see net_error_list.h
+ // for values) instead of net::ERR_ABORTED.
+ // Used to attach a reason for canceling a request.
+ void CancelWithError(int os_error);
// Read initiates an asynchronous read from the response, and must only
// be called after the OnResponseStarted callback is received with a
@@ -440,10 +435,6 @@ class URLRequest {
// been orphaned.
void OrphanJob();
- // Cancels the request and set the error and ssl info for this request to the
- // passed values.
- void DoCancel(int os_error, const net::SSLInfo& ssl_info);
-
// Discard headers which have meaning in POST (Content-Length, Content-Type,
// Origin).
static std::string StripPostSpecificHeaders(const std::string& headers);
diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h
index aac3768..fae5a1b 100644
--- a/net/url_request/url_request_job.h
+++ b/net/url_request/url_request_job.h
@@ -192,9 +192,6 @@ class URLRequestJob : public base::RefCountedThreadSafe<URLRequestJob> {
expected_content_size_ = size;
}
- // Whether we have processed the response for that request yet.
- bool has_response_started() const { return has_handled_response_; }
-
protected:
// Notifies the job that headers have been received.
void NotifyHeadersComplete();
diff --git a/webkit/glue/resource_handle_impl.cc b/webkit/glue/resource_handle_impl.cc
index dbc8606..ee7acb4 100644
--- a/webkit/glue/resource_handle_impl.cc
+++ b/webkit/glue/resource_handle_impl.cc
@@ -227,8 +227,7 @@ class ResourceHandleInternal : public ResourceLoaderBridge::Peer {
const ResourceLoaderBridge::ResponseInfo& info,
bool content_filtered);
virtual void OnReceivedData(const char* data, int len);
- virtual void OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info);
+ virtual void OnCompletedRequest(const URLRequestStatus& status);
virtual std::string GetURLForDebugging();
// Handles a data: url internally instead of calling the bridge.
@@ -300,7 +299,7 @@ void ResourceHandleInternal::HandleDataUrl() {
OnReceivedData(data.c_str(), data.size());
}
- OnCompletedRequest(status, info.security_info);
+ OnCompletedRequest(status);
// We are done using the object. ResourceHandle and ResourceHandleInternal
// might be destroyed now.
@@ -605,8 +604,7 @@ void ResourceHandleInternal::OnReceivedData(const char* data, int data_len) {
}
void ResourceHandleInternal::OnCompletedRequest(
- const URLRequestStatus& status,
- const std::string& security_info) {
+ const URLRequestStatus& status) {
if (multipart_delegate_.get()) {
multipart_delegate_->OnCompletedRequest();
multipart_delegate_.reset(NULL);
diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h
index d5ca181..948bc74 100644
--- a/webkit/glue/resource_loader_bridge.h
+++ b/webkit/glue/resource_loader_bridge.h
@@ -111,8 +111,7 @@ class ResourceLoaderBridge {
// Called when the response is complete. This method signals completion of
// the resource load.ff
- virtual void OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info) = 0;
+ virtual void OnCompletedRequest(const URLRequestStatus& status) = 0;
// Returns the URL of the request, which allows us to display it in
// debugging situations.
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index c6c7b78..f6b10f3 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -173,10 +173,9 @@ class RequestProxy : public URLRequest::Delegate,
peer_->OnReceivedData(buf_copy.get(), bytes_read);
}
- void NotifyCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info) {
+ void NotifyCompletedRequest(const URLRequestStatus& status) {
if (peer_) {
- peer_->OnCompletedRequest(status, security_info);
+ peer_->OnCompletedRequest(status);
DropPeer(); // ensure no further notifications
}
}
@@ -247,10 +246,9 @@ class RequestProxy : public URLRequest::Delegate,
this, &RequestProxy::NotifyReceivedData, bytes_read));
}
- virtual void OnCompletedRequest(const URLRequestStatus& status,
- const std::string& security_info) {
+ virtual void OnCompletedRequest(const URLRequestStatus& status) {
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &RequestProxy::NotifyCompletedRequest, status, security_info));
+ this, &RequestProxy::NotifyCompletedRequest, status));
}
// --------------------------------------------------------------------------
@@ -291,7 +289,7 @@ class RequestProxy : public URLRequest::Delegate,
void Done() {
DCHECK(request_.get());
- OnCompletedRequest(request_->status(), std::string());
+ OnCompletedRequest(request_->status());
request_.reset(); // destroy on the io thread
}