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

Side by Side Diff: chrome/browser/automation/automation_provider_observers.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: Fixed various problems surfaced by trybots. 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/automation/automation_provider_observers.h" 5 #include "chrome/browser/automation/automation_provider_observers.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 AutomationProviderDownloadItemObserver:: 1454 AutomationProviderDownloadItemObserver::
1455 ~AutomationProviderDownloadItemObserver() {} 1455 ~AutomationProviderDownloadItemObserver() {}
1456 1456
1457 void AutomationProviderDownloadItemObserver::OnDownloadUpdated( 1457 void AutomationProviderDownloadItemObserver::OnDownloadUpdated(
1458 DownloadItem* download) { 1458 DownloadItem* download) {
1459 interrupted_ |= download->IsInterrupted(); 1459 interrupted_ |= download->IsInterrupted();
1460 // If any download was interrupted, on the next update each outstanding 1460 // If any download was interrupted, on the next update each outstanding
1461 // download is cancelled. 1461 // download is cancelled.
1462 if (interrupted_) { 1462 if (interrupted_) {
1463 // |Cancel()| does nothing if |download| is already interrupted. 1463 // |Cancel()| does nothing if |download| is already interrupted.
1464 download->Cancel(true); 1464 download->Cancel();
1465 RemoveAndCleanupOnLastEntry(download); 1465 RemoveAndCleanupOnLastEntry(download);
1466 } 1466 }
1467 1467
1468 if (download->IsComplete()) 1468 if (download->IsComplete())
1469 RemoveAndCleanupOnLastEntry(download); 1469 RemoveAndCleanupOnLastEntry(download);
1470 } 1470 }
1471 1471
1472 // We don't want to send multiple messages, as the behavior is undefined. 1472 // We don't want to send multiple messages, as the behavior is undefined.
1473 // Set |interrupted_| on error, and on the last download completed/ 1473 // Set |interrupted_| on error, and on the last download completed/
1474 // interrupted, send either an error or a success message. 1474 // interrupted, send either an error or a success message.
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2591 void DragTargetDropAckNotificationObserver::Observe( 2591 void DragTargetDropAckNotificationObserver::Observe(
2592 NotificationType type, 2592 NotificationType type,
2593 const NotificationSource& source, 2593 const NotificationSource& source,
2594 const NotificationDetails& details) { 2594 const NotificationDetails& details) {
2595 if (automation_) { 2595 if (automation_) {
2596 AutomationJSONReply(automation_, 2596 AutomationJSONReply(automation_,
2597 reply_message_.release()).SendSuccess(NULL); 2597 reply_message_.release()).SendSuccess(NULL);
2598 } 2598 }
2599 delete this; 2599 delete this;
2600 } 2600 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | chrome/browser/download/download_history.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698