diff options
author | Luis Hector Chavez <lhchavez@google.com> | 2017-07-26 17:33:47 +0000 |
---|---|---|
committer | Luis Hector Chavez <lhchavez@google.com> | 2017-07-26 17:33:47 +0000 |
commit | e5b2c6fa6f923f3a2f66346c2f169d9f0fceb3dc (patch) | |
tree | 26593cf846dcf61fbaa2d04558e4984333832351 /dbus/property.cc | |
parent | 0601274935e7f632eb0d6ce0fd223b744349d20b (diff) | |
download | libchrome-e5b2c6fa6f923f3a2f66346c2f169d9f0fceb3dc.tar.gz |
Revert "libchrome: Uprev the library to r456626 from Chromium"android-o-iot-preview-5o-iot-preview-5
This reverts commit 0601274935e7f632eb0d6ce0fd223b744349d20b.
Reason for revert: Broke the mac_sdk
Exempt-From-Owner-Approval: Fixing mac_sdk
Change-Id: I2cab1818261f3b75dcf7dfc3edf6d6b7bab541a8
Diffstat (limited to 'dbus/property.cc')
-rw-r--r-- | dbus/property.cc | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/dbus/property.cc b/dbus/property.cc index 93f9ed693c..aa58436f51 100644 --- a/dbus/property.cc +++ b/dbus/property.cc @@ -6,8 +6,6 @@ #include <stddef.h> -#include <memory> - #include "base/bind.h" #include "base/logging.h" @@ -661,134 +659,6 @@ void Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>:: writer->CloseContainer(&variant_writer); } -// -// Property<std::unordered_map<std::string, std::vector<uint8_t>>> -// specialization. -// - -template <> -bool Property<std::unordered_map<std::string, std::vector<uint8_t>>>:: - PopValueFromReader(MessageReader* reader) { - MessageReader variant_reader(nullptr); - MessageReader dict_reader(nullptr); - if (!reader->PopVariant(&variant_reader) || - !variant_reader.PopArray(&dict_reader)) - return false; - - value_.clear(); - while (dict_reader.HasMoreData()) { - MessageReader entry_reader(nullptr); - if (!dict_reader.PopDictEntry(&entry_reader)) - return false; - - std::string key; - MessageReader value_varient_reader(nullptr); - if (!entry_reader.PopString(&key) || - !entry_reader.PopVariant(&value_varient_reader)) - return false; - - const uint8_t* bytes = nullptr; - size_t length = 0; - if (!value_varient_reader.PopArrayOfBytes(&bytes, &length)) - return false; - - value_[key].assign(bytes, bytes + length); - } - return true; -} - -template <> -void Property<std::unordered_map<std::string, std::vector<uint8_t>>>:: - AppendSetValueToWriter(MessageWriter* writer) { - MessageWriter variant_writer(nullptr); - MessageWriter dict_writer(nullptr); - - writer->OpenVariant("a{sv}", &variant_writer); - variant_writer.OpenArray("{sv}", &dict_writer); - - for (const auto& pair : set_value_) { - MessageWriter entry_writer(nullptr); - dict_writer.OpenDictEntry(&entry_writer); - - entry_writer.AppendString(pair.first); - - MessageWriter value_varient_writer(nullptr); - entry_writer.OpenVariant("ay", &value_varient_writer); - value_varient_writer.AppendArrayOfBytes(pair.second.data(), - pair.second.size()); - entry_writer.CloseContainer(&value_varient_writer); - - dict_writer.CloseContainer(&entry_writer); - } - - variant_writer.CloseContainer(&dict_writer); - writer->CloseContainer(&variant_writer); -} - -// -// Property<std::unordered_map<uint16_t, std::vector<uint8_t>>> -// specialization. -// - -template <> -bool Property<std::unordered_map<uint16_t, std::vector<uint8_t>>>:: - PopValueFromReader(MessageReader* reader) { - MessageReader variant_reader(nullptr); - MessageReader dict_reader(nullptr); - if (!reader->PopVariant(&variant_reader) || - !variant_reader.PopArray(&dict_reader)) - return false; - - value_.clear(); - while (dict_reader.HasMoreData()) { - MessageReader entry_reader(nullptr); - if (!dict_reader.PopDictEntry(&entry_reader)) - return false; - - uint16_t key; - MessageReader value_varient_reader(nullptr); - if (!entry_reader.PopUint16(&key) || - !entry_reader.PopVariant(&value_varient_reader)) - return false; - - const uint8_t* bytes = nullptr; - size_t length = 0; - if (!value_varient_reader.PopArrayOfBytes(&bytes, &length)) - return false; - - value_[key].assign(bytes, bytes + length); - } - return true; -} - -template <> -void Property<std::unordered_map<uint16_t, std::vector<uint8_t>>>:: - AppendSetValueToWriter(MessageWriter* writer) { - MessageWriter variant_writer(nullptr); - MessageWriter dict_writer(nullptr); - - writer->OpenVariant("a{qv}", &variant_writer); - variant_writer.OpenArray("{qv}", &dict_writer); - - for (const auto& pair : set_value_) { - MessageWriter entry_writer(nullptr); - dict_writer.OpenDictEntry(&entry_writer); - - entry_writer.AppendUint16(pair.first); - - MessageWriter value_varient_writer(nullptr); - entry_writer.OpenVariant("ay", &value_varient_writer); - value_varient_writer.AppendArrayOfBytes(pair.second.data(), - pair.second.size()); - entry_writer.CloseContainer(&value_varient_writer); - - dict_writer.CloseContainer(&entry_writer); - } - - variant_writer.CloseContainer(&dict_writer); - writer->CloseContainer(&variant_writer); -} - template class Property<uint8_t>; template class Property<bool>; template class Property<int16_t>; @@ -805,7 +675,5 @@ template class Property<std::vector<ObjectPath> >; template class Property<std::vector<uint8_t>>; template class Property<std::map<std::string, std::string>>; template class Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>; -template class Property<std::unordered_map<std::string, std::vector<uint8_t>>>; -template class Property<std::unordered_map<uint16_t, std::vector<uint8_t>>>; } // namespace dbus |