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

Unified Diff: dbus/message.cc

Issue 9363045: Revert 121920 - dbus: add ObjectPath type (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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/message.h ('k') | dbus/message_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/message.cc
===================================================================
--- dbus/message.cc (revision 121922)
+++ dbus/message.cc (working copy)
@@ -10,7 +10,6 @@
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/stringprintf.h"
-#include "dbus/object_path.h"
#include "third_party/protobuf/src/google/protobuf/message_lite.h"
namespace {
@@ -158,10 +157,10 @@
break;
}
case OBJECT_PATH: {
- ObjectPath value;
+ std::string value;
if (!reader->PopObjectPath(&value))
return kBrokenMessage;
- output += indent + "object_path \"" + value.value() + "\"\n";
+ output += indent + "object_path \"" + value + "\"\n";
break;
}
case ARRAY: {
@@ -225,7 +224,7 @@
std::string headers;
AppendStringHeader("message_type", GetMessageTypeAsString(), &headers);
AppendStringHeader("destination", GetDestination(), &headers);
- AppendStringHeader("path", GetPath().value(), &headers);
+ AppendStringHeader("path", GetPath(), &headers);
AppendStringHeader("interface", GetInterface(), &headers);
AppendStringHeader("member", GetMember(), &headers);
AppendStringHeader("error_name", GetErrorName(), &headers);
@@ -245,9 +244,9 @@
CHECK(success) << "Unable to allocate memory";
}
-void Message::SetPath(const ObjectPath& path) {
+void Message::SetPath(const std::string& path) {
const bool success = dbus_message_set_path(raw_message_,
- path.value().c_str());
+ path.c_str());
CHECK(success) << "Unable to allocate memory";
}
@@ -288,9 +287,9 @@
return destination ? destination : "";
}
-ObjectPath Message::GetPath() {
+std::string Message::GetPath() {
const char* path = dbus_message_get_path(raw_message_);
- return ObjectPath(path ? path : "");
+ return path ? path : "";
}
std::string Message::GetInterface() {
@@ -491,8 +490,8 @@
// bool AppendStringWithErrorChecking().
}
-void MessageWriter::AppendObjectPath(const ObjectPath& value) {
- const char* pointer = value.value().c_str();
+void MessageWriter::AppendObjectPath(const std::string& value) {
+ const char* pointer = value.c_str();
AppendBasic(DBUS_TYPE_OBJECT_PATH, &pointer);
}
@@ -588,7 +587,7 @@
}
void MessageWriter::AppendArrayOfObjectPaths(
- const std::vector<ObjectPath>& object_paths) {
+ const std::vector<std::string>& object_paths) {
DCHECK(!container_is_open_);
MessageWriter array_writer(message_);
OpenArray("o", &array_writer);
@@ -653,8 +652,8 @@
AppendVariantOfBasic(DBUS_TYPE_STRING, &pointer);
}
-void MessageWriter::AppendVariantOfObjectPath(const ObjectPath& value) {
- const char* pointer = value.value().c_str();
+void MessageWriter::AppendVariantOfObjectPath(const std::string& value) {
+ const char* pointer = value.c_str();
AppendVariantOfBasic(DBUS_TYPE_OBJECT_PATH, &pointer);
}
@@ -747,11 +746,11 @@
return success;
}
-bool MessageReader::PopObjectPath(ObjectPath* value) {
+bool MessageReader::PopObjectPath(std::string* value) {
char* tmp_value = NULL;
const bool success = PopBasic(DBUS_TYPE_OBJECT_PATH, &tmp_value);
if (success)
- *value = ObjectPath(tmp_value);
+ value->assign(tmp_value);
return success;
}
@@ -806,12 +805,12 @@
}
bool MessageReader::PopArrayOfObjectPaths(
- std::vector<ObjectPath> *object_paths) {
+ std::vector<std::string> *object_paths) {
MessageReader array_reader(message_);
if (!PopArray(&array_reader))
return false;
while (array_reader.HasMoreData()) {
- ObjectPath object_path;
+ std::string object_path;
if (!array_reader.PopObjectPath(&object_path))
return false;
object_paths->push_back(object_path);
@@ -883,11 +882,11 @@
return success;
}
-bool MessageReader::PopVariantOfObjectPath(ObjectPath* value) {
+bool MessageReader::PopVariantOfObjectPath(std::string* value) {
char* tmp_value = NULL;
const bool success = PopVariantOfBasic(DBUS_TYPE_OBJECT_PATH, &tmp_value);
if (success)
- *value = ObjectPath(tmp_value);
+ value->assign(tmp_value);
return success;
}
« no previous file with comments | « dbus/message.h ('k') | dbus/message_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698