forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchromecast_switches.h
152 lines (117 loc) · 5.13 KB
/
chromecast_switches.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_BASE_CHROMECAST_SWITCHES_H_
#define CHROMECAST_BASE_CHROMECAST_SWITCHES_H_
#include <cstdint>
#include <string>
#include "build/build_config.h"
namespace switches {
// Switch values
extern const char kSwitchValueTrue[];
extern const char kSwitchValueFalse[];
// Url to upload crash data to.
extern const char kCrashServerUrl[];
// Disable Crash Reporting
extern const char kDisableCrashReporter[];
// Path to dumpstate binary to be used for crash reporting.
// This gives Chromium's crash reporter the flexibility to switch
// between multiple implementations of dumpstate tool.
extern const char kDumpstateBinPath[];
// Content-implementation switches
extern const char kEnableLocalFileAccesses[];
// Metrics switches
extern const char kOverrideMetricsUploadUrl[];
// Network switches
extern const char kRequireWlan[];
// Switches to communicate app state information
extern const char kLastLaunchedApp[];
extern const char kPreviousApp[];
// Cast Receiver switches
extern const char kAcceptResourceProvider[];
// ALSA-based CMA switches. (Only valid for audio products.)
// TODO(sergeyu): kAlsaEnableUpsampling and kAlsaCheckCloseTimeout are
// implemented in StreamMixer, which is not ALSA-specific - it's also used on
// Fuchsia. Rename these flags.
extern const char kAlsaAmpDeviceName[];
extern const char kAlsaAmpElementName[];
extern const char kAlsaCheckCloseTimeout[];
extern const char kAlsaEnableUpsampling[];
extern const char kAlsaFixedOutputSampleRate[];
extern const char kAlsaMuteDeviceName[];
extern const char kAlsaMuteElementName[];
extern const char kAlsaOutputAvailMin[];
extern const char kAlsaOutputBufferSize[];
extern const char kAlsaOutputPeriodSize[];
extern const char kAlsaOutputStartThreshold[];
extern const char kAlsaVolumeDeviceName[];
extern const char kAlsaVolumeElementName[];
extern const char kAudioOutputChannels[];
extern const char kAudioOutputSampleRate[];
extern const char kMaxOutputVolumeDba1m[];
extern const char kMixerEnableDynamicChannelCount[];
extern const char kMixerSourceAudioReadyThresholdMs[];
extern const char kMixerSourceInputQueueMs[];
// Memory pressure switches
extern const char kMemPressureSystemReservedKb[];
// GPU process switches
extern const char kCastInitialScreenWidth[];
extern const char kCastInitialScreenHeight[];
extern const char kGraphicsBufferCount[];
extern const char kVSyncInterval[];
// Graphics switches
extern const char kDesktopWindow1080p[];
extern const char kForceMediaResolutionHeight[];
extern const char kForceMediaResolutionWidth[];
// UI switches
extern const char kEnableInput[];
extern const char kSystemGestureStartWidth[];
extern const char kSystemGestureStartHeight[];
extern const char kBottomSystemGestureStartHeight[];
extern const char kBackGestureHorizontalThreshold[];
extern const char kEnableTopDragGesture[];
extern const char kManagedMode[];
// Background color used when Chromium hasn't rendered anything yet.
extern const char kCastAppBackgroundColor[];
extern const char kMixerServiceEndpoint[];
extern const char kMixerServicePort[];
extern const char kCastMemoryPressureCriticalFraction[];
extern const char kCastMemoryPressureModerateFraction[];
extern const char kDisableMojoRenderer[];
// OTA update related switches.
extern const char kForceUpdateRemoteUrl[];
extern const char kSysInfoFilePath[];
// Extension switches.
extern const char kExtensionsDir[];
// Switches for Cast browser decoupling.
extern const char kDeferFeatureList[];
extern const char kUseCastBrowserPrefConfig[];
extern const char kInProcessBroker[];
} // namespace switches
namespace chromecast {
// Gets boolean value from switch |switch_string|.
// --|switch_string| -> true
// --|switch_string|="true" -> true
// --|switch_string|="false" -> false
// no switch named |switch_string| -> |default_value|
bool GetSwitchValueBoolean(const std::string& switch_string,
const bool default_value);
// Gets an integer value from switch |switch_name|. If the switch is not present
// in the command line, or the value is not an integer, the |default_value| is
// returned.
int GetSwitchValueInt(const std::string& switch_name, const int default_value);
// Gets a non-negative integer value from switch |switch_name|. If the switch is
// not present in the command line, or the value is not a non-negative integer,
// the |default_value| is returned.
int GetSwitchValueNonNegativeInt(const std::string& switch_name,
const int default_value);
// Gets a floating point value from switch |switch_name|. If the switch is not
// present in the command line, or the value is not a number, the
// |default_value| is returned.
double GetSwitchValueDouble(const std::string& switch_name,
const double default_value);
// Gets a color value from the format "#AARRGGBB" (hex).
uint32_t GetSwitchValueColor(const std::string& switch_name,
const uint32_t default_value);
} // namespace chromecast
#endif // CHROMECAST_BASE_CHROMECAST_SWITCHES_H_