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

Unified Diff: chrome/browser/download/download_safe_browsing_client.cc

Issue 6969009: Reduced the lifetime of DownloadCreateInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Stupid clang! Created 9 years, 7 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/download/download_safe_browsing_client.cc
diff --git a/chrome/browser/download/download_safe_browsing_client.cc b/chrome/browser/download/download_safe_browsing_client.cc
index 36cf5fb28b436efe9b2337180cdb37a428380c31..1acc45c4322847125d1bc3ae3bdbc0bca1d30daa 100644
--- a/chrome/browser/download/download_safe_browsing_client.cc
+++ b/chrome/browser/download/download_safe_browsing_client.cc
@@ -10,8 +10,8 @@
#include "base/metrics/histogram.h"
#include "base/metrics/stats_counters.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/download/download_create_info.h"
#include "chrome/browser/download/download_manager.h"
-#include "chrome/browser/history/download_create_info.h"
#include "chrome/browser/safe_browsing/safe_browsing_util.h"
#include "chrome/common/chrome_switches.h"
#include "content/browser/browser_thread.h"
@@ -23,8 +23,7 @@
DownloadSBClient::DownloadSBClient(int32 download_id,
const std::vector<GURL>& url_chain,
const GURL& referrer_url)
- : info_(NULL),
- download_id_(download_id),
+ : download_id_(download_id),
url_chain_(url_chain),
referrer_url_(referrer_url) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -36,22 +35,19 @@ DownloadSBClient::DownloadSBClient(int32 download_id,
DownloadSBClient::~DownloadSBClient() {}
-void DownloadSBClient::CheckDownloadUrl(DownloadCreateInfo* info,
- UrlDoneCallback* callback) {
+void DownloadSBClient::CheckDownloadUrl(UrlDoneCallback* callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// It is not allowed to call this method twice.
CHECK(!url_done_callback_.get() && !hash_done_callback_.get());
CHECK(callback);
- CHECK(info);
- info_ = info;
start_time_ = base::TimeTicks::Now();
url_done_callback_.reset(callback);
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this,
&DownloadSBClient::CheckDownloadUrlOnIOThread,
- info->url_chain));
+ url_chain_));
}
void DownloadSBClient::CheckDownloadHash(const std::string& hash,
@@ -125,7 +121,7 @@ void DownloadSBClient::SafeBrowsingCheckUrlDone(
DVLOG(1) << "SafeBrowsingCheckUrlDone with result: " << result;
bool is_dangerous = result != SafeBrowsingService::SAFE;
- url_done_callback_->Run(info_, is_dangerous);
+ url_done_callback_->Run(download_id_, is_dangerous);
if (sb_service_.get() && sb_service_->download_protection_enabled()) {
UMA_HISTOGRAM_TIMES("SB2.DownloadUrlCheckDuration",
« no previous file with comments | « chrome/browser/download/download_safe_browsing_client.h ('k') | chrome/browser/download/download_state_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698