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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #if defined(USE_OZONE) | 54 #if defined(USE_OZONE) |
55 ui::OzonePlatform::Shutdown(); | 55 ui::OzonePlatform::Shutdown(); |
56 #endif | 56 #endif |
57 | 57 |
58 DCHECK_EQ(this, lazy_tls_ptr.Pointer()->Get()); | 58 DCHECK_EQ(this, lazy_tls_ptr.Pointer()->Get()); |
59 lazy_tls_ptr.Pointer()->Set(NULL); | 59 lazy_tls_ptr.Pointer()->Set(NULL); |
60 } | 60 } |
61 | 61 |
62 // static | 62 // static |
63 std::unique_ptr<Env> Env::CreateInstance(Mode mode) { | 63 std::unique_ptr<Env> Env::CreateInstance(Mode mode) { |
| 64 LOG(ERROR) << "Env::CreateInstance"; |
64 DCHECK(!lazy_tls_ptr.Pointer()->Get()); | 65 DCHECK(!lazy_tls_ptr.Pointer()->Get()); |
65 std::unique_ptr<Env> env(new Env(mode)); | 66 std::unique_ptr<Env> env(new Env(mode)); |
66 env->Init(); | 67 env->Init(); |
67 return env; | 68 return env; |
68 } | 69 } |
69 | 70 |
70 // static | 71 // static |
71 Env* Env::GetInstance() { | 72 Env* Env::GetInstance() { |
72 Env* env = lazy_tls_ptr.Pointer()->Get(); | 73 Env* env = lazy_tls_ptr.Pointer()->Get(); |
73 DCHECK(env) << "Env::CreateInstance must be called before getting the " | 74 // DCHECK(env) << "~~Env::CreateInstance must be called before getting the " |
74 "instance of Env."; | 75 // "instance of Env."; |
| 76 if (!env) { |
| 77 LOG(ERROR) << "~~Env::CreateInstance must be called before getting the " |
| 78 "instance of Env."; |
| 79 base::debug::StackTrace().Print(); |
| 80 } |
75 return env; | 81 return env; |
76 } | 82 } |
77 | 83 |
78 // static | 84 // static |
79 Env* Env::GetInstanceDontCreate() { | 85 Env* Env::GetInstanceDontCreate() { |
80 return lazy_tls_ptr.Pointer()->Get(); | 86 return lazy_tls_ptr.Pointer()->Get(); |
81 } | 87 } |
82 | 88 |
83 std::unique_ptr<WindowPort> Env::CreateWindowPort(Window* window) { | 89 std::unique_ptr<WindowPort> Env::CreateWindowPort(Window* window) { |
84 if (mode_ == Mode::LOCAL) | 90 if (mode_ == Mode::LOCAL) |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 ui::EventTargeter* Env::GetEventTargeter() { | 236 ui::EventTargeter* Env::GetEventTargeter() { |
231 NOTREACHED(); | 237 NOTREACHED(); |
232 return NULL; | 238 return NULL; |
233 } | 239 } |
234 | 240 |
235 std::unique_ptr<ui::OSExchangeData::Provider> Env::BuildProvider() { | 241 std::unique_ptr<ui::OSExchangeData::Provider> Env::BuildProvider() { |
236 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); | 242 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); |
237 } | 243 } |
238 | 244 |
239 } // namespace aura | 245 } // namespace aura |
OLD | NEW |