I'm still thinking that creating another file is not the right answer, but I
won't complain if the other reviewers feel it's the right thing to do.
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
File chrome/browser/policy/device_management_policy_provider_unittest.cc
(right):
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
chrome/browser/policy/device_management_policy_provider_unittest.cc:56: void
CreateNewProviderDontRunPending() {
Hm, maybe it's worth to just have one of them and make the caller do the
RunAllPending() call when required?
And if not, I'd rather change the names so this function is called
CreateNewProvider and the other one CreateNewProviderAndRunPending.
Jakob Kummerow
On 2010/11/25 16:12:36, Mattias Nissler wrote: > I'm still thinking that creating another file is ...
On 2010/11/25 16:12:36, Mattias Nissler wrote:
> I'm still thinking that creating another file is not the right answer, but I
> won't complain if the other reviewers feel it's the right thing to do.
Let me emphasize that we don't really have "another file", rather we have either
the one or the other. So always having the same file (in terms of filename) but
with alternating content wouldn't make much of a difference IMO.
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
File chrome/browser/policy/device_management_policy_provider_unittest.cc
(right):
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
chrome/browser/policy/device_management_policy_provider_unittest.cc:56: void
CreateNewProviderDontRunPending() {
On 2010/11/25 16:12:36, Mattias Nissler wrote:
> Hm, maybe it's worth to just have one of them and make the caller do the
> RunAllPending() call when required?
>
> And if not, I'd rather change the names so this function is called
> CreateNewProvider and the other one CreateNewProviderAndRunPending.
Done.
I went for the first option -- only provide one method, which doesn't include
RunAllPending().
Mattias Nissler (ping if slow)
On 2010/11/25 16:28:45, jkummerow wrote: > On 2010/11/25 16:12:36, Mattias Nissler wrote: > > I'm ...
On 2010/11/25 16:28:45, jkummerow wrote:
> On 2010/11/25 16:12:36, Mattias Nissler wrote:
> > I'm still thinking that creating another file is not the right answer, but I
> > won't complain if the other reviewers feel it's the right thing to do.
>
> Let me emphasize that we don't really have "another file", rather we have
either
> the one or the other. So always having the same file (in terms of filename)
but
> with alternating content wouldn't make much of a difference IMO.
You are right in that their existence is exclusive. What I meant by "another
file" is that we now have code for writing three different files although we're
keeping state for more or less a single component. That just feels wrong to me.
We have three different implementations for
"persist-this-piece-to-a-file-and-read-it-back", where it should be perfectly
possible to at least keep the (admittedtly suboptimal) current situation where
we have only two.
>
>
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
> File chrome/browser/policy/device_management_policy_provider_unittest.cc
> (right):
>
>
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
> chrome/browser/policy/device_management_policy_provider_unittest.cc:56: void
> CreateNewProviderDontRunPending() {
> On 2010/11/25 16:12:36, Mattias Nissler wrote:
> > Hm, maybe it's worth to just have one of them and make the caller do the
> > RunAllPending() call when required?
> >
> > And if not, I'd rather change the names so this function is called
> > CreateNewProvider and the other one CreateNewProviderAndRunPending.
>
> Done.
> I went for the first option -- only provide one method, which doesn't include
> RunAllPending().
Quick answers to some of Danno's comments.
Due to popular demand, I'll give embedding the 'unmanaged' flag into the policy
cache's existing file a shot. I'm not convinced that that'll turn out to be any
more elegant than the current solution, but we'll see.
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
File chrome/browser/policy/device_management_policy_provider.cc (right):
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
chrome/browser/policy/device_management_policy_provider.cc:221: if
(policy_request_pending_)
On 2010/11/25 16:35:01, danno wrote:
> Why reverse this? Seems like an unrelated change.
It is indeed unrelated and merely a formatting change to reduce indentation. We
recently had the "Boyscout Rule" in the bathroom, remember? ;-)
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
chrome/browser/policy/device_management_policy_provider.cc:273: #if
defined(OS_CHROMEOS)
On 2010/11/25 16:35:01, danno wrote:
> Do you need this #define here? sending the notification if there are not any
> listeners is harmless, and it makes sure this code gets compiled on all
> platforms.
This is Markus' code, I only moved it. Battle it out with him ;-)
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
chrome/browser/policy/device_management_policy_provider.cc:276:
NotifyCloudPolicyUpdate();
On 2010/11/25 16:35:01, danno wrote:
> Would it be possible to create a specific observer for this even in the same
> style as the token fetcher? Given that the notifications are tied to the
> profile/provider, I think this would be cleaner, it doesn't require the
listener
> to know which provider he's expecting the notification from in the "Observe"
> method.
Same as above -- not my code. I'm just keeping the interface intact. Apparently
a major restructuring of this particular notification mechanism is on the
horizon anyway, but will probably have to wait until after the branching on
Monday.
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
File chrome/browser/policy/device_management_policy_provider_unittest.cc
(right):
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
chrome/browser/policy/device_management_policy_provider_unittest.cc:51: void
CreateNewProvider() {
On 2010/11/25 16:35:01, danno wrote:
> Probably would be clearer to have:
> CreateNewProvider --> just creates provider
> CreateNewProviderRunPending --> calls CreateNewProvider and runs all.
Done. See Mattias' comment and my reply.
markusheintz_
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_management_policy_provider.h File chrome/browser/policy/device_management_policy_provider.h (right): http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_management_policy_provider.h#newcode60 chrome/browser/policy/device_management_policy_provider.h:60: // for the first attempt to fetch policies to ...
Major restructuring:
• No standalone "UnmanagedDevice" file any more, instead the cache stores this
information.
• No more accessors to refresh time, instead a private constructor for the
policy provider for use by test cases.
Happy, now, are you?
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
File chrome/browser/policy/device_management_policy_provider.cc (right):
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
chrome/browser/policy/device_management_policy_provider.cc:37: const char*
kUnmanagedDeviceMarkerFilename = "UnmanagedDevice";
On 2010/11/25 16:35:01, danno wrote:
> It occurs to me that the information in this file could be nicely put into the
> policy cache, and it seems like that is almost a logical place for it. I think
> folding it into the the policy boolean PB would save a lot of code here, since
> the lifecycles are tied anyway.
Done.
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
File chrome/browser/policy/device_management_policy_provider.h (right):
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
chrome/browser/policy/device_management_policy_provider.h:60: // for the first
attempt to fetch policies to complete.
On 2010/11/25 17:49:44, markusheintz_ wrote:
> Should we mention that the method also returns true even if the request wasn't
> issued yet? This is the case right?
Strictly speaking, yes. But the request is issued immediately (that is, as soon
as the IOThread is available). Also, I'd argue that the current formulation
covers that situation. But we can make it more explicit if you wish.
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/device_ma...
chrome/browser/policy/device_management_policy_provider.h:135:
unmanaged_device_refresh_rate_ms_ = unmanaged_device_refresh_rate_ms;
On 2010/11/25 16:35:01, danno wrote:
> Can you use a new private/protected constructor for these that's only called
by
> the tests? I think I'd like that better.
Done.
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/proto/dev...
File chrome/browser/policy/proto/device_management_local.proto (right):
http://codereview.chromium.org/5331008/diff/1/chrome/browser/policy/proto/dev...
chrome/browser/policy/proto/device_management_local.proto:31: }
On 2010/11/25 16:35:01, danno wrote:
> Are you sure you can't fold this into the cache?
Quite the contrary: I'm sure I can if I decide I want to :-)
Done.
Mattias Nissler (ping if slow)
Looks much butter, but I'm not happy enough yet! http://codereview.chromium.org/5331008/diff/10001/chrome/browser/policy/device_management_policy_cache.cc File chrome/browser/policy/device_management_policy_cache.cc (right): http://codereview.chromium.org/5331008/diff/10001/chrome/browser/policy/device_management_policy_cache.cc#newcode155 chrome/browser/policy/device_management_policy_cache.cc:155: ...
LGTM. http://codereview.chromium.org/5331008/diff/10001/chrome/browser/policy/device_management_policy_provider.cc File chrome/browser/policy/device_management_policy_provider.cc (right): http://codereview.chromium.org/5331008/diff/10001/chrome/browser/policy/device_management_policy_provider.cc#newcode332 chrome/browser/policy/device_management_policy_provider.cc:332: return waiting_for_initial_policies_; I almost gave the same feedback ...
Mattias: more to your taste? http://codereview.chromium.org/5331008/diff/10001/chrome/browser/policy/device_management_policy_cache.cc File chrome/browser/policy/device_management_policy_cache.cc (right): http://codereview.chromium.org/5331008/diff/10001/chrome/browser/policy/device_management_policy_cache.cc#newcode155 chrome/browser/policy/device_management_policy_cache.cc:155: (is_device_unmanaged ? NULL On ...
fixup all style violations and you're good to go! http://codereview.chromium.org/5331008/diff/25001/chrome/browser/policy/device_management_policy_cache.cc File chrome/browser/policy/device_management_policy_cache.cc (right): http://codereview.chromium.org/5331008/diff/25001/chrome/browser/policy/device_management_policy_cache.cc#newcode30 chrome/browser/policy/device_management_policy_cache.cc:30: ...
I had to revert this because it didn't compile on Windows. I fixed that, the
Windows try job is already at browser_tests (Mac and Linux ran without problems
anyway).
Please give me the thumbs-up to land this again (of course I'll wait until the
try job is completely finished).
Issue 5331008: Persist 'this device is not managed' information
(Closed)
Created 10 years ago by Jakob Kummerow
Modified 9 years, 6 months ago
Reviewers: Mattias Nissler (ping if slow), gfeher, markusheintz_, danno
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 47