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

Unified Diff: dbus/test_service.cc

Issue 510863002: dbus::ObjectManager: Add a match rule for properties before GetManagedObjects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased; updated BUILD.gn; fixed crash from latest RunLoop changes Created 6 years, 3 months 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
« no previous file with comments | « dbus/test_service.h ('k') | dbus/util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/test_service.cc
diff --git a/dbus/test_service.cc b/dbus/test_service.cc
index 96fa8bced98764ff043b0c2b66023972ed98747c..c976c3786b53dafa77431a7b656bc36fef233a0c 100644
--- a/dbus/test_service.cc
+++ b/dbus/test_service.cc
@@ -24,7 +24,7 @@ void EmptyCallback(bool /* success */) {
namespace dbus {
// Echo, SlowEcho, AsyncEcho, BrokenMethod, GetAll, Get, Set, PerformAction,
-// GetManagedObjects.
+// GetManagedObjects
const int TestService::kNumMethodsToExport = 9;
TestService::Options::Options()
@@ -160,6 +160,10 @@ void TestService::ReleaseOwnershipInternal(
callback);
}
+void TestService::SetSendImmediatePropertiesChanged() {
+ send_immediate_properties_changed_ = true;
+}
+
void TestService::OnExported(const std::string& interface_name,
const std::string& method_name,
bool success) {
@@ -471,11 +475,13 @@ void TestService::PerformAction(
return;
}
- if (action == "AddObject")
+ if (action == "AddObject") {
AddObject(object_path);
- else if (action == "RemoveObject")
+ } else if (action == "RemoveObject") {
RemoveObject(object_path);
- else if (action == "ReleaseOwnership") {
+ } else if (action == "SetSendImmediatePropertiesChanged") {
+ SetSendImmediatePropertiesChanged();
+ } if (action == "ReleaseOwnership") {
ReleaseOwnership(base::Bind(&TestService::PerformActionResponse,
base::Unretained(this),
method_call, response_sender));
@@ -556,6 +562,9 @@ void TestService::GetManagedObjects(
writer.CloseContainer(&array_writer);
response_sender.Run(response.Pass());
+
+ if (send_immediate_properties_changed_)
+ SendPropertyChangedSignal("ChangedTestServiceName");
}
void TestService::AddPropertiesToWriter(MessageWriter* writer) {
« no previous file with comments | « dbus/test_service.h ('k') | dbus/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698