Removing files that failed to be removed in a previous commit.


BUG=None
TEST=None


Review URL: http://codereview.chromium.org/6966018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86636 0039d316-1c4b-4281-b951-d872f2087c98
parent e4c7744e
// 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.
#include "chrome/browser/history/download_create_info.h"
#include <string>
#include "base/format_macros.h"
#include "base/stringprintf.h"
DownloadCreateInfo::DownloadCreateInfo(const FilePath& path,
const GURL& url,
base::Time start_time,
int64 received_bytes,
int64 total_bytes,
int32 state,
int32 download_id,
bool has_user_gesture)
: path(path),
url_chain(1, url),
path_uniquifier(0),
start_time(start_time),
received_bytes(received_bytes),
total_bytes(total_bytes),
state(state),
download_id(download_id),
has_user_gesture(has_user_gesture),
db_handle(0),
prompt_user_for_save_location(false),
is_dangerous_file(false),
is_dangerous_url(false),
is_extension_install(false) {
}
DownloadCreateInfo::DownloadCreateInfo()
: path_uniquifier(0),
received_bytes(0),
total_bytes(0),
state(-1),
download_id(-1),
has_user_gesture(false),
db_handle(0),
prompt_user_for_save_location(false),
is_dangerous_file(false),
is_dangerous_url(false),
is_extension_install(false) {
}
DownloadCreateInfo::~DownloadCreateInfo() {
}
bool DownloadCreateInfo::IsDangerous() {
return is_dangerous_url || is_dangerous_file;
}
std::string DownloadCreateInfo::DebugString() const {
return base::StringPrintf("{"
" download_id = %d"
" url = \"%s\""
" path = \"%" PRFilePath "\""
" received_bytes = %" PRId64
" total_bytes = %" PRId64
" child_id = %d"
" render_view_id = %d"
" request_id = %d"
" prompt_user_for_save_location = %c"
" }",
download_id,
url().spec().c_str(),
path.value().c_str(),
received_bytes,
total_bytes,
process_handle.child_id(),
process_handle.render_view_id(),
process_handle.request_id(),
prompt_user_for_save_location ? 'T' : 'F');
}
const GURL& DownloadCreateInfo::url() const {
return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back();
}
// 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.
//
// Download creation struct used for querying the history service.
#ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_
#define CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_
#pragma once
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/time.h"
#include "chrome/browser/download/download_file.h"
#include "chrome/browser/download/download_process_handle.h"
#include "googleurl/src/gurl.h"
// Used for informing the download database of a new download, where we don't
// want to pass DownloadItems between threads. The history service also uses a
// vector of these structs for passing us the state of all downloads at
// initialization time (see DownloadQueryInfo below).
struct DownloadCreateInfo {
DownloadCreateInfo(const FilePath& path,
const GURL& url,
base::Time start_time,
int64 received_bytes,
int64 total_bytes,
int32 state,
int32 download_id,
bool has_user_gesture);
DownloadCreateInfo();
~DownloadCreateInfo();
// Indicates if the download is dangerous.
bool IsDangerous();
std::string DebugString() const;
// The URL from which we are downloading. This is the final URL after any
// redirection by the server for |url_chain|.
const GURL& url() const;
// DownloadItem fields
FilePath path;
// The chain of redirects that leading up to and including the final URL.
std::vector<GURL> url_chain;
GURL referrer_url;
FilePath suggested_path;
// A number that should be added to the suggested path to make it unique.
// 0 means no number should be appended. Not actually stored in the db.
int path_uniquifier;
base::Time start_time;
int64 received_bytes;
int64 total_bytes;
int32 state;
int32 download_id;
bool has_user_gesture;
DownloadProcessHandle process_handle;
int64 db_handle;
std::string content_disposition;
std::string mime_type;
// The value of the content type header sent with the downloaded item. It
// may be different from |mime_type|, which may be set based on heuristics
// which may look at the file extension and first few bytes of the file.
std::string original_mime_type;
// True if we should display the 'save as...' UI and prompt the user
// for the download location.
// False if the UI should be supressed and the download performed to the
// default location.
bool prompt_user_for_save_location;
// Whether this download file is potentially dangerous (ex: exe, dll, ...).
bool is_dangerous_file;
// If safebrowsing believes this URL leads to malware.
bool is_dangerous_url;
// The original name for a dangerous download.
FilePath original_name;
// Whether this download is for extension install or not.
bool is_extension_install;
// The charset of the referring page where the download request comes from.
// It's used to construct a suggested filename.
std::string referrer_charset;
// The download file save info.
DownloadSaveInfo save_info;
};
#endif // CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment