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

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

Issue 7825035: Implement chrome.experimental.downloads.search() (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: comments Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 28 matching lines...) Expand all
39 #include "base/gtest_prod_util.h" 39 #include "base/gtest_prod_util.h"
40 #include "base/hash_tables.h" 40 #include "base/hash_tables.h"
41 #include "base/memory/ref_counted.h" 41 #include "base/memory/ref_counted.h"
42 #include "base/memory/scoped_ptr.h" 42 #include "base/memory/scoped_ptr.h"
43 #include "base/memory/weak_ptr.h" 43 #include "base/memory/weak_ptr.h"
44 #include "base/observer_list.h" 44 #include "base/observer_list.h"
45 #include "base/synchronization/lock.h" 45 #include "base/synchronization/lock.h"
46 #include "base/time.h" 46 #include "base/time.h"
47 #include "content/browser/browser_thread.h" 47 #include "content/browser/browser_thread.h"
48 #include "content/browser/download/download_item.h" 48 #include "content/browser/download/download_item.h"
49 #include "content/browser/download/download_query.h"
49 #include "content/browser/download/download_request_handle.h" 50 #include "content/browser/download/download_request_handle.h"
50 #include "content/browser/download/download_status_updater_delegate.h" 51 #include "content/browser/download/download_status_updater_delegate.h"
51 #include "content/browser/download/interrupt_reasons.h" 52 #include "content/browser/download/interrupt_reasons.h"
52 #include "content/common/content_export.h" 53 #include "content/common/content_export.h"
53 #include "net/base/net_errors.h" 54 #include "net/base/net_errors.h"
54 55
55 class DownloadFileManager; 56 class DownloadFileManager;
56 class DownloadManagerDelegate; 57 class DownloadManagerDelegate;
57 class DownloadStatusUpdater; 58 class DownloadStatusUpdater;
58 class GURL; 59 class GURL;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 101
101 typedef std::vector<DownloadItem*> DownloadVector; 102 typedef std::vector<DownloadItem*> DownloadVector;
102 103
103 // Return all temporary downloads that reside in the specified directory. 104 // Return all temporary downloads that reside in the specified directory.
104 void GetTemporaryDownloads(const FilePath& dir_path, DownloadVector* result); 105 void GetTemporaryDownloads(const FilePath& dir_path, DownloadVector* result);
105 106
106 // Return all non-temporary downloads in the specified directory that are 107 // Return all non-temporary downloads in the specified directory that are
107 // are in progress or have completed. 108 // are in progress or have completed.
108 void GetAllDownloads(const FilePath& dir_path, DownloadVector* result); 109 void GetAllDownloads(const FilePath& dir_path, DownloadVector* result);
109 110
111 // Fill |results| with the items that match |query|.
112 void Search(const download_util::DownloadQuery& query,
113 DownloadVector* results) const;
114
110 // Returns all non-temporary downloads matching |query|. Empty query matches 115 // Returns all non-temporary downloads matching |query|. Empty query matches
111 // everything. 116 // everything.
112 void SearchDownloads(const string16& query, DownloadVector* result); 117 void SearchDownloads(const string16& query, DownloadVector* result);
113 118
114 // Returns the next download id in a DownloadId and increments the counter. 119 // Returns the next download id in a DownloadId and increments the counter.
115 // May be called on any thread. The incremented counter is not persisted, but 120 // May be called on any thread. The incremented counter is not persisted, but
116 // the base counter for this accessor is initialized from the largest id 121 // the base counter for this accessor is initialized from the largest id
117 // actually saved to the download history database. 122 // actually saved to the download history database.
118 DownloadId GetNextId(); 123 DownloadId GetNextId();
119 124
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 DownloadManagerDelegate* delegate_; 436 DownloadManagerDelegate* delegate_;
432 437
433 // TODO(rdsmith): Remove when http://crbug.com/85408 is fixed. 438 // TODO(rdsmith): Remove when http://crbug.com/85408 is fixed.
434 // For debugging only. 439 // For debugging only.
435 int64 largest_db_handle_in_history_; 440 int64 largest_db_handle_in_history_;
436 441
437 DISALLOW_COPY_AND_ASSIGN(DownloadManager); 442 DISALLOW_COPY_AND_ASSIGN(DownloadManager);
438 }; 443 };
439 444
440 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ 445 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698