OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_DOWNLOAD_METADATA_MANAGE
R_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_DOWNLOAD_METADATA_MANAGE
R_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_DOWNLOAD_METADATA_MANAGE
R_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_DOWNLOAD_METADATA_MANAGE
R_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class ClientIncidentReport_DownloadDetails; | 28 class ClientIncidentReport_DownloadDetails; |
29 class DownloadMetadata; | 29 class DownloadMetadata; |
30 | 30 |
31 // A browser-wide object that manages the persistent state of metadata | 31 // A browser-wide object that manages the persistent state of metadata |
32 // pertaining to a download. | 32 // pertaining to a download. |
33 class DownloadMetadataManager : public content::DownloadManager::Observer { | 33 class DownloadMetadataManager : public content::DownloadManager::Observer { |
34 public: | 34 public: |
35 // A callback run when the results of a call to GetDownloadDetails are ready. | 35 // A callback run when the results of a call to GetDownloadDetails are ready. |
36 // The supplied parameter may be null, indicating that there are no persisted | 36 // The supplied parameter may be null, indicating that there are no persisted |
37 // details for the |browser_context| passed to GetDownloadDetails. | 37 // details for the |browser_context| passed to GetDownloadDetails. |
38 typedef base::Callback<void(scoped_ptr<ClientIncidentReport_DownloadDetails>)> | 38 typedef base::Callback<void( |
| 39 std::unique_ptr<ClientIncidentReport_DownloadDetails>)> |
39 GetDownloadDetailsCallback; | 40 GetDownloadDetailsCallback; |
40 | 41 |
41 // Constructs a new instance for which disk IO operations will take place in | 42 // Constructs a new instance for which disk IO operations will take place in |
42 // |worker_pool|. | 43 // |worker_pool|. |
43 explicit DownloadMetadataManager( | 44 explicit DownloadMetadataManager( |
44 const scoped_refptr<base::SequencedWorkerPool>& worker_pool); | 45 const scoped_refptr<base::SequencedWorkerPool>& worker_pool); |
45 | 46 |
46 // Constructor that allows tests to provide a specific runner for | 47 // Constructor that allows tests to provide a specific runner for |
47 // asynchronous tasks. | 48 // asynchronous tasks. |
48 explicit DownloadMetadataManager( | 49 explicit DownloadMetadataManager( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Contexts for each DownloadManager that has been added and has not yet | 91 // Contexts for each DownloadManager that has been added and has not yet |
91 // "gone down". | 92 // "gone down". |
92 ManagerToContextMap contexts_; | 93 ManagerToContextMap contexts_; |
93 | 94 |
94 DISALLOW_COPY_AND_ASSIGN(DownloadMetadataManager); | 95 DISALLOW_COPY_AND_ASSIGN(DownloadMetadataManager); |
95 }; | 96 }; |
96 | 97 |
97 } // namespace safe_browsing | 98 } // namespace safe_browsing |
98 | 99 |
99 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_DOWNLOAD_METADATA_MAN
AGER_H_ | 100 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_DOWNLOAD_METADATA_MAN
AGER_H_ |
OLD | NEW |