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

Unified Diff: chrome/browser/ui/webui/downloads_dom_handler.cc

Issue 7192016: chrome.experimental.downloads (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merged db_handle, id; onCreated, onErased Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/renderer_host/download_throttling_resource_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/downloads_dom_handler.cc
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index f5e7929ce49d63f00a34573c4dad7fb57e61c438..adbb43a0662e2f774f04411a697e970d4fc84d66 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -52,6 +52,7 @@ DownloadsDOMHandler::DownloadsDOMHandler(DownloadManager* dlm)
: search_text_(),
download_manager_(dlm),
callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ DVLOG(1) << __PRETTY_FUNCTION__ << " " << dlm;
// Create our fileicon data source.
dlm->profile()->GetChromeURLDataManager()->AddDataSource(
#if defined(OS_CHROMEOS)
@@ -143,7 +144,7 @@ void DownloadsDOMHandler::ModelChanged() {
// fixed.
// We should never see anything that isn't already in the history.
CHECK(*it);
- CHECK_NE(DownloadHistory::kUninitializedHandle, (*it)->db_handle());
+ CHECK((*it)->IsInHistory());
(*it)->AddObserver(this);
}
@@ -186,6 +187,7 @@ void DownloadsDOMHandler::HandleDrag(const ListValue* args) {
void DownloadsDOMHandler::HandleSaveDangerous(const ListValue* args) {
DownloadItem* file = GetDownloadByValue(args);
+ DVLOG(1) << __PRETTY_FUNCTION__ << " " << file;
if (file)
download_manager_->DangerousDownloadValidated(file);
}
@@ -211,8 +213,6 @@ void DownloadsDOMHandler::HandlePause(const ListValue* args) {
void DownloadsDOMHandler::HandleRemove(const ListValue* args) {
DownloadItem* file = GetDownloadByValue(args);
if (file) {
- // TODO(rdsmith): Change to DCHECK when http://crbug.com/84508 is fixed.
- CHECK_NE(DownloadHistory::kUninitializedHandle, file->db_handle());
file->Remove();
}
}
@@ -259,6 +259,7 @@ DownloadItem* DownloadsDOMHandler::GetDownloadById(int id) {
for (OrderedDownloads::iterator it = download_items_.begin();
it != download_items_.end(); ++it) {
if (static_cast<int>(it - download_items_.begin() == id)) {
+ DVLOG(1) << " " << id << " " << *it;
return (*it);
}
}
@@ -269,6 +270,7 @@ DownloadItem* DownloadsDOMHandler::GetDownloadById(int id) {
DownloadItem* DownloadsDOMHandler::GetDownloadByValue(const ListValue* args) {
int id;
if (ExtractIntegerValue(args, &id)) {
+ DVLOG(1) << id;
return GetDownloadById(id);
}
return NULL;
« no previous file with comments | « chrome/browser/renderer_host/download_throttling_resource_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698