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

Side by Side Diff: chrome/browser/ui/webui/downloads_dom_handler.cc

Issue 7294013: Modified cancel and interrupt processing to avoid race with history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to TOT. Again :-}. 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 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 #include "chrome/browser/ui/webui/downloads_dom_handler.h" 5 #include "chrome/browser/ui/webui/downloads_dom_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 if (file) { 213 if (file) {
214 // TODO(rdsmith): Change to DCHECK when http://crbug.com/84508 is fixed. 214 // TODO(rdsmith): Change to DCHECK when http://crbug.com/84508 is fixed.
215 CHECK_NE(DownloadHistory::kUninitializedHandle, file->db_handle()); 215 CHECK_NE(DownloadHistory::kUninitializedHandle, file->db_handle());
216 file->Remove(); 216 file->Remove();
217 } 217 }
218 } 218 }
219 219
220 void DownloadsDOMHandler::HandleCancel(const ListValue* args) { 220 void DownloadsDOMHandler::HandleCancel(const ListValue* args) {
221 DownloadItem* file = GetDownloadByValue(args); 221 DownloadItem* file = GetDownloadByValue(args);
222 if (file) 222 if (file)
223 file->Cancel(true); 223 file->Cancel();
224 } 224 }
225 225
226 void DownloadsDOMHandler::HandleClearAll(const ListValue* args) { 226 void DownloadsDOMHandler::HandleClearAll(const ListValue* args) {
227 download_manager_->RemoveAllDownloads(); 227 download_manager_->RemoveAllDownloads();
228 } 228 }
229 229
230 // DownloadsDOMHandler, private: ---------------------------------------------- 230 // DownloadsDOMHandler, private: ----------------------------------------------
231 231
232 void DownloadsDOMHandler::SendCurrentDownloads() { 232 void DownloadsDOMHandler::SendCurrentDownloads() {
233 ListValue results_value; 233 ListValue results_value;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 return NULL; 266 return NULL;
267 } 267 }
268 268
269 DownloadItem* DownloadsDOMHandler::GetDownloadByValue(const ListValue* args) { 269 DownloadItem* DownloadsDOMHandler::GetDownloadByValue(const ListValue* args) {
270 int id; 270 int id;
271 if (ExtractIntegerValue(args, &id)) { 271 if (ExtractIntegerValue(args, &id)) {
272 return GetDownloadById(id); 272 return GetDownloadById(id);
273 } 273 }
274 return NULL; 274 return NULL;
275 } 275 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc ('k') | chrome/test/data/download-dangerous.jar » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698