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

Unified Diff: remoting/host/host_attributes_win.h

Issue 2464293002: [Chromoting] GetHostAttributes with tests (Closed)
Patch Set: Resolve review comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/host_attributes_win.h
diff --git a/remoting/host/host_attributes_win.h b/remoting/host/host_attributes_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..ca7b4a168dfdb5e7d59412cc05633be19e7fd944
--- /dev/null
+++ b/remoting/host/host_attributes_win.h
@@ -0,0 +1,36 @@
+// Copyright 2016 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 REMOTING_HOST_HOST_ATTRIBUTES_WIN_H_
+#define REMOTING_HOST_HOST_ATTRIBUTES_WIN_H_
+
+#include "remoting/host/host_attributes.h"
+#include "third_party/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h"
+
+namespace remoting {
+
+namespace {
+
+inline constexpr bool IsDebug() {
Sergey Ulanov 2016/11/07 20:11:33 I don't think that putting this in the per-platfor
Hzj_jie 2016/11/08 01:29:54 Done.
+#if defined(NDEBUG)
+ return false;
+#else
+ return true;
+#endif
+}
+
+} // namespace
+
+// TODO(zijiehe): Add DirectX version attributes. Blocked by change
+// https://codereview.chromium.org/2468083002/.
+static StaticAttribute kStaticAttributes[] = {
Hzj_jie 2016/11/05 05:29:28 MSVC does not allow to change the value of a const
+ StaticAttribute::Create( { "Debug-Build", &IsDebug } ),
Hzj_jie 2016/11/05 05:29:28 MSVC does not allow sizeof(int[0]), i.e. size of a
Sergey Ulanov 2016/11/07 20:11:33 StaticAttribute::Create() is not constexpr, so thi
Hzj_jie 2016/11/08 01:29:54 I think requiring static initializer or not depend
Sergey Ulanov 2016/11/08 20:11:05 I think if an attributes cannot be evaluated in co
Hzj_jie 2016/11/09 02:37:52 Yes, that's a good opinion, for expensive but cach
+};
+static constexpr DynamicAttribute kDynamicAttributes[] = {
+ { "DirectX-Capturer", &webrtc::ScreenCapturerWinDirectx::IsSupported },
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_HOST_ATTRIBUTES_WIN_H_
« remoting/host/host_attributes.cc ('K') | « remoting/host/host_attributes_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698