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

Side by Side Diff: chrome/browser/automation/automation_resource_tracker.cc

Issue 3412016: FBTF: Move a bunch of code to the headers and remove includes. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Rebase + fixed windows issues locally Created 10 years, 3 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
OLDNEW
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/browser/automation/automation_resource_tracker.h" 5 #include "chrome/browser/automation/automation_resource_tracker.h"
6 6
7 #include "chrome/common/notification_service.h" 7 #include "chrome/common/notification_service.h"
8 #include "chrome/test/automation/automation_messages.h" 8 #include "chrome/test/automation/automation_messages.h"
9 9
10 AutomationResourceTrackerImpl::AutomationResourceTrackerImpl(
11 IPC::Message::Sender* sender)
12 : sender_(sender) {
13 }
14
15 AutomationResourceTrackerImpl::~AutomationResourceTrackerImpl() {
16 }
17
10 int AutomationResourceTrackerImpl::AddImpl(void* resource) { 18 int AutomationResourceTrackerImpl::AddImpl(void* resource) {
11 if (ContainsResourceImpl(resource)) 19 if (ContainsResourceImpl(resource))
12 return resource_to_handle_[resource]; 20 return resource_to_handle_[resource];
13 21
14 int handle = GenerateHandle(); 22 int handle = GenerateHandle();
15 DCHECK(!ContainsHandleImpl(handle)); 23 DCHECK(!ContainsHandleImpl(handle));
16 24
17 resource_to_handle_[resource] = handle; 25 resource_to_handle_[resource] = handle;
18 handle_to_resource_[handle] = resource; 26 handle_to_resource_[handle] = resource;
19 27
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 75
68 void AutomationResourceTrackerImpl::HandleCloseNotification(void* resource) { 76 void AutomationResourceTrackerImpl::HandleCloseNotification(void* resource) {
69 if (!ContainsResourceImpl(resource)) 77 if (!ContainsResourceImpl(resource))
70 return; 78 return;
71 79
72 sender_->Send( 80 sender_->Send(
73 new AutomationMsg_InvalidateHandle(0, resource_to_handle_[resource])); 81 new AutomationMsg_InvalidateHandle(0, resource_to_handle_[resource]));
74 82
75 RemoveImpl(resource); 83 RemoveImpl(resource);
76 } 84 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_resource_tracker.h ('k') | chrome/browser/automation/automation_tab_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698