Skip to content

Commit

Permalink
[RemotePlayback] Don't expose Remote Playback API for WebView.
Browse files Browse the repository at this point in the history
I don't recall if we decided to support disableRemotePlayback on
WebView, but I don't see why we would want it.

BUG=578833
TEST=WebViewLayoutTest

Review-Url: https://codereview.chromium.org/2528433004
Cr-Commit-Position: refs/heads/master@{#435504}
  • Loading branch information
avayvod authored and Commit bot committed Dec 1, 2016
1 parent e7592f0 commit df718b9
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions android_webview/lib/main/aw_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
// https://crbug.com/521319
cl->AppendSwitch(switches::kDisablePresentationAPI);

// WebView doesn't support Remote Playback API for the same reason as the
// Presentation API, see https://crbug.com/521319.
cl->AppendSwitch(switches::kDisableRemotePlaybackAPI);

#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
if (cl->GetSwitchValueASCII(switches::kProcessType).empty()) {
// Browser process (no type specified).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,6 @@ interface HTMLMediaElement : HTMLElement
getter currentTime
getter defaultMuted
getter defaultPlaybackRate
getter disableRemotePlayback
getter duration
getter ended
getter error
Expand Down Expand Up @@ -2068,7 +2067,6 @@ interface HTMLMediaElement : HTMLElement
setter currentTime
setter defaultMuted
setter defaultPlaybackRate
setter disableRemotePlayback
setter loop
setter muted
setter onencrypted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,23 @@ interface PresentationConnectionAvailableEvent : Event
interface PresentationConnectionCloseEvent : Event
interface PresentationRequest : EventTarget

# remoteplayback api not supported in webview crbug.com/521319
interface RemotePlayback : EventTarget

# crbug.com/589500
interface HTMLMediaElement : HTMLElement
getter sinkId
method setSinkId
setter disableRemotePlayback # crbug.com/521319
getter disableRemotePlayback # crbug.com/521319
getter remote # crbug.com/521319

interface Navigator
getter permissions # crbug.com/490120
method registerProtocolHandler # crbug.com/589502
getter presentation # crbug.com/521319
method unregisterProtocolHandler # crbug.com/589502

# notifications not yet supported in webview, crbug.com/551446
interface ServiceWorkerRegistration : EventTarget
getter pushManager
Expand Down
3 changes: 3 additions & 0 deletions content/child/runtime_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (command_line.HasSwitch(switches::kDisablePresentationAPI))
WebRuntimeFeatures::enablePresentationAPI(false);

if (command_line.HasSwitch(switches::kDisableRemotePlaybackAPI))
WebRuntimeFeatures::enableRemotePlaybackAPI(false);

const std::string webfonts_intervention_v2_group_name =
base::FieldTrialList::FindFullName("WebFontsInterventionV2");
const std::string webfonts_intervention_v2_about_flag =
Expand Down
3 changes: 3 additions & 0 deletions content/public/common/content_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ const char kDisableReadingFromCanvas[] = "disable-reading-from-canvas";
// option is specified or not.
const char kDisableRemoteFonts[] = "disable-remote-fonts";

// Disables the RemotePlayback API.
const char kDisableRemotePlaybackAPI[] = "disable-remote-playback-api";

// Turns off the accessibility in the renderer.
const char kDisableRendererAccessibility[] = "disable-renderer-accessibility";

Expand Down
1 change: 1 addition & 0 deletions content/public/common/content_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ CONTENT_EXPORT extern const char kDisablePresentationAPI[];
CONTENT_EXPORT extern const char kDisableRGBA4444Textures[];
CONTENT_EXPORT extern const char kDisableReadingFromCanvas[];
extern const char kDisableRemoteFonts[];
CONTENT_EXPORT extern const char kDisableRemotePlaybackAPI[];
extern const char kDisableRendererAccessibility[];
CONTENT_EXPORT extern const char kDisableRendererBackgrounding[];
CONTENT_EXPORT extern const char kDisableResizeLock[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

partial interface HTMLMediaElement {
[RuntimeEnabled=RemotePlayback] readonly attribute RemotePlayback remote;
[CEReactions, Reflect] attribute boolean disableRemotePlayback;
[CEReactions, Reflect, RuntimeEnabled=RemotePlayback] attribute boolean disableRemotePlayback;
};
4 changes: 4 additions & 0 deletions third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,4 +358,8 @@ void WebRuntimeFeatures::enableBackgroundVideoTrackOptimization(bool enable) {
RuntimeEnabledFeatures::setBackgroundVideoTrackOptimizationEnabled(enable);
}

void WebRuntimeFeatures::enableRemotePlaybackAPI(bool enable) {
RuntimeEnabledFeatures::setRemotePlaybackEnabled(enable);
}

} // namespace blink
1 change: 1 addition & 0 deletions third_party/WebKit/public/web/WebRuntimeFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class WebRuntimeFeatures {
BLINK_EXPORT static void enableReloadwithoutSubResourceCacheRevalidation(
bool);
BLINK_EXPORT static void enableRenderingPipelineThrottling(bool);
BLINK_EXPORT static void enableRemotePlaybackAPI(bool);
BLINK_EXPORT static void enableRootLayerScrolling(bool);
BLINK_EXPORT static void enableScriptedSpeech(bool);
BLINK_EXPORT static void enableScrollAnchoring(bool);
Expand Down

0 comments on commit df718b9

Please sign in to comment.