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

Side by Side Diff: chrome/browser/download/download_manager.h

Issue 2805091: Download code cleanup: (Closed)
Patch Set: rebased Created 10 years, 5 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 profile in Chrome. 8 // active profile in Chrome.
9 // 9 //
10 // Download observers: 10 // Download observers:
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 // Called when the user has validated the donwload of a dangerous file. 239 // Called when the user has validated the donwload of a dangerous file.
240 void DangerousDownloadValidated(DownloadItem* download); 240 void DangerousDownloadValidated(DownloadItem* download);
241 241
242 // Used to make sure we have a safe file extension and filename for a 242 // Used to make sure we have a safe file extension and filename for a
243 // download. |file_name| can either be just the file name or it can be a 243 // download. |file_name| can either be just the file name or it can be a
244 // full path to a file. 244 // full path to a file.
245 static void GenerateSafeFileName(const std::string& mime_type, 245 static void GenerateSafeFileName(const std::string& mime_type,
246 FilePath* file_name); 246 FilePath* file_name);
247 247
248 // Runs the network cancel. Must be called on the IO thread.
249 static void OnCancelDownloadRequest(ResourceDispatcherHost* rdh,
250 int render_process_id,
251 int request_id);
252
253 // Create a file name based on the response from the server. 248 // Create a file name based on the response from the server.
254 static void GenerateFileName(const GURL& url, 249 static void GenerateFileName(const GURL& url,
255 const std::string& content_disposition, 250 const std::string& content_disposition,
256 const std::string& referrer_charset, 251 const std::string& referrer_charset,
257 const std::string& mime_type, 252 const std::string& mime_type,
258 FilePath* generated_name); 253 FilePath* generated_name);
259 254
260 private: 255 private:
261 class FakeDbHandleGenerator { 256 class FakeDbHandleGenerator {
262 public: 257 public:
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 // Downloads are expected to have unique handles, so FakeDbHandleGenerator 459 // Downloads are expected to have unique handles, so FakeDbHandleGenerator
465 // automatically decrement the handle value on every use. 460 // automatically decrement the handle value on every use.
466 FakeDbHandleGenerator fake_db_handle_; 461 FakeDbHandleGenerator fake_db_handle_;
467 462
468 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; 463 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_;
469 464
470 DISALLOW_COPY_AND_ASSIGN(DownloadManager); 465 DISALLOW_COPY_AND_ASSIGN(DownloadManager);
471 }; 466 };
472 467
473 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ 468 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_file_manager.cc ('k') | chrome/browser/download/download_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698