Commit 8027acd0 authored by urvang@google.com's avatar urvang@google.com

Add a switch to Chromium to enable/disable 'image/webp' accept header.

This switch is off by default. It will be turned on later once we verify that this change doesn't break any sites.

It can be can be enabled through command-line (--enable-webp-in-accept-header) or through 'chrome://flags'.

Note: This is a follow up of the pre-requisite change in Blink: https://codereview.chromium.org/13814024/

BUG=169182

Review URL: https://chromiumcodereview.appspot.com/14273007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194853 0039d316-1c4b-4281-b951-d872f2087c98
parent 8a938fed
......@@ -6777,6 +6777,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION" desc="Description for the flag to enable locally managed users.">
Enables support for user profiles that are managed by another user and can have restrictions applied.
</message>
<message name="IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME" desc="Title for the flag to enable 'image/webp' in accept header.">
Enable 'image/webp' accept header
</message>
<message name="IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION" desc="Description for the flag to enable 'image/webp' in accept header.">
Enables 'image/webp' accept header in HTTP requests for images, to denote WebP image support.
</message>
<message name="IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC" desc="Generic 'Automatic' experiment choice option name.">
Automatic
......
......@@ -1349,6 +1349,13 @@ const Experiment kExperiments[] = {
kOsLinux | kOsCrOS | kOsAndroid,
SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
},
{
"enable-webp-in-accept-header",
IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
kOsAll,
SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
},
};
const Experiment* experiments = kExperiments;
......
......@@ -834,6 +834,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableMemoryBenchmarking,
switches::kEnableLogging,
switches::kEnableVsyncNotification,
switches::kEnableWebPInAcceptHeader,
switches::kDisableMediaSource,
switches::kDisableRendererSideMixing,
switches::kEnableStrictSiteIsolation,
......@@ -943,7 +944,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
cc::switches::kTopControlsHideThreshold,
cc::switches::kTopControlsShowThreshold,
cc::switches::kTraceAllRenderedFrames,
cc::switches::kTraceOverdraw
cc::switches::kTraceOverdraw,
};
renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames,
arraysize(kSwitchNames));
......
......@@ -777,4 +777,7 @@ const char kEnableVsyncNotification[] = "enable-vsync-notification";
const char kEnableOverscrollHistoryNavigation[] =
"enable-overscroll-history-navigation";
// Enables 'image/webp' accept header for image requests.
const char kEnableWebPInAcceptHeader[] = "enable-webp-in-accept-header";
} // namespace switches
......@@ -244,6 +244,8 @@ extern const char kDisableCarbonInterposing[];
CONTENT_EXPORT extern const char kTestCompositor[];
#endif
extern const char kEnableWebPInAcceptHeader[];
} // namespace switches
#endif // CONTENT_PUBLIC_COMMON_CONTENT_SWITCHES_H_
......@@ -771,6 +771,9 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
WebRuntimeFeatures::enableSeamlessIFrames(
command_line.HasSwitch(switches::kEnableExperimentalWebKitFeatures));
WebRuntimeFeatures::enableWebPInAcceptHeader(
command_line.HasSwitch(switches::kEnableWebPInAcceptHeader));
FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized());
devtools_agent_message_filter_ = new DevToolsAgentFilter();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment