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

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

Issue 7108037: Revert 88492 - In chromedriver, add /log url to get the contents of the chromedriver log (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | « chrome/test/webdriver/server.cc ('k') | chrome/test/webdriver/utility_functions.h » ('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/test/webdriver/session_manager.h" 5 #include "chrome/test/webdriver/session_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/test/webdriver/utility_functions.h" 8 #include "chrome/test/webdriver/utility_functions.h"
9 #include "net/base/net_util.h" 9 #include "net/base/net_util.h"
10 10
(...skipping 27 matching lines...) Expand all
38 bool SessionManager::Has(const std::string& id) const { 38 bool SessionManager::Has(const std::string& id) const {
39 base::AutoLock lock(map_lock_); 39 base::AutoLock lock(map_lock_);
40 return map_.find(id) != map_.end(); 40 return map_.find(id) != map_.end();
41 } 41 }
42 42
43 bool SessionManager::Remove(const std::string& id) { 43 bool SessionManager::Remove(const std::string& id) {
44 std::map<std::string, Session*>::iterator it; 44 std::map<std::string, Session*>::iterator it;
45 Session* session; 45 Session* session;
46 base::AutoLock lock(map_lock_); 46 base::AutoLock lock(map_lock_);
47 it = map_.find(id); 47 it = map_.find(id);
48 if (it == map_.end()) 48 if (it == map_.end()) {
49 VLOG(1) << "No such session with ID " << id;
49 return false; 50 return false;
51 }
50 session = it->second; 52 session = it->second;
51 map_.erase(it); 53 map_.erase(it);
52 return true; 54 return true;
53 } 55 }
54 56
55 Session* SessionManager::GetSession(const std::string& id) const { 57 Session* SessionManager::GetSession(const std::string& id) const {
56 std::map<std::string, Session*>::const_iterator it; 58 std::map<std::string, Session*>::const_iterator it;
57 base::AutoLock lock(map_lock_); 59 base::AutoLock lock(map_lock_);
58 it = map_.find(id); 60 it = map_.find(id);
59 if (it == map_.end()) 61 if (it == map_.end()) {
62 VLOG(1) << "No such session with ID " << id;
60 return NULL; 63 return NULL;
64 }
61 return it->second; 65 return it->second;
62 } 66 }
63 67
64 void SessionManager::set_port(const std::string& port) { 68 void SessionManager::set_port(const std::string& port) {
65 port_ = port; 69 port_ = port;
66 } 70 }
67 71
68 void SessionManager::set_url_base(const std::string& url_base) { 72 void SessionManager::set_url_base(const std::string& url_base) {
69 url_base_ = url_base; 73 url_base_ = url_base;
70 } 74 }
71 75
72 std::string SessionManager::url_base() const { 76 std::string SessionManager::url_base() const {
73 return url_base_; 77 return url_base_;
74 } 78 }
75 79
76 SessionManager::SessionManager() : port_(""), url_base_("") {} 80 SessionManager::SessionManager() : port_(""), url_base_("") {}
77 81
78 SessionManager::~SessionManager() {} 82 SessionManager::~SessionManager() {}
79 83
80 // static 84 // static
81 SessionManager* SessionManager::GetInstance() { 85 SessionManager* SessionManager::GetInstance() {
82 return Singleton<SessionManager>::get(); 86 return Singleton<SessionManager>::get();
83 } 87 }
84 88
85 } // namespace webdriver 89 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/server.cc ('k') | chrome/test/webdriver/utility_functions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698