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

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

Issue 114193009: [Download] Return DownloadInterruptReason from OnStartedCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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"
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "base/timer/timer.h" 17 #include "base/timer/timer.h"
18 #include "content/browser/download/download_net_log_parameters.h" 18 #include "content/browser/download/download_net_log_parameters.h"
19 #include "content/browser/download/download_request_handle.h" 19 #include "content/browser/download/download_request_handle.h"
20 #include "content/common/content_export.h" 20 #include "content/common/content_export.h"
21 #include "content/public/browser/download_destination_observer.h" 21 #include "content/public/browser/download_destination_observer.h"
22 #include "content/public/browser/download_interrupt_reasons.h"
22 #include "content/public/browser/download_item.h" 23 #include "content/public/browser/download_item.h"
23 #include "net/base/net_errors.h"
24 #include "net/base/net_log.h" 24 #include "net/base/net_log.h"
25 #include "url/gurl.h" 25 #include "url/gurl.h"
26 26
27 namespace content { 27 namespace content {
28 class DownloadFile; 28 class DownloadFile;
29 class DownloadItemImplDelegate; 29 class DownloadItemImplDelegate;
30 30
31 // See download_item.h for usage. 31 // See download_item.h for usage.
32 class CONTENT_EXPORT DownloadItemImpl 32 class CONTENT_EXPORT DownloadItemImpl
33 : public DownloadItem, 33 : public DownloadItem,
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 // Called if the embedder took over opening a download, to indicate that 334 // Called if the embedder took over opening a download, to indicate that
335 // the download has been opened. 335 // the download has been opened.
336 void DelayedDownloadOpened(bool auto_opened); 336 void DelayedDownloadOpened(bool auto_opened);
337 337
338 // Called when the entire download operation (including renaming etc) 338 // Called when the entire download operation (including renaming etc)
339 // is completed. 339 // is completed.
340 void Completed(); 340 void Completed();
341 341
342 // Callback invoked when the URLRequest for a download resumption has started. 342 // Callback invoked when the URLRequest for a download resumption has started.
343 void OnResumeRequestStarted(DownloadItem* item, net::Error error); 343 void OnResumeRequestStarted(DownloadItem* item,
344 DownloadInterruptReason interrupt_reason);
344 345
345 // Helper routines ----------------------------------------------------------- 346 // Helper routines -----------------------------------------------------------
346 347
347 // Indicate that an error has occurred on the download. 348 // Indicate that an error has occurred on the download.
348 void Interrupt(DownloadInterruptReason reason); 349 void Interrupt(DownloadInterruptReason reason);
349 350
350 // Destroy the DownloadFile object. If |destroy_file| is true, the file is 351 // Destroy the DownloadFile object. If |destroy_file| is true, the file is
351 // destroyed with it. Otherwise, DownloadFile::Detach() is called before 352 // destroyed with it. Otherwise, DownloadFile::Detach() is called before
352 // object destruction to prevent file destruction. Destroying the file also 353 // object destruction to prevent file destruction. Destroying the file also
353 // resets |current_path_|. 354 // resets |current_path_|.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 const net::BoundNetLog bound_net_log_; 543 const net::BoundNetLog bound_net_log_;
543 544
544 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; 545 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_;
545 546
546 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); 547 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl);
547 }; 548 };
548 549
549 } // namespace content 550 } // namespace content
550 551
551 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 552 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_interrupt_reasons_impl.cc ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698