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

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: 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
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 AutomationProviderDownloadItemObserver:: 1456 AutomationProviderDownloadItemObserver::
1457 ~AutomationProviderDownloadItemObserver() {} 1457 ~AutomationProviderDownloadItemObserver() {}
1458 1458
1459 void AutomationProviderDownloadItemObserver::OnDownloadUpdated( 1459 void AutomationProviderDownloadItemObserver::OnDownloadUpdated(
1460 DownloadItem* download) { 1460 DownloadItem* download) {
1461 interrupted_ |= download->IsInterrupted(); 1461 interrupted_ |= download->IsInterrupted();
1462 // If any download was interrupted, on the next update each outstanding 1462 // If any download was interrupted, on the next update each outstanding
1463 // download is cancelled. 1463 // download is cancelled.
1464 if (interrupted_) { 1464 if (interrupted_) {
1465 // |Cancel()| does nothing if |download| is already interrupted. 1465 // |Cancel()| does nothing if |download| is already interrupted.
1466 download->Cancel(true); 1466 download->Cancel();
1467 RemoveAndCleanupOnLastEntry(download); 1467 RemoveAndCleanupOnLastEntry(download);
1468 } 1468 }
1469 1469
1470 if (download->IsComplete()) 1470 if (download->IsComplete())
1471 RemoveAndCleanupOnLastEntry(download); 1471 RemoveAndCleanupOnLastEntry(download);
1472 } 1472 }
1473 1473
1474 // We don't want to send multiple messages, as the behavior is undefined. 1474 // We don't want to send multiple messages, as the behavior is undefined.
1475 // Set |interrupted_| on error, and on the last download completed/ 1475 // Set |interrupted_| on error, and on the last download completed/
1476 // interrupted, send either an error or a success message. 1476 // interrupted, send either an error or a success message.
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2592 void DragTargetDropAckNotificationObserver::Observe( 2592 void DragTargetDropAckNotificationObserver::Observe(
2593 int type, 2593 int type,
2594 const NotificationSource& source, 2594 const NotificationSource& source,
2595 const NotificationDetails& details) { 2595 const NotificationDetails& details) {
2596 if (automation_) { 2596 if (automation_) {
2597 AutomationJSONReply(automation_, 2597 AutomationJSONReply(automation_,
2598 reply_message_.release()).SendSuccess(NULL); 2598 reply_message_.release()).SendSuccess(NULL);
2599 } 2599 }
2600 delete this; 2600 delete this;
2601 } 2601 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698