From a99bbfecb79304af6c280b447d89e6b0f2cfdcbd Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Wed, 31 Aug 2016 20:22:40 +0200 Subject: [PATCH 1/5] Bug 1299580 - Remove unused localized strings from debugger;r=jlongster MozReview-Commit-ID: HaBSZLXaaYJ --HG-- extra : rebase_source : 8225311fda9c2e70eef18be7f7a61c95f25a4c81 --- devtools/client/locales/en-US/debugger.dtd | 4 --- .../client/locales/en-US/debugger.properties | 29 ------------------- 2 files changed, 33 deletions(-) diff --git a/devtools/client/locales/en-US/debugger.dtd b/devtools/client/locales/en-US/debugger.dtd index 7a8a8b68552b..018f7fbc75d4 100644 --- a/devtools/client/locales/en-US/debugger.dtd +++ b/devtools/client/locales/en-US/debugger.dtd @@ -54,10 +54,6 @@ - tooltip for the button that toggles the promise debugger. --> - - - diff --git a/devtools/client/locales/en-US/debugger.properties b/devtools/client/locales/en-US/debugger.properties index d73b617e9c92..10102a78bf17 100644 --- a/devtools/client/locales/en-US/debugger.properties +++ b/devtools/client/locales/en-US/debugger.properties @@ -30,14 +30,6 @@ pausePendingButtonTooltip=Waiting for next execution # button when the debugger is in a paused state. resumeButtonTooltip=Click to resume (%S) -# LOCALIZATION NOTE (startTracingTooltip): The label that is displayed on the trace -# button when execution tracing is stopped. -startTracingTooltip=Click to start tracing - -# LOCALIZATION NOTE (stopTracingTooltip): The label that is displayed on the trace -# button when execution tracing is started. -stopTracingTooltip=Click to stop tracing - # LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the # button that steps over a function call. stepOverTooltip=Step Over (%S) @@ -50,10 +42,6 @@ stepInTooltip=Step In (%S) # button that steps out of a function call. stepOutTooltip=Step Out (%S) -# LOCALIZATION NOTE (emptyGlobalsText): The text to display in the menulist -# when there are no chrome globals available. -noGlobalsText=No globals - # LOCALIZATION NOTE (noWorkersText): The text to display in the workers list # when there are no workers. noWorkersText=This page has no workers. @@ -62,10 +50,6 @@ noWorkersText=This page has no workers. # when there are no sources. noSourcesText=This page has no sources. -# LOCALIZATION NOTE (loadingSourcesText): The text to display in the sources menu -# when waiting for scripts to load. -loadingSourcesText=Waiting for sources… - # LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab # when there are no events. noEventListenersText=No event listeners to display @@ -74,14 +58,6 @@ noEventListenersText=No event listeners to display # when there are no stack frames. noStackFramesText=No stack frames to display -# LOCALIZATION NOTE (noStackFramesText): The text to display in the traces tab -# when there are no function calls. -noFunctionCallsText=No function calls to display - -# LOCALIZATION NOTE (tracingNotStartedText): The text to display in the traces tab -# when when tracing hasn't started yet. -tracingNotStartedText=Tracing has not started - # LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when # the user hovers over the checkbox used to toggle an event breakpoint. eventCheckboxTooltip=Toggle breaking on this event @@ -140,11 +116,6 @@ noMatchingStringsText=No matches found # filter text box when it is empty and the scripts container is selected. emptySearchText=Search scripts (%S) -# LOCALIZATION NOTE (emptyChromeGlobalsFilterText): This is the text that -# appears in the filter text box when it is empty and the chrome globals -# container is selected. -emptyChromeGlobalsFilterText=Filter chrome globals (%S) - # LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that # appears in the filter text box for the variables view container. emptyVariablesFilterText=Filter variables From 9b373105655a180269ec5cb55a208539de81e11f Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Mon, 5 Sep 2016 12:17:43 +0200 Subject: [PATCH 2/5] Bug 1299580 - Remove unused string from storage.properties file;r=flod MozReview-Commit-ID: K1xTCYUKem6 --HG-- extra : rebase_source : 33abf20c2c68d46c565bd4833dc1f4153c8136c0 --- devtools/client/locales/en-US/storage.properties | 6 ------ 1 file changed, 6 deletions(-) diff --git a/devtools/client/locales/en-US/storage.properties b/devtools/client/locales/en-US/storage.properties index 2f277c514f13..70df12a6374a 100644 --- a/devtools/client/locales/en-US/storage.properties +++ b/devtools/client/locales/en-US/storage.properties @@ -9,12 +9,6 @@ # A good criteria is the language in which you'd find the best documentation # on web development on the web. -# LOCALIZATION NOTE (storage.tooltip3): -# This string is displayed in the tooltip of the tab when the storage editor is -# displayed inside the developer tools window. -# A keyboard shortcut for Storage Inspector will be shown inside the brackets. -storage.tooltip3=Storage Inspector (Cookies, Local Storage, …) (%S) - # LOCALIZATION NOTE (storage.filter.key): # Key shortcut used to focus the filter box on top of the data view storage.filter.key=CmdOrCtrl+F From 5b8fbc92f9e3108bb64f1a6ae890af3df8a88343 Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Mon, 5 Sep 2016 12:56:49 -0700 Subject: [PATCH 3/5] Bug 1297117 - Replace unnecessary usage of getUrlFromAboutReader with stripAboutReaderUrl r=sebastian In some of these cases we're duplicating the work of stripAboutReaderUrl. In the other cases there is no effective difference, however switching to stripAboutReaderUrl allows us to make getUrlFromAboutReader private, which should help prevent future errors. MozReview-Commit-ID: BLeQkve2XIs --HG-- extra : histedit_source : 1818137ef447b70ca49a783a85cb1a198415df77 --- .../android/base/java/org/mozilla/gecko/BrowserApp.java | 9 ++------- mobile/android/base/java/org/mozilla/gecko/Tabs.java | 7 +++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java index 4d6f2af31a5c..777464a65801 100644 --- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java @@ -3356,10 +3356,7 @@ public class BrowserApp extends GeckoApp String url = tab.getURL(); if (AboutPages.isAboutReader(url)) { - String urlFromReader = ReaderModeUtils.getUrlFromAboutReader(url); - if (urlFromReader != null) { - url = urlFromReader; - } + url = ReaderModeUtils.stripAboutReaderUrl(url); } // Disable share menuitem for about:, chrome:, file:, and resource: URIs @@ -3538,9 +3535,7 @@ public class BrowserApp extends GeckoApp if (tab != null) { String url = tab.getURL(); if (url != null) { - if (AboutPages.isAboutReader(url)) { - url = ReaderModeUtils.getUrlFromAboutReader(url); - } + url = ReaderModeUtils.stripAboutReaderUrl(url); // Context: Sharing via chrome list (no explicit session is active) Telemetry.sendUIEvent(TelemetryContract.Event.SHARE, TelemetryContract.Method.LIST, "menu"); diff --git a/mobile/android/base/java/org/mozilla/gecko/Tabs.java b/mobile/android/base/java/org/mozilla/gecko/Tabs.java index 0a98aa60d465..7fa3cb47e513 100644 --- a/mobile/android/base/java/org/mozilla/gecko/Tabs.java +++ b/mobile/android/base/java/org/mozilla/gecko/Tabs.java @@ -745,16 +745,15 @@ public class Tabs implements GeckoEventListener { return null; } - if (AboutPages.isAboutReader(url)) { - url = ReaderModeUtils.getUrlFromAboutReader(url); - } + url = ReaderModeUtils.stripAboutReaderUrl(url); + for (Tab tab : mOrder) { if (isPrivate != tab.isPrivate()) { continue; } String tabUrl = tab.getURL(); if (AboutPages.isAboutReader(tabUrl)) { - tabUrl = ReaderModeUtils.getUrlFromAboutReader(tabUrl); + tabUrl = ReaderModeUtils.stripAboutReaderUrl(tabUrl); if (url.equals(tabUrl)) { return tab; } From 2f3ba414fe77ac4808c268d8e0c07fe69fc464e5 Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Fri, 2 Sep 2016 12:35:08 -0700 Subject: [PATCH 4/5] Bug 1297117 - Make getUrlFromAboutReader private to avoid erronous usage r=sebastian getUrlFromAboutReader can return null. There have been crashes caused by not checking this result in the past. stripAboutReaderFromUrl is a safer version which returns the input URL if necessary, and is probably what should be used in new code, hence we can make this method private. MozReview-Commit-ID: Lg7QWrpSE8F --HG-- extra : histedit_source : 0964ebab8e9d66e65fc9c3a296031f720219f529 --- .../base/java/org/mozilla/gecko/reader/ReaderModeUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java b/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java index 66e32f0fc2a7..84dcaf531ba0 100644 --- a/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java +++ b/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java @@ -20,7 +20,7 @@ public class ReaderModeUtils { * URLs. * @return null if the URL is malformed or doesn't contain a URL parameter. */ - public static String getUrlFromAboutReader(String aboutReaderUrl) { + private static String getUrlFromAboutReader(String aboutReaderUrl) { return StringUtils.getQueryParameter(aboutReaderUrl, "url"); } From 9e859c42fc981e469d8847c36e8614d2a1fb8a0c Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Fri, 2 Sep 2016 12:35:47 -0700 Subject: [PATCH 5/5] Bug 1297117 - Add documentation to stripAboutReaderUrl r=sebastian MozReview-Commit-ID: Ibzhnk7LLmh --HG-- extra : histedit_source : f8460143a4c00238defb68774e96ac99150779aa --- .../base/java/org/mozilla/gecko/reader/ReaderModeUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java b/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java index 84dcaf531ba0..c863754b4fd3 100644 --- a/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java +++ b/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java @@ -45,6 +45,12 @@ public class ReaderModeUtils { return getAboutReaderForUrl(url, -1); } + /** + * Obtain the underlying URL from an about:reader URL. + * This will return the input URL if either of the following is true: + * 1. the input URL is a non about:reader URL + * 2. the input URL is an invalid/unparseable about:reader URL + */ public static String stripAboutReaderUrl(String url) { if (!AboutPages.isAboutReader(url)) { return url;