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

Unified Diff: content/browser/download/download_item_impl.h

Issue 9121053: Added net logging to DownloadItem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk 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: content/browser/download/download_item_impl.h
diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h
index c3d31194af18f77940b72b1a2d80afaaca7890d5..60c12932ec8754512d24bea4fdc8d69c462befcc 100644
--- a/content/browser/download/download_item_impl.h
+++ b/content/browser/download/download_item_impl.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -14,12 +14,14 @@
#include "base/observer_list.h"
#include "base/time.h"
#include "base/timer.h"
+#include "content/browser/download/download_net_log_parameters.h"
#include "content/browser/download/download_request_handle.h"
#include "content/common/content_export.h"
#include "content/public/browser/download_id.h"
#include "content/public/browser/download_item.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
+#include "net/base/net_log.h"
// See download_item.h for usage.
@@ -83,10 +85,13 @@ class CONTENT_EXPORT DownloadItemImpl : public content::DownloadItem {
// Constructing from persistent store:
DownloadItemImpl(Delegate* delegate,
content::DownloadId download_id,
- const DownloadPersistentStoreInfo& info);
+ const DownloadPersistentStoreInfo& info,
+ net::NetLog* net_log);
// Constructing for a regular download.
// Takes ownership of the object pointed to by |request_handle|.
+ // The |BoundNetLog| for this case is passed in via |info|, as it is
+ // constructed earlier in the download sequence.
Randy Smith (Not in Mondays) 2012/02/06 22:34:59 This comment seems misleading in context (neither
ahendrickson 2012/02/07 00:16:19 Done.
DownloadItemImpl(Delegate* delegate,
const DownloadCreateInfo& info,
DownloadRequestHandleInterface* request_handle,
@@ -97,7 +102,8 @@ class CONTENT_EXPORT DownloadItemImpl : public content::DownloadItem {
const FilePath& path,
const GURL& url,
bool is_otr,
- content::DownloadId download_id);
+ content::DownloadId download_id,
+ net::NetLog* net_log);
virtual ~DownloadItemImpl();
@@ -204,7 +210,9 @@ class CONTENT_EXPORT DownloadItemImpl : public content::DownloadItem {
private:
// Construction common to all constructors. |active| should be true for new
// downloads and false for downloads from the history.
- void Init(bool active);
+ // |download_type| indicates to the net log system what kind of download
+ // this is.
+ void Init(bool active, download_net_logs::DownloadType download_type);
// Internal helper for maintaining consistent received and total sizes, and
// hash state.
@@ -371,6 +379,9 @@ class CONTENT_EXPORT DownloadItemImpl : public content::DownloadItem {
// are owned by the DownloadItemImpl.
std::map<const void*, ExternalData*> external_data_map_;
+ // Net log to use for this download.
+ const net::BoundNetLog bound_net_log_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl);
};

Powered by Google App Engine
This is Rietveld 408576698