Chromium Code Reviews| 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 "ui/aura/env.h" | 5 #include "ui/aura/env.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 std::unique_ptr<Env> Env::CreateInstance(Mode mode) { | 63 std::unique_ptr<Env> Env::CreateInstance(Mode mode) { |
| 64 DCHECK(!lazy_tls_ptr.Pointer()->Get()); | 64 DCHECK(!lazy_tls_ptr.Pointer()->Get()); |
| 65 std::unique_ptr<Env> env(new Env(mode)); | 65 std::unique_ptr<Env> env(new Env(mode)); |
| 66 env->Init(); | 66 env->Init(); |
| 67 return env; | 67 return env; |
| 68 } | 68 } |
| 69 | 69 |
| 70 // static | 70 // static |
| 71 Env* Env::GetInstance() { | 71 Env* Env::GetInstance() { |
| 72 Env* env = lazy_tls_ptr.Pointer()->Get(); | 72 Env* env = lazy_tls_ptr.Pointer()->Get(); |
| 73 DCHECK(env) << "Env::CreateInstance must be called before getting the " | 73 DCHECK(env) << "~~Env::CreateInstance must be called before getting the " |
|
sky
2017/06/27 19:58:57
remove ~~?
mfomitchev
2017/07/11 21:47:00
Oops. Done.
| |
| 74 "instance of Env."; | 74 "instance of Env."; |
| 75 return env; | 75 return env; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // static | 78 // static |
| 79 Env* Env::GetInstanceDontCreate() { | 79 Env* Env::GetInstanceDontCreate() { |
| 80 return lazy_tls_ptr.Pointer()->Get(); | 80 return lazy_tls_ptr.Pointer()->Get(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 std::unique_ptr<WindowPort> Env::CreateWindowPort(Window* window) { | 83 std::unique_ptr<WindowPort> Env::CreateWindowPort(Window* window) { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 ui::EventTargeter* Env::GetEventTargeter() { | 230 ui::EventTargeter* Env::GetEventTargeter() { |
| 231 NOTREACHED(); | 231 NOTREACHED(); |
| 232 return NULL; | 232 return NULL; |
| 233 } | 233 } |
| 234 | 234 |
| 235 std::unique_ptr<ui::OSExchangeData::Provider> Env::BuildProvider() { | 235 std::unique_ptr<ui::OSExchangeData::Provider> Env::BuildProvider() { |
| 236 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); | 236 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace aura | 239 } // namespace aura |
| OLD | NEW |