Chromium Code Reviews

Side by Side Diff: chrome/test/webdriver/session_manager.cc

Issue 5581008: Add a new GetInstance() method for singleton classes, take 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/webdriver/session_manager.h" 5 #include "chrome/test/webdriver/session_manager.h"
6 6
7 #ifdef OS_POSIX 7 #ifdef OS_POSIX
8 #include <netdb.h> 8 #include <netdb.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #include <arpa/inet.h> 10 #include <arpa/inet.h>
(...skipping 165 matching lines...)
176 Session* SessionManager::GetSession(const std::string& id) const { 176 Session* SessionManager::GetSession(const std::string& id) const {
177 std::map<std::string, Session*>::const_iterator it; 177 std::map<std::string, Session*>::const_iterator it;
178 it = map_.find(id); 178 it = map_.find(id);
179 if (it == map_.end()) { 179 if (it == map_.end()) {
180 VLOG(1) << "No such session with ID " << id; 180 VLOG(1) << "No such session with ID " << id;
181 return NULL; 181 return NULL;
182 } 182 }
183 return it->second; 183 return it->second;
184 } 184 }
185 185
186 // static
187 SessionManager* SessionManager::GetInstance() {
188 return Singleton<SessionManager>::get();
189 }
190
186 } // namespace webdriver 191 } // namespace webdriver
OLDNEW

Powered by Google App Engine