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

Unified Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 48113021: Expose WebGL extension WEBGL_debug_renderer_info to Google domains (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
Index: content/browser/gpu/gpu_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index ab8029c63b925b6e481a48f346bde38809a53106..56b8f27578acf562ed8d4b7b526cd4fdf2045405 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -19,6 +19,7 @@
#include "content/browser/gpu/gpu_process_host.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/gpu_data_manager_observer.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_constants.h"
@@ -312,6 +313,17 @@ enum BlockStatusHistogram {
BLOCK_STATUS_MAX
};
+bool IsWebGLDebugRendererInfoFieldTrialEnabled() {
+ const char kWebGLDebugRendererInfoFieldTrialName[] = "WebGLDebugRendererInfo";
+ const char kWebGLDebugRendererInfoFieldTrialEnabledName[] = "enabled";
+
+ base::FieldTrial* trial = base::FieldTrialList::Find(
+ kWebGLDebugRendererInfoFieldTrialName);
+ if (!trial)
+ return false;
+ return trial->group_name() == kWebGLDebugRendererInfoFieldTrialEnabledName;
Alexei Svitkine (slow) 2013/10/30 18:10:18 Instead, just use base::FieldTrialList::FindFullNa
Zhenyao Mo 2013/10/30 20:20:50 Done. See chrome_render_message_filter.cc
+}
+
} // namespace anonymous
void GpuDataManagerImplPrivate::InitializeForTesting(
@@ -1259,6 +1271,22 @@ void GpuDataManagerImplPrivate::Notify3DAPIBlocked(const GURL& url,
url, render_process_id, render_view_id, requester);
}
+bool GpuDataManagerImplPrivate::IsWebGLDebugRendererInfoAllowed(
+ const GURL& url) const {
+ const CommandLine* command_line = CommandLine::ForCurrentProcess();
+ // Allow someone to disable this extension in WebGL.
+ if (command_line->HasSwitch(switches::kDisableWebGLDebugRendererInfo))
+ return false;
+ // Allow someone to force-enable this extension. This is mostly for
+ // testing purpose.
+ if (command_line->HasSwitch(switches::kEnableWebGLDebugRendererInfo))
+ return true;
Ken Russell (switch to Gerrit) 2013/10/29 23:15:35 The test of the kEnableWebGLDebugRendererInfo swit
Zhenyao Mo 2013/10/29 23:33:43 I just realized we can probably get rid of the kEn
Zhenyao Mo 2013/10/29 23:43:37 Never mind about this auto flag thing. I read the
Ken Russell (switch to Gerrit) 2013/10/29 23:58:16 OK. Using --force-fieldtrials and removing the kEn
+
+ if (!GetContentClient()->browser()->AllowWebGLDebugRendererInfoForDomain(url))
+ return false;
+ return IsWebGLDebugRendererInfoFieldTrialEnabled();
+}
+
void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() {
gpu_process_accessible_ = false;
gpu_info_.finalized = true;

Powered by Google App Engine
This is Rietveld 408576698