WebKit Bugzilla
Attachment 360356 Details for
Bug 193863
: Web Inspector: provide a way to edit page WebRTC settings on a remote target
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193863-20190128105049.patch (text/plain), 40.70 KB, created by
Devin Rousso
on 2019-01-28 10:50:50 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-01-28 10:50:50 PST
Size:
40.70 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 64b553ed70d30bc84e1b306ae116da25e7ddecb3..7d81fc15abf7e50c9e386d1fb92c4ad04cb0f99f 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-28 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/protocol/Page.json: >+ Add more values to the `Setting` enum type: >+ - `ICECandidateFilteringEnabled` >+ - `MediaCaptureRequiresSecureConnection` >+ - `MockCaptureDevicesEnabled` >+ > 2019-01-26 Devin Rousso <drousso@apple.com> > > Web Inspector: provide a way to edit the user agent of a remote target >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index aaa113994d607050cafb0e90b26bcb69e95e3225..b2ceda51621880c0829cb6027097b49d0d582dbd 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,45 @@ >+2019-01-28 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html >+ inspector/page/overrideSetting-MockCaptureDevicesEnabled.html >+ >+ * inspector/agents/InspectorPageAgent.cpp: >+ >+ * page/Settings.yaml: >+ * page/SettingsBase.h: >+ * page/SettingsBase.cpp: >+ (SettingsBase::iceCandidateFilteringEnabledChanged): Added. >+ (SettingsBase::mockCaptureDevicesEnabledChanged): Added. >+ * page/SettingsDefaultValues.h: >+ * Scripts/GenerateSettings.rb: >+ * Scripts/SettingsTemplates/Settings.cpp.erb: >+ Add page-level settings for WebRTC preferences. >+ >+ * Modules/mediastream/UserMediaController.cpp: >+ (WebCore::UserMediaController::canCallGetUserMedia): >+ >+ * testing/InternalSettings.cpp: >+ (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection): >+ >+ * testing/Internals.h: >+ * testing/Internals.cpp: >+ (WebCore::Internals::Internals): >+ (WebCore::Internals::setMockMediaCaptureDevicesEnabled): >+ (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added. >+ >+ * page/DeprecatedGlobalSettings.h: >+ * page/DeprecatedGlobalSettings.cpp: >+ (WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted. >+ (WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted. >+ (WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted. >+ (WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted. >+ > 2019-01-26 Simon Fraser <simon.fraser@apple.com> > > Allow scrolling tree nodes to exist in a detached state >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index ffddf7c4c6be26091f8a4312fd3ddd2ad0174d4f..7f5e5659fe717693093a341e72187de4bbd6d4b9 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,22 @@ >+2019-01-28 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Base/Main.js: >+ (WI.loaded): >+ (WI.initializeTarget): >+ (WI._handleDeviceSettingsToolbarButtonClicked): >+ (WI._handleDeviceSettingsToolbarButtonClicked.createCheckbox): >+ (WI._handleDeviceSettingsToolbarButtonClicked.createColumns): Deleted. >+ * UserInterface/Views/Main.css: >+ (.device-settings-content .container): Added. >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2019-01-26 Devin Rousso <drousso@apple.com> > > Web Inspector: handle CSS Color 4 color syntaxes >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 03a1013b6dcc3be10fd251b1ca4d7d97914c3e1d..068a9c94acb530ed108903a534a15e08d474d390 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-28 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/WebPreferences.yaml: >+ Add page-level settings for WebRTC preferences. >+ > 2019-01-26 Simon Fraser <simon.fraser@apple.com> > > Allow scrolling tree nodes to exist in a detached state >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 3c6d71db37f7ba5bc917c242e8aa5f098e327462..2faa97a0936854967378d925e70dd872c284eb89 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-28 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView/WebView.mm: >+ (-[WebView _preferencesChanged:]): >+ Add page-level settings for WebRTC preferences. >+ > 2019-01-25 Keith Rollin <krollin@apple.com> > > Update WebKitAdditions.xcconfig with correct order of variable definitions >diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json >index 7142a0e582ea6a20049c0268d40a62639410ab43..769bf4b3b8f98e6c4ed39f5506955727e72f0815 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Page.json >+++ b/Source/JavaScriptCore/inspector/protocol/Page.json >@@ -9,7 +9,10 @@ > "description": "List of settings able to be overridden by WebInspector. Keep this in sync with FOR_EACH_INSPECTOR_OVERRIDE_SETTING.", > "enum": [ > "AuthorAndUserStylesEnabled", >+ "ICECandidateFilteringEnabled", > "ImagesEnabled", >+ "MediaCaptureRequiresSecureConnection", >+ "MockCaptureDevicesEnabled", > "NeedsSiteSpecificQuirks", > "ScriptEnabled", > "WebSecurityEnabled" >diff --git a/Source/WebCore/Modules/mediastream/UserMediaController.cpp b/Source/WebCore/Modules/mediastream/UserMediaController.cpp >index 6251a7ec05da629b8b450dbe37396ce8be866ce5..21ea1b574b481a89c968bdc80db8394a27ffbd55 100644 >--- a/Source/WebCore/Modules/mediastream/UserMediaController.cpp >+++ b/Source/WebCore/Modules/mediastream/UserMediaController.cpp >@@ -29,13 +29,13 @@ > #if ENABLE(MEDIA_STREAM) > > #include "DOMWindow.h" >-#include "DeprecatedGlobalSettings.h" > #include "Document.h" > #include "DocumentLoader.h" > #include "Frame.h" > #include "HTMLIFrameElement.h" > #include "HTMLParserIdioms.h" > #include "SchemeRegistry.h" >+#include "Settings.h" > #include "UserMediaRequest.h" > > namespace WebCore { >@@ -113,7 +113,9 @@ UserMediaController::GetUserMediaAccess UserMediaController::canCallGetUserMedia > { > ASSERT(!types.isEmpty()); > >- bool requiresSecureConnection = DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection(); >+ bool requiresSecureConnection = true; >+ if (auto page = document.page()) >+ requiresSecureConnection = page->settings().mediaCaptureRequiresSecureConnection(); > auto& documentLoader = *document.loader(); > if (requiresSecureConnection && !isSecure(documentLoader)) > return GetUserMediaAccess::InsecureDocument; >diff --git a/Source/WebCore/Scripts/GenerateSettings.rb b/Source/WebCore/Scripts/GenerateSettings.rb >index 8aca9456bfe74edc3f9b7d81ff7f01b686dc12e3..19a19bf364112f15355cf0dc76a9c5963c30bf60 100755 >--- a/Source/WebCore/Scripts/GenerateSettings.rb >+++ b/Source/WebCore/Scripts/GenerateSettings.rb >@@ -120,7 +120,7 @@ class Setting > end > > def setterFunctionName >- if @name.start_with?("css", "xss", "ftp", "dom", "dns") >+ if @name.start_with?("css", "xss", "ftp", "dom", "dns", "ice") > "set" + @name[0..2].upcase + @name[3..@name.length] > else > "set" + @name[0].upcase + @name[1..@name.length] >diff --git a/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb b/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb >index c56e7ae7d4f0faa39adcd1982a5ec2efc52af461..036867c59df3b30d32dd3af28a54271d0b0b7425 100644 >--- a/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb >+++ b/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb >@@ -125,7 +125,13 @@ void Settings::<%= @setting.setterFunctionName %>InspectorOverride(Optional<<%= > if (m_<%= @setting.name %>InspectorOverride == <%= @setting.name %>InspectorOverride) > return; > m_<%= @setting.name %>InspectorOverride = <%= @setting.name %>InspectorOverride; >+<%- if @setting.conditional -%> >+#if ENABLE(<%= @setting.conditional %>) >+<%- end -%> > <%= @setting.onChange %>(); >+<%- if @setting.conditional -%> >+#endif >+<%- end -%> > } > > <%- end -%> >diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >index 6cd1fd7e252c8daf6ff1e9c89e592dad709ea1e7..1333aa937d4070cbbb77315ec9d76ce3f5323fee 100644 >--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >@@ -83,9 +83,13 @@ namespace WebCore { > > using namespace Inspector; > >+// Keep this in sync with Page.Setting > #define FOR_EACH_INSPECTOR_OVERRIDE_SETTING(macro) \ > macro(AuthorAndUserStylesEnabled) \ >+ macro(ICECandidateFilteringEnabled) \ > macro(ImagesEnabled) \ >+ macro(MediaCaptureRequiresSecureConnection) \ >+ macro(MockCaptureDevicesEnabled) \ > macro(NeedsSiteSpecificQuirks) \ > macro(ScriptEnabled) \ > macro(WebSecurityEnabled) >diff --git a/Source/WebCore/page/DeprecatedGlobalSettings.cpp b/Source/WebCore/page/DeprecatedGlobalSettings.cpp >index f4995d3870c2bda06e13f019f9de5ec203059eff..cf4ccc80e93936d568cd550e028b68152eb94d2d 100644 >--- a/Source/WebCore/page/DeprecatedGlobalSettings.cpp >+++ b/Source/WebCore/page/DeprecatedGlobalSettings.cpp >@@ -31,11 +31,6 @@ > #include "RuntimeApplicationChecks.h" > #include <wtf/NeverDestroyed.h> > >-#if ENABLE(MEDIA_STREAM) >-#include "MockRealtimeMediaSourceCenter.h" >- >-#endif >- > namespace WebCore { > > #if USE(AVFOUNDATION) >@@ -51,11 +46,6 @@ bool DeprecatedGlobalSettings::gMockScrollbarsEnabled = false; > bool DeprecatedGlobalSettings::gUsesOverlayScrollbars = false; > bool DeprecatedGlobalSettings::gMockScrollAnimatorEnabled = false; > >-#if ENABLE(MEDIA_STREAM) >-bool DeprecatedGlobalSettings::gMockCaptureDevicesEnabled = false; >-bool DeprecatedGlobalSettings::gMediaCaptureRequiresSecureConnection = true; >-#endif >- > #if PLATFORM(WIN) > bool DeprecatedGlobalSettings::gShouldUseHighResolutionTimers = true; > #endif >@@ -113,29 +103,6 @@ void DeprecatedGlobalSettings::setGStreamerEnabled(bool enabled) > } > #endif > >-#if ENABLE(MEDIA_STREAM) >-bool DeprecatedGlobalSettings::mockCaptureDevicesEnabled() >-{ >- return gMockCaptureDevicesEnabled; >-} >- >-void DeprecatedGlobalSettings::setMockCaptureDevicesEnabled(bool enabled) >-{ >- gMockCaptureDevicesEnabled = enabled; >- MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled(enabled); >-} >- >-bool DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection() >-{ >- return gMediaCaptureRequiresSecureConnection; >-} >- >-void DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(bool mediaCaptureRequiresSecureConnection) >-{ >- gMediaCaptureRequiresSecureConnection = mediaCaptureRequiresSecureConnection; >-} >-#endif >- > // It's very important that this setting doesn't change in the middle of a document's lifetime. > // The Mac port uses this flag when registering and deregistering platform-dependent scrollbar > // objects. Therefore, if this changes at an unexpected time, deregistration may not happen >diff --git a/Source/WebCore/page/DeprecatedGlobalSettings.h b/Source/WebCore/page/DeprecatedGlobalSettings.h >index 216da09f87de45a7d7216b2965fe1291a191e7bf..620d12a18aef92a62d5fc74a7c3aab7a976e7944 100644 >--- a/Source/WebCore/page/DeprecatedGlobalSettings.h >+++ b/Source/WebCore/page/DeprecatedGlobalSettings.h >@@ -103,14 +103,6 @@ public: > static void setShouldManageAudioSessionCategory(bool flag) { gManageAudioSession = flag; } > static bool shouldManageAudioSessionCategory() { return gManageAudioSession; } > #endif >- >-#if ENABLE(MEDIA_STREAM) >- static bool mockCaptureDevicesEnabled(); >- WEBCORE_EXPORT static void setMockCaptureDevicesEnabled(bool); >- >- static bool mediaCaptureRequiresSecureConnection(); >- WEBCORE_EXPORT static void setMediaCaptureRequiresSecureConnection(bool); >-#endif > > WEBCORE_EXPORT static void setAllowsAnySSLCertificate(bool); > static bool allowsAnySSLCertificate(); >@@ -140,11 +132,6 @@ private: > WEBCORE_EXPORT static bool gDisableScreenSizeOverride; > #endif > WEBCORE_EXPORT static bool gManageAudioSession; >- >-#if ENABLE(MEDIA_STREAM) >- static bool gMockCaptureDevicesEnabled; >- static bool gMediaCaptureRequiresSecureConnection; >-#endif > > static bool gLowPowerVideoAudioBufferSizeEnabled; > static bool gResourceLoadStatisticsEnabledEnabled; >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index ca4c57c869f4950881ba840d8bb649102eb3257e..775b5647e391f57f0d5f9228349d8bf0a5a699ab 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -796,3 +796,21 @@ editableImagesEnabled: > > adClickAttributionEnabled: > initial: false >+ >+# Deprecated >+ >+iceCandidateFilteringEnabled: >+ initial: true >+ onChange: iceCandidateFilteringEnabledChanged >+ inspectorOverride: true >+ >+mockCaptureDevicesEnabled: >+ initial: defaultMockCaptureDevicesEnabled >+ conditional: MEDIA_STREAM >+ onChange: mockCaptureDevicesEnabledChanged >+ inspectorOverride: true >+ >+mediaCaptureRequiresSecureConnection: >+ initial: true >+ conditional: MEDIA_STREAM >+ inspectorOverride: true >diff --git a/Source/WebCore/page/SettingsBase.cpp b/Source/WebCore/page/SettingsBase.cpp >index cd4c4e8118f151520a2c02b2b41343fcedd2e782..5309fcefb1a51d491472378d6fe041aac788c558 100644 >--- a/Source/WebCore/page/SettingsBase.cpp >+++ b/Source/WebCore/page/SettingsBase.cpp >@@ -48,6 +48,10 @@ > #include <limits> > #include <wtf/StdLibExtras.h> > >+#if ENABLE(MEDIA_STREAM) >+#include "MockRealtimeMediaSourceCenter.h" >+#endif >+ > namespace WebCore { > > static void invalidateAfterGenericFamilyChange(Page* page) >@@ -297,6 +301,18 @@ void SettingsBase::pluginsEnabledChanged() > Page::refreshPlugins(false); > } > >+void SettingsBase::iceCandidateFilteringEnabledChanged() >+{ >+ if (!m_page) >+ return; >+ >+ if (m_page->settings().iceCandidateFilteringEnabled()) >+ m_page->enableICECandidateFiltering(); >+ else >+ m_page->disableICECandidateFiltering(); >+ >+} >+ > #if ENABLE(TEXT_AUTOSIZING) > > void SettingsBase::shouldEnableTextAutosizingBoostChanged() >@@ -314,6 +330,17 @@ void SettingsBase::shouldEnableTextAutosizingBoostChanged() > > #endif > >+#if ENABLE(MEDIA_STREAM) >+void SettingsBase::mockCaptureDevicesEnabledChanged() >+{ >+ bool enabled = false; >+ if (m_page) >+ enabled = m_page->settings().mockCaptureDevicesEnabled(); >+ >+ MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled(enabled); >+} >+#endif >+ > void SettingsBase::userStyleSheetLocationChanged() > { > if (m_page) >diff --git a/Source/WebCore/page/SettingsBase.h b/Source/WebCore/page/SettingsBase.h >index d6471c24d9ebc70da937afab59bcbad01e119dfd..87d361690a69122b8012b951c09568309958f902 100644 >--- a/Source/WebCore/page/SettingsBase.h >+++ b/Source/WebCore/page/SettingsBase.h >@@ -188,9 +188,13 @@ protected: > void hiddenPageDOMTimerThrottlingStateChanged(); > void hiddenPageCSSAnimationSuspensionEnabledChanged(); > void resourceUsageOverlayVisibleChanged(); >+ void iceCandidateFilteringEnabledChanged(); > #if ENABLE(TEXT_AUTOSIZING) > void shouldEnableTextAutosizingBoostChanged(); > #endif >+#if ENABLE(MEDIA_STREAM) >+ void mockCaptureDevicesEnabledChanged(); >+#endif > > Page* m_page; > >diff --git a/Source/WebCore/page/SettingsDefaultValues.h b/Source/WebCore/page/SettingsDefaultValues.h >index 5ad744ac8f52843914901722849ca95997fe7577..571050242136965b6b098bb28b84b457add09198 100644 >--- a/Source/WebCore/page/SettingsDefaultValues.h >+++ b/Source/WebCore/page/SettingsDefaultValues.h >@@ -109,6 +109,11 @@ static const bool defaultConicGradient = true; > #else > static const bool defaultConicGradient = false; > #endif >- >+ >+#if PLATFORM(IOS_FAMILY_SIMULATOR) >+static const bool defaultMockCaptureDevicesEnabled = true; >+#else >+static const bool defaultMockCaptureDevicesEnabled = false; >+#endif > > } >diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp >index 6f7e519630954856bfcf95d75b993db88946c3f2..5dfb065056d47ab178234c06e359fff4499b32a3 100644 >--- a/Source/WebCore/testing/InternalSettings.cpp >+++ b/Source/WebCore/testing/InternalSettings.cpp >@@ -462,7 +462,7 @@ ExceptionOr<void> InternalSettings::setMediaCaptureRequiresSecureConnection(bool > if (!m_page) > return Exception { InvalidAccessError }; > #if ENABLE(MEDIA_STREAM) >- DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(requires); >+ m_page->settings().setMediaCaptureRequiresSecureConnection(requires); > #else > UNUSED_PARAM(requires); > #endif >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 1c84704b7b3965298a872894bcfad2e12b4da602..4856f7f94604ab92f20efe8509d36ffa1cafd81b 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -534,7 +534,7 @@ Internals::Internals(Document& document) > > #if ENABLE(MEDIA_STREAM) > setMockMediaCaptureDevicesEnabled(true); >- WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(false); >+ setMediaCaptureRequiresSecureConnection(false); > #endif > > #if ENABLE(WIRELESS_PLAYBACK_TARGET) >@@ -1472,7 +1472,16 @@ void Internals::applyRotationForOutgoingVideoSources(RTCPeerConnection& connecti > > void Internals::setMockMediaCaptureDevicesEnabled(bool enabled) > { >- WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled(enabled); >+ Document* document = contextDocument(); >+ if (auto* page = document->page()) >+ page->settings().setMockCaptureDevicesEnabled(enabled); >+} >+ >+void Internals::setMediaCaptureRequiresSecureConnection(bool enabled) >+{ >+ Document* document = contextDocument(); >+ if (auto* page = document->page()) >+ page->settings().setMediaCaptureRequiresSecureConnection(enabled); > } > > static std::unique_ptr<MediaRecorderPrivate> createRecorderMockSource() >diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h >index f70b7b6b93e7bf017364036002da4686a6eece94..37c5490d477ff54852a1400bb24975ffed86b429 100644 >--- a/Source/WebCore/testing/Internals.h >+++ b/Source/WebCore/testing/Internals.h >@@ -507,6 +507,7 @@ public: > > #if ENABLE(MEDIA_STREAM) > void setMockMediaCaptureDevicesEnabled(bool); >+ void setMediaCaptureRequiresSecureConnection(bool); > void setCustomPrivateRecorderCreator(); > #endif > >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index bf92bafb669cd61242f3c629d9fde46533667564..a9842da4a54ba4aa5069df56f5a11689442374b6 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -59,6 +59,7 @@ localizedStrings["%s cannot be modified"] = "%s cannot be modified"; > localizedStrings["%s delay"] = "%s delay"; > localizedStrings["%s eval\n%s async"] = "%s eval\n%s async"; > localizedStrings["%s interval"] = "%s interval"; >+localizedStrings["%s:"] = "%s:"; > localizedStrings["(Action %s)"] = "(Action %s)"; > localizedStrings["(Disk)"] = "(Disk)"; > localizedStrings["(Index)"] = "(Index)"; >@@ -104,6 +105,7 @@ localizedStrings["All Storage"] = "All Storage"; > localizedStrings["All items in \u0022%s\u0022 must be error objects"] = "All items in \u0022%s\u0022 must be error objects"; > localizedStrings["All items in \u0022%s\u0022 must be non-empty strings"] = "All items in \u0022%s\u0022 must be non-empty strings"; > localizedStrings["All items in \u0022%s\u0022 must be valid DOM nodes"] = "All items in \u0022%s\u0022 must be valid DOM nodes"; >+localizedStrings["Allow Media Capture on Insecure Sites"] = "Allow Media Capture on Insecure Sites"; > localizedStrings["An error occurred trying to load the resource."] = "An error occurred trying to load the resource."; > localizedStrings["An error occurred trying to read the \u201C%s\u201D table."] = "An error occurred trying to read the \u201C%s\u201D table."; > localizedStrings["An unexpected error %s occurred."] = "An unexpected error %s occurred."; >@@ -302,6 +304,7 @@ localizedStrings["Dimensions"] = "Dimensions"; > localizedStrings["Disable Breakpoint"] = "Disable Breakpoint"; > localizedStrings["Disable Breakpoints"] = "Disable Breakpoints"; > localizedStrings["Disable Event Listener"] = "Disable Event Listener"; >+localizedStrings["Disable ICE Candidate Restrictions"] = "Disable ICE Candidate Restrictions"; > localizedStrings["Disable Program"] = "Disable Program"; > localizedStrings["Disable all breakpoints (%s)"] = "Disable all breakpoints (%s)"; > localizedStrings["Disable paint flashing"] = "Disable paint flashing"; >@@ -1018,6 +1021,7 @@ localizedStrings["Unsupported property value"] = "Unsupported property value"; > localizedStrings["Untitled"] = "Untitled"; > localizedStrings["Use Default Appearance"] = "Use Default Appearance"; > localizedStrings["Use Default Media Styles"] = "Use Default Media Styles"; >+localizedStrings["Use Mock Capture Devices"] = "Use Mock Capture Devices"; > localizedStrings["Use the resource cache when loading resources"] = "Use the resource cache when loading resources"; > localizedStrings["User Agent"] = "User Agent"; > localizedStrings["User Agent Stylesheet"] = "User Agent Stylesheet"; >diff --git a/Source/WebInspectorUI/UserInterface/Base/Main.js b/Source/WebInspectorUI/UserInterface/Base/Main.js >index 3e0e136ce76170a21b95de038168eb3c5b7f7229..59ef477b5a700a2fc6a80a4e7d5702fc86a02c69 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/Main.js >+++ b/Source/WebInspectorUI/UserInterface/Base/Main.js >@@ -162,7 +162,7 @@ WI.loaded = function() > this._windowKeydownListeners = []; > this._targetsAvailablePromise = new WI.WrappedPromise; > WI._overridenDeviceUserAgent = null; >- WI._overridenDeviceSettings = new Set; >+ WI._overridenDeviceSettings = new Map; > > // Targets. > WI.backendTarget = null; >@@ -612,8 +612,8 @@ WI.initializeTarget = function(target) > > // COMPATIBILITY (iOS 12.2): Page.overrideSetting did not exist. > if (target.PageAgent.overrideSetting) { >- for (let setting of WI._overridenDeviceSettings) >- target.PageAgent.overrideSetting(setting, true); >+ for (let [setting, value] of WI._overridenDeviceSettings) >+ target.PageAgent.overrideSetting(setting, value); > } > > // COMPATIBILITY (iOS 8): Page.setShowPaintRects did not exist. >@@ -1990,7 +1990,7 @@ WI._handleDeviceSettingsToolbarButtonClicked = function(event) > } > } > >- function applyOverriddenSetting(setting, callback) { >+ function applyOverriddenSetting(setting, value, callback) { > if (WI._overridenDeviceSettings.has(setting)) { > // We've just "disabled" the checkbox, so clear the override instead of applying it. > PageAgent.overrideSetting(setting, (error) => { >@@ -2004,15 +2004,13 @@ WI._handleDeviceSettingsToolbarButtonClicked = function(event) > updateActivatedState(); > }); > } else { >- // Override to false since the labels are the inverse of the setting. >- const value = false; > PageAgent.overrideSetting(setting, value, (error) => { > if (error) { > console.error(error); > return; > } > >- WI._overridenDeviceSettings.add(setting); >+ WI._overridenDeviceSettings.set(setting, value); > callback(true); > updateActivatedState(); > }); >@@ -2031,27 +2029,17 @@ WI._handleDeviceSettingsToolbarButtonClicked = function(event) > return container; > } > >- function createColumns(parent, count) { >- let columnContainer = parent.appendChild(document.createElement("div")); >- columnContainer.classList.add("columns"); >+ function createCheckbox(container, label, setting, value) { >+ if (!setting) >+ return; > >- let columns = []; >- for (let i = 0; i < count; ++i) { >- let column = columnContainer.appendChild(document.createElement("div")); >- column.classList.add("column"); >- columns.push(column); >- } >- return columns; >- } >- >- function createCheckbox(container, label, setting) { > let labelElement = container.appendChild(document.createElement("label")); > > let checkboxElement = labelElement.appendChild(document.createElement("input")); > checkboxElement.type = "checkbox"; > checkboxElement.checked = WI._overridenDeviceSettings.has(setting); > checkboxElement.addEventListener("change", (event) => { >- applyOverriddenSetting(setting, (enabled) => { >+ applyOverriddenSetting(setting, value, (enabled) => { > checkboxElement.checked = enabled; > }); > }); >@@ -2168,12 +2156,50 @@ WI._handleDeviceSettingsToolbarButtonClicked = function(event) > } > }); > >- let disableColumns = createColumns(createContainer(contentElement, WI.UIString("Disable:")), 2); >- createCheckbox(disableColumns[0], WI.UIString("Images"), PageAgent.Setting.ImagesEnabled); >- createCheckbox(disableColumns[0], WI.UIString("Styles"), PageAgent.Setting.AuthorAndUserStylesEnabled); >- createCheckbox(disableColumns[0], WI.UIString("JavaScript"), PageAgent.Setting.ScriptEnabled); >- createCheckbox(disableColumns[1], WI.UIString("Site-specific Hacks"), PageAgent.Setting.NeedsSiteSpecificQuirks); >- createCheckbox(disableColumns[1], WI.UIString("Cross-Origin Restrictions"), PageAgent.Setting.WebSecurityEnabled); >+ const settings = [ >+ { >+ name: WI.UIString("Disable:"), >+ columns: [ >+ [ >+ {name: WI.UIString("Images"), setting: PageAgent.Setting.ImagesEnabled, value: false}, >+ {name: WI.UIString("Styles"), setting: PageAgent.Setting.AuthorAndUserStylesEnabled, value: false}, >+ {name: WI.UIString("JavaScript"), setting: PageAgent.Setting.ScriptEnabled, value: false}, >+ ], >+ [ >+ {name: WI.UIString("Site-specific Hacks"), setting: PageAgent.Setting.NeedsSiteSpecificQuirks, value: false}, >+ {name: WI.UIString("Cross-Origin Restrictions"), setting: PageAgent.Setting.WebSecurityEnabled, value: false}, >+ ] >+ ], >+ }, >+ { >+ name: WI.UIString("%s:").format(WI.unlocalizedString("WebRTC")), >+ columns: [ >+ [ >+ {name: WI.UIString("Allow Media Capture on Insecure Sites"), setting: PageAgent.Setting.MediaCaptureRequiresSecureConnection, value: false}, >+ {name: WI.UIString("Disable ICE Candidate Restrictions"), setting: PageAgent.Setting.ICECandidateFilteringEnabled, value: false}, >+ {name: WI.UIString("Use Mock Capture Devices"), setting: PageAgent.Setting.MockCaptureDevicesEnabled, value: true}, >+ ], >+ ], >+ }, >+ ]; >+ >+ for (let group of settings) { >+ if (!group.columns.some((column) => column.some((item) => item.setting))) >+ continue; >+ >+ let container = createContainer(contentElement, group.name); >+ >+ let columnContainer = container.appendChild(document.createElement("div")); >+ columnContainer.classList.add("columns"); >+ >+ for (let column of group.columns) { >+ let columnElement = columnContainer.appendChild(document.createElement("div")); >+ columnElement.classList.add("column"); >+ >+ for (let item of column) >+ createCheckbox(columnElement, item.name, item.setting, item.value); >+ } >+ } > > WI._deviceSettingsPopover.presentNewContentWithFrame(contentElement, calculateTargetFrame(), preferredEdges); > }; >diff --git a/Source/WebInspectorUI/UserInterface/Views/Main.css b/Source/WebInspectorUI/UserInterface/Views/Main.css >index 15a71ef104f7d4c3389626809a0bd8707a372d3a..cfbaead215f87492cdbfed2f64e1a6bf20a2939c 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/Main.css >+++ b/Source/WebInspectorUI/UserInterface/Views/Main.css >@@ -391,6 +391,10 @@ body[dir=rtl] .go-to-arrow { > padding: 8px; > } > >+.device-settings-content .container { >+ margin-top: 8px; >+} >+ > .device-settings-content .columns { > display: flex; > } >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 9b0eacaa9b7a79c21fda40dcbd6b7dcc77dae73c..c905fdab52868de004b2417cb6ac97edbc65cdf3 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -629,35 +629,17 @@ HTTPEquivEnabled: > defaultValue: true > webcoreName: httpEquivEnabled > >-MockCaptureDevicesEnabled: >- type: bool >- defaultValue: DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED >- webcoreBinding: DeprecatedGlobalSettings >- condition: ENABLE(MEDIA_STREAM) >- > MockCaptureDevicesPromptEnabled: > type: bool > defaultValue: true > webcoreBinding: none > >-MediaCaptureRequiresSecureConnection: >- type: bool >- defaultValue: true >- webcoreBinding: DeprecatedGlobalSettings >- condition: ENABLE(MEDIA_STREAM) >- > # FIXME: What is this for? > EnumeratingAllNetworkInterfacesEnabled: > type: bool > defaultValue: false > webcoreBinding: none > >-# FIXME: What is this for? >-ICECandidateFilteringEnabled: >- type: bool >- defaultValue: true >- webcoreBinding: none >- > ShadowDOMEnabled: > type: bool > defaultValue: true >@@ -1551,3 +1533,19 @@ AdClickAttributionEnabled: > humanReadableDescription: "Enable Ad Click Attribution for Cross-Site Link Navigations" > webcoreBinding: RuntimeEnabledFeatures > category: internal >+ >+# Deprecated >+ >+ICECandidateFilteringEnabled: >+ type: bool >+ defaultValue: true >+ >+MockCaptureDevicesEnabled: >+ type: bool >+ defaultValue: DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED >+ condition: ENABLE(MEDIA_STREAM) >+ >+MediaCaptureRequiresSecureConnection: >+ type: bool >+ defaultValue: true >+ condition: ENABLE(MEDIA_STREAM) >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index eaef8ff160fb4eb30a890e6bcf53afda6ad55017..2835ef51585de16757827c98919aa357eb95d6d9 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -3054,8 +3054,8 @@ - (void)_preferencesChanged:(WebPreferences *)preferences > #endif > > #if ENABLE(MEDIA_STREAM) >- DeprecatedGlobalSettings::setMockCaptureDevicesEnabled(false); >- DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(true); >+ settings.setMockCaptureDevicesEnabled(false); >+ settings.setMediaCaptureRequiresSecureConnection(true); > RuntimeEnabledFeatures::sharedFeatures().setMediaStreamEnabled(false); > RuntimeEnabledFeatures::sharedFeatures().setMediaDevicesEnabled(false); > RuntimeEnabledFeatures::sharedFeatures().setMediaRecorderEnabled(preferences.mediaRecorderEnabled); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e2996664a14d7f60c774e7e56c5389af25f5db55..4b1f34b20462db11b76482607480b9cd26984ecb 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-28 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/page/overrideSetting-ICECandidateFilteringEnabled.html: Added. >+ * inspector/page/overrideSetting-ICECandidateFilteringEnabled-expected.txt: Added. >+ * inspector/page/overrideSetting-MockCaptureDevicesEnabled.html: Added. >+ * inspector/page/overrideSetting-MockCaptureDevicesEnabled-expected.txt: Added. >+ * platform/mac/TestExpectations: >+ > 2019-01-26 Devin Rousso <drousso@apple.com> > > Web Inspector: handle CSS Color 4 color syntaxes >diff --git a/LayoutTests/inspector/page/overrideSetting-ICECandidateFilteringEnabled-expected.txt b/LayoutTests/inspector/page/overrideSetting-ICECandidateFilteringEnabled-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..3b8b06e4cd469b8df471fa29c41787c311884510 >--- /dev/null >+++ b/LayoutTests/inspector/page/overrideSetting-ICECandidateFilteringEnabled-expected.txt >@@ -0,0 +1,11 @@ >+Tests for the Page.overrideSetting command. >+ >+ >+== Running test suite: Page.overrideSetting >+-- Running test case: Page.overrideSetting.ICECandidateFilteringEnabled >+PASS: Should not be able to establish a connection when filtering ice candidates. >+Overriding ICECandidateFilteringEnabled to false... >+PASS: Should be able to establish a connection when filtering ice candidates. >+Removing ICECandidateFilteringEnabled override... >+PASS: Should not be able to establish a connection when filtering ice candidates. >+ >diff --git a/LayoutTests/inspector/page/overrideSetting-ICECandidateFilteringEnabled.html b/LayoutTests/inspector/page/overrideSetting-ICECandidateFilteringEnabled.html >new file mode 100644 >index 0000000000000000000000000000000000000000..33d7812c5fb5206b28759afda4c3c32e20979336 >--- /dev/null >+++ b/LayoutTests/inspector/page/overrideSetting-ICECandidateFilteringEnabled.html >@@ -0,0 +1,77 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../http/tests/inspector/resources/inspector-test.js"></script> >+<script> >+ >+if (window.internals) >+ window.internals.setICECandidateFiltering(true); >+ >+function createDataChannel() { >+ let receivedCandidate = false; >+ >+ let pc = new RTCPeerConnection(); >+ pc.createDataChannel("sendDataChannel"); >+ pc.onicecandidate = (event) => { >+ if (event.candidate) { >+ receivedCandidate = true; >+ return; >+ } >+ >+ if (receivedCandidate) { >+ pc.createOffer().then((offer) => { >+ TestPage.dispatchEventToFrontend("DataChannel", {success: true}); >+ }); >+ } else >+ TestPage.dispatchEventToFrontend("DataChannel", {success: false}); >+ >+ delete pc.onicecandidate; >+ }; >+ pc.createOffer().then((offer) => { >+ pc.setLocalDescription(offer); >+ }); >+} >+ >+function test() >+{ >+ let suite = InspectorTest.createAsyncSuite("Page.overrideSetting"); >+ >+ suite.addTestCase({ >+ name: "Page.overrideSetting.ICECandidateFilteringEnabled", >+ description: "Test that changing whether ice candidate filtering is enabled has an effect.", >+ async test() { >+ let [defaultResult] = await Promise.all([ >+ InspectorTest.awaitEvent("DataChannel"), >+ InspectorTest.evaluateInPage(`createDataChannel()`), >+ ]); >+ InspectorTest.expectFalse(defaultResult.data.success, "Should not be able to establish a connection when filtering ice candidates."); >+ >+ InspectorTest.log("Overriding ICECandidateFilteringEnabled to false..."); >+ await PageAgent.overrideSetting(PageAgent.Setting.ICECandidateFilteringEnabled, false); >+ >+ let [overriddenResult] = await Promise.all([ >+ InspectorTest.awaitEvent("DataChannel"), >+ InspectorTest.evaluateInPage(`createDataChannel()`), >+ ]) >+ InspectorTest.expectFalse(defaultResult.data.success, "Should be able to establish a connection when filtering ice candidates."); >+ >+ InspectorTest.log("Removing ICECandidateFilteringEnabled override..."); >+ await PageAgent.overrideSetting(PageAgent.Setting.ICECandidateFilteringEnabled); >+ >+ let [originalResult] = await Promise.all([ >+ InspectorTest.awaitEvent("DataChannel"), >+ InspectorTest.evaluateInPage(`createDataChannel()`), >+ ]) >+ InspectorTest.expectFalse(defaultResult.data.success, "Should not be able to establish a connection when filtering ice candidates."); >+ }, >+ }); >+ >+ suite.runTestCasesAndFinish(); >+} >+ >+</script> >+</head> >+<body onload="runTest()"> >+ <p>Tests for the Page.overrideSetting command.</p> >+</body> >+</html> >diff --git a/LayoutTests/inspector/page/overrideSetting-MockCaptureDevicesEnabled-expected.txt b/LayoutTests/inspector/page/overrideSetting-MockCaptureDevicesEnabled-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0f88bf022c965716b428ca29c8eca894d331037d >--- /dev/null >+++ b/LayoutTests/inspector/page/overrideSetting-MockCaptureDevicesEnabled-expected.txt >@@ -0,0 +1,11 @@ >+Tests for the Page.overrideSetting command. >+ >+ >+== Running test suite: Page.overrideSetting >+-- Running test case: Page.overrideSetting.MockCaptureDevicesEnabled >+Expected Error: The I/O read operation failed. >+Overriding MockCaptureDevicesEnabled to true... >+PASS: getUserMedia should not fail when no devices are available >+Removing MockCaptureDevicesEnabled override... >+Expected Error: The I/O read operation failed. >+ >diff --git a/LayoutTests/inspector/page/overrideSetting-MockCaptureDevicesEnabled.html b/LayoutTests/inspector/page/overrideSetting-MockCaptureDevicesEnabled.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cb92e594e9f69742f49f1d1729df01205539b203 >--- /dev/null >+++ b/LayoutTests/inspector/page/overrideSetting-MockCaptureDevicesEnabled.html >@@ -0,0 +1,58 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../http/tests/inspector/resources/inspector-test.js"></script> >+<script> >+ >+if (window.internals) >+ window.internals.setMockMediaCaptureDevicesEnabled(false); >+ >+function requestGetUserMedia() { >+ navigator.mediaDevices.getUserMedia({audio: {}, video: {}}) >+ .then(() => TestPage.dispatchEventToFrontend("GetUserMedia", {success: true})) >+ .catch((error) => TestPage.dispatchEventToFrontend("GetUserMedia", {error: error.message})); >+} >+ >+function test() >+{ >+ let suite = InspectorTest.createAsyncSuite("Page.overrideSetting"); >+ >+ suite.addTestCase({ >+ name: "Page.overrideSetting.MockCaptureDevicesEnabled", >+ description: "Test that changing whether mock capture devices are enabled has an effect.", >+ async test() { >+ let [defaultResult] = await Promise.all([ >+ InspectorTest.awaitEvent("GetUserMedia"), >+ InspectorTest.evaluateInPage(`requestGetUserMedia()`), >+ ]); >+ InspectorTest.log("Expected Error: " + defaultResult.data.error); >+ >+ InspectorTest.log("Overriding MockCaptureDevicesEnabled to true..."); >+ await PageAgent.overrideSetting(PageAgent.Setting.MockCaptureDevicesEnabled, true); >+ >+ let [overriddenResult] = await Promise.all([ >+ InspectorTest.awaitEvent("GetUserMedia"), >+ InspectorTest.evaluateInPage(`requestGetUserMedia()`), >+ ]) >+ InspectorTest.expectTrue(overriddenResult.data.success, "getUserMedia should not fail when no devices are available"); >+ >+ InspectorTest.log("Removing MockCaptureDevicesEnabled override..."); >+ await PageAgent.overrideSetting(PageAgent.Setting.MockCaptureDevicesEnabled); >+ >+ let [originalResult] = await Promise.all([ >+ InspectorTest.awaitEvent("GetUserMedia"), >+ InspectorTest.evaluateInPage(`requestGetUserMedia()`), >+ ]) >+ InspectorTest.log("Expected Error: " + originalResult.data.error); >+ }, >+ }); >+ >+ suite.runTestCasesAndFinish(); >+} >+ >+</script> >+</head> >+<body onload="runTest()"> >+ <p>Tests for the Page.overrideSetting command.</p> >+</body> >+</html> >diff --git a/LayoutTests/platform/mac/TestExpectations b/LayoutTests/platform/mac/TestExpectations >index a555df820e3633231d6b4a5cf5a3ada414314057..8234e2a5838a708297c8e2e621eef799aecfb12f 100644 >--- a/LayoutTests/platform/mac/TestExpectations >+++ b/LayoutTests/platform/mac/TestExpectations >@@ -146,6 +146,9 @@ fast/mediastream/RTCPeerConnection-ice.html [ Skip ] > fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html [ Skip ] > fast/mediastream/RTCPeerConnection-stats.html [ Skip ] > >+[ HighSierra ] inspector/page/overrideSetting-ICECandidateFilteringEnabled.html [ Skip ] >+[ HighSierra ] inspector/page/overrideSetting-MockCaptureDevicesEnabled.html [ Skip ] >+ > # Asserts in debug. > [ Debug ] fast/images/large-size-image-crash.html [ Skip ] >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193863
:
360232
|
360233
|
360234
|
360257
|
360259
|
360260
|
360267
|
360269
|
360356
|
360372
|
360428