Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Unified Diff: dbus/test_service.h

Issue 11358111: Make SignalSenderVerificationTest more robust (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dbus/test_service.h
diff --git a/dbus/test_service.h b/dbus/test_service.h
index 17f27ca133aa01c3700425748889d0b5892594fc..a37227a5f7e4aa80d56bf5291365c7245ea36e5f 100644
--- a/dbus/test_service.h
+++ b/dbus/test_service.h
@@ -66,7 +66,10 @@ class TestService : public base::Thread {
void SendTestSignalFromRoot(const std::string& message);
// Request the ownership of a well-known name "TestService".
satorux1 2012/11/07 01:42:25 Please add some comment about the new parameter.
Haruki Sato 2012/11/12 04:59:43 Done.
- void RequestOwnership();
+ void RequestOwnership(base::Callback<void(bool)>);
satorux1 2012/11/07 01:42:25 parameter name is missing.
Haruki Sato 2012/11/12 04:59:43 Done. Thanks.
+
+ // Returns whether this instance has the name ownership or not.
+ bool HasOwnership();
satorux1 2012/11/07 01:42:25 bool has_ownership() const { return has_ownership_
Haruki Sato 2012/11/12 04:59:43 Done.
private:
// Helper function for SendTestSignal().
@@ -79,7 +82,8 @@ class TestService : public base::Thread {
void ShutdownAndBlockInternal();
// Called when an ownership request is completed.
- void OnOwnership(const std::string& service_name,
+ void OnOwnership(base::Callback<void(bool)> callback,
satorux1 2012/11/07 01:42:25 Please add some comment about the new parameter, a
Haruki Sato 2012/11/12 04:59:43 Done.
+ const std::string& service_name,
bool success);
// Called when a method is exported.
@@ -131,13 +135,16 @@ class TestService : public base::Thread {
void SendPropertyChangedSignalInternal(const std::string& name);
// Helper function for RequestOwnership().
- void RequestOwnershipInternal();
+ void RequestOwnershipInternal(base::Callback<void(bool)> callback);
scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy_;
base::WaitableEvent on_all_methods_exported_;
// The number of methods actually exported.
int num_exported_methods_;
+ // True iff this instance has successfully acquired the name ownership.
+ bool has_name_ownership;
satorux1 2012/11/07 01:42:25 The trailing _ is missing.
Haruki Sato 2012/11/12 04:59:43 Done.
+
scoped_refptr<Bus> bus_;
ExportedObject* exported_object_;
};

Powered by Google App Engine
This is Rietveld 408576698