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

Unified Diff: content/browser/download/download_manager_impl.cc

Issue 10069014: Save Page As MHTML (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: non-cros works Created 8 years, 8 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: content/browser/download/download_manager_impl.cc
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index 9bdb48aa7bfbe2382d1e3b34056dbf0f6c79d308..9d67769fc6d271b020880251f2a08d7939a13e49 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -444,11 +444,18 @@ DownloadItem* DownloadManagerImpl::CreateSavePackageDownloadItem(
const FilePath& main_file_path,
const GURL& page_url,
bool is_otr,
+ const std::string& mime_type,
DownloadItem::Observer* observer) {
net::BoundNetLog bound_net_log =
net::BoundNetLog::Make(net_log_, net::NetLog::SOURCE_DOWNLOAD);
DownloadItem* download = new DownloadItemImpl(
- this, main_file_path, page_url, is_otr, GetNextId(), bound_net_log);
+ this,
+ main_file_path,
+ page_url,
+ is_otr,
+ GetNextId(),
+ mime_type,
+ bound_net_log);
download->AddObserver(observer);
@@ -594,6 +601,10 @@ void DownloadManagerImpl::AssertStateConsistent(DownloadItem* download) const {
}
bool DownloadManagerImpl::IsDownloadReadyForCompletion(DownloadItem* download) {
asanka 2012/04/26 16:06:20 MaybeCompleteDownload() requires that the download
asanka 2012/04/26 16:06:20 Also add a DCHECK() here to verify that a completi
asanka 2012/04/26 16:11:28 I'm referring to the additional UpdateObsevers() i
benjhayden 2012/04/26 16:33:36 You're suggesting that SavePackage not go through
asanka 2012/04/26 18:15:25 I was actually under the impression that you were
benjhayden 2012/04/26 19:00:48 Ah, nope, sorry. The fact that MaybeCompleteDownlo
asanka 2012/04/26 19:20:26 Thanks! A short note in GDataDownloadObserver::On
benjhayden 2012/04/26 20:09:30 PTAL, Thanks!
+ VLOG(20) << __FUNCTION__ << " all_data_saved=" << download->AllDataSaved()
+ << " safety=" << download->GetSafetyState()
+ << " active=" << (active_downloads_.count(download->GetId()) == 0)
+ << " persisted=" << download->IsPersisted();
// If we don't have all the data, the download is not ready for
// completion.
if (!download->AllDataSaved())

Powered by Google App Engine
This is Rietveld 408576698