summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhayato@chromium.org <hayato@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-30 09:13:16 +0000
committerhayato@chromium.org <hayato@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-30 09:13:16 +0000
commitd2edc6705ee1da92a09d2791ca679a1e2ad4e296 (patch)
tree326efb1518f38d6c0994e0f1d9867d409f1019a4
parent483dc7e3e358e8211fb7455240093fc1e50ef9f1 (diff)
downloadchromium_src-d2edc6705ee1da92a09d2791ca679a1e2ad4e296.zip
chromium_src-d2edc6705ee1da92a09d2791ca679a1e2ad4e296.tar.gz
chromium_src-d2edc6705ee1da92a09d2791ca679a1e2ad4e296.tar.bz2
Add enable-shadow-dom command line flag.
BUG=111112 TEST=Run chrome with '--enable-shadow-dom' and enter 'new WebKitShadowRoot(document.createElement('div'))' in Console. Review URL: http://codereview.chromium.org/9285014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119652 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd6
-rw-r--r--chrome/browser/about_flags.cc7
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc1
-rw-r--r--content/public/common/content_switches.cc3
-rw-r--r--content/public/common/content_switches.h1
-rw-r--r--content/renderer/render_thread_impl.cc3
6 files changed, 21 insertions, 0 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index bd1b45b..5a821bd 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5078,6 +5078,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_MEDIA_STREAM_DESCRIPTION" desc="Description for the flag to enable MediaStream, GetUserMedia and PeerConnection.">
Enable MediaStream, GetUserMedia, and PeerConnection APIs for WebRTC functionality. More info at webrtc.org.
</message>
+ <message name="IDS_FLAGS_SHADOW_DOM_NAME" desc="Name for the flag to enable Shadow DOM.">
+ Enable Shadow DOM.
+ </message>
+ <message name="IDS_FLAGS_SHADOW_DOM_DESCRIPTION" desc="Description for the flag to enable Shadow DOM.">
+ This API allows web applications to use Web Components.
+ </message>
<!-- Crashes -->
<message name="IDS_CRASHES_TITLE" desc="Title for the chrome://crashes page.">
Crashes
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index fb78147..b4f2349 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -558,6 +558,13 @@ const Experiment kExperiments[] = {
kOsAll,
SINGLE_VALUE_TYPE(switches::kDisableUberPage)
},
+ {
+ "enable-shadow-dom",
+ IDS_FLAGS_SHADOW_DOM_NAME,
+ IDS_FLAGS_SHADOW_DOM_DESCRIPTION,
+ kOsAll,
+ SINGLE_VALUE_TYPE(switches::kEnableShadowDOM)
+ },
};
const Experiment* experiments = kExperiments;
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 80d1e68..52b3cfb 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -661,6 +661,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableLogging,
switches::kEnableMediaSource,
switches::kEnableMediaStream,
+ switches::kEnableShadowDOM,
switches::kEnableStrictSiteIsolation,
switches::kDisableFullScreen,
switches::kEnablePepperTesting,
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 391d4f8..6ddd375 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -253,6 +253,9 @@ const char kEnableSandboxLogging[] = "enable-sandbox-logging";
// Enable the seccomp sandbox (Linux only)
const char kEnableSeccompSandbox[] = "enable-seccomp-sandbox";
+// Enable shadow DOM API
+const char kEnableShadowDOM[] = "enable-shadow-dom";
+
// Enables StatsTable, logging statistics to a global named shared memory table.
const char kEnableStatsTable[] = "enable-stats-table";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index a666779..ba48bfe 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -88,6 +88,7 @@ CONTENT_EXPORT extern const char kEnablePrivilegedWebGLExtensions[];
extern const char kEnableSSLCachedInfo[];
extern const char kEnableSandboxLogging[];
extern const char kEnableSeccompSandbox[];
+extern const char kEnableShadowDOM[];
CONTENT_EXPORT extern const char kEnableStatsTable[];
extern const char kEnableStrictSiteIsolation[];
CONTENT_EXPORT extern const char kEnableThreadedCompositing[];
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index c9f4099..0cb8d20 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -547,6 +547,9 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
WebRuntimeFeatures::enableQuota(true);
+ WebRuntimeFeatures::enableShadowDOM(
+ command_line.HasSwitch(switches::kEnableShadowDOM));
+
FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized());
if (content::GetContentClient()->renderer()->