| 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;
|
|
|