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

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

Issue 8401001: Fix history importing by delaying DownloadManager creation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix ifndefs Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Each download is represented by a DownloadItem, and all DownloadItems 5 // Each download is represented by a DownloadItem, and all DownloadItems
6 // are owned by the DownloadManager which maintains a global list of all 6 // are owned by the DownloadManager which maintains a global list of all
7 // downloads. DownloadItems are created when a user initiates a download, 7 // downloads. DownloadItems are created when a user initiates a download,
8 // and exist for the duration of the browser life time. 8 // and exist for the duration of the browser life time.
9 // 9 //
10 // Download observers: 10 // Download observers:
11 // DownloadItem::Observer: 11 // DownloadItem::Observer:
12 // - allows observers to receive notifications about one download from start 12 // - allows observers to receive notifications about one download from start
13 // to completion 13 // to completion
14 // Use AddObserver() / RemoveObserver() on the appropriate download object to 14 // Use AddObserver() / RemoveObserver() on the appropriate download object to
15 // receive state updates. 15 // receive state updates.
16 16
17 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ 17 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_
18 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ 18 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_
19 #pragma once 19 #pragma once
20 20
21 #include <string> 21 #include <string>
22 22
23 #include "base/basictypes.h" 23 #include "base/basictypes.h"
24 #include "base/file_path.h" 24 #include "base/file_path.h"
25 #include "base/observer_list.h" 25 #include "base/observer_list.h"
26 #include "base/time.h" 26 #include "base/time.h"
27 #include "base/timer.h" 27 #include "base/timer.h"
28 #include "content/browser/download/download_id.h"
28 #include "content/browser/download/download_request_handle.h" 29 #include "content/browser/download/download_request_handle.h"
29 #include "content/browser/download/download_state_info.h" 30 #include "content/browser/download/download_state_info.h"
30 #include "content/browser/download/interrupt_reasons.h" 31 #include "content/browser/download/interrupt_reasons.h"
31 #include "content/common/content_export.h" 32 #include "content/common/content_export.h"
32 #include "googleurl/src/gurl.h" 33 #include "googleurl/src/gurl.h"
33 #include "net/base/net_errors.h" 34 #include "net/base/net_errors.h"
34 35
35 class DownloadFileManager; 36 class DownloadFileManager;
36 class DownloadId; 37 class DownloadId;
37 class DownloadManager; 38 class DownloadManager;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 std::string suggested_filename() const { return suggested_filename_; } 271 std::string suggested_filename() const { return suggested_filename_; }
271 std::string content_disposition() const { return content_disposition_; } 272 std::string content_disposition() const { return content_disposition_; }
272 std::string mime_type() const { return mime_type_; } 273 std::string mime_type() const { return mime_type_; }
273 std::string original_mime_type() const { return original_mime_type_; } 274 std::string original_mime_type() const { return original_mime_type_; }
274 std::string referrer_charset() const { return referrer_charset_; } 275 std::string referrer_charset() const { return referrer_charset_; }
275 int64 total_bytes() const { return total_bytes_; } 276 int64 total_bytes() const { return total_bytes_; }
276 void set_total_bytes(int64 total_bytes) { 277 void set_total_bytes(int64 total_bytes) {
277 total_bytes_ = total_bytes; 278 total_bytes_ = total_bytes;
278 } 279 }
279 int64 received_bytes() const { return received_bytes_; } 280 int64 received_bytes() const { return received_bytes_; }
280 int32 id() const { return download_id_; } 281 int32 id() const { return download_id_.local(); }
281 DownloadId global_id() const; 282 DownloadId global_id() const { return download_id_; }
282 base::Time start_time() const { return start_time_; } 283 base::Time start_time() const { return start_time_; }
283 base::Time end_time() const { return end_time_; } 284 base::Time end_time() const { return end_time_; }
284 void set_db_handle(int64 handle) { db_handle_ = handle; } 285 void set_db_handle(int64 handle) { db_handle_ = handle; }
285 int64 db_handle() const { return db_handle_; } 286 int64 db_handle() const { return db_handle_; }
286 DownloadManager* download_manager() { return download_manager_; } 287 DownloadManager* download_manager() { return download_manager_; }
287 bool is_paused() const { return is_paused_; } 288 bool is_paused() const { return is_paused_; }
288 bool open_when_complete() const { return open_when_complete_; } 289 bool open_when_complete() const { return open_when_complete_; }
289 void set_open_when_complete(bool open) { open_when_complete_ = open; } 290 void set_open_when_complete(bool open) { open_when_complete_ = open; }
290 bool file_externally_removed() const { return file_externally_removed_; } 291 bool file_externally_removed() const { return file_externally_removed_; }
291 SafetyState safety_state() const { return safety_state_; } 292 SafetyState safety_state() const { return safety_state_; }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 void UpdateTarget(); 373 void UpdateTarget();
373 374
374 // State information used by the download manager. 375 // State information used by the download manager.
375 DownloadStateInfo state_info_; 376 DownloadStateInfo state_info_;
376 377
377 // The handle to the request information. Used for operations outside the 378 // The handle to the request information. Used for operations outside the
378 // download system. 379 // download system.
379 DownloadRequestHandle request_handle_; 380 DownloadRequestHandle request_handle_;
380 381
381 // Download ID assigned by DownloadResourceHandler. 382 // Download ID assigned by DownloadResourceHandler.
382 int32 download_id_; 383 DownloadId download_id_;
383 384
384 // Full path to the downloaded or downloading file. 385 // Full path to the downloaded or downloading file.
385 FilePath full_path_; 386 FilePath full_path_;
386 387
387 // A number that should be appended to the path to make it unique, or 0 if the 388 // A number that should be appended to the path to make it unique, or 0 if the
388 // path should be used as is. 389 // path should be used as is.
389 int path_uniquifier_; 390 int path_uniquifier_;
390 391
391 // The chain of redirects that leading up to and including the final URL. 392 // The chain of redirects that leading up to and including the final URL.
392 std::vector<GURL> url_chain_; 393 std::vector<GURL> url_chain_;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 // only. 485 // only.
485 bool open_enabled_; 486 bool open_enabled_;
486 487
487 // Did the delegate delay calling Complete on this download? 488 // Did the delegate delay calling Complete on this download?
488 bool delegate_delayed_complete_; 489 bool delegate_delayed_complete_;
489 490
490 DISALLOW_COPY_AND_ASSIGN(DownloadItem); 491 DISALLOW_COPY_AND_ASSIGN(DownloadItem);
491 }; 492 };
492 493
493 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ 494 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_id_unittest.cc ('k') | content/browser/download/download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698