New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 727487 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Remove OffscreenTab's use of CreateOffTheRecordProfile

Project Member Reported by tibell@chromium.org, May 30 2017

Issue description

miu@chromium.org I've assigned you as a first owner, based on blame output, hoping you would know who might be a good owner. I found you through this CL: http://crrev.com/1401473004

While reworking how incognito works (in particular how incognito prefs works) I noticed that OffscreenTab uses CreateOffTheRecordProfile. This function isn't really sensible. There should only ever be one incognito profile per real profile and it's accessed by GetOffTheRecordProfile.

I see two solutions:

 * stop using this function or
 * remove this functionality altogether.

I checked usage of the API this class implements (chrome.tabCapture.captureOffscreenTab) and it's very low.
 

Comment 1 by m...@chromium.org, May 30 2017

Cc: m...@chromium.org
Owner: mfo...@chromium.org
Some clarifications:

1. The offscreen tab is not just used by the extension API. More widely, it's used to support the W3C Presentation API.

2. For the Presentation API use case, we are creating a separate off-the-record profile because the purpose is to simulate a web page running in a browser on another device (e.g., a remote "smart TV"). Thus, it's not appropriate for it to use the current user profile, nor the incognito profile that would be shared with other local on-screen tabs.

3. I'm beginning to wonder if the offscreen tab feature should provide its own Profile (or content::BrowserContext) that is neither the normal nor incognito implementation. FWIW, our current method of creating a separate incognito profile instance that cannot be shared with local onscreen tabs satisfies functional requirements. I would want to understand tibell's "reworkings" before determining whether this bug is a WontFix.

Reassigning to mfoltz@ for follow-up/handling/assignment...

Comment 2 by mfo...@chromium.org, May 30 2017

Can you elaborate on the issues here?

We could fork the OffTheRecordProfile implementation and maintain it ourselves but I don't think that's good in the long term.

Comment 3 by tibell@chromium.org, May 31 2017

Thanks for the clarifications.

Unfortunately CreateOffTheRecordProfile doesn't really give you a separate incognito profile that can't influence other (on-screen) incognito profile tabs or the underlying user profile.

CreateOffTheRecordProfile eventually ends up calling GetOffTheRecordPrefs on the underlying user profile, which returns a PrefService object shared by all such calls. In other words, if you were to write a pref in the profile you got from CreateOffTheRecordProfile you would affect all incognito profile tabs, including on-screen tabs (and vice versa). Furthermore, writes to prefs that aren't explicitly whitelisted to only be stored in-memory will be persisted in the underlying user's profile.

What kind of separation do you need from the other incognito profiles?

Comment 4 by tibell@chromium.org, May 31 2017

Perhaps a stupid question, but I don't see offscreen_tab.h included anywhere except in extensions. How does the W3C Presentation API use it?

Comment 5 by m...@chromium.org, May 31 2017

Cc: zhaobin@chromium.org
zhaobin: Could you respond to comment 4?
For comment 4, 

media_router::ReceiverPresentationServiceDelegateImpl::CreateForWebContents(
    offscreen_tab_web_contents_.get(), optional_presentation_id); (https://cs.chromium.org/chromium/src/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc?rcl=867e554db2e9d5b2cd58d684544b81c8d170144b&l=128)

It will associate a ReceiverPresentationServiceDelegateImpl object (Presentation API related object) with offscreen tab's web content.

Comment 7 by mfo...@chromium.org, Jul 21 2017

Components: Internals>Cast

Comment 8 by m...@chromium.org, Jul 21 2017

Owner: zhaobin@chromium.org
Status: Assigned (was: Untriaged)
Assigning to zhaobin, as they're currently working on related  bug 664351 .

Comment 9 by m...@chromium.org, Jul 21 2017

Cc: tibell@chromium.org
tibell (re: c#3): Offscreen tabs are supposed to be completely separate from the normal user profiles. Each offscreen tab should start with its own separate "blank" Profile instance that auto-destructs when the offscreen tab shuts down. In other words, we don't want a user's cookies or localStorage or other PII to "leak" into (or outside of) an offscreen tab page.

Offscreen tabs are meant to simulate a browser instance running on another device. Here, they use the local browser to render the page, and tab capture on that offscreen instance to record audio/video and feed that to a remote display device.
related to:  crbug.com/664351 
Cc: taku...@chromium.org
+takumif@
Project Member

Comment 12 by bugdroid1@chromium.org, Dec 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7adfa2d52607a71519432fbe05bc1bdb93f7ba75

commit 7adfa2d52607a71519432fbe05bc1bdb93f7ba75
Author: btolsch <btolsch@chromium.org>
Date: Sat Dec 16 23:35:44 2017

Add PresentationReceiverWindow for wired screen presentations

This change adds a class which shows a Presentation API receiver page in
a popup-style window that is started fullscreen on a specific wired
display.

It also changes the handling of one-off OTR profiles used by
presentations, which affects this class and offscreen tabs.  Previously,
offscreen tabs assumed ownership of their OTR profiles.  However, it was
possible for this to be violated by opening a DevTools window and
Browser would think that it could destroy the profile.  Additionally,
there was no handling of the original profile being destroyed, which
would leave dangling references in the OTR profile.  This has been
addressed by adding an IndependentOTRProfileManager class, which helps
both offscreen tabs and PresentationReceiverWindow manage the lifetime
of these one-off OTR profiles.

Bug:  777654 ,  786158 ,  664351 , 727487
Change-Id: I64d032419d341affbdde4ee80b57d45c99648588
Reviewed-on: https://chromium-review.googlesource.com/742122
Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: Derek Cheng <imcheng@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524615}
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/chromeos/profiles/profile_helper.h
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/extensions/api/tab_capture/offscreen_tab.h
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/media/router/BUILD.gn
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/media/router/independent_otr_profile_manager.cc
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/media/router/independent_otr_profile_manager.h
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/media/router/independent_otr_profile_manager_browsertest.cc
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/media/router/presentation_navigation_policy.cc
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/media/router/presentation_navigation_policy.h
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/media/router/receiver_presentation_service_delegate_impl.cc
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/browser.cc
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/media_router/presentation_receiver_window.h
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/media_router/presentation_receiver_window_controller.h
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/media_router/presentation_receiver_window_delegate.h
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/views/location_bar/location_bar_view.cc
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/views/location_bar/location_bar_view.h
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/views/media_router/presentation_receiver_window_factory.cc
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/views/media_router/presentation_receiver_window_frame.cc
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/views/media_router/presentation_receiver_window_frame.h
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/browser/ui/views/media_router/presentation_receiver_window_view.h
[modify] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/test/BUILD.gn
[add] https://crrev.com/7adfa2d52607a71519432fbe05bc1bdb93f7ba75/chrome/test/data/media/router/presentation_receiver.html

Owner: btolsch@chromium.org
Status: Available (was: Assigned)
btolsch@ is working on this. Unassign myself.
Status: Assigned (was: Available)
Available -> Assigned
Cc: -zhaobin@chromium.org
Cc: -imch...@chromium.org

Sign in to add a comment