| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/test/automation/automation_handle_tracker.h" | 5 #include "chrome/test/automation/automation_handle_tracker.h" |
| 6 | 6 |
| 7 #include "chrome/test/automation/automation_messages.h" | 7 #include "chrome/test/automation/automation_messages.h" |
| 8 #include "chrome/test/automation/automation_proxy.h" | 8 #include "chrome/test/automation/automation_proxy.h" |
| 9 | 9 |
| 10 AutomationResourceProxy::AutomationResourceProxy( | 10 AutomationResourceProxy::AutomationResourceProxy( |
| 11 AutomationHandleTracker* tracker, AutomationMessageSender* sender, | 11 AutomationHandleTracker* tracker, AutomationMessageSender* sender, |
| 12 AutomationHandle handle) | 12 AutomationHandle handle) |
| 13 : tracker_(tracker), | 13 : handle_(handle), |
| 14 tracker_(tracker), |
| 14 sender_(sender), | 15 sender_(sender), |
| 15 handle_(handle), | |
| 16 is_valid_(true) { | 16 is_valid_(true) { |
| 17 tracker_->Add(this); | 17 tracker_->Add(this); |
| 18 } | 18 } |
| 19 | 19 |
| 20 AutomationResourceProxy::~AutomationResourceProxy() { | 20 AutomationResourceProxy::~AutomationResourceProxy() { |
| 21 if (tracker_) | 21 if (tracker_) |
| 22 tracker_->Remove(this); | 22 tracker_->Remove(this); |
| 23 } | 23 } |
| 24 | 24 |
| 25 AutomationHandleTracker::~AutomationHandleTracker() { | 25 AutomationHandleTracker::~AutomationHandleTracker() { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void AutomationHandleTracker::InvalidateHandle(AutomationHandle handle) { | 64 void AutomationHandleTracker::InvalidateHandle(AutomationHandle handle) { |
| 65 HandleToObjectMap::iterator iter = handle_to_object_.lower_bound(handle); | 65 HandleToObjectMap::iterator iter = handle_to_object_.lower_bound(handle); |
| 66 HandleToObjectMap::const_iterator end_of_matching_objects = | 66 HandleToObjectMap::const_iterator end_of_matching_objects = |
| 67 handle_to_object_.upper_bound(handle); | 67 handle_to_object_.upper_bound(handle); |
| 68 | 68 |
| 69 for (; iter != end_of_matching_objects; ++iter) { | 69 for (; iter != end_of_matching_objects; ++iter) { |
| 70 iter->second->Invalidate(); | 70 iter->second->Invalidate(); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| OLD | NEW |