Closed
Bug 1199752
Opened 9 years ago
Closed 7 years ago
Removing all tab mirroring UI code
Categories
(Firefox for Android Graveyard :: Screencasting, defect)
Firefox for Android Graveyard
Screencasting
Tracking
(firefox54 fixed)
RESOLVED
FIXED
Firefox 54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: mfinkle, Assigned: srivatsav1998, Mentored)
References
Details
(Whiteboard: [good first bug][lang=js])
Attachments
(1 file, 15 obsolete files)
16.46 KB,
patch
|
sebastian
:
review+
|
Details | Diff | Splinter Review |
When we started exploring Tab Mirroring, we added some UI code to the app to make it easy to test. Since we are removing Tab Mirroring implementation code, we should just remove the front-end code too.
Reporter | ||
Updated•9 years ago
|
Mentor: mark.finkle
Whiteboard: [good-first-bug][lang=js]
Comment 1•9 years ago
|
||
Hello Mark - I'd be happy to work on this bug (it'll be my first). I'll probably need your help finding where in the code base I can find the relevant code.
Flags: needinfo?(mark.finkle)
Reporter | ||
Comment 2•9 years ago
|
||
Hi Andrew! The tab mirroring code happend over several different landings, so I expect we'll need to peel it away in layers. Looking at the code that originally landed will help. Here is the last bit of code (I think) that landed: http://hg.mozilla.org/mozilla-central/rev/8d7b53cc415e Here is the original code that landed (again, I think): http://hg.mozilla.org/mozilla-central/rev/b350df009721 Based on these, I think we should start by: 1. Removing any tab mirroring code from CastingApps.js 2. Remove TabMirror.jsm completely 3. Remove the casting.mirrorTab* sttings from browser.properties 4. Remove the mirror function from MediaPlayerApp.jsm We should look into ChromeCast.java and MediaPlayerManager.java to see what should and shouldn't be removed. Some of those changes might be formatting or bug fixes. I'm pretty sure SimpleServiceDiscovery.jsm has already been cleaned up and there is no relevant code in that file for mirroring anymore. That should be enough to get us going. Jump on Mozilla IRC #mobile to ask questions you might have as well.
Flags: needinfo?(mark.finkle)
Comment 3•9 years ago
|
||
Attachment #8657849 -
Flags: review?(mark.finkle)
Comment 4•9 years ago
|
||
Attachment #8657851 -
Flags: review?(mark.finkle)
Comment 5•9 years ago
|
||
Attachment #8657855 -
Flags: review?(mark.finkle)
Comment 6•9 years ago
|
||
Not 100% sure I got everything on this one - the call to new GoogleApiClient at the end for instance
Attachment #8657857 -
Flags: review?(mark.finkle)
Comment 7•9 years ago
|
||
Attachment #8657864 -
Flags: review?(mark.finkle)
Comment 8•9 years ago
|
||
Hey Mark - how do I create a patch that completely removes a file (TabMirror.jsm)? Just upload a blank file as the patch?
Reporter | ||
Comment 9•9 years ago
|
||
(In reply to Andrew Brown from comment #8) > Hey Mark - how do I create a patch that completely removes a file > (TabMirror.jsm)? Just upload a blank file as the patch? Andrew - Just use | hg remove <path/to/file> | and then you should see the completely deleted file in your | hg diff |
Reporter | ||
Comment 10•9 years ago
|
||
Comment on attachment 8657849 [details] [diff] [review] Removed tab mirroring code from CastingApps.js >diff --git a/mobile/android/chrome/content/CastingApps.js b/mobile/android/chrome/content/CastingApps.js >@@ -70,18 +70,16 @@ var mediaPlayerDevice = { > modelName: display.modelName, > mirror: display.mirror We can remove the | mirror | property here. I think MediaPlayerApp.jsm looks for it. >- Services.obs.addObserver(this, "Casting:Mirror", false); > Services.obs.addObserver(this, "ssdp-service-found", false); > Services.obs.addObserver(this, "ssdp-service-lost", false); Looks like we no longer need "ssdp-service-found" and "ssdp-service-lost" either. > isMirroringEnabled: function isMirroringEnabled() { > return Services.prefs.getBoolPref("browser.mirroring.enabled"); > }, isMirroringEnabled can be removed too. There is no harm in removing the "browser.mirroring.enabled" perference from mobile.js: http://mxr.mozilla.org/mozilla-central/source/mobile/android/app/mobile.js#293 (lines 293 to 298) > case "ssdp-service-found": > { > this.serviceAdded(SimpleServiceDiscovery.findServiceForID(aData)); > break; > } > case "ssdp-service-lost": > { > this.serviceLost(SimpleServiceDiscovery.findServiceForID(aData)); These can go too. Great start, but let's keep removing code!
Attachment #8657849 -
Flags: review?(mark.finkle) → review-
Reporter | ||
Comment 11•9 years ago
|
||
Comment on attachment 8657851 [details] [diff] [review] Removed mirror function from MediaPlayerApp.jsm >diff --git a/mobile/android/modules/MediaPlayerApp.jsm b/mobile/android/modules/MediaPlayerApp.jsm > remoteMedia: function remoteMedia(callback, listener) { > if (callback) { > callback(new RemoteMedia(this.id, listener)); > } > }, > >- mirror: function mirror(callback) { >- send("MediaPlayer:Mirror", { id: this.id }, (result, err) => { >- if (callback) { >- callback(err == null); >- } >- }); >- } Looks good, but can you remove the "," and remaining blank line after the | remoteMedia | method. Put up a fixed patch and I'll r+ it too.
Attachment #8657851 -
Flags: review?(mark.finkle) → review+
Reporter | ||
Updated•9 years ago
|
Attachment #8657855 -
Flags: review?(mark.finkle) → review+
Reporter | ||
Comment 12•9 years ago
|
||
Comment on attachment 8657857 [details] [diff] [review] Removed tab mirroring from ChromeCast.java >diff --git a/mobile/android/base/ChromeCast.java b/mobile/android/base/ChromeCast.java >- @Override >- public void mirror(final EventCallback callback) { >- final CastDevice device = CastDevice.getFromBundle(route.getExtras()); >- Cast.CastOptions.Builder apiOptionsBuilder = Cast.CastOptions.builder(device, new Cast.Listener() { >- @Override >- public void onApplicationStatusChanged() { } >- >- @Override >- public void onVolumeChanged() { } >- >- @Override >- public void onApplicationDisconnected(int errorCode) { } >- }); >- > apiClient = new GoogleApiClient.Builder(context) > .addApi(Cast.API, apiOptionsBuilder.build()) > .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() { > @Override > public void onConnected(Bundle connectionHint) { > // Sometimes apiClient is null here. See bug 1061032 > if (apiClient == null || !apiClient.isConnected()) { > return; Yeah. Looks like we need to remove more (or less) for this code to build. Let's get you set up to build these changes, so we know we didn't break the build. If you have a Chromecast, we should test "video flinging" to make sure it's not broken when we remove "tab mirroring". If you don't have a Chromecast, I (or someone else) can do the testing.
Attachment #8657857 -
Flags: review?(mark.finkle) → review-
Comment 13•9 years ago
|
||
Attachment #8657849 -
Attachment is obsolete: true
Comment 14•9 years ago
|
||
Attachment #8657851 -
Attachment is obsolete: true
Updated•9 years ago
|
Assignee: nobody → aebrownz11
Updated•9 years ago
|
Assignee: aebrownz11 → nobody
Comment 15•8 years ago
|
||
Modified whitelist 'good-first-bug'->'good first bug'. see https://wiki.mozilla.org/Good_first_bug
Whiteboard: [good-first-bug][lang=js] → [good first bug][lang=js]
Finkle, is this still relevant?
Flags: needinfo?(mark.finkle)
Reporter | ||
Comment 17•8 years ago
|
||
Yes, but I can probably try to land some of the code that is "close enough" and see what's left over.
Flags: needinfo?(mark.finkle)
Assignee | ||
Comment 18•7 years ago
|
||
Hey Mark, can I work on this bug since I see no one is working on this bug? Could you inform whether it is still relevant? If yes help me with this bug since I am new to bug fixing.
Flags: needinfo?(mark.finkle)
Assignee | ||
Comment 19•7 years ago
|
||
I have removed all the mirror UI code as mentioned in the comment2. Please review my patch.
Attachment #8825045 -
Flags: review?(liuche)
Comment 20•7 years ago
|
||
Comment on attachment 8825045 [details] [diff] [review] bug-1199752-fix.patch Sebastian is more active.
Attachment #8825045 -
Flags: review?(liuche) → review?(s.kaspari)
Comment 21•7 years ago
|
||
Comment on attachment 8825045 [details] [diff] [review] bug-1199752-fix.patch @schien: Can you take a quick look at this patch too? I have no clue about our casting code yet - and you have at least work on this area a bit. :)
Attachment #8825045 -
Flags: review?(schien)
Comment 22•7 years ago
|
||
Comment on attachment 8825045 [details] [diff] [review] bug-1199752-fix.patch Review of attachment 8825045 [details] [diff] [review]: ----------------------------------------------------------------- The modification in CastingApps.js and MediaPlayerApp.jsm looks good to me in general. In addition you'll need to remove https://searchfox.org/mozilla-central/source/mobile/android/chrome/content/CastingApps.js#57 as well. ::: mobile/android/chrome/content/CastingApps.js @@ -92,5 @@ > Services.obs.addObserver(this, "Casting:Pause", false); > Services.obs.addObserver(this, "Casting:Stop", false); > - Services.obs.addObserver(this, "Casting:Mirror", false); > - Services.obs.addObserver(this, "ssdp-service-found", false); > - Services.obs.addObserver(this, "ssdp-service-lost", false); ssdp-service-found and ssdp-service-lost is a general callback from SimpleServiceDiscovery.jsm. We should keep them if this bug is only for removing tab mirroring. @@ -111,5 @@ > - NativeWindow.menu.update(this.mirrorStartMenuId, { visible: false }); > - NativeWindow.menu.update(this.mirrorStopMenuId, { visible: true }); > - }, > - > - serviceAdded: function(aService) { keep serviceAdded as an empty function. Remote playback should use this notification to update casting icon if casting device is added after video element is loaded (this should be done in another bug). @@ -148,5 @@ > - NativeWindow.menu.update(this.mirrorStopMenuId, { visible: false }); > - } > - }, > - > - serviceLost: function(aService) { keep serviceLost as empty function for the same reason. @@ -168,5 @@ > return Services.prefs.getBoolPref("browser.casting.enabled"); > }, > > - isMirroringEnabled: function isMirroringEnabled() { > - return Services.prefs.getBoolPref("browser.mirroring.enabled"); should remove the preference from mobile/android/app/mobile.js as well.
Attachment #8825045 -
Flags: review?(schien) → feedback+
Updated•7 years ago
|
Attachment #8660856 -
Attachment is obsolete: true
Updated•7 years ago
|
Attachment #8660838 -
Attachment is obsolete: true
Updated•7 years ago
|
Attachment #8657864 -
Attachment is obsolete: true
Attachment #8657864 -
Flags: review?(mark.finkle)
Updated•7 years ago
|
Attachment #8657857 -
Attachment is obsolete: true
Updated•7 years ago
|
Attachment #8657855 -
Attachment is obsolete: true
Updated•7 years ago
|
Assignee: nobody → srivatsav1998
Status: NEW → ASSIGNED
Comment 23•7 years ago
|
||
Comment on attachment 8825045 [details] [diff] [review] bug-1199752-fix.patch Thanks, schien! I'll remove the review flag for me until a new version of the patch is available.
Attachment #8825045 -
Flags: review?(s.kaspari)
Assignee | ||
Comment 24•7 years ago
|
||
I have made the corrections which you have suggested in comment22. Please review it.
Attachment #8825779 -
Flags: review?(schien)
Comment 25•7 years ago
|
||
Comment on attachment 8825779 [details] [diff] [review] bug-1199752-fix-v3.patch Review of attachment 8825779 [details] [diff] [review]: ----------------------------------------------------------------- overall looks good! but one more thing to fix. ::: mobile/android/app/mobile.js @@ +299,5 @@ > pref("browser.search.noCurrentEngine", true); > > // Control media casting & mirroring features > pref("browser.casting.enabled", true); > #ifdef RELEASE_OR_BETA This line should be removed as well.
Attachment #8825779 -
Flags: review?(schien)
Assignee | ||
Comment 26•7 years ago
|
||
Made the suggested changes. Please review it.
Attachment #8825045 -
Attachment is obsolete: true
Attachment #8825779 -
Attachment is obsolete: true
Attachment #8826100 -
Flags: review?(schien)
Comment 27•7 years ago
|
||
Comment on attachment 8826100 [details] [diff] [review] bug-1199752-fix-v4.patch Review of attachment 8826100 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/app/mobile.js @@ -299,5 @@ > -pref("browser.search.noCurrentEngine", true); > - > -// Control media casting & mirroring features > -pref("browser.casting.enabled", true); > -#ifdef RELEASE_OR_BETA What I meant in previous comment is including `#ifdef RELEASE_OR_BETA`. You should not touch line 298-302.
Attachment #8826100 -
Flags: review?(schien)
Assignee | ||
Comment 28•7 years ago
|
||
Sorry for the previous patch. I have removed the line which you said. Please review it.
Attachment #8826100 -
Attachment is obsolete: true
Attachment #8826103 -
Flags: review?(schien)
Comment 29•7 years ago
|
||
Comment on attachment 8826103 [details] [diff] [review] bug-1199752-fix-v5.patch Review of attachment 8826103 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/chrome/content/CastingApps.js @@ +113,4 @@ > }, > > serviceLost: function(aService) { > + nit: remove this empty line as well. ::: mobile/android/modules/MediaPlayerApp.jsm @@ -65,5 @@ > - callback(err == null); > - } > - }); > - } > -} should not remove the last '}'.
Attachment #8826103 -
Flags: review?(schien)
Assignee | ||
Comment 30•7 years ago
|
||
Oops, my fault. I have rectified the mistake.
Attachment #8826103 -
Attachment is obsolete: true
Attachment #8826116 -
Flags: review?(schien)
Comment 31•7 years ago
|
||
Comment on attachment 8826116 [details] [diff] [review] bug-1199752-fix-v6.patch Review of attachment 8826116 [details] [diff] [review]: ----------------------------------------------------------------- Sebastian can do the final review now.
Attachment #8826116 -
Flags: review?(schien)
Attachment #8826116 -
Flags: review?(s.kaspari)
Attachment #8826116 -
Flags: review+
Comment 32•7 years ago
|
||
Comment on attachment 8826116 [details] [diff] [review] bug-1199752-fix-v6.patch Review of attachment 8826116 [details] [diff] [review]: ----------------------------------------------------------------- This looks like a good start. Following the "MediaPlayer:Mirror" event there should be more (Java) code that can be removed. Do you want to remove that too?
Attachment #8826116 -
Flags: review?(s.kaspari) → feedback+
Assignee | ||
Comment 33•7 years ago
|
||
Yes, I would like to work on that too. What else should be removed?
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(mark.finkle) → needinfo?(s.kaspari)
Comment 34•7 years ago
|
||
You removed the code that sends the 'MediaPlayer:Mirror' event. If you search for that on DXR you will find some more Java code that handles receiving this event: https://dxr.mozilla.org/mozilla-central/search?q=MediaPlayer%3AMirror
Flags: needinfo?(s.kaspari)
Assignee | ||
Comment 35•7 years ago
|
||
I have removed the other dependent code also please review it. Can I ping you directly in IRC when I have any doubt?
Attachment #8826116 -
Attachment is obsolete: true
Attachment #8827546 -
Flags: review?(s.kaspari)
Comment 36•7 years ago
|
||
Comment on attachment 8827546 [details] [diff] [review] bug-1199752-fix-v7.patch Review of attachment 8827546 [details] [diff] [review]: ----------------------------------------------------------------- You'll need to remove the file from the build file too: https://dxr.mozilla.org/mozilla-central/source/mobile/android/modules/moz.build#31 This makes me wonder: Did you actually build the app and try whether everything still works before submitting a patch? ::: mobile/android/base/java/org/mozilla/gecko/MediaPlayerManager.java @@ -135,5 @@ > player.pause(callback); > } else if ("MediaPlayer:End".equals(event)) { > player.end(callback); > - } else if ("MediaPlayer:Mirror".equals(event)) { > - player.mirror(callback); I think we could go even deeper: The mirror() method was only called here. Sothere might be more code that can be removed in the GeckoMediaPlayer interface and ChromecastPlayer.java. However to not expand the scope on and on I'm going to file a new bug for this.
Attachment #8827546 -
Flags: review?(s.kaspari) → feedback+
Comment 37•7 years ago
|
||
Comment on attachment 8827546 [details] [diff] [review] bug-1199752-fix-v7.patch Review of attachment 8827546 [details] [diff] [review]: ----------------------------------------------------------------- Applying the patch locally I noticed that it fails with some conflicts. Can you try to rebase your patch and upload a new version?
Assignee | ||
Comment 38•7 years ago
|
||
I have removed the line you have suggested. Sorry for not verifying the patch before submitting it for review. I have rebased the patch. Please review it.
Attachment #8827546 -
Attachment is obsolete: true
Attachment #8828771 -
Flags: review?(s.kaspari)
Comment 40•7 years ago
|
||
Comment on attachment 8828771 [details] [diff] [review] bug-1199752-fix-v8.patch Review of attachment 8828771 [details] [diff] [review]: ----------------------------------------------------------------- LGTM. Let's see what try says: https://treeherder.mozilla.org/#/jobs?repo=try&revision=16e154e282747494d183cdb8eaf0fc09078b2497
Attachment #8828771 -
Flags: review?(s.kaspari) → review+
Assignee | ||
Comment 41•7 years ago
|
||
Attachment #8832431 -
Flags: checkin?(s.kaspari)
Updated•7 years ago
|
Keywords: checkin-needed
Updated•7 years ago
|
Attachment #8832431 -
Flags: checkin?(s.kaspari)
Updated•7 years ago
|
Attachment #8832431 -
Attachment is obsolete: true
Assignee | ||
Comment 43•7 years ago
|
||
Hey Sebastian, there have been some changes in the core since my last patch. So please review this patch again. I hope I did everything needed.
Attachment #8828771 -
Attachment is obsolete: true
Attachment #8832781 -
Flags: review?(s.kaspari)
Comment 44•7 years ago
|
||
Comment on attachment 8832781 [details] [diff] [review] bug-1199752-fix.patch Review of attachment 8832781 [details] [diff] [review]: ----------------------------------------------------------------- LGTM. I'll verify that the new patch applies and land it. Thank you!
Attachment #8832781 -
Flags: review?(s.kaspari) → review+
Comment 45•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/676201b830f06fd9058946529db870573d837dcb Bug 1199752 - Removing all tab mirroring UI code. r=sebastian
Comment 46•7 years ago
|
||
Pushed by s.kaspari@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/676201b830f0 Removing all tab mirroring UI code. r=sebastian
Comment 47•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/676201b830f0
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•