Chromium Code Reviews| Index: chrome/test/webdriver/commands/create_session.cc |
| diff --git a/chrome/test/webdriver/commands/create_session.cc b/chrome/test/webdriver/commands/create_session.cc |
| index d8f51120cbe67b9812282ed0f9676837634b47a5..e052bb27819c5e558e65433dcceda07ed642597b 100644 |
| --- a/chrome/test/webdriver/commands/create_session.cc |
| +++ b/chrome/test/webdriver/commands/create_session.cc |
| @@ -16,28 +16,19 @@ |
| namespace webdriver { |
| void CreateSession::ExecutePost(Response* const response) { |
| - SessionManager* session_manager = SessionManager::GetInstance(); |
| - Session* session = session_manager->Create(); |
| - if (!session) { |
| - SET_WEBDRIVER_ERROR(response, |
| - "Failed to create session", |
| - kInternalServerError); |
| - return; |
| - } |
| - |
| - std::string session_id = session->id(); |
| + Session* session = new Session(); |
|
Jason Leyba
2011/02/14 21:00:23
I think these changes unnecessarily obfuscate who
|
| if (!session->Init()) { |
| - session_manager->Delete(session_id); |
| SET_WEBDRIVER_ERROR(response, |
| "Failed to initialize session", |
| kInternalServerError); |
| return; |
| } |
| - VLOG(1) << "Created session " << session_id; |
| + SessionManager* session_manager = SessionManager::GetInstance(); |
| + VLOG(1) << "Created session " << session->id(); |
| std::ostringstream stream; |
| stream << "http://" << session_manager->GetAddress() << "/session/" |
| - << session_id; |
| + << session->id(); |
| response->set_status(kSeeOther); |
| response->set_value(Value::CreateStringValue(stream.str())); |
| } |