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

Unified Diff: chrome/browser/safe_browsing/protocol_manager.cc

Issue 9572001: Do cookie checks in NetworkDelegate instead of the URLRequest::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang fix Created 8 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
Index: chrome/browser/safe_browsing/protocol_manager.cc
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 669c85c75bbd6b1c50f6e1aeae69ea65bb6e26a3..7cced21714e23b704097a558df698391c4e5ec70 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -21,6 +21,7 @@
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/env_vars.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/common/content_url_request_user_data.h"
#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
@@ -180,6 +181,9 @@ void SafeBrowsingProtocolManager::GetFullHash(
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE);
fetcher->SetRequestContext(request_context_getter_);
+ // TODO(jochen): Do cookie audit.
+ fetcher->SetContentURLRequestUserData(
+ new content::ContentURLRequestUserData());
fetcher->SetUploadData("text/plain", get_hash);
fetcher->Start();
}
@@ -567,6 +571,9 @@ void SafeBrowsingProtocolManager::IssueChunkRequest() {
chunk_url, content::URLFetcher::GET, this));
request_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
request_->SetRequestContext(request_context_getter_);
+ // TODO(jochen): Do cookie audit.
+ request_->SetContentURLRequestUserData(
+ new content::ContentURLRequestUserData());
chunk_request_start_ = base::Time::Now();
request_->Start();
}
@@ -578,6 +585,9 @@ void SafeBrowsingProtocolManager::IssueKeyRequest() {
key_url, content::URLFetcher::GET, this));
request_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
request_->SetRequestContext(request_context_getter_);
+ // TODO(jochen): Do cookie audit.
+ request_->SetContentURLRequestUserData(
+ new content::ContentURLRequestUserData());
request_->Start();
}
@@ -620,6 +630,9 @@ void SafeBrowsingProtocolManager::OnGetChunksComplete(
update_url, content::URLFetcher::POST, this));
request_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
request_->SetRequestContext(request_context_getter_);
+ // TODO(jochen): Do cookie audit.
+ request_->SetContentURLRequestUserData(
+ new content::ContentURLRequestUserData());
request_->SetUploadData("text/plain", list_data);
request_->Start();
@@ -666,6 +679,9 @@ void SafeBrowsingProtocolManager::ReportSafeBrowsingHit(
this);
report->SetLoadFlags(net::LOAD_DISABLE_CACHE);
report->SetRequestContext(request_context_getter_);
+ // TODO(jochen): Do cookie audit.
+ report->SetContentURLRequestUserData(
+ new content::ContentURLRequestUserData());
if (!post_data.empty())
report->SetUploadData("text/plain", post_data);
report->Start();
@@ -680,6 +696,9 @@ void SafeBrowsingProtocolManager::ReportMalwareDetails(
report_url, content::URLFetcher::POST, this);
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE);
fetcher->SetRequestContext(request_context_getter_);
+ // TODO(jochen): Do cookie audit.
+ fetcher->SetContentURLRequestUserData(
+ new content::ContentURLRequestUserData());
fetcher->SetUploadData("application/octet-stream", report);
// Don't try too hard to send reports on failures.
fetcher->SetAutomaticallyRetryOn5xx(false);

Powered by Google App Engine
This is Rietveld 408576698