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

Side by Side Diff: content/browser/download/download_item_impl.h

Issue 10833058: Make DownloadItem derive SupportsUserData instead of re-implementing it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gdata: "external"->"user" Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 virtual content::DownloadInterruptReason GetLastReason() const OVERRIDE; 188 virtual content::DownloadInterruptReason GetLastReason() const OVERRIDE;
189 virtual content::DownloadPersistentStoreInfo 189 virtual content::DownloadPersistentStoreInfo
190 GetPersistentStoreInfo() const OVERRIDE; 190 GetPersistentStoreInfo() const OVERRIDE;
191 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; 191 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE;
192 virtual content::WebContents* GetWebContents() const OVERRIDE; 192 virtual content::WebContents* GetWebContents() const OVERRIDE;
193 virtual FilePath GetFileNameToReportUser() const OVERRIDE; 193 virtual FilePath GetFileNameToReportUser() const OVERRIDE;
194 virtual void SetDisplayName(const FilePath& name) OVERRIDE; 194 virtual void SetDisplayName(const FilePath& name) OVERRIDE;
195 virtual FilePath GetUserVerifiedFilePath() const OVERRIDE; 195 virtual FilePath GetUserVerifiedFilePath() const OVERRIDE;
196 virtual std::string DebugString(bool verbose) const OVERRIDE; 196 virtual std::string DebugString(bool verbose) const OVERRIDE;
197 virtual void MockDownloadOpenForTesting() OVERRIDE; 197 virtual void MockDownloadOpenForTesting() OVERRIDE;
198 virtual ExternalData* GetExternalData(const void* key) OVERRIDE;
199 virtual const ExternalData* GetExternalData(const void* key) const OVERRIDE;
200 virtual void SetExternalData(const void* key, ExternalData* data) OVERRIDE;
201 198
202 private: 199 private:
203 // Construction common to all constructors. |active| should be true for new 200 // Construction common to all constructors. |active| should be true for new
204 // downloads and false for downloads from the history. 201 // downloads and false for downloads from the history.
205 // |download_type| indicates to the net log system what kind of download 202 // |download_type| indicates to the net log system what kind of download
206 // this is. 203 // this is.
207 void Init(bool active, download_net_logs::DownloadType download_type); 204 void Init(bool active, download_net_logs::DownloadType download_type);
208 205
209 // Returns true if the download still needs to be renamed to 206 // Returns true if the download still needs to be renamed to
210 // GetTargetFilePath(). 207 // GetTargetFilePath().
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // when the user closes the shelf before the item has been opened but should 394 // when the user closes the shelf before the item has been opened but should
398 // be treated as though the user opened it. 395 // be treated as though the user opened it.
399 bool opened_; 396 bool opened_;
400 397
401 // Do we actually open downloads when requested? For testing purposes only. 398 // Do we actually open downloads when requested? For testing purposes only.
402 bool open_enabled_; 399 bool open_enabled_;
403 400
404 // Did the delegate delay calling Complete on this download? 401 // Did the delegate delay calling Complete on this download?
405 bool delegate_delayed_complete_; 402 bool delegate_delayed_complete_;
406 403
407 // External Data storage. All objects in the store
408 // are owned by the DownloadItemImpl.
409 std::map<const void*, ExternalData*> external_data_map_;
410
411 // Net log to use for this download. 404 // Net log to use for this download.
412 const net::BoundNetLog bound_net_log_; 405 const net::BoundNetLog bound_net_log_;
413 406
414 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; 407 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_;
415 408
416 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); 409 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl);
417 }; 410 };
418 411
419 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 412 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_installer.cc ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698