https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_context.h File chrome/browser/content_settings/permission_context.h (right): https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_context.h#newcode17 chrome/browser/content_settings/permission_context.h:17: PermissionContextBase* Get(Profile* profile, This could be renamed PermissionContextFactory::Create() to ...
5 years, 9 months ago
(2015-03-11 11:38:17 UTC)
#4
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_context.h File chrome/browser/content_settings/permission_context.h (right): https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_context.h#newcode13 chrome/browser/content_settings/permission_context.h:13: namespace PermissionContext { Namespaces should be lowercase_with_underscores. Or you ...
5 years, 9 months ago
(2015-03-11 14:06:18 UTC)
#5
https://codereview.chromium.org/990303002/diff/20001/content/public/browser/content_browser_client.h File content/public/browser/content_browser_client.h (right): https://codereview.chromium.org/990303002/diff/20001/content/public/browser/content_browser_client.h#newcode458 content/public/browser/content_browser_client.h:458: virtual int SubscribePermissionStatusChange( why is this not on browser_context?
5 years, 9 months ago
(2015-03-11 16:11:24 UTC)
#6
https://codereview.chromium.org/990303002/diff/20001/content/common/permission_service.mojom File content/common/permission_service.mojom (right): https://codereview.chromium.org/990303002/diff/20001/content/common/permission_service.mojom#newcode31 content/common/permission_service.mojom:31: // conditions, the caller must pass the last known ...
5 years, 9 months ago
(2015-03-11 17:18:42 UTC)
#7
5 years, 9 months ago
(2015-03-18 16:24:02 UTC)
#8
PTAL
mlamouri (slow - plz ping)
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_context.h File chrome/browser/content_settings/permission_context.h (right): https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_context.h#newcode13 chrome/browser/content_settings/permission_context.h:13: namespace PermissionContext { On 2015/03/11 at 14:06:18, Bernhard Bauer ...
5 years, 9 months ago
(2015-03-18 16:24:40 UTC)
#9
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
File chrome/browser/content_settings/permission_context.h (right):
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
chrome/browser/content_settings/permission_context.h:13: namespace
PermissionContext {
On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> Namespaces should be lowercase_with_underscores. Or you could make this a
class with only static methods...
Done.
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
chrome/browser/content_settings/permission_context.h:17: PermissionContextBase*
Get(Profile* profile,
On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> On 2015/03/11 11:38:17, Mounir Lamouri wrote:
> > This could be renamed PermissionContextFactory::Create() to match what it is
> > actually abstracting.
>
> I prefer Get() over Create(), as the method doesn't unconditionally create a
permission context. And neither PermissionContext nor PermissionContextFactory
are actually classses, so both would be in the wrong naming style.
>
> > Also, I would gladly move that one directory up if it's a problem to have
> > chrome/browser/content_settings/ to be aware of the different
> > PermissionContextBase factories.
>
> Meh, as long as there is no conceptual layering violation, I'm fine to keep
both in the same directory until content settings and permissions get separated
out more explicitly.
Sounds good.
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
File chrome/browser/content_settings/permission_observer.h (right):
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
chrome/browser/content_settings/permission_observer.h:35: void
OnContentSettingChanged(const ContentSettingsPattern& primary_pattern,
On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> Add // content_settings::Observer implementation.
Done.
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
File chrome/browser/content_settings/permission_observer_factory.cc (right):
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
chrome/browser/content_settings/permission_observer_factory.cc:27:
BrowserContextDependencyManager::GetInstance()) {
On 2015/03/11 at 14:06:18, Bernhard (OOO until Mar 23) wrote:
> You need to declare your dependencies on other keyed services here.
I exposed a way to get the PermissionContext related factories in order to setup
the dependencies. Hopefully, it's not too ugly.
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
File chrome/browser/content_settings/permission_observer_unittest.cc (right):
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
chrome/browser/content_settings/permission_observer_unittest.cc:13: class
PermissionObserverTests : public ChromeRenderViewHostTestHarness {
On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> The usual style is to use singular for the test fixture name.
I will not point that permission_context_base_unittest.cc doesn't follow the
style then :)
Fixed.
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
chrome/browser/content_settings/permission_observer_unittest.cc:37: return url_;
On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> If this URL is constant, you could just directly use a constant at call sites.
I used to do that and I stopped because it was adding more pain when adding a
new test. I've even moved "https://foo.com" as "other_url_". I think reducing
the cost of adding a new unit test is probably a good thing.
https://codereview.chromium.org/990303002/diff/20001/content/browser/permissi...
File content/browser/permissions/permission_service_impl.cc (right):
https://codereview.chromium.org/990303002/diff/20001/content/browser/permissi...
content/browser/permissions/permission_service_impl.cc:153: int id =
pending_subscriptions_.Add(subscription);
On 2015/03/11 at 14:06:18, Bernhard (OOO until Mar 23) wrote:
> I don't think you need this map. You could create a scoped_ptr<int> and bind
it into OnPermissionStatusChanged, then set the value to the ID returned by
SubscribePermissionStatusChange. In OnPermissionStatusChanged() you would then
dereference the pointer to get the actual ID.
Didn't use a scoped_ptr but a raw pointer that is then base::Owned by the
callback.
https://codereview.chromium.org/990303002/diff/20001/content/browser/permissi...
content/browser/permissions/permission_service_impl.cc:155: // If the
embedding_origin is empty, we,ll use the |origin| instead.
On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> Nit: "we'll". Also, move the code here that falls back to the origin if the
embedding origin is empty, so that it's clear what the comment refers to?
Done.
https://codereview.chromium.org/990303002/diff/20001/content/browser/permissi...
content/browser/permissions/permission_service_impl.cc:169: PermissionStatus
PermissionServiceImpl::GetPermissionStatus(
On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> Overloading methods is discouraged by the style guide.
Snif. I fixed that. GetPermissionStatusFromType() and
GetPermissionStatusFromName() doesn't sound like the best names but if that's
what the style guide wants.
https://codereview.chromium.org/990303002/diff/20001/content/browser/permissi...
content/browser/permissions/permission_service_impl.cc:194: const
mojo::Callback<void(PermissionStatus)>& callback,
On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> Are you going to call the callback?
Oups :)
https://codereview.chromium.org/990303002/diff/20001/content/common/permissio...
File content/common/permission_service.mojom (right):
https://codereview.chromium.org/990303002/diff/20001/content/common/permissio...
content/common/permission_service.mojom:31: // conditions, the caller must pass
the last known value.
On 2015/03/11 at 17:18:42, Tom Sepez wrote:
> Doesn't this imply that the service provider might have to buffer a
potentially infinite set of changes since a request for the next one might
arrive at any point in the future?
No. It means that the service provider will do a check when it receives the call
and if the value it gets is different from the one being passed, it will
directly run the callback with the new value instead of observing. It will only
observe for changes if the current value is different from the last known value
by the caller.
https://codereview.chromium.org/990303002/diff/20001/content/public/browser/c...
File content/public/browser/content_browser_client.h (right):
https://codereview.chromium.org/990303002/diff/20001/content/public/browser/c...
content/public/browser/content_browser_client.h:458: virtual int
SubscribePermissionStatusChange(
On 2015/03/11 at 16:11:24, jochen (slow) wrote:
> why is this not on browser_context?
All the permission related method live here but I think it would make great
sense to make sense to have a PermissionManager hanging from the BrowserContext
(or move the methods there).
However, it might require some refactoring so it would probably be better in a
follow-up.
Bernhard Bauer
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_observer_unittest.cc File chrome/browser/content_settings/permission_observer_unittest.cc (right): https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_observer_unittest.cc#newcode13 chrome/browser/content_settings/permission_observer_unittest.cc:13: class PermissionObserverTests : public ChromeRenderViewHostTestHarness { On 2015/03/18 16:24:40, ...
5 years, 9 months ago
(2015-03-23 10:20:44 UTC)
#10
PTAL. Revision 3 was included a WIP version of a CL that has landed since. ...
5 years, 9 months ago
(2015-03-23 18:06:50 UTC)
#11
PTAL.
Revision 3 was included a WIP version of a CL that has landed since. That branch
wasn't fully rebased.
Bernhard Bauer
LGTM https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_observer_unittest.cc File chrome/browser/content_settings/permission_observer_unittest.cc (right): https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_observer_unittest.cc#newcode37 chrome/browser/content_settings/permission_observer_unittest.cc:37: return url_; On 2015/03/23 10:20:43, Bernhard Bauer wrote: ...
5 years, 9 months ago
(2015-03-23 18:26:18 UTC)
#12
LGTM
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
File chrome/browser/content_settings/permission_observer_unittest.cc (right):
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
chrome/browser/content_settings/permission_observer_unittest.cc:37: return url_;
On 2015/03/23 10:20:43, Bernhard Bauer wrote:
> On 2015/03/18 16:24:40, Mounir Lamouri wrote:
> > On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> > > If this URL is constant, you could just directly use a constant at call
> sites.
> >
> > I used to do that and I stopped because it was adding more pain when adding
a
> > new test. I've even moved "https://foo.com" as "other_url_". I think
reducing
> > the cost of adding a new unit test is probably a good thing.
>
> What additional cost is that?
Ping?
mlamouri (slow - plz ping)
On 2015/03/23 at 18:26:18, bauerb wrote: > LGTM > > https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_settings/permission_observer_unittest.cc > File chrome/browser/content_settings/permission_observer_unittest.cc (right): ...
5 years, 9 months ago
(2015-03-23 18:39:36 UTC)
#13
On 2015/03/23 at 18:26:18, bauerb wrote:
> LGTM
>
>
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
> File chrome/browser/content_settings/permission_observer_unittest.cc (right):
>
>
https://codereview.chromium.org/990303002/diff/20001/chrome/browser/content_s...
> chrome/browser/content_settings/permission_observer_unittest.cc:37: return
url_;
> On 2015/03/23 10:20:43, Bernhard Bauer wrote:
> > On 2015/03/18 16:24:40, Mounir Lamouri wrote:
> > > On 2015/03/11 at 14:06:18, Bernhard Bauer wrote:
> > > > If this URL is constant, you could just directly use a constant at call
> > sites.
> > >
> > > I used to do that and I stopped because it was adding more pain when
adding a
> > > new test. I've even moved "https://foo.com" as "other_url_". I think
reducing
> > > the cost of adding a new unit test is probably a good thing.
> >
> > What additional cost is that?
>
> Ping?
Sorry for missing that. The cost is about creating a GURL and if there is an
"other url", making sure it's not the same. It's mostly about reducing the
number of lines you have to write in order to have a test done.
Also, having url() and other_url() will make it easier to refactor some bits if
needed.
jochen (gone - plz use gerrit)
On 2015/03/18 at 16:24:40, mlamouri wrote: > https://codereview.chromium.org/990303002/diff/20001/content/public/browser/content_browser_client.h > File content/public/browser/content_browser_client.h (right): > > https://codereview.chromium.org/990303002/diff/20001/content/public/browser/content_browser_client.h#newcode458 ...
5 years, 9 months ago
(2015-03-24 09:16:35 UTC)
#14
On 2015/03/18 at 16:24:40, mlamouri wrote:
>
https://codereview.chromium.org/990303002/diff/20001/content/public/browser/c...
> File content/public/browser/content_browser_client.h (right):
>
>
https://codereview.chromium.org/990303002/diff/20001/content/public/browser/c...
> content/public/browser/content_browser_client.h:458: virtual int
SubscribePermissionStatusChange(
> On 2015/03/11 at 16:11:24, jochen (slow) wrote:
> > why is this not on browser_context?
>
> All the permission related method live here but I think it would make great
sense to make sense to have a PermissionManager hanging from the BrowserContext
(or move the methods there).
>
> However, it might require some refactoring so it would probably be better in a
follow-up.
The Content.*Client classes are meant as a last resort fallback. I'd rather not
add more stuff to them. If you expect the permission manager to live on the UI
thread, it should hang of browser context, and if it's supposed to live on the
IO thread, it should hang of resource context.
mlamouri (slow - plz ping)
On 2015/03/24 at 09:16:35, jochen wrote: > On 2015/03/18 at 16:24:40, mlamouri wrote: > > ...
5 years, 9 months ago
(2015-03-25 19:45:29 UTC)
#15
On 2015/03/24 at 09:16:35, jochen wrote:
> On 2015/03/18 at 16:24:40, mlamouri wrote:
>
> >
https://codereview.chromium.org/990303002/diff/20001/content/public/browser/c...
> > File content/public/browser/content_browser_client.h (right):
> >
> >
https://codereview.chromium.org/990303002/diff/20001/content/public/browser/c...
> > content/public/browser/content_browser_client.h:458: virtual int
SubscribePermissionStatusChange(
> > On 2015/03/11 at 16:11:24, jochen (slow) wrote:
> > > why is this not on browser_context?
> >
> > All the permission related method live here but I think it would make great
sense to make sense to have a PermissionManager hanging from the BrowserContext
(or move the methods there).
> >
> > However, it might require some refactoring so it would probably be better in
a follow-up.
>
> The Content.*Client classes are meant as a last resort fallback. I'd rather
not add more stuff to them. If you expect the permission manager to live on the
UI thread, it should hang of browser context, and if it's supposed to live on
the IO thread, it should hang of resource context.
I wrote that:
https://codereview.chromium.org/1011953003
Will get back to this CL later.
mlamouri (slow - plz ping)
Updated to extend content::PermissionManager interface. PTAL.
5 years, 8 months ago
(2015-03-29 21:58:56 UTC)
#16
Updated to extend content::PermissionManager interface.
PTAL.
jochen (gone - plz use gerrit)
lgtm
5 years, 8 months ago
(2015-03-31 10:22:16 UTC)
#17
lgtm
Tom Sepez
lgtm
5 years, 8 months ago
(2015-03-31 16:24:15 UTC)
#18
lgtm
mlamouri (slow - plz ping)
The CQ bit was checked by mlamouri@chromium.org
5 years, 8 months ago
(2015-03-31 21:01:19 UTC)
#19
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/53095)
5 years, 8 months ago
(2015-03-31 21:42:03 UTC)
#27
Issue 990303002: Implement PermissionService::GetNextPermissionChange.
(Closed)
Created 5 years, 9 months ago by mlamouri (slow - plz ping)
Modified 5 years, 8 months ago
Reviewers: Bernhard Bauer, jochen (gone - plz use gerrit), Miguel Garcia, Torne, Tom Sepez
Base URL: https://chromium.googlesource.com/chromium/src.git@permission_impl
Comments: 40