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

Side by Side Diff: content/public/browser/download_manager.h

Issue 2860593003: Refactoring DownloadManager::DownloadURL to add proper annotation. (Closed)
Patch Set: Comment addressed. Created 3 years, 6 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
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 // The DownloadManager object manages the process of downloading, including 5 // The DownloadManager object manages the process of downloading, including
6 // updates to the history system and providing the information for displaying 6 // updates to the history system and providing the information for displaying
7 // the downloads view in the Destinations tab. There is one DownloadManager per 7 // the downloads view in the Destinations tab. There is one DownloadManager per
8 // active browser context in Chrome. 8 // active browser context in Chrome.
9 // 9 //
10 // Download observers: 10 // Download observers:
(...skipping 22 matching lines...) Expand all
33 #include <vector> 33 #include <vector>
34 34
35 #include "base/callback.h" 35 #include "base/callback.h"
36 #include "base/files/file_path.h" 36 #include "base/files/file_path.h"
37 #include "base/sequenced_task_runner_helpers.h" 37 #include "base/sequenced_task_runner_helpers.h"
38 #include "base/time/time.h" 38 #include "base/time/time.h"
39 #include "content/public/browser/download_interrupt_reasons.h" 39 #include "content/public/browser/download_interrupt_reasons.h"
40 #include "content/public/browser/download_item.h" 40 #include "content/public/browser/download_item.h"
41 #include "content/public/browser/download_url_parameters.h" 41 #include "content/public/browser/download_url_parameters.h"
42 #include "net/base/net_errors.h" 42 #include "net/base/net_errors.h"
43 #include "net/traffic_annotation/network_traffic_annotation.h"
43 44
44 class GURL; 45 class GURL;
45 46
46 namespace content { 47 namespace content {
47 48
48 class BrowserContext; 49 class BrowserContext;
49 class ByteStreamReader; 50 class ByteStreamReader;
50 class DownloadManagerDelegate; 51 class DownloadManagerDelegate;
51 struct DownloadCreateInfo; 52 struct DownloadCreateInfo;
52 53
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // the given time constraints - after remove_begin (inclusive) and before 115 // the given time constraints - after remove_begin (inclusive) and before
115 // remove_end (exclusive). You may pass in null Time values to do an unbounded 116 // remove_end (exclusive). You may pass in null Time values to do an unbounded
116 // delete in either direction. 117 // delete in either direction.
117 virtual int RemoveDownloadsByURLAndTime( 118 virtual int RemoveDownloadsByURLAndTime(
118 const base::Callback<bool(const GURL&)>& url_filter, 119 const base::Callback<bool(const GURL&)>& url_filter,
119 base::Time remove_begin, 120 base::Time remove_begin,
120 base::Time remove_end) = 0; 121 base::Time remove_end) = 0;
121 122
122 // See DownloadUrlParameters for details about controlling the download. 123 // See DownloadUrlParameters for details about controlling the download.
123 virtual void DownloadUrl( 124 virtual void DownloadUrl(
124 std::unique_ptr<DownloadUrlParameters> parameters) = 0; 125 std::unique_ptr<DownloadUrlParameters> parameters,
126 const net::NetworkTrafficAnnotationTag& traffic_annotation) = 0;
125 127
126 // Allow objects to observe the download creation process. 128 // Allow objects to observe the download creation process.
127 virtual void AddObserver(Observer* observer) = 0; 129 virtual void AddObserver(Observer* observer) = 0;
128 130
129 // Remove a download observer from ourself. 131 // Remove a download observer from ourself.
130 virtual void RemoveObserver(Observer* observer) = 0; 132 virtual void RemoveObserver(Observer* observer) = 0;
131 133
132 // Called by the embedder, after creating the download manager, to let it know 134 // Called by the embedder, after creating the download manager, to let it know
133 // about downloads from previous runs of the browser. 135 // about downloads from previous runs of the browser.
134 virtual DownloadItem* CreateDownloadItem( 136 virtual DownloadItem* CreateDownloadItem(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // if you need to keep track of a specific download. (http://crbug.com/593020) 191 // if you need to keep track of a specific download. (http://crbug.com/593020)
190 virtual DownloadItem* GetDownload(uint32_t id) = 0; 192 virtual DownloadItem* GetDownload(uint32_t id) = 0;
191 193
192 // Get the download item for |guid|. 194 // Get the download item for |guid|.
193 virtual DownloadItem* GetDownloadByGuid(const std::string& guid) = 0; 195 virtual DownloadItem* GetDownloadByGuid(const std::string& guid) = 0;
194 }; 196 };
195 197
196 } // namespace content 198 } // namespace content
197 199
198 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ 200 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/public/test/mock_download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698