summaryrefslogtreecommitdiffstats
path: root/content/browser/download
Commit message (Collapse)AuthorAgeFilesLines
* Removed progress timer from DownloadItembenwells@chromium.org2011-11-082-32/+0
| | | | | | | | | | | | | | | | | | | This timer is redundant - all state changes which need to be updated immediately call UpdateObservers directly, and there is already a central timer in the download file manager which updates progress. Testing has been done manually to ensure the download shelf and the downloads UI get updated properly when downloading items. Also unit testing has been added for DownloadItem's public interface to check that state-changing functions generate notifications. BUG=None TEST=See above. Review URL: http://codereview.chromium.org/8463003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108947 0039d316-1c4b-4281-b951-d872f2087c98
* Check request handle existence in MatchQuery.rdsmith@chromium.org2011-11-041-1/+2
| | | | | | | | | | | | | Request_handles are null in DownloadItems generated from the history; any methods that may be called on such download items need to work with null request handles. BUG=102933 Review URL: http://codereview.chromium.org/8465001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108653 0039d316-1c4b-4281-b951-d872f2087c98
* Add unit tests for DownloadItem notification generation.benwells@chromium.org2011-11-031-1/+2
| | | | | | | | | | BUG=None TEST=Unit tests added. Review URL: http://codereview.chromium.org/8425004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108424 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed a bug where Linux users couldn't download to NTFS file systems.ahendrickson@chromium.org2011-11-031-4/+7
| | | | | | | | | | | | | | | The problem is that chmod() fails on NTFS and FAT file systems. That should not cause the download to fail. The bug was introduced in r99579 (Chrome 15). I tested it with the previous revision and that one, to verify that as the point where the bug first showed up. BUG=50104,102200 TEST=Download a file on Ubuntu, to an NTFS disk. Review URL: http://codereview.chromium.org/8438048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108380 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a webstorePrivate method for silently installing extensions.jstritar@chromium.org2011-11-021-1/+0
| | | | | | | | | | BUG=98687 TEST=*WebstorePrivate* Review URL: http://codereview.chromium.org/8430033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108367 0039d316-1c4b-4281-b951-d872f2087c98
* First pass at some Downloads UMA to get a handle on downloads performance.rdsmith@chromium.org2011-11-025-1/+48
| | | | | | | | | BUG=None Review URL: http://codereview.chromium.org/8135032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108309 0039d316-1c4b-4281-b951-d872f2087c98
* Move BrowserThread to content namespace.joi@chromium.org2011-11-0220-7/+39
| | | | | | | | | TBR=owners BUG=98716 Review URL: http://codereview.chromium.org/8437002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108270 0039d316-1c4b-4281-b951-d872f2087c98
* Use a DownloadRequestHandle pointer in construction to allow mocking for tests.rdsmith@chromium.org2011-11-018-38/+68
| | | | | | | | | BUG=101214 Review URL: http://codereview.chromium.org/8399001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108149 0039d316-1c4b-4281-b951-d872f2087c98
* Rearrange Should*Download delegate calls to be more useful and intuitive.rdsmith@chromium.org2011-11-015-10/+13
| | | | | | | | | | | | This involves killing the code in ShouldOpenDownload (vestigal), renaming ShouldCompleteDownload to ShouldOpenDownload, and creating a new ShouldCompleteDownload delegate method to allow blocking download completion before final rename. Review URL: http://codereview.chromium.org/8414007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108141 0039d316-1c4b-4281-b951-d872f2087c98
* Switch content tests to use BrowserThreadImpl directly.joi@chromium.org2011-10-314-9/+17
| | | | | | | | | BUG=98716 Review URL: http://codereview.chromium.org/8400060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107964 0039d316-1c4b-4281-b951-d872f2087c98
* Fix history importing by delaying DownloadManager creation. Replace ↵benjhayden@chromium.org2011-10-2918-103/+131
| | | | | | | | | | | | | | | | | | | | GetNextIdThunkType with DownloadIdFactory (RefCountedThreadSafe, created by DownloadService). DownloadService uses the same DownloadIdFactory for an OTR profile as its original profile. DownloadService passes the DownloadIdFactory into the DownloadManager so that the DownloadManager can allocate new valid ids for items loaded from the history or downloads started on the ui thread. Since the DownloadService precedes and outlives its DownloadManager, DownloadManager does not have a scoped_refptr<DownloadIdFactory>. Objects that do have a scoped_refptr<DownloadIdFactory>: DownloadService, ProfileIOData, ShellBrowserContext, ShellResourceContext. The DownloadIdFactory must be RefCountedThreadSafe because ProfileIOData outlives Profile and because it's used in both the OTR and original profiles. Longer term, the import process should strictly precede profile initialization, and the next_download_id counter should be loaded from the History db strictly before DownloadService is created and creates a DownloadIdFactory. BUG=98966 Review URL: http://codereview.chromium.org/8401001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107836 0039d316-1c4b-4281-b951-d872f2087c98
* Replace NewRunnable with Callback in DownloadManager.achuith@chromium.org2011-10-281-43/+46
| | | | | | | | BUG=chromium-os:22024 TEST=compiles, tests pass. Review URL: http://codereview.chromium.org/8417009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107802 0039d316-1c4b-4281-b951-d872f2087c98
* Replace NewRunnableMethod with Callback in DownloadResourceHandler.achuith@chromium.org2011-10-281-13/+7
| | | | | | | | BUG=chromium-os:22024 TEST=compiles, tests pass. Review URL: http://codereview.chromium.org/8343042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107788 0039d316-1c4b-4281-b951-d872f2087c98
* Replace NewRunnableMethod with Callback in DownloadFileManager.achuith@chromium.org2011-10-281-45/+32
| | | | | | | | BUG=chromium-os:22024 TEST=compiles, tests pass. Review URL: http://codereview.chromium.org/8416018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107787 0039d316-1c4b-4281-b951-d872f2087c98
* Replace NewRunnableMethod with Callback in DownloadItem.achuith@chromium.org2011-10-281-10/+13
| | | | | | | | BUG=chromium-os:22024 TEST=compiles, tests pass. Review URL: http://codereview.chromium.org/8413016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107786 0039d316-1c4b-4281-b951-d872f2087c98
* Replace NewRunnableFunction with Callback in DownloadRequestHandle.achuith@chromium.org2011-10-281-6/+7
| | | | | | | | BUG=chromium-os:22024 TEST=compiles, tests pass. Review URL: http://codereview.chromium.org/8417010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107785 0039d316-1c4b-4281-b951-d872f2087c98
* export DownloadRequestHandle - this is needed in both content_unittests and ↵dpranke@chromium.org2011-10-281-1/+3
| | | | | | | | | | | | unit_tests. R=jam@chromium.org BUG=90442 TEST= Review URL: http://codereview.chromium.org/8343046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107762 0039d316-1c4b-4281-b951-d872f2087c98
* Split BrowserThread into public API and private implementation, step 1.joi@chromium.org2011-10-2819-31/+33
| | | | | | | | | | | | | | | | | | | | | Only content/ now has the ability to create BrowserThread objects, with the exception that tests can create the content::TestBrowserThread subclass, and (temporarily) code in chrome/ can create the DeprecatedBrowserThread subclass. A follow-up change will make content/ take care of its own thread creation, remove DeprecatedBrowserThread, and move all state and non-trivial constructors from BrowserThread down to BrowserThreadImpl. Also moved BrowserProcessSubThread into content/ namespace. As part of follow-up cleanup, chrome/ will stop using this class. BUG=98716 TEST=existing Review URL: http://codereview.chromium.org/8392042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107718 0039d316-1c4b-4281-b951-d872f2087c98
* more content exports.dpranke@chromium.org2011-10-272-2/+3
| | | | | | | | | | R=jam@chromium.org BUG=90442 TEST=none Review URL: http://codereview.chromium.org/8381024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107510 0039d316-1c4b-4281-b951-d872f2087c98
* Replace NewRunnableFunction/NewRunnableMethod with Callback in SavePackage.achuith@chromium.org2011-10-261-42/+42
| | | | | | | | BUG=chromium-os:22024 TEST=tests pass. Review URL: http://codereview.chromium.org/8393042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107439 0039d316-1c4b-4281-b951-d872f2087c98
* Replace NewRunnableFunction with Callback in SaveFileResourceHandler.achuith@chromium.org2011-10-261-14/+6
| | | | | | | | BUG=chromium-os:22024 TEST=tests pass. Review URL: http://codereview.chromium.org/8394036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107437 0039d316-1c4b-4281-b951-d872f2087c98
* Replace NewRunnableMethod with Callback in SaveFileManager.achuith@chromium.org2011-10-261-30/+23
| | | | | | | | BUG=chromium-os:22024 TEST=tests pass Review URL: http://codereview.chromium.org/8394035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107436 0039d316-1c4b-4281-b951-d872f2087c98
* Make passing of DownloadRequestHandle separate from DownloadCreateInfo.rdsmith@chromium.org2011-10-2512-32/+40
| | | | | | | | | | This is to support mocking DownloadRequestHandle. BUG=101214 Review URL: http://codereview.chromium.org/8371009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107219 0039d316-1c4b-4281-b951-d872f2087c98
* Const-ify DownloadStatusUpdaterDelegate methods.cbentzel@chromium.org2011-10-256-26/+26
| | | | | | | | | Also add OVERRIDEs. Review URL: http://codereview.chromium.org/8381009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107159 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a bug where putting a laptop to sleep causes downloads to end normally.ahendrickson@chromium.org2011-10-244-17/+32
| | | | | | | | | | | | Special case download interrupt reason if we get a CANCELED/ABORTED status. BUG=101044 TEST=None Review URL: http://codereview.chromium.org/8369005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106928 0039d316-1c4b-4281-b951-d872f2087c98
* DownloadBuffer is used in two different ways, only one of which is used ↵ahendrickson@chromium.org2011-10-219-58/+292
| | | | | | | | | | | | | | | | across threads. This CL splits a ContentVector typedef from the DownloadBuffer class. DownloadBuffer is also made RefCountedThreadSafe. BUG=None TEST=None Review URL: http://codereview.chromium.org/8036038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106640 0039d316-1c4b-4281-b951-d872f2087c98
* The apitest needs a handler on the testserver that does not return a ↵benjhayden@chromium.org2011-10-203-7/+25
| | | | | | | | | | | | | dangerous file and finishes quickly. "/slow?0" appears to work. DownloadRequestHandle::GetTabContents() returns NULL in the test framework. Make DRH::GetDownloadManager() use RVH->process().browser_context() directly instead. Make MockDownloadManagerDelegate::AddItemToPersistentStore() call DM::OnItemAddedToPersistentStore() so that items are added to the history_downloads_ map even in the test framework. Review URL: http://codereview.chromium.org/8060042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106560 0039d316-1c4b-4281-b951-d872f2087c98
* Move ResourceDispatcherHostDelegate and DownloadManagerDelegate to /public/.joi@chromium.org2011-10-208-130/+14
| | | | | | | | | | | | | | To avoid proliferation of folders, drop the /download/ and /render_host/ bits of those files' original paths when moving to /public/. BUG=98716 TEST=it builds Review URL: http://codereview.chromium.org/8352023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106456 0039d316-1c4b-4281-b951-d872f2087c98
* Make NotificationService an interface in the content namespace, and switch ↵jam@chromium.org2011-10-192-4/+4
| | | | | | | | | callers to use it. Move the implementation to content/browser. Stop creating it in all child processes since it's only used in the browser. BUG=98716 Review URL: http://codereview.chromium.org/8342048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106403 0039d316-1c4b-4281-b951-d872f2087c98
* Move content_browser_client.h to public, and while at it, movejoi@chromium.org2011-10-194-4/+4
| | | | | | | | | | | | window_container_type.h as well since it is included by content_browser_client.h BUG=98716 TEST=it builds + existing tests Review URL: http://codereview.chromium.org/8346017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106323 0039d316-1c4b-4281-b951-d872f2087c98
* Move NotificationObserver, NotificationSource, and NotificationDetails to ↵jam@chromium.org2011-10-193-5/+5
| | | | | | | | | | | content/public/browser. This patch got way bigger than I wanted, but once I moved NotificationDetails, I figured I might as well mvoe the others since they're in the same files. In hindsight, I should have converted a subset of files at a time by leaving a using statement in the header. BUG=98716 TBR=joi git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106196 0039d316-1c4b-4281-b951-d872f2087c98
* content: Make tab_contents_drag_source not depend on download_util.herg@google.com2011-10-181-1/+1
| | | | | | | | | | | This adds a method to the ContentBrowserClient to get what is otherwise localized resources. Most of this patch changes the interface to net::GenerateFileName() to take a utf8 string instead of a utf16 one (which was immediately changed to a utf8 one in implementation.) BUG=none TEST=none Review URL: http://codereview.chromium.org/8113012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106124 0039d316-1c4b-4281-b951-d872f2087c98
* Move content_notification_types.h from content\common to ↵jam@chromium.org2011-10-183-3/+3
| | | | | | | | | content\public\browser. I dropped the "content" from the name to match other files whose chrome version adds a "chrome_" prefix. I also moved it to the browser directory since notifications are only used in the browser process. I will move the other notification files in future changes. BUG=98716 Review URL: http://codereview.chromium.org/8331001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106028 0039d316-1c4b-4281-b951-d872f2087c98
* Add new UMA stats to get a handle on Downloads UI Usagebenjhayden@chromium.org2011-10-179-11/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | Download.OpenTime: number of milliseconds between a download completing and when it is opened Download.FirstOpenTime: same, but is only counted the first time that a download is opened (even across restarts) Download.HistorySize: number of items in the history when a download begins. A user who downloads 5 times per minute, Clears All, then repeats will look exactly like a user who downloads 5 times per week then Clears All and repeats, which is a flat line that goes to 5 then stops. People like me who Clear All after every download will be a dirac delta in the 0 bucket, whereas people who never Clear All will be a flat line all the way out. This should look more like an exponential distribution, with bumps at db sizes when chrome updated. The expected value of this distribution will be the most interesting number. Download.ShelfSizeOnAutoClose: number of items displayed in the shelf when it autocloses Download.ShelfSizeOnUserClose: same as ShelfSizeOnAutoClose, but either when the user opens chrome://downloads or clicks the shelf's |x|. Download.ShelfInProgressSizeOnAutoClose: same as ShelfSizeOnAutoClose, but only counts in-progress items. Download.ShelfInProgressSizeOnUserClose: same as ShelfSizeOnUserClose, but only counts in-progress items. Download.ClearAllSize: number of items removed by 'Clear All' Download.OpensOutstanding: number of completed unopened items when an item is opened. FirstOpenTime required adding |end_time| and |opened| to the downloads table. ScheduleAndForget only goes up to 4 args, so I changed UpdateEntry to use DownloadPersistentStoreInfo. Review URL: http://codereview.chromium.org/8008021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105871 0039d316-1c4b-4281-b951-d872f2087c98
* Move url_constansts.h to content/public/common.jam@chromium.org2011-10-141-1/+1
| | | | | | | BUG=98716 Review URL: http://codereview.chromium.org/8276022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105508 0039d316-1c4b-4281-b951-d872f2087c98
* Add screen power save block level.avi@chromium.org2011-10-141-1/+1
| | | | | | | | | | | | | BUG=100054 TEST=no change Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=105401 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=105415 Review URL: http://codereview.chromium.org/8251008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105507 0039d316-1c4b-4281-b951-d872f2087c98
* Add screen power save block level.avi@chromium.org2011-10-131-1/+1
| | | | | | | | | | | BUG=100054 TEST=no change Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=105401 Review URL: http://codereview.chromium.org/8251008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105415 0039d316-1c4b-4281-b951-d872f2087c98
* Add screen power save block level.avi@chromium.org2011-10-131-1/+1
| | | | | | | | | | BUG=100054 TEST=no change Review URL: http://codereview.chromium.org/8251008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105401 0039d316-1c4b-4281-b951-d872f2087c98
* Added a InterruptReason enum.ahendrickson@chromium.org2011-10-1310-40/+298
| | | | | | | | | | | | Will be used when downloads are interrupted to communicate errors to the user. Bug=None Test=None Review URL: http://codereview.chromium.org/8052017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105296 0039d316-1c4b-4281-b951-d872f2087c98
* Move PageTransition into content namespace. While I'm touching all these ↵jam@chromium.org2011-10-135-12/+11
| | | | | | | | | files, I've also updated it to use the enum naming convention in the Content API. BUG=98716 Review URL: http://codereview.chromium.org/8253002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105254 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor downloads into a ProfileKeyedService.rdsmith@chromium.org2011-10-122-3/+10
| | | | | | | | | | BUG=94383 TEST= Review URL: http://codereview.chromium.org/8135017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105115 0039d316-1c4b-4281-b951-d872f2087c98
* Switch FileStream to use new CompletionCallback.willchan@chromium.org2011-10-121-1/+2
| | | | | | | | | | BUG=98719 TEST=none Review URL: http://codereview.chromium.org/8139019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105042 0039d316-1c4b-4281-b951-d872f2087c98
* Move kExtensionScheme from content to chromejochen@chromium.org2011-10-071-2/+2
| | | | | | | | | BUG=89642 TEST=everything still works Review URL: http://codereview.chromium.org/8159006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104492 0039d316-1c4b-4281-b951-d872f2087c98
* Changed broken downloads bug reference.shess@chromium.org2011-10-052-5/+5
| | | | | | | | | | | | | Was triaging a CHECK crash, and the comment pointed to the wrong bug. s/84508/85408/g; BUG=85408 TEST=none Review URL: http://codereview.chromium.org/8139012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104055 0039d316-1c4b-4281-b951-d872f2087c98
* Fix check_perms error from r103992.thestig@chromium.org2011-10-041-0/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104001 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed bug in operator<().ahendrickson@chromium.org2011-10-042-2/+151
| | | | | | | | | | | | Added unit tests for DownloadId. BUG=98495 TEST=The new DownloadId unit tests. Review URL: http://codereview.chromium.org/8114015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103992 0039d316-1c4b-4281-b951-d872f2087c98
* Export some unix-specific content symbols.dpranke@chromium.org2011-10-041-2/+2
| | | | | | | | | | R=jam@chromium.org BUG=90442 TEST= Review URL: http://codereview.chromium.org/8113027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103929 0039d316-1c4b-4281-b951-d872f2087c98
* more content exports needed for unit_tests and browser_tests.dpranke@chromium.org2011-09-303-7/+4
| | | | | | | | | | R=jam@chromium.org BUG=90442 TEST= Review URL: http://codereview.chromium.org/8082019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103584 0039d316-1c4b-4281-b951-d872f2087c98
* Here are more exports needed for content_unittests to link in the component ↵dpranke@chromium.org2011-09-301-1/+2
| | | | | | | | | | | | build. R=jam@chromium.org, darin@chromium.org BUG=90442 TEST= Review URL: http://codereview.chromium.org/8054037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103394 0039d316-1c4b-4281-b951-d872f2087c98
* Uniquified path needs to be used to rename the file for dangerous types.ncj674@motorola.com2011-09-291-1/+1
| | | | | | | | | | | BUG=98300 TEST=Download a dangerous file (say a.exe). Download the same file again so that it tries to create a (1).exe. Try to open the file downloaded second. Should open a (1).exe. Review URL: http://codereview.chromium.org/8065012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103335 0039d316-1c4b-4281-b951-d872f2087c98