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

Unified Diff: chrome/browser/renderer_host/chrome_render_message_filter.cc

Issue 57563004: Merge r232231: Expose WebGL extension WEBGL_debug_renderer_info to Google domains (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1650/src/
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/renderer_host/chrome_render_message_filter.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_render_message_filter.cc
===================================================================
--- chrome/browser/renderer_host/chrome_render_message_filter.cc (revision 232511)
+++ chrome/browser/renderer_host/chrome_render_message_filter.cc (working copy)
@@ -8,6 +8,8 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/automation/automation_resource_message_filter.h"
@@ -23,10 +25,12 @@
#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_system.h"
+#include "chrome/browser/google/google_util.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/net/predictor.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/task_manager/task_manager.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/api/i18n/default_locale_handler.h"
#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/extensions/extension_messages.h"
@@ -147,6 +151,8 @@
OnCanTriggerClipboardRead)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CanTriggerClipboardWrite,
OnCanTriggerClipboardWrite)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_IsWebGLDebugRendererInfoAllowed,
+ OnIsWebGLDebugRendererInfoAllowed)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -622,6 +628,28 @@
origin, render_process_id_, APIPermission::kClipboardWrite));
}
+void ChromeRenderMessageFilter::OnIsWebGLDebugRendererInfoAllowed(
+ const GURL& origin, bool* allowed) {
+ *allowed = false;
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kDisableWebGLDebugRendererInfo))
+ return;
+
+ // TODO(zmo): in this experimental stage, we only expose WebGL extension
+ // WEBGL_debug_renderer_info for Google domains. Once we finish the experiment
+ // and make a decision, this extension should be avaiable to all or none.
+ if (!google_util::IsGoogleDomainUrl(origin, google_util::ALLOW_SUBDOMAIN,
+ google_util::ALLOW_NON_STANDARD_PORTS)) {
+ return;
+ }
+
+ const char kWebGLDebugRendererInfoFieldTrialName[] = "WebGLDebugRendererInfo";
+ const char kWebGLDebugRendererInfoFieldTrialEnabledName[] = "enabled";
+ *allowed = (base::FieldTrialList::FindFullName(
+ kWebGLDebugRendererInfoFieldTrialName) ==
+ kWebGLDebugRendererInfoFieldTrialEnabledName);
+}
+
void ChromeRenderMessageFilter::OnGetCookies(
const GURL& url,
const GURL& first_party_for_cookies,
« no previous file with comments | « chrome/browser/renderer_host/chrome_render_message_filter.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698