OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromedriver/session.h" | 5 #include "chrome/test/chromedriver/session.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/test/chromedriver/chrome/chrome.h" | 12 #include "chrome/test/chromedriver/chrome/chrome.h" |
13 #include "chrome/test/chromedriver/chrome/status.h" | 13 #include "chrome/test/chromedriver/chrome/status.h" |
14 #include "chrome/test/chromedriver/chrome/version.h" | |
15 #include "chrome/test/chromedriver/chrome/web_view.h" | 14 #include "chrome/test/chromedriver/chrome/web_view.h" |
16 #include "chrome/test/chromedriver/logging.h" | 15 #include "chrome/test/chromedriver/logging.h" |
17 | 16 |
18 namespace { | 17 namespace { |
19 | 18 |
20 base::LazyInstance<base::ThreadLocalPointer<Session> > | 19 base::LazyInstance<base::ThreadLocalPointer<Session> > |
21 lazy_tls_session = LAZY_INSTANCE_INITIALIZER; | 20 lazy_tls_session = LAZY_INSTANCE_INITIALIZER; |
22 | 21 |
23 } // namespace | 22 } // namespace |
24 | 23 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 return std::string(); | 112 return std::string(); |
114 } | 113 } |
115 | 114 |
116 Session* GetThreadLocalSession() { | 115 Session* GetThreadLocalSession() { |
117 return lazy_tls_session.Pointer()->Get(); | 116 return lazy_tls_session.Pointer()->Get(); |
118 } | 117 } |
119 | 118 |
120 void SetThreadLocalSession(scoped_ptr<Session> session) { | 119 void SetThreadLocalSession(scoped_ptr<Session> session) { |
121 lazy_tls_session.Pointer()->Set(session.release()); | 120 lazy_tls_session.Pointer()->Set(session.release()); |
122 } | 121 } |
OLD | NEW |