Enable WEB_REPLAY for PLATFORM(MAC)
authorburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Apr 2014 17:28:20 +0000 (17:28 +0000)
committerburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Apr 2014 17:28:20 +0000 (17:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130700

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Switch on WEB_REPLAY feature flag for non-production builds.

* Configurations/FeatureDefines.xcconfig:
* replay/ReplayInputDispatchMethods.cpp: Fix the ENABLE(WEB_REPLAY) build.
It was broken by the bool to enum refactoring in r166684.
(WebCore::InitialNavigation::dispatch):

Source/WebInspectorUI:

If the ReplayAgent is available, then add an option to toggle between the
replay interface and normal Timeline interface from the timeline
sidebar panel. The option is available through a context menu item on the
sidebar panel's top navigation bar.

If web replay not available, just show the non-replay interface.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js: Add WebInspector.showReplayInterfaceSetting.
(WebInspector.loaded):

* UserInterface/Views/TimelineSidebarPanel.js: Unconditionally create the replay
interface elements, but only show them if showReplayInterfaceSetting is enabled.
(WebInspector.TimelineSidebarPanel.prototype._updateReplayInterfaceVisibility): Added
(WebInspector.TimelineSidebarPanel.prototype._contextMenuNavigationBarOrStatusBar.toggleReplayInterface): Added.
(WebInspector.TimelineSidebarPanel.prototype._contextMenuNavigationBarOrStatusBar): Added.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* Scripts/webkitperl/FeatureList.pm: Set the default for WEB_REPLAY for OS X engineering builds.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166851 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/replay/ReplayInputDispatchMethods.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm

index b063e5380d836870839045aa6a28f50cc3cc0613..8dde84f3262df9ce0c27090e8e3ca6458ed4afd9 100644 (file)
@@ -1,3 +1,12 @@
+2014-04-04  Brian J. Burg  <burg@cs.washington.edu>
+
+        Enable WEB_REPLAY for PLATFORM(MAC)
+        https://bugs.webkit.org/show_bug.cgi?id=130700
+
+        Reviewed by Timothy Hatcher.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2014-04-05  Mark Hahnenberg  <mhahnenberg@apple.com>
 
         Add missing files from r166837
index e3de3c8b89597cba30d05d0e952e57d0a9636856..3a9e9ff3ec5af93cf2e9215a53e176f3bac5343f 100644 (file)
@@ -208,7 +208,13 @@ ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;
 ENABLE_WEBGL = ENABLE_WEBGL;
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
-ENABLE_WEB_REPLAY = ;
+ENABLE_WEB_REPLAY = $(ENABLE_WEB_REPLAY_$(PLATFORM_NAME));
+ENABLE_WEB_REPLAY_macosx = $(ENABLE_WEB_REPLAY_macosx_$(CONFIGURATION));
+ENABLE_WEB_REPLAY_macosx_Debug = ENABLE_WEB_REPLAY;
+ENABLE_WEB_REPLAY_macosx_Release = ENABLE_WEB_REPLAY;
+ENABLE_WEB_REPLAY_macosx_Production = ;
+ENABLE_WEB_REPLAY_iphoneos = ;
+ENABLE_WEB_REPLAY_iphonesimulator = ;
 ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS;
 
 ENABLE_WEB_TIMING = $(ENABLE_WEB_TIMING_$(PLATFORM_NAME));
index c8dc371f3bb1d01ede5fa5abfdc837ad6fdd4d78..77cfc1fa89b4b873ff442d5177cd4f8fb6c3cf4c 100644 (file)
@@ -1,3 +1,17 @@
+2014-04-04  Brian J. Burg  <burg@cs.washington.edu>
+
+        Enable WEB_REPLAY for PLATFORM(MAC)
+        https://bugs.webkit.org/show_bug.cgi?id=130700
+
+        Reviewed by Timothy Hatcher.
+
+        Switch on WEB_REPLAY feature flag for non-production builds.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * replay/ReplayInputDispatchMethods.cpp: Fix the ENABLE(WEB_REPLAY) build.
+        It was broken by the bool to enum refactoring in r166684.
+        (WebCore::InitialNavigation::dispatch):
+
 2014-04-05  Brian J. Burg  <burg@cs.washington.edu>
 
         Web Inspector: remove unused test hook setInspectorResourcesDataSizeLimits
index e3de3c8b89597cba30d05d0e952e57d0a9636856..3a9e9ff3ec5af93cf2e9215a53e176f3bac5343f 100644 (file)
@@ -208,7 +208,13 @@ ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;
 ENABLE_WEBGL = ENABLE_WEBGL;
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
-ENABLE_WEB_REPLAY = ;
+ENABLE_WEB_REPLAY = $(ENABLE_WEB_REPLAY_$(PLATFORM_NAME));
+ENABLE_WEB_REPLAY_macosx = $(ENABLE_WEB_REPLAY_macosx_$(CONFIGURATION));
+ENABLE_WEB_REPLAY_macosx_Debug = ENABLE_WEB_REPLAY;
+ENABLE_WEB_REPLAY_macosx_Release = ENABLE_WEB_REPLAY;
+ENABLE_WEB_REPLAY_macosx_Production = ;
+ENABLE_WEB_REPLAY_iphoneos = ;
+ENABLE_WEB_REPLAY_iphonesimulator = ;
 ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS;
 
 ENABLE_WEB_TIMING = $(ENABLE_WEB_TIMING_$(PLATFORM_NAME));
index fba67dcc91622d76d7473e11a4d4ea64c94f3654..6454a4801573bdb76ee39a777c51b0b383bc555c 100644 (file)
@@ -50,7 +50,7 @@ void EndSegmentSentinel::dispatch(ReplayController&)
 // Navigation inputs.
 void InitialNavigation::dispatch(ReplayController& controller)
 {
-    controller.page().mainFrame().navigationScheduler().scheduleLocationChange(m_securityOrigin.get(), m_url, m_referrer, true, true);
+    controller.page().mainFrame().navigationScheduler().scheduleLocationChange(m_securityOrigin.get(), m_url, m_referrer);
 }
 
 void HandleKeyPress::dispatch(ReplayController& controller)
index a4648777765181e7786ef12eb032f9697d82b30b..dd64e44dfdead776f3942e70a0fe738dfbb1eb4e 100644 (file)
@@ -1,3 +1,27 @@
+2014-04-05  Brian J. Burg  <burg@cs.washington.edu>
+
+        Enable WEB_REPLAY for PLATFORM(MAC)
+        https://bugs.webkit.org/show_bug.cgi?id=130700
+
+        Reviewed by Timothy Hatcher.
+
+        If the ReplayAgent is available, then add an option to toggle between the
+        replay interface and normal Timeline interface from the timeline
+        sidebar panel. The option is available through a context menu item on the
+        sidebar panel's top navigation bar.
+
+        If web replay not available, just show the non-replay interface.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Base/Main.js: Add WebInspector.showReplayInterfaceSetting.
+        (WebInspector.loaded):
+
+        * UserInterface/Views/TimelineSidebarPanel.js: Unconditionally create the replay
+        interface elements, but only show them if showReplayInterfaceSetting is enabled.
+        (WebInspector.TimelineSidebarPanel.prototype._updateReplayInterfaceVisibility): Added
+        (WebInspector.TimelineSidebarPanel.prototype._contextMenuNavigationBarOrStatusBar.toggleReplayInterface): Added.
+        (WebInspector.TimelineSidebarPanel.prototype._contextMenuNavigationBarOrStatusBar): Added.
+
 2014-04-05  Brian J. Burg  <burg@cs.washington.edu>
 
         Web Inspector: remove unused metrics and commands from the Timeline agent
index d7ed5f6e5594bcc4f212f4226ebbc3c062d3743e..4e203b71a760c9760c05c06ba662440974ad02fd 100644 (file)
Binary files a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js and b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js differ
index a7d8639dabffc01de2cc9f946bbc854577e465c1..c0e8fbdb2b1a8956ce45a8b20dc77a6e15efb435 100644 (file)
@@ -159,6 +159,7 @@ WebInspector.loaded = function()
     this._dockButtonToggledSetting = new WebInspector.Setting("dock-button-toggled", false);
 
     this.showShadowDOMSetting = new WebInspector.Setting("show-shadow-dom", false);
+    this.showReplayInterfaceSetting = new WebInspector.Setting("show-web-replay", false);
 
     this.mouseCoords = {
         x: 0,
index f524ae636441c685b9fcfadfac48498f6917650f..8d396c123e3e168c3cadbee379fc1a0d001b18cc 100644 (file)
@@ -49,7 +49,7 @@ WebInspector.TimelineSidebarPanel = function()
     timelinesTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TimelinesTitleBarStyleClass);
     this.element.insertBefore(timelinesTitleBarElement, this.element.firstChild);
 
-    var statusBarElement = document.createElement("div");
+    var statusBarElement = this._statusBarElement = document.createElement("div");
     statusBarElement.classList.add(WebInspector.TimelineSidebarPanel.StatusBarStyleClass);
     this.element.insertBefore(statusBarElement, this.element.firstChild);
 
@@ -64,30 +64,32 @@ WebInspector.TimelineSidebarPanel = function()
     this._recordStatusElement.className = WebInspector.TimelineSidebarPanel.RecordStatusStyleClass;
     statusBarElement.appendChild(this._recordStatusElement);
 
-    if (window.ReplayAgent) {
-        // If replay support is enabled, hide the default status bar element and show a navigation bar instead.
-        statusBarElement.classList.add(WebInspector.TimelineSidebarPanel.HiddenStyleClassName);
+    WebInspector.showReplayInterfaceSetting.addEventListener(WebInspector.Setting.Event.Changed, this._updateReplayInterfaceVisibility, this);
 
-        this._navigationBar = new WebInspector.NavigationBar;
-        this.element.appendChild(this._navigationBar.element);
+    // We always create a navigation bar; its visibility is controlled by WebInspector.showReplayInterfaceSetting.
+    this._navigationBar = new WebInspector.NavigationBar;
+    this.element.appendChild(this._navigationBar.element);
 
-        var toolTip = WebInspector.UIString("Begin Capturing");
-        var altToolTip = WebInspector.UIString("End Capturing");
-        this._replayCaptureButtonItem = new WebInspector.ActivateButtonNavigationItem("replay-capture", toolTip, altToolTip, "Images/Circle.svg", 16, 16);
-        this._replayCaptureButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._replayCaptureButtonClicked, this);
-        this._replayCaptureButtonItem.enabled = true;
-        this._navigationBar.addNavigationItem(this._replayCaptureButtonItem);
+    var toolTip = WebInspector.UIString("Begin Capturing");
+    var altToolTip = WebInspector.UIString("End Capturing");
+    this._replayCaptureButtonItem = new WebInspector.ActivateButtonNavigationItem("replay-capture", toolTip, altToolTip, "Images/Circle.svg", 16, 16);
+    this._replayCaptureButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._replayCaptureButtonClicked, this);
+    this._replayCaptureButtonItem.enabled = true;
+    this._navigationBar.addNavigationItem(this._replayCaptureButtonItem);
 
-        toolTip = WebInspector.UIString("Start Playback");
-        altToolTip = WebInspector.UIString("Pause Playback");
-        this._replayPauseResumeButtonItem = new WebInspector.ToggleButtonNavigationItem("replay-pause-resume", toolTip, altToolTip, "Images/Resume.svg", "Images/Pause.svg", 16, 16, true);
-        this._replayPauseResumeButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._replayPauseResumeButtonClicked, this);
-        this._replayPauseResumeButtonItem.enabled = false;
-        this._navigationBar.addNavigationItem(this._replayPauseResumeButtonItem);
+    toolTip = WebInspector.UIString("Start Playback");
+    altToolTip = WebInspector.UIString("Pause Playback");
+    this._replayPauseResumeButtonItem = new WebInspector.ToggleButtonNavigationItem("replay-pause-resume", toolTip, altToolTip, "Images/Resume.svg", "Images/Pause.svg", 16, 16, true);
+    this._replayPauseResumeButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._replayPauseResumeButtonClicked, this);
+    this._replayPauseResumeButtonItem.enabled = false;
+    this._navigationBar.addNavigationItem(this._replayPauseResumeButtonItem);
 
-        WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStarted, this._captureStarted, this);
-        WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStopped, this._captureStopped, this);
-    }
+    WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStarted, this._captureStarted, this);
+    WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStopped, this._captureStopped, this);
+
+    this._statusBarElement.oncontextmenu = this._contextMenuNavigationBarOrStatusBar.bind(this);
+    this._navigationBar.element.oncontextmenu = this._contextMenuNavigationBarOrStatusBar.bind(this);
+    this._updateReplayInterfaceVisibility();
 
     function createTimelineTreeElement(label, iconClass, identifier)
     {
@@ -377,6 +379,31 @@ WebInspector.TimelineSidebarPanel.prototype = {
 
     // These methods are only used when ReplayAgent is available.
 
+    _updateReplayInterfaceVisibility: function()
+    {
+        var shouldShowReplayInterface = window.ReplayAgent && WebInspector.showReplayInterfaceSetting.value;
+
+        this._statusBarElement.classList.toggle(WebInspector.TimelineSidebarPanel.HiddenStyleClassName, shouldShowReplayInterface);
+        this._navigationBar.element.classList.toggle(WebInspector.TimelineSidebarPanel.HiddenStyleClassName, !shouldShowReplayInterface);
+    },
+
+    _contextMenuNavigationBarOrStatusBar: function()
+    {
+        if (!window.ReplayAgent)
+            return;
+
+        function toggleReplayInterface() {
+            WebInspector.showReplayInterfaceSetting.value = !WebInspector.showReplayInterfaceSetting.value;
+        }
+
+        var contextMenu = new WebInspector.ContextMenu(event);
+        if (WebInspector.showReplayInterfaceSetting.value)
+            contextMenu.appendItem(WebInspector.UIString("Hide Replay Controls"), toggleReplayInterface);
+        else
+            contextMenu.appendItem(WebInspector.UIString("Show Replay Controls"), toggleReplayInterface);
+        contextMenu.show();
+    },
+
     _replayCaptureButtonClicked: function()
     {
         if (!this._replayCaptureButtonItem.activated) {
index b05196e6963176f832b2315ea357aeebc82b74d6..d9b5669b4c69f495a9d36408196ccccbdcd70134 100644 (file)
@@ -1,3 +1,12 @@
+2014-04-04  Brian J. Burg  <burg@cs.washington.edu>
+
+        Enable WEB_REPLAY for PLATFORM(MAC)
+        https://bugs.webkit.org/show_bug.cgi?id=130700
+
+        Reviewed by Timothy Hatcher.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2014-04-03  Sam Weinig  <sam@webkit.org>
 
         [WebKit2] Promote user script SPI to API
index e3de3c8b89597cba30d05d0e952e57d0a9636856..3a9e9ff3ec5af93cf2e9215a53e176f3bac5343f 100644 (file)
@@ -208,7 +208,13 @@ ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;
 ENABLE_WEBGL = ENABLE_WEBGL;
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
-ENABLE_WEB_REPLAY = ;
+ENABLE_WEB_REPLAY = $(ENABLE_WEB_REPLAY_$(PLATFORM_NAME));
+ENABLE_WEB_REPLAY_macosx = $(ENABLE_WEB_REPLAY_macosx_$(CONFIGURATION));
+ENABLE_WEB_REPLAY_macosx_Debug = ENABLE_WEB_REPLAY;
+ENABLE_WEB_REPLAY_macosx_Release = ENABLE_WEB_REPLAY;
+ENABLE_WEB_REPLAY_macosx_Production = ;
+ENABLE_WEB_REPLAY_iphoneos = ;
+ENABLE_WEB_REPLAY_iphonesimulator = ;
 ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS;
 
 ENABLE_WEB_TIMING = $(ENABLE_WEB_TIMING_$(PLATFORM_NAME));
index b1997dd6a2b9ef582b32a01d061ea28926381750..6782a81dcdf6d8fc78fe025cb0069a7229391ff2 100644 (file)
@@ -1,3 +1,12 @@
+2014-04-04  Brian J. Burg  <burg@cs.washington.edu>
+
+        Enable WEB_REPLAY for PLATFORM(MAC)
+        https://bugs.webkit.org/show_bug.cgi?id=130700
+
+        Reviewed by Timothy Hatcher.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2014-04-05  Miyoung Shin  <myid.m.shin@gmail.com>
 
         [WK2] Fix unused parameter compile warning.
index e3de3c8b89597cba30d05d0e952e57d0a9636856..3a9e9ff3ec5af93cf2e9215a53e176f3bac5343f 100644 (file)
@@ -208,7 +208,13 @@ ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;
 ENABLE_WEBGL = ENABLE_WEBGL;
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
-ENABLE_WEB_REPLAY = ;
+ENABLE_WEB_REPLAY = $(ENABLE_WEB_REPLAY_$(PLATFORM_NAME));
+ENABLE_WEB_REPLAY_macosx = $(ENABLE_WEB_REPLAY_macosx_$(CONFIGURATION));
+ENABLE_WEB_REPLAY_macosx_Debug = ENABLE_WEB_REPLAY;
+ENABLE_WEB_REPLAY_macosx_Release = ENABLE_WEB_REPLAY;
+ENABLE_WEB_REPLAY_macosx_Production = ;
+ENABLE_WEB_REPLAY_iphoneos = ;
+ENABLE_WEB_REPLAY_iphonesimulator = ;
 ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS;
 
 ENABLE_WEB_TIMING = $(ENABLE_WEB_TIMING_$(PLATFORM_NAME));
index bda066477b7ffe931109be9e228fe9c0a799d2f6..e857150c17249704a68fd137d5102c884ce46cac 100644 (file)
@@ -1,3 +1,12 @@
+2014-04-04  Brian J. Burg  <burg@cs.washington.edu>
+
+        Enable WEB_REPLAY for PLATFORM(MAC)
+        https://bugs.webkit.org/show_bug.cgi?id=130700
+
+        Reviewed by Timothy Hatcher.
+
+        * Scripts/webkitperl/FeatureList.pm: Set the default for WEB_REPLAY for OS X engineering builds.
+
 2014-04-05  Raphael Kubo da Costa  <raphael.kubo.da.costa@intel.com>
 
         [CMake] Include X11's include dirs in TestNetscapePlugin
index 4784078b56405c2bfcae66b2b21e18ae1f15fb5b..941268d95848ebb427aec2bce16c3eea2d49b6ad 100644 (file)
@@ -444,7 +444,7 @@ my @features = (
       define => "ENABLE_WEB_AUDIO", default => (isEfl() || isGtk()), value => \$webAudioSupport },
 
     { option => "web-replay", desc => "Toggle Web Replay support",
-      define => "ENABLE_WEB_REPLAY", default => 0, value => \$webReplaySupport },
+      define => "ENABLE_WEB_REPLAY", default => isAppleMacWebKit(), value => \$webReplaySupport },
 
     { option => "web-sockets", desc => "Toggle Web Sockets support",
       define => "ENABLE_WEB_SOCKETS", default => 1, value => \$webSocketsSupport },