OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "sky/viewer/runtime_flags.h" | 5 #include "services/sky/runtime_flags.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "mojo/public/cpp/application/application_impl.h" | 8 #include "mojo/public/cpp/application/application_impl.h" |
9 | 9 |
10 namespace sky { | 10 namespace sky { |
11 namespace { | 11 namespace { |
12 | 12 |
13 bool initialized = false; | 13 bool initialized = false; |
14 RuntimeFlags flags; | 14 RuntimeFlags flags; |
15 | 15 |
16 // Load the viewer in testing mode so we can dump pixels. | 16 // Load the viewer in testing mode so we can dump pixels. |
17 const char kTesting[] = "--testing"; | 17 const char kTesting[] = "--testing"; |
18 | 18 |
19 } // namespace | 19 } // namespace |
20 | 20 |
21 void RuntimeFlags::Initialize(mojo::ApplicationImpl* app) { | 21 void RuntimeFlags::Initialize(mojo::ApplicationImpl* app) { |
22 DCHECK(!initialized); | 22 DCHECK(!initialized); |
23 flags.testing_ = app->HasArg(kTesting); | 23 flags.testing_ = app->HasArg(kTesting); |
24 initialized = true; | 24 initialized = true; |
25 } | 25 } |
26 | 26 |
27 const RuntimeFlags& RuntimeFlags::Get() { | 27 const RuntimeFlags& RuntimeFlags::Get() { |
28 DCHECK(initialized); | 28 DCHECK(initialized); |
29 return flags; | 29 return flags; |
30 } | 30 } |
31 | 31 |
32 } // namespace sky | 32 } // namespace sky |
OLD | NEW |