OLD | NEW |
---|---|
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 #include "content/browser/download/download_item_impl_delegate.h" | |
6 | |
5 #include "base/logging.h" | 7 #include "base/logging.h" |
6 #include "content/browser/download/download_item_impl_delegate.h" | |
7 | 8 |
8 class DownloadItemImpl; | 9 class DownloadItemImpl; |
9 | 10 |
10 // Infrastructure in DownloadItemImplDelegate to assert invariant that | 11 // Infrastructure in DownloadItemImplDelegate to assert invariant that |
11 // delegate always outlives all attached DownloadItemImpls. | 12 // delegate always outlives all attached DownloadItemImpls. |
12 DownloadItemImplDelegate::DownloadItemImplDelegate() | 13 DownloadItemImplDelegate::DownloadItemImplDelegate() |
13 : count_(0) {} | 14 : count_(0) {} |
14 | 15 |
15 DownloadItemImplDelegate::~DownloadItemImplDelegate() { | 16 DownloadItemImplDelegate::~DownloadItemImplDelegate() { |
16 DCHECK_EQ(0, count_); | 17 DCHECK_EQ(0, count_); |
17 } | 18 } |
18 | 19 |
19 void DownloadItemImplDelegate::Attach() { | 20 void DownloadItemImplDelegate::Attach() { |
20 ++count_; | 21 ++count_; |
21 } | 22 } |
22 | 23 |
23 void DownloadItemImplDelegate::Detach() { | 24 void DownloadItemImplDelegate::Detach() { |
24 DCHECK_LT(0, count_); | 25 DCHECK_LT(0, count_); |
25 --count_; | 26 --count_; |
26 } | 27 } |
27 | 28 |
29 void DownloadItemImplDelegate::DelegateStart( | |
30 DownloadItemImpl* download_item) {} | |
asanka
2012/09/24 20:43:53
I know this is perfectly legitimate C++, but why p
Randy Smith (Not in Mondays)
2012/09/26 21:01:05
Fair point, but mooted by your other comment about
| |
31 | |
32 bool DownloadItemImplDelegate::ShouldOpenDownload(DownloadItemImpl* download) { | |
33 return false; | |
34 } | |
35 | |
28 bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension( | 36 bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension( |
29 const FilePath& path) { | 37 const FilePath& path) { |
30 return false; | 38 return false; |
31 } | 39 } |
32 | 40 |
33 bool DownloadItemImplDelegate::ShouldOpenDownload(DownloadItemImpl* download) { | |
34 return false; | |
35 } | |
36 | |
37 void DownloadItemImplDelegate::CheckForFileRemoval( | 41 void DownloadItemImplDelegate::CheckForFileRemoval( |
38 DownloadItemImpl* download_item) {} | 42 DownloadItemImpl* download_item) {} |
39 | 43 |
40 void DownloadItemImplDelegate::MaybeCompleteDownload( | 44 void DownloadItemImplDelegate::MaybeCompleteDownload( |
41 DownloadItemImpl* download) {} | 45 DownloadItemImpl* download) {} |
42 | 46 |
43 content::BrowserContext* DownloadItemImplDelegate::GetBrowserContext() const { | 47 content::BrowserContext* DownloadItemImplDelegate::GetBrowserContext() const { |
44 return NULL; | 48 return NULL; |
45 } | 49 } |
46 | 50 |
(...skipping 10 matching lines...) Expand all Loading... | |
57 void DownloadItemImplDelegate::DownloadRemoved(DownloadItemImpl* download) {} | 61 void DownloadItemImplDelegate::DownloadRemoved(DownloadItemImpl* download) {} |
58 | 62 |
59 void DownloadItemImplDelegate::DownloadRenamedToIntermediateName( | 63 void DownloadItemImplDelegate::DownloadRenamedToIntermediateName( |
60 DownloadItemImpl* download) {} | 64 DownloadItemImpl* download) {} |
61 | 65 |
62 void DownloadItemImplDelegate::DownloadRenamedToFinalName( | 66 void DownloadItemImplDelegate::DownloadRenamedToFinalName( |
63 DownloadItemImpl* download) {} | 67 DownloadItemImpl* download) {} |
64 | 68 |
65 void DownloadItemImplDelegate::AssertStateConsistent( | 69 void DownloadItemImplDelegate::AssertStateConsistent( |
66 DownloadItemImpl* download) const {} | 70 DownloadItemImpl* download) const {} |
OLD | NEW |