9 years, 2 months ago
(2011-10-17 21:30:35 UTC)
#4
+cmasone who originally wrote this code.
Chris Masone
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus/session_manager_client.cc File chrome/browser/chromeos/dbus/session_manager_client.cc (right): http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus/session_manager_client.cc#newcode64 chrome/browser/chromeos/dbus/session_manager_client.cc:64: login_manager::kSessionManagerEmitLoginPromptReady); For speed purposes, we were calling this and ...
9 years, 2 months ago
(2011-10-18 16:32:41 UTC)
#5
Chris, thank you for the great comments! http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus/session_manager_client.cc File chrome/browser/chromeos/dbus/session_manager_client.cc (right): http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus/session_manager_client.cc#newcode64 chrome/browser/chromeos/dbus/session_manager_client.cc:64: login_manager::kSessionManagerEmitLoginPromptReady); On ...
9 years, 2 months ago
(2011-10-18 17:49:44 UTC)
#6
Chris, thank you for the great comments!
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
File chrome/browser/chromeos/dbus/session_manager_client.cc (right):
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.cc:64:
login_manager::kSessionManagerEmitLoginPromptReady);
On 2011/10/18 16:32:41, Chris Masone wrote:
> For speed purposes, we were calling this and not bothering to wait for a
> response to come back from dbus, because we didn't care about the response.
Is
> this doing the same?
Yes. CallMethod() is asynchronous. CallMethodAndBlock() is synchronous, but we
don't plan to use the latter for the code in this directory.
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.cc:76:
login_manager::kSessionManagerEmitLoginPromptVisible);
On 2011/10/18 16:32:41, Chris Masone wrote:
> Same comment as above
Done.
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.cc:152:
login_manager::kSessionManagerStorePolicy);
On 2011/10/18 16:32:41, Chris Masone wrote:
> Shouldn't policy_blob be put in the message here?
You are absolutely right. You saved me from harshly getting yelled at a later
time. Fixed.
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.cc:166: <<
login_manager::kSessionManagerEmitLoginPromptReady;
On 2011/10/18 16:32:41, Chris Masone wrote:
> The particular error responses from DBus are useful for debugging. Are they
not
> exposed?
Good question. In case of a method call error, the error message is emitted from
dbus/object_proxy.cc, and NULL is passed to the callback.
The relevant piece of code is:
} else if (dbus_message_get_type(response_message) ==
DBUS_MESSAGE_TYPE_ERROR) {
// This will take |response_message| and release (unref) it.
scoped_ptr<dbus::ErrorResponse> error_response(
dbus::ErrorResponse::FromRawMessage(response_message));
// Error message may contain the error message as string.
dbus::MessageReader reader(error_response.get());
std::string error_message;
reader.PopString(&error_message);
LOG(ERROR) << "Failed to call method: " << error_response->GetErrorName()
<< ": " << error_message;
// We don't give the error message to the callback.
response_callback.Run(NULL);
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
File chrome/browser/chromeos/dbus/session_manager_client.h (right):
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.h:45: virtual void
RestartEntd() = 0;
On 2011/10/18 16:32:41, Chris Masone wrote:
> This is deprecated; we can either remove it now, or just note with a comment,
> your choice.
RestartEntd() is called from browser/chromeos/enterprise_extension_observer.cc.
Can we remove this code now?
For now, added a comment saying it's deprecated.
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.h:61: virtual void
RetrievePolicy(RetrievePolicyCallback callback) = 0;
On 2011/10/18 16:32:41, Chris Masone wrote:
> When I wrote this originally, davemoore indicated that he felt it shouldn't be
> called RetrievePolicy, because it doesn't actually retrieve the policy :-) It
> asynchronously kicks off a request to retrieve the policy, and expects a
> callback to fire upon success/failure.
>
> That's why we settled on RequestRetrievePolicy. We weren't super happy with
the
> name, but we felt it was more accurate. If naming all asynchronous calls
thusly
> is a convention you're following in all this new code, that's fine.
Good point. I expect all D-Bus method calls to be asynchronous in the D-Bus code
in Chrome, so I thought we wouldn't need to add something like 'Request' for
asynchronous methods. Otherwise, all method names end up starting with
'Request'. :)
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.h:63: // Used for
StorePolicyCallback. Takes a bollean indicating whether the
On 2011/10/18 16:32:41, Chris Masone wrote:
> nit: boolean
Done.
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.h:69: virtual void
StorePolicy(const std::string& policy_bob,
On 2011/10/18 16:32:41, Chris Masone wrote:
> Same comment as above.
Done.
Chris Masone
LGTM I do notice that the mocks aren't added to any gyp files yet, but ...
9 years, 2 months ago
(2011-10-18 17:55:44 UTC)
#7
LGTM
I do notice that the mocks aren't added to any gyp files yet, but that doesn't
really matter for now anyway.
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
File chrome/browser/chromeos/dbus/session_manager_client.cc (right):
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.cc:64:
login_manager::kSessionManagerEmitLoginPromptReady);
On 2011/10/18 17:49:44, satorux1 wrote:
> On 2011/10/18 16:32:41, Chris Masone wrote:
> > For speed purposes, we were calling this and not bothering to wait for a
> > response to come back from dbus, because we didn't care about the response.
> Is
> > this doing the same?
>
> Yes. CallMethod() is asynchronous. CallMethodAndBlock() is synchronous, but we
> don't plan to use the latter for the code in this directory.
cool.
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.cc:166: <<
login_manager::kSessionManagerEmitLoginPromptReady;
On 2011/10/18 17:49:44, satorux1 wrote:
> On 2011/10/18 16:32:41, Chris Masone wrote:
> > The particular error responses from DBus are useful for debugging. Are they
> not
> > exposed?
>
> Good question. In case of a method call error, the error message is emitted
from
> dbus/object_proxy.cc, and NULL is passed to the callback.
>
> The relevant piece of code is:
>
> } else if (dbus_message_get_type(response_message) ==
> DBUS_MESSAGE_TYPE_ERROR) {
> // This will take |response_message| and release (unref) it.
>
> scoped_ptr<dbus::ErrorResponse> error_response(
> dbus::ErrorResponse::FromRawMessage(response_message));
> // Error message may contain the error message as string.
>
> dbus::MessageReader reader(error_response.get());
> std::string error_message;
> reader.PopString(&error_message);
> LOG(ERROR) << "Failed to call method: " << error_response->GetErrorName()
> << ": " << error_message;
> // We don't give the error message to the callback.
>
> response_callback.Run(NULL);
okey doke.
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
File chrome/browser/chromeos/dbus/session_manager_client.h (right):
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.h:45: virtual void
RestartEntd() = 0;
On 2011/10/18 17:49:44, satorux1 wrote:
> On 2011/10/18 16:32:41, Chris Masone wrote:
> > This is deprecated; we can either remove it now, or just note with a
comment,
> > your choice.
>
> RestartEntd() is called from
browser/chromeos/enterprise_extension_observer.cc.
> Can we remove this code now?
>
I believe so, but kmixter and rginda would know for sure. That can certainly
happen in a follow on CL, if it's appropriate. I know that entd is no longer
running by default in R16, but it's still installed in case we need to backtrack
for some reason. Perhaps we should leave it in til the Chromium R16 branch
point, if that hasn't happened already.
> For now, added a comment saying it's deprecated.
works for me!
http://codereview.chromium.org/8295019/diff/6001/chrome/browser/chromeos/dbus...
chrome/browser/chromeos/dbus/session_manager_client.h:61: virtual void
RetrievePolicy(RetrievePolicyCallback callback) = 0;
On 2011/10/18 17:49:44, satorux1 wrote:
> On 2011/10/18 16:32:41, Chris Masone wrote:
> > When I wrote this originally, davemoore indicated that he felt it shouldn't
be
> > called RetrievePolicy, because it doesn't actually retrieve the policy :-)
It
> > asynchronously kicks off a request to retrieve the policy, and expects a
> > callback to fire upon success/failure.
> >
> > That's why we settled on RequestRetrievePolicy. We weren't super happy with
> the
> > name, but we felt it was more accurate. If naming all asynchronous calls
> thusly
> > is a convention you're following in all this new code, that's fine.
>
> Good point. I expect all D-Bus method calls to be asynchronous in the D-Bus
code
> in Chrome, so I thought we wouldn't need to add something like 'Request' for
> asynchronous methods. Otherwise, all method names end up starting with
> 'Request'. :)
Fair enough
stevenjb
lgtm http://codereview.chromium.org/8295019/diff/12001/chrome/browser/chromeos/dbus/session_manager_client.h File chrome/browser/chromeos/dbus/session_manager_client.h (right): http://codereview.chromium.org/8295019/diff/12001/chrome/browser/chromeos/dbus/session_manager_client.h#newcode68 chrome/browser/chromeos/dbus/session_manager_client.h:68: // Attempts to store the policy blob |policy_blob| ...
9 years, 2 months ago
(2011-10-18 18:02:37 UTC)
#8
The mock will be used in the next patch! http://codereview.chromium.org/8295019/diff/12001/chrome/browser/chromeos/dbus/session_manager_client.h File chrome/browser/chromeos/dbus/session_manager_client.h (right): http://codereview.chromium.org/8295019/diff/12001/chrome/browser/chromeos/dbus/session_manager_client.h#newcode68 chrome/browser/chromeos/dbus/session_manager_client.h:68: ...
9 years, 2 months ago
(2011-10-18 18:26:42 UTC)
#9
Issue 8295019: chromeos: Implement the new D-Bus client for SessionManagerClient.
(Closed)
Created 9 years, 2 months ago by satorux1
Modified 9 years, 2 months ago
Reviewers: stevenjb, Chris Masone
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 36