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

Unified Diff: remoting/host/host_attributes.cc

Issue 2936603003: [Chromoting] Implement host safe-mode
Patch Set: Created 3 years, 6 months 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
« no previous file with comments | « remoting/host/desktop_environment_options.cc ('k') | remoting/host/safe_mode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/host_attributes.cc
diff --git a/remoting/host/host_attributes.cc b/remoting/host/host_attributes.cc
index 307d04e289fd66c4df9a4ed1219155dcf2904287..d75157442cf56a0ae0ee6ef865f4f670de0733a7 100644
--- a/remoting/host/host_attributes.cc
+++ b/remoting/host/host_attributes.cc
@@ -14,6 +14,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "build/build_config.h"
+#include "remoting/host/safe_mode.h"
#if defined(OS_WIN)
#include "third_party/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h"
@@ -65,7 +66,19 @@ inline constexpr bool IsNonOfficialBuild() {
}
#if defined(OS_WIN)
+inline bool IsDirectxCapturerSupported() {
+ if (ExecuteHostInSafeMode()) {
+ return false;
+ }
+
+ return webrtc::ScreenCapturerWinDirectx::IsSupported();
+}
+
inline bool MinD3DFeatureLevelGreatThan10() {
+ if (ExecuteHostInSafeMode()) {
+ return false;
+ }
+
webrtc::DxgiDuplicatorController::D3dInfo info;
if (webrtc::DxgiDuplicatorController::Instance()->RetrieveD3dInfo(&info)) {
return info.min_feature_level >= D3D_FEATURE_LEVEL_10_0;
@@ -74,6 +87,10 @@ inline bool MinD3DFeatureLevelGreatThan10() {
}
inline bool MinD3DFeatureLevelGreatThan11() {
+ if (ExecuteHostInSafeMode()) {
+ return false;
+ }
+
webrtc::DxgiDuplicatorController::D3dInfo info;
if (webrtc::DxgiDuplicatorController::Instance()->RetrieveD3dInfo(&info)) {
return info.min_feature_level >= D3D_FEATURE_LEVEL_11_0;
@@ -82,6 +99,10 @@ inline bool MinD3DFeatureLevelGreatThan11() {
}
inline bool MinD3DFeatureLevelGreatThan12() {
+ if (ExecuteHostInSafeMode()) {
+ return false;
+ }
+
webrtc::DxgiDuplicatorController::D3dInfo info;
if (webrtc::DxgiDuplicatorController::Instance()->RetrieveD3dInfo(&info)) {
return info.min_feature_level >= D3D_FEATURE_LEVEL_12_0;
@@ -106,8 +127,9 @@ static constexpr Attribute kAttributes[] = {
{ "ChromiumBrand", &IsChromiumBranded },
{ "OfficialBuild", &IsOfficialBuild },
{ "NonOfficialBuild", &IsNonOfficialBuild },
+ { "Safe-Mode", &ExecuteHostInSafeMode },
#if defined(OS_WIN)
- { "DirectX-Capturer", &webrtc::ScreenCapturerWinDirectx::IsSupported },
+ { "DirectX-Capturer", &IsDirectxCapturerSupported },
{ "MinD3DGT10", &MinD3DFeatureLevelGreatThan10 },
{ "MinD3DGT11", &MinD3DFeatureLevelGreatThan11 },
{ "MinD3DGT12", &MinD3DFeatureLevelGreatThan12 },
« no previous file with comments | « remoting/host/desktop_environment_options.cc ('k') | remoting/host/safe_mode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698