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

Unified Diff: chrome/browser/renderer_host/safe_browsing_resource_handler.cc

Issue 6334131: Turn off safebrowsing for PREFETCH requests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remediate to cbentzel + lzheng review Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/safe_browsing_resource_handler.cc
diff --git a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
index 32d4a59ad79affb9b2ed020ca2367f18e5c0bcf6..d31639b6023839a4f4df51559477344e8223e7fc 100644
--- a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
+++ b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
@@ -9,8 +9,9 @@
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/renderer_host/resource_message_filter.h"
#include "chrome/common/resource_response.h"
-#include "net/base/net_errors.h"
#include "net/base/io_buffer.h"
+#include "net/base/load_flags.h"
+#include "net/base/net_errors.h"
// Maximum time in milliseconds to wait for the safe browsing service to
// verify a URL. After this amount of time the outstanding check will be
@@ -158,6 +159,19 @@ void SafeBrowsingResourceHandler::OnBrowseUrlCheckResult(
// Continue the request.
ResumeRequest();
} else {
+ const net::URLRequest* request = rdh_->GetURLRequest(
+ GlobalRequestID(render_process_host_id_, deferred_request_id_));
+ if (request->load_flags() & net::LOAD_PREFETCH) {
+ // Don't prefetch resources that fail safe browsing, disallow
+ // them.
+ rdh_->CancelRequest(render_process_host_id_, deferred_request_id_, false);
+ // TODO(gavinp): reevaluate fixing this if bug 73778.
+ next_handler_->OnResponseCompleted(
lzheng 2011/02/23 02:19:12 I read your reply to Chris's question, but I still
rvargas (doing something else) 2011/02/23 03:49:51 I see what's going on here. The problem is that UR
gavinp 2011/03/07 23:26:40 OMG, Thanks for setting my head straight. I've no
+ deferred_request_id_,
+ net::URLRequestStatus(net::URLRequestStatus::FAILED, net::ERR_ABORTED),
lzheng 2011/02/23 02:19:12 80 chars.
gavinp 2011/03/07 23:26:40 Done.
+ std::string());
+ return;
lzheng 2011/02/23 02:19:12 Can't return here without calling Release. How abo
gavinp 2011/03/07 23:26:40 Done.
+ }
StartDisplayingBlockingPage(url, result);
}
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698