| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "dbus/message.h" | 5 #include "dbus/message.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "dbus/object_path.h" | 14 #include "dbus/object_path.h" |
| 15 |
| 16 #if defined(USE_SYSTEM_PROTOBUF) |
| 17 #include <google/protobuf/message_lite.h> |
| 18 #else |
| 15 #include "third_party/protobuf/src/google/protobuf/message_lite.h" | 19 #include "third_party/protobuf/src/google/protobuf/message_lite.h" |
| 20 #endif |
| 16 | 21 |
| 17 namespace { | 22 namespace { |
| 18 | 23 |
| 19 // Appends the header name and the value to |output|, if the value is | 24 // Appends the header name and the value to |output|, if the value is |
| 20 // not empty. | 25 // not empty. |
| 21 void AppendStringHeader(const std::string& header_name, | 26 void AppendStringHeader(const std::string& header_name, |
| 22 const std::string& header_value, | 27 const std::string& header_value, |
| 23 std::string* output) { | 28 std::string* output) { |
| 24 if (!header_value.empty()) { | 29 if (!header_value.empty()) { |
| 25 *output += header_name + ": " + header_value + "\n"; | 30 *output += header_name + ": " + header_value + "\n"; |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 const bool success = PopBasic(DBUS_TYPE_UNIX_FD, &fd); | 977 const bool success = PopBasic(DBUS_TYPE_UNIX_FD, &fd); |
| 973 if (!success) | 978 if (!success) |
| 974 return false; | 979 return false; |
| 975 | 980 |
| 976 value->PutValue(fd); | 981 value->PutValue(fd); |
| 977 // NB: the caller must check validity before using the value | 982 // NB: the caller must check validity before using the value |
| 978 return true; | 983 return true; |
| 979 } | 984 } |
| 980 | 985 |
| 981 } // namespace dbus | 986 } // namespace dbus |
| OLD | NEW |