diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 03:47:34 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 03:47:34 +0000 |
commit | 8799e54a69efe75a81d7e66a96720f680ce8170a (patch) | |
tree | b47bbfcf5fe6cdaff166df4f324e0a028d4e6833 /chrome/browser/history/download_create_info.cc | |
parent | 8b1f708235422955fea682718f7ee6a96fe06c60 (diff) | |
download | chromium_src-8799e54a69efe75a81d7e66a96720f680ce8170a.zip chromium_src-8799e54a69efe75a81d7e66a96720f680ce8170a.tar.gz chromium_src-8799e54a69efe75a81d7e66a96720f680ce8170a.tar.bz2 |
Check all redirect URLs against download safebrowsing list.
BUG=77942
TEST=unit_tests, browser_tests, manual(see bug)
Review URL: http://codereview.chromium.org/6881041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/download_create_info.cc')
-rw-r--r-- | chrome/browser/history/download_create_info.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/history/download_create_info.cc b/chrome/browser/history/download_create_info.cc index eaa007a..a7ece9a 100644 --- a/chrome/browser/history/download_create_info.cc +++ b/chrome/browser/history/download_create_info.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -18,7 +18,7 @@ DownloadCreateInfo::DownloadCreateInfo(const FilePath& path, int32 download_id, bool has_user_gesture) : path(path), - url(url), + url_chain(1, url), path_uniquifier(0), start_time(start_time), received_bytes(received_bytes), @@ -59,6 +59,7 @@ DownloadCreateInfo::~DownloadCreateInfo() { bool DownloadCreateInfo::IsDangerous() { return is_dangerous_url || is_dangerous_file; } + std::string DownloadCreateInfo::DebugString() const { return base::StringPrintf("{" " url_ = \"%s\"" @@ -71,7 +72,7 @@ std::string DownloadCreateInfo::DebugString() const { " download_id = %d" " prompt_user_for_save_location = %c" " }", - url.spec().c_str(), + url().spec().c_str(), path.value().c_str(), received_bytes, total_bytes, @@ -81,3 +82,7 @@ std::string DownloadCreateInfo::DebugString() const { download_id, prompt_user_for_save_location ? 'T' : 'F'); } + +const GURL& DownloadCreateInfo::url() const { + return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); +} |