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

Side by Side Diff: chrome/test/chromedriver/session.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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) 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 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/threading/thread_local.h" 11 #include "base/threading/thread_local.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/test/chromedriver/chrome/chrome.h" 13 #include "chrome/test/chromedriver/chrome/chrome.h"
14 #include "chrome/test/chromedriver/chrome/status.h" 14 #include "chrome/test/chromedriver/chrome/status.h"
15 #include "chrome/test/chromedriver/chrome/web_view.h" 15 #include "chrome/test/chromedriver/chrome/web_view.h"
16 #include "chrome/test/chromedriver/logging.h" 16 #include "chrome/test/chromedriver/logging.h"
17 17
18 namespace { 18 namespace {
19 19
20 base::LazyInstance<base::ThreadLocalPointer<Session> > 20 base::LazyInstance<base::ThreadLocalPointer<Session>>::DestructorAtExit
21 lazy_tls_session = LAZY_INSTANCE_INITIALIZER; 21 lazy_tls_session = LAZY_INSTANCE_INITIALIZER;
22 22
23 } // namespace 23 } // namespace
24 24
25 FrameInfo::FrameInfo(const std::string& parent_frame_id, 25 FrameInfo::FrameInfo(const std::string& parent_frame_id,
26 const std::string& frame_id, 26 const std::string& frame_id,
27 const std::string& chromedriver_frame_id) 27 const std::string& chromedriver_frame_id)
28 : parent_frame_id(parent_frame_id), 28 : parent_frame_id(parent_frame_id),
29 frame_id(frame_id), 29 frame_id(frame_id),
30 chromedriver_frame_id(chromedriver_frame_id) {} 30 chromedriver_frame_id(chromedriver_frame_id) {}
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 return std::string(); 115 return std::string();
116 } 116 }
117 117
118 Session* GetThreadLocalSession() { 118 Session* GetThreadLocalSession() {
119 return lazy_tls_session.Pointer()->Get(); 119 return lazy_tls_session.Pointer()->Get();
120 } 120 }
121 121
122 void SetThreadLocalSession(std::unique_ptr<Session> session) { 122 void SetThreadLocalSession(std::unique_ptr<Session> session) {
123 lazy_tls_session.Pointer()->Set(session.release()); 123 lazy_tls_session.Pointer()->Set(session.release());
124 } 124 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/server/chromedriver_server.cc ('k') | chrome/test/logging/win/test_log_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698