OLD | NEW |
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_resource_tracker.h" | 5 #include "chrome/browser/automation/automation_resource_tracker.h" |
6 | 6 |
7 #include "chrome/common/automation_messages.h" | 7 #include "chrome/common/automation_messages.h" |
8 | 8 |
9 AutomationResourceTrackerImpl::AutomationResourceTrackerImpl( | 9 AutomationResourceTrackerImpl::AutomationResourceTrackerImpl( |
10 IPC::Message::Sender* sender) | 10 IPC::Sender* sender) |
11 : sender_(sender) { | 11 : sender_(sender) { |
12 } | 12 } |
13 | 13 |
14 AutomationResourceTrackerImpl::~AutomationResourceTrackerImpl() { | 14 AutomationResourceTrackerImpl::~AutomationResourceTrackerImpl() { |
15 } | 15 } |
16 | 16 |
17 int AutomationResourceTrackerImpl::AddImpl(const void* resource) { | 17 int AutomationResourceTrackerImpl::AddImpl(const void* resource) { |
18 if (ContainsResourceImpl(resource)) | 18 if (ContainsResourceImpl(resource)) |
19 return resource_to_handle_[resource]; | 19 return resource_to_handle_[resource]; |
20 | 20 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 void AutomationResourceTrackerImpl::HandleCloseNotification( | 75 void AutomationResourceTrackerImpl::HandleCloseNotification( |
76 const void* resource) { | 76 const void* resource) { |
77 if (!ContainsResourceImpl(resource)) | 77 if (!ContainsResourceImpl(resource)) |
78 return; | 78 return; |
79 | 79 |
80 sender_->Send( | 80 sender_->Send( |
81 new AutomationMsg_InvalidateHandle(resource_to_handle_[resource])); | 81 new AutomationMsg_InvalidateHandle(resource_to_handle_[resource])); |
82 | 82 |
83 RemoveImpl(resource); | 83 RemoveImpl(resource); |
84 } | 84 } |
OLD | NEW |