weaved: Rename "chromeos" -> "brillo" in include paths and namespaces
libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.
Bug: 24872993
Change-Id: Ic91fe342fb2c29ae915300d1ce9ae8473303238b
diff --git a/buffet/ap_manager_client.cc b/buffet/ap_manager_client.cc
index 6449c0f..380f10e 100644
--- a/buffet/ap_manager_client.cc
+++ b/buffet/ap_manager_client.cc
@@ -50,7 +50,7 @@
void ApManagerClient::RemoveService(const dbus::ObjectPath& object_path) {
CHECK(object_path.IsValid());
- chromeos::ErrorPtr error;
+ brillo::ErrorPtr error;
if (!manager_proxy_->RemoveService(object_path, &error)) {
LOG(ERROR) << "RemoveService failed: " << error->GetMessage();
}
@@ -63,7 +63,7 @@
if (service_path_.IsValid())
return;
- chromeos::ErrorPtr error;
+ brillo::ErrorPtr error;
if (!manager_proxy_->CreateService(&service_path_, &error)) {
LOG(ERROR) << "CreateService failed: " << error->GetMessage();
}
@@ -91,7 +91,7 @@
}
VLOG(1) << "SSID is set: " << ssid_;
- chromeos::ErrorPtr error;
+ brillo::ErrorPtr error;
if (!service_proxy_->Start(&error)) {
LOG(ERROR) << "Service start failed: " << error->GetMessage();
}
diff --git a/buffet/avahi_mdns_client.cc b/buffet/avahi_mdns_client.cc
index 636ba35..6bf8c5d 100644
--- a/buffet/avahi_mdns_client.cc
+++ b/buffet/avahi_mdns_client.cc
@@ -22,19 +22,19 @@
#include <avahi-common/defs.h>
#include <avahi-common/address.h>
#include <base/guid.h>
-#include <chromeos/dbus/async_event_sequencer.h>
-#include <chromeos/dbus/dbus_signal_handler.h>
-#include <chromeos/dbus/dbus_method_invoker.h>
-#include <chromeos/errors/error.h>
+#include <brillo/dbus/async_event_sequencer.h>
+#include <brillo/dbus/dbus_signal_handler.h>
+#include <brillo/dbus/dbus_method_invoker.h>
+#include <brillo/errors/error.h>
#include <dbus/object_path.h>
#include <dbus/object_proxy.h>
-using chromeos::ErrorPtr;
-using chromeos::dbus_utils::AsyncEventSequencer;
-using chromeos::dbus_utils::CallMethodAndBlock;
-using chromeos::dbus_utils::ExtractMethodCallResults;
+using brillo::ErrorPtr;
+using brillo::dbus_utils::AsyncEventSequencer;
+using brillo::dbus_utils::CallMethodAndBlock;
+using brillo::dbus_utils::ExtractMethodCallResults;
using CompletionAction =
- chromeos::dbus_utils::AsyncEventSequencer::CompletionAction;
+ brillo::dbus_utils::AsyncEventSequencer::CompletionAction;
namespace buffet {
@@ -139,7 +139,7 @@
// Reconnect to our signals on a new Avahi instance.
scoped_refptr<AsyncEventSequencer> sequencer(new AsyncEventSequencer());
- chromeos::dbus_utils::ConnectToSignal(
+ brillo::dbus_utils::ConnectToSignal(
avahi_,
dbus_constants::avahi::kServerInterface,
dbus_constants::avahi::kServerSignalStateChanged,
@@ -191,7 +191,7 @@
}
};
- chromeos::dbus_utils::ConnectToSignal(
+ brillo::dbus_utils::ConnectToSignal(
entry_group_,
dbus_constants::avahi::kGroupInterface,
dbus_constants::avahi::kGroupSignalStateChanged,
diff --git a/buffet/buffet_config.cc b/buffet/buffet_config.cc
index c375e1f..c75fe7e 100644
--- a/buffet/buffet_config.cc
+++ b/buffet/buffet_config.cc
@@ -11,9 +11,9 @@
#include <base/files/important_file_writer.h>
#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/errors/error_codes.h>
-#include <chromeos/strings/string_utils.h>
+#include <brillo/errors/error.h>
+#include <brillo/errors/error_codes.h>
+#include <brillo/strings/string_utils.h>
#include <weave/enum_to_string.h>
namespace buffet {
@@ -79,7 +79,7 @@
if (!base::PathExists(options_.defaults))
return true; // Nothing to load.
- chromeos::KeyValueStore store;
+ brillo::KeyValueStore store;
if (!store.Load(options_.defaults))
return false;
bool result = LoadDefaults(store, settings);
@@ -100,7 +100,7 @@
return result;
}
-bool BuffetConfig::LoadDefaults(const chromeos::KeyValueStore& store,
+bool BuffetConfig::LoadDefaults(const brillo::KeyValueStore& store,
weave::Settings* settings) {
store.GetString(config_keys::kClientId, &settings->client_id);
store.GetString(config_keys::kClientSecret, &settings->client_secret);
@@ -112,7 +112,7 @@
store.GetString(config_keys::kModelId, &settings->model_id);
base::FilePath lsb_release_path("/etc/lsb-release");
- chromeos::KeyValueStore lsb_release_store;
+ brillo::KeyValueStore lsb_release_store;
if (lsb_release_store.Load(lsb_release_path) &&
lsb_release_store.GetString("CHROMEOS_RELEASE_VERSION",
&settings->firmware_version)) {
@@ -129,7 +129,7 @@
if (store.GetString(config_keys::kPairingModes, &modes_str)) {
std::set<weave::PairingType> pairing_modes;
for (const std::string& mode :
- chromeos::string_utils::Split(modes_str, ",", true, true)) {
+ brillo::string_utils::Split(modes_str, ",", true, true)) {
weave::PairingType pairing_mode;
if (!StringToEnum(mode, &pairing_mode))
return false;
@@ -183,10 +183,10 @@
bool BuffetConfig::LoadFile(const base::FilePath& file_path,
std::string* data,
- chromeos::ErrorPtr* error) {
+ brillo::ErrorPtr* error) {
if (!file_io_->ReadFile(file_path, data)) {
- chromeos::errors::system::AddSystemError(error, FROM_HERE, errno);
- chromeos::Error::AddToPrintf(error, FROM_HERE, kErrorDomain, kFileReadError,
+ brillo::errors::system::AddSystemError(error, FROM_HERE, errno);
+ brillo::Error::AddToPrintf(error, FROM_HERE, kErrorDomain, kFileReadError,
"Failed to read file '%s'",
file_path.value().c_str());
return false;
diff --git a/buffet/buffet_config.h b/buffet/buffet_config.h
index 3db6de8..8b7e4e9 100644
--- a/buffet/buffet_config.h
+++ b/buffet/buffet_config.h
@@ -12,8 +12,8 @@
#include <base/callback.h>
#include <base/files/file_path.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/key_value_store.h>
+#include <brillo/errors/error.h>
+#include <brillo/key_value_store.h>
#include <weave/provider/config_store.h>
#include "buffet/encryptor.h"
@@ -59,7 +59,7 @@
std::string LoadSettings() override;
void SaveSettings(const std::string& settings) override;
- bool LoadDefaults(const chromeos::KeyValueStore& store,
+ bool LoadDefaults(const brillo::KeyValueStore& store,
weave::Settings* settings);
// Allows injection of a non-default |encryptor| for testing. The caller
@@ -77,7 +77,7 @@
private:
bool LoadFile(const base::FilePath& file_path,
std::string* data,
- chromeos::ErrorPtr* error);
+ brillo::ErrorPtr* error);
Options options_;
std::unique_ptr<Encryptor> default_encryptor_;
diff --git a/buffet/buffet_config_unittest.cc b/buffet/buffet_config_unittest.cc
index 795d172..f19812e 100644
--- a/buffet/buffet_config_unittest.cc
+++ b/buffet/buffet_config_unittest.cc
@@ -7,13 +7,13 @@
#include <set>
#include <base/bind.h>
-#include <chromeos/data_encoding.h>
+#include <brillo/data_encoding.h>
#include <gtest/gtest.h>
namespace buffet {
TEST(BuffetConfigTest, LoadConfig) {
- chromeos::KeyValueStore config_store;
+ brillo::KeyValueStore config_store;
config_store.SetString("client_id", "conf_client_id");
config_store.SetString("client_secret", "conf_client_secret");
config_store.SetString("api_key", "conf_api_key");
@@ -82,13 +82,13 @@
// buffet::Encryptor methods.
bool EncryptWithAuthentication(const std::string& plaintext,
std::string* ciphertext) override {
- *ciphertext = chromeos::data_encoding::Base64Encode(plaintext);
+ *ciphertext = brillo::data_encoding::Base64Encode(plaintext);
return encryptor_result_;
};
bool DecryptWithAuthentication(const std::string& ciphertext,
std::string* plaintext) override {
return encryptor_result_ &&
- chromeos::data_encoding::Base64Decode(ciphertext, plaintext);
+ brillo::data_encoding::Base64Decode(ciphertext, plaintext);
};
// buffet::BuffetConfig::FileIO methods.
diff --git a/buffet/dbus_command_dispatcher.cc b/buffet/dbus_command_dispatcher.cc
index 9317258..1891cf2 100644
--- a/buffet/dbus_command_dispatcher.cc
+++ b/buffet/dbus_command_dispatcher.cc
@@ -4,15 +4,15 @@
#include "buffet/dbus_command_dispatcher.h"
-#include <chromeos/dbus/exported_object_manager.h>
+#include <brillo/dbus/exported_object_manager.h>
#include <weave/command.h>
#include <weave/device.h>
#include "buffet/dbus_command_proxy.h"
#include "buffet/dbus_constants.h"
-using chromeos::dbus_utils::AsyncEventSequencer;
-using chromeos::dbus_utils::ExportedObjectManager;
+using brillo::dbus_utils::AsyncEventSequencer;
+using brillo::dbus_utils::ExportedObjectManager;
namespace buffet {
diff --git a/buffet/dbus_command_dispatcher.h b/buffet/dbus_command_dispatcher.h
index 082576a..b5ccfb7 100644
--- a/buffet/dbus_command_dispatcher.h
+++ b/buffet/dbus_command_dispatcher.h
@@ -16,11 +16,11 @@
class Device;
}
-namespace chromeos {
+namespace brillo {
namespace dbus_utils {
class ExportedObjectManager;
} // namespace dbus_utils
-} // namespace chromeos
+} // namespace brillo
namespace buffet {
@@ -34,14 +34,14 @@
class DBusCommandDispacher final {
public:
explicit DBusCommandDispacher(
- const base::WeakPtr<chromeos::dbus_utils::ExportedObjectManager>&
+ const base::WeakPtr<brillo::dbus_utils::ExportedObjectManager>&
object_manager,
weave::Device* device);
private:
void OnCommandAdded(const std::weak_ptr<weave::Command>& cmd);
- base::WeakPtr<chromeos::dbus_utils::ExportedObjectManager> object_manager_;
+ base::WeakPtr<brillo::dbus_utils::ExportedObjectManager> object_manager_;
int next_id_{0};
// Default constructor is used in special circumstances such as for testing.
diff --git a/buffet/dbus_command_proxy.cc b/buffet/dbus_command_proxy.cc
index 327aea3..112474f 100644
--- a/buffet/dbus_command_proxy.cc
+++ b/buffet/dbus_command_proxy.cc
@@ -4,15 +4,15 @@
#include "buffet/dbus_command_proxy.h"
-#include <chromeos/dbus/async_event_sequencer.h>
-#include <chromeos/dbus/exported_object_manager.h>
+#include <brillo/dbus/async_event_sequencer.h>
+#include <brillo/dbus/exported_object_manager.h>
#include <weave/enum_to_string.h>
#include "buffet/dbus_conversion.h"
#include "buffet/weave_error_conversion.h"
-using chromeos::dbus_utils::AsyncEventSequencer;
-using chromeos::dbus_utils::ExportedObjectManager;
+using brillo::dbus_utils::AsyncEventSequencer;
+using brillo::dbus_utils::ExportedObjectManager;
namespace errors {
namespace commands {
@@ -25,10 +25,10 @@
namespace {
-bool ReportDestroyedError(chromeos::ErrorPtr* error) {
- chromeos::Error::AddTo(error, FROM_HERE, errors::commands::kDomain,
- errors::commands::kCommandDestroyed,
- "Command has been destroyed");
+bool ReportDestroyedError(brillo::ErrorPtr* error) {
+ brillo::Error::AddTo(error, FROM_HERE, errors::commands::kDomain,
+ errors::commands::kCommandDestroyed,
+ "Command has been destroyed");
return false;
}
@@ -66,8 +66,8 @@
}
bool DBusCommandProxy::SetProgress(
- chromeos::ErrorPtr* error,
- const chromeos::VariantDictionary& progress) {
+ brillo::ErrorPtr* error,
+ const brillo::VariantDictionary& progress) {
auto command = command_.lock();
if (!command)
return ReportDestroyedError(error);
@@ -88,8 +88,8 @@
return true;
}
-bool DBusCommandProxy::Complete(chromeos::ErrorPtr* error,
- const chromeos::VariantDictionary& results) {
+bool DBusCommandProxy::Complete(brillo::ErrorPtr* error,
+ const brillo::VariantDictionary& results) {
auto command = command_.lock();
if (!command)
return ReportDestroyedError(error);
@@ -110,7 +110,7 @@
return true;
}
-bool DBusCommandProxy::Abort(chromeos::ErrorPtr* error,
+bool DBusCommandProxy::Abort(brillo::ErrorPtr* error,
const std::string& code,
const std::string& message) {
auto command = command_.lock();
@@ -130,7 +130,7 @@
return true;
}
-bool DBusCommandProxy::Cancel(chromeos::ErrorPtr* error) {
+bool DBusCommandProxy::Cancel(brillo::ErrorPtr* error) {
auto command = command_.lock();
if (!command)
return ReportDestroyedError(error);
diff --git a/buffet/dbus_command_proxy.h b/buffet/dbus_command_proxy.h
index dd9e679..15b5bb1 100644
--- a/buffet/dbus_command_proxy.h
+++ b/buffet/dbus_command_proxy.h
@@ -9,45 +9,45 @@
#include <base/macros.h>
#include <base/scoped_observer.h>
-#include <chromeos/dbus/data_serialization.h>
-#include <chromeos/dbus/dbus_object.h>
+#include <brillo/dbus/data_serialization.h>
+#include <brillo/dbus/dbus_object.h>
#include <weave/command.h>
#include "buffet/dbus_bindings/com.android.Weave.Command.h"
-namespace chromeos {
+namespace brillo {
namespace dbus_utils {
class ExportedObjectManager;
} // namespace dbus_utils
-} // namespace chromeos
+} // namespace brillo
namespace buffet {
class DBusCommandProxy : public com::android::Weave::CommandInterface {
public:
- DBusCommandProxy(chromeos::dbus_utils::ExportedObjectManager* object_manager,
+ DBusCommandProxy(brillo::dbus_utils::ExportedObjectManager* object_manager,
const scoped_refptr<dbus::Bus>& bus,
const std::weak_ptr<weave::Command>& command,
std::string object_path);
~DBusCommandProxy() override = default;
void RegisterAsync(
- const chromeos::dbus_utils::AsyncEventSequencer::CompletionAction&
+ const brillo::dbus_utils::AsyncEventSequencer::CompletionAction&
completion_callback);
private:
- bool SetProgress(chromeos::ErrorPtr* error,
- const chromeos::VariantDictionary& progress) override;
- bool Complete(chromeos::ErrorPtr* error,
- const chromeos::VariantDictionary& results) override;
- bool Abort(chromeos::ErrorPtr* error,
+ bool SetProgress(brillo::ErrorPtr* error,
+ const brillo::VariantDictionary& progress) override;
+ bool Complete(brillo::ErrorPtr* error,
+ const brillo::VariantDictionary& results) override;
+ bool Abort(brillo::ErrorPtr* error,
const std::string& code,
const std::string& message) override;
- bool Cancel(chromeos::ErrorPtr* error) override;
+ bool Cancel(brillo::ErrorPtr* error) override;
std::weak_ptr<weave::Command> command_;
com::android::Weave::CommandAdaptor dbus_adaptor_{this};
- chromeos::dbus_utils::DBusObject dbus_object_;
+ brillo::dbus_utils::DBusObject dbus_object_;
friend class DBusCommandProxyTest;
friend class DBusCommandDispacherTest;
diff --git a/buffet/dbus_command_proxy_unittest.cc b/buffet/dbus_command_proxy_unittest.cc
index 06a393e..a32c773 100644
--- a/buffet/dbus_command_proxy_unittest.cc
+++ b/buffet/dbus_command_proxy_unittest.cc
@@ -11,8 +11,8 @@
#include <dbus/mock_bus.h>
#include <dbus/mock_exported_object.h>
#include <dbus/property.h>
-#include <chromeos/dbus/dbus_object.h>
-#include <chromeos/dbus/dbus_object_test_helpers.h>
+#include <brillo/dbus/dbus_object.h>
+#include <brillo/dbus/dbus_object_test_helpers.h>
#include <gtest/gtest.h>
#include <weave/command.h>
#include <weave/enum_to_string.h>
@@ -29,8 +29,8 @@
using ::testing::ReturnRefOfCopy;
using ::testing::StrictMock;
-using chromeos::VariantDictionary;
-using chromeos::dbus_utils::AsyncEventSequencer;
+using brillo::VariantDictionary;
+using brillo::dbus_utils::AsyncEventSequencer;
using weave::test::CreateDictionaryValue;
using weave::test::IsEqualValue;
diff --git a/buffet/dbus_conversion.cc b/buffet/dbus_conversion.cc
index e943ad7..daed6ef 100644
--- a/buffet/dbus_conversion.cc
+++ b/buffet/dbus_conversion.cc
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include <chromeos/type_name_undecorate.h>
+#include <brillo/type_name_undecorate.h>
namespace buffet {
@@ -16,18 +16,18 @@
// Helpers for JsonToAny().
template <typename T>
-chromeos::Any ValueToAny(const base::Value& json,
- bool (base::Value::*fnc)(T*) const) {
+brillo::Any ValueToAny(const base::Value& json,
+ bool (base::Value::*fnc)(T*) const) {
T val;
CHECK((json.*fnc)(&val));
return val;
}
-chromeos::Any ValueToAny(const base::Value& json);
+brillo::Any ValueToAny(const base::Value& json);
template <typename T>
-chromeos::Any ListToAny(const base::ListValue& list,
- bool (base::Value::*fnc)(T*) const) {
+brillo::Any ListToAny(const base::ListValue& list,
+ bool (base::Value::*fnc)(T*) const) {
std::vector<T> result;
result.reserve(list.GetSize());
for (const base::Value* v : list) {
@@ -38,8 +38,8 @@
return result;
}
-chromeos::Any DictListToAny(const base::ListValue& list) {
- std::vector<chromeos::VariantDictionary> result;
+brillo::Any DictListToAny(const base::ListValue& list) {
+ std::vector<brillo::VariantDictionary> result;
result.reserve(list.GetSize());
for (const base::Value* v : list) {
const base::DictionaryValue* dict = nullptr;
@@ -49,8 +49,8 @@
return result;
}
-chromeos::Any ListListToAny(const base::ListValue& list) {
- std::vector<chromeos::Any> result;
+brillo::Any ListListToAny(const base::ListValue& list) {
+ std::vector<brillo::Any> result;
result.reserve(list.GetSize());
for (const base::Value* v : list)
result.push_back(ValueToAny(*v));
@@ -59,8 +59,8 @@
// Converts a JSON value into an Any so it can be sent over D-Bus using
// UpdateState D-Bus method from Buffet.
-chromeos::Any ValueToAny(const base::Value& json) {
- chromeos::Any prop_value;
+brillo::Any ValueToAny(const base::Value& json) {
+ brillo::Any prop_value;
switch (json.GetType()) {
case base::Value::TYPE_BOOLEAN:
prop_value = ValueToAny<bool>(json, &base::Value::GetAsBoolean);
@@ -85,7 +85,7 @@
CHECK(json.GetAsList(&list));
if (list->empty()) {
// We don't know type of objects this list intended for, so we just use
- // vector<chromeos::Any>.
+ // vector<brillo::Any>.
prop_value = ListListToAny(*list);
break;
}
@@ -130,27 +130,27 @@
template <typename T>
std::unique_ptr<base::Value> CreateValue(const T& value,
- chromeos::ErrorPtr* error) {
+ brillo::ErrorPtr* error) {
return std::unique_ptr<base::Value>{new base::FundamentalValue{value}};
}
template <>
std::unique_ptr<base::Value> CreateValue<std::string>(
const std::string& value,
- chromeos::ErrorPtr* error) {
+ brillo::ErrorPtr* error) {
return std::unique_ptr<base::Value>{new base::StringValue{value}};
}
template <>
-std::unique_ptr<base::Value> CreateValue<chromeos::VariantDictionary>(
- const chromeos::VariantDictionary& value,
- chromeos::ErrorPtr* error) {
+std::unique_ptr<base::Value> CreateValue<brillo::VariantDictionary>(
+ const brillo::VariantDictionary& value,
+ brillo::ErrorPtr* error) {
return DictionaryFromDBusVariantDictionary(value, error);
}
template <typename T>
std::unique_ptr<base::ListValue> CreateListValue(const std::vector<T>& value,
- chromeos::ErrorPtr* error) {
+ brillo::ErrorPtr* error) {
std::unique_ptr<base::ListValue> list{new base::ListValue};
for (const T& i : value) {
@@ -166,9 +166,9 @@
// Returns false only in case of error. True can be returned if type is not
// matched.
template <typename T>
-bool TryCreateValue(const chromeos::Any& any,
+bool TryCreateValue(const brillo::Any& any,
std::unique_ptr<base::Value>* value,
- chromeos::ErrorPtr* error) {
+ brillo::ErrorPtr* error) {
if (any.IsTypeCompatible<T>()) {
*value = CreateValue(any.Get<T>(), error);
return *value != nullptr;
@@ -183,9 +183,9 @@
}
template <>
-std::unique_ptr<base::Value> CreateValue<chromeos::Any>(
- const chromeos::Any& any,
- chromeos::ErrorPtr* error) {
+std::unique_ptr<base::Value> CreateValue<brillo::Any>(
+ const brillo::Any& any,
+ brillo::ErrorPtr* error) {
std::unique_ptr<base::Value> result;
if (!TryCreateValue<bool>(any, &result, error) || result)
return result;
@@ -199,18 +199,18 @@
if (!TryCreateValue<std::string>(any, &result, error) || result)
return result;
- if (!TryCreateValue<chromeos::VariantDictionary>(any, &result, error) ||
+ if (!TryCreateValue<brillo::VariantDictionary>(any, &result, error) ||
result) {
return result;
}
// This will collapse Any{Any{T}} and vector{Any{T}}.
- if (!TryCreateValue<chromeos::Any>(any, &result, error) || result)
+ if (!TryCreateValue<brillo::Any>(any, &result, error) || result)
return result;
- chromeos::Error::AddToPrintf(
+ brillo::Error::AddToPrintf(
error, FROM_HERE, "buffet", "unknown_type", "Type '%s' is not supported.",
- chromeos::UndecorateTypeName(any.GetType().name()).c_str());
+ brillo::UndecorateTypeName(any.GetType().name()).c_str());
return nullptr;
}
@@ -218,9 +218,9 @@
} // namespace
// TODO(vitalybuka): Use in buffet_client.
-chromeos::VariantDictionary DictionaryToDBusVariantDictionary(
+brillo::VariantDictionary DictionaryToDBusVariantDictionary(
const base::DictionaryValue& object) {
- chromeos::VariantDictionary result;
+ brillo::VariantDictionary result;
for (base::DictionaryValue::Iterator it(object); !it.IsAtEnd(); it.Advance())
result.emplace(it.key(), ValueToAny(it.value()));
@@ -229,8 +229,8 @@
}
std::unique_ptr<base::DictionaryValue> DictionaryFromDBusVariantDictionary(
- const chromeos::VariantDictionary& object,
- chromeos::ErrorPtr* error) {
+ const brillo::VariantDictionary& object,
+ brillo::ErrorPtr* error) {
std::unique_ptr<base::DictionaryValue> result{new base::DictionaryValue};
for (const auto& pair : object) {
diff --git a/buffet/dbus_conversion.h b/buffet/dbus_conversion.h
index 20c3f58..d521171 100644
--- a/buffet/dbus_conversion.h
+++ b/buffet/dbus_conversion.h
@@ -6,20 +6,20 @@
#define BUFFET_DBUS_CONVERSION_H_
#include <base/values.h>
-#include <chromeos/any.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/variant_dictionary.h>
+#include <brillo/any.h>
+#include <brillo/errors/error.h>
+#include <brillo/variant_dictionary.h>
namespace buffet {
// Converts DictionaryValue to D-Bus variant dictionary.
-chromeos::VariantDictionary DictionaryToDBusVariantDictionary(
+brillo::VariantDictionary DictionaryToDBusVariantDictionary(
const base::DictionaryValue& object);
// Converts D-Bus variant dictionary to DictionaryValue.
std::unique_ptr<base::DictionaryValue> DictionaryFromDBusVariantDictionary(
- const chromeos::VariantDictionary& object,
- chromeos::ErrorPtr* error);
+ const brillo::VariantDictionary& object,
+ brillo::ErrorPtr* error);
} // namespace buffet
diff --git a/buffet/dbus_conversion_unittest.cc b/buffet/dbus_conversion_unittest.cc
index 53b0da5..62659de 100644
--- a/buffet/dbus_conversion_unittest.cc
+++ b/buffet/dbus_conversion_unittest.cc
@@ -12,7 +12,7 @@
#include <base/guid.h>
#include <base/rand_util.h>
#include <base/values.h>
-#include <chromeos/variant_dictionary.h>
+#include <brillo/variant_dictionary.h>
#include <gtest/gtest.h>
#include <weave/test/unittest_utils.h>
@@ -20,18 +20,18 @@
namespace {
-using chromeos::Any;
-using chromeos::VariantDictionary;
+using brillo::Any;
+using brillo::VariantDictionary;
using weave::test::CreateDictionaryValue;
using weave::test::IsEqualValue;
-chromeos::VariantDictionary ToDBus(const base::DictionaryValue& object) {
+brillo::VariantDictionary ToDBus(const base::DictionaryValue& object) {
return DictionaryToDBusVariantDictionary(object);
}
std::unique_ptr<base::DictionaryValue> FromDBus(
- const chromeos::VariantDictionary& object) {
- chromeos::ErrorPtr error;
+ const brillo::VariantDictionary& object) {
+ brillo::ErrorPtr error;
auto result = DictionaryFromDBusVariantDictionary(object, &error);
EXPECT_TRUE(result || error);
return result;
diff --git a/buffet/fake_encryptor.cc b/buffet/fake_encryptor.cc
index b82b9f0..2d7e1ba 100644
--- a/buffet/fake_encryptor.cc
+++ b/buffet/fake_encryptor.cc
@@ -16,7 +16,7 @@
#include <memory>
-#include <chromeos/data_encoding.h>
+#include <brillo/data_encoding.h>
namespace buffet {
@@ -24,13 +24,13 @@
public:
bool EncryptWithAuthentication(const std::string& plaintext,
std::string* ciphertext) override {
- *ciphertext = chromeos::data_encoding::Base64Encode(plaintext);
+ *ciphertext = brillo::data_encoding::Base64Encode(plaintext);
return true;
}
bool DecryptWithAuthentication(const std::string& ciphertext,
std::string* plaintext) override {
- return chromeos::data_encoding::Base64Decode(ciphertext, plaintext);
+ return brillo::data_encoding::Base64Decode(ciphertext, plaintext);
}
};
diff --git a/buffet/flouride_socket_bluetooth_client.cc b/buffet/flouride_socket_bluetooth_client.cc
index 09c10a0..d6090dd 100644
--- a/buffet/flouride_socket_bluetooth_client.cc
+++ b/buffet/flouride_socket_bluetooth_client.cc
@@ -19,7 +19,7 @@
#include <sys/socket.h>
#include <sys/un.h>
-#include <chromeos/streams/file_stream.h>
+#include <brillo/streams/file_stream.h>
namespace buffet {
@@ -55,7 +55,7 @@
return false;
}
- stream_ = chromeos::FileStream::FromFileDescriptor(socket_fd, true, nullptr);
+ stream_ = brillo::FileStream::FromFileDescriptor(socket_fd, true, nullptr);
return true;
}
diff --git a/buffet/flouride_socket_bluetooth_client.h b/buffet/flouride_socket_bluetooth_client.h
index 6e14563..869bc8e 100644
--- a/buffet/flouride_socket_bluetooth_client.h
+++ b/buffet/flouride_socket_bluetooth_client.h
@@ -17,7 +17,7 @@
#ifndef BUFFET_FLOURIDE_SOCKET_BLUETOOTH_CLIENT_H
#define BUFFET_FLOURIDE_SOCKET_BLUETOOTH_CLIENT_H
-#include <chromeos/streams/stream.h>
+#include <brillo/streams/stream.h>
#include "buffet/bluetooth_client.h"
@@ -38,7 +38,7 @@
private:
bool OpenSocket();
- std::unique_ptr<chromeos::Stream> stream_;
+ std::unique_ptr<brillo::Stream> stream_;
};
} // namespace buffet
diff --git a/buffet/http_transport_client.cc b/buffet/http_transport_client.cc
index 6c8af44..75e2a33 100644
--- a/buffet/http_transport_client.cc
+++ b/buffet/http_transport_client.cc
@@ -5,10 +5,10 @@
#include "buffet/http_transport_client.h"
#include <base/bind.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/http/http_request.h>
-#include <chromeos/http/http_utils.h>
-#include <chromeos/streams/memory_stream.h>
+#include <brillo/errors/error.h>
+#include <brillo/http/http_request.h>
+#include <brillo/http/http_utils.h>
+#include <brillo/streams/memory_stream.h>
#include <weave/enum_to_string.h>
#include "buffet/weave_error_conversion.h"
@@ -25,7 +25,7 @@
class ResponseImpl : public HttpClient::Response {
public:
~ResponseImpl() override = default;
- explicit ResponseImpl(std::unique_ptr<chromeos::http::Response> response)
+ explicit ResponseImpl(std::unique_ptr<brillo::http::Response> response)
: response_{std::move(response)},
data_{response_->ExtractDataAsString()} {}
@@ -39,20 +39,20 @@
std::string GetData() const override { return data_; }
private:
- std::unique_ptr<chromeos::http::Response> response_;
+ std::unique_ptr<brillo::http::Response> response_;
std::string data_;
DISALLOW_COPY_AND_ASSIGN(ResponseImpl);
};
void OnSuccessCallback(const HttpClient::SuccessCallback& success_callback,
int id,
- std::unique_ptr<chromeos::http::Response> response) {
+ std::unique_ptr<brillo::http::Response> response) {
success_callback.Run(ResponseImpl{std::move(response)});
}
void OnErrorCallback(const weave::ErrorCallback& error_callback,
int id,
- const chromeos::Error* chromeos_error) {
+ const brillo::Error* chromeos_error) {
weave::ErrorPtr error;
ConvertError(*chromeos_error, &error);
error_callback.Run(std::move(error));
@@ -61,7 +61,7 @@
} // anonymous namespace
HttpTransportClient::HttpTransportClient()
- : transport_{chromeos::http::Transport::CreateDefault()} {
+ : transport_{brillo::http::Transport::CreateDefault()} {
transport_->SetDefaultTimeout(
base::TimeDelta::FromSeconds(kRequestTimeoutSeconds));
}
@@ -75,12 +75,12 @@
const std::string& data,
const SuccessCallback& success_callback,
const weave::ErrorCallback& error_callback) {
- chromeos::http::Request request(url, weave::EnumToString(method), transport_);
+ brillo::http::Request request(url, weave::EnumToString(method), transport_);
request.AddHeaders(headers);
if (!data.empty()) {
- auto stream = chromeos::MemoryStream::OpenCopyOf(data, nullptr);
+ auto stream = brillo::MemoryStream::OpenCopyOf(data, nullptr);
CHECK(stream->GetRemainingSize());
- chromeos::ErrorPtr cromeos_error;
+ brillo::ErrorPtr cromeos_error;
if (!request.AddRequestBody(std::move(stream), &cromeos_error)) {
weave::ErrorPtr error;
ConvertError(*cromeos_error, &error);
diff --git a/buffet/http_transport_client.h b/buffet/http_transport_client.h
index 792963b..17e20d9 100644
--- a/buffet/http_transport_client.h
+++ b/buffet/http_transport_client.h
@@ -10,7 +10,7 @@
#include <weave/provider/http_client.h>
-namespace chromeos {
+namespace brillo {
namespace http {
class Transport;
}
@@ -32,7 +32,7 @@
const weave::ErrorCallback& error_callback) override;
private:
- std::shared_ptr<chromeos::http::Transport> transport_;
+ std::shared_ptr<brillo::http::Transport> transport_;
DISALLOW_COPY_AND_ASSIGN(HttpTransportClient);
};
diff --git a/buffet/main.cc b/buffet/main.cc
index 616542d..b447b74 100644
--- a/buffet/main.cc
+++ b/buffet/main.cc
@@ -7,19 +7,19 @@
#include <signal.h>
#include <base/files/file_path.h>
-#include <chromeos/daemons/dbus_daemon.h>
-#include <chromeos/dbus/async_event_sequencer.h>
-#include <chromeos/dbus/exported_object_manager.h>
-#include <chromeos/flag_helper.h>
-#include <chromeos/strings/string_utils.h>
-#include <chromeos/syslog_logging.h>
+#include <brillo/daemons/dbus_daemon.h>
+#include <brillo/dbus/async_event_sequencer.h>
+#include <brillo/dbus/exported_object_manager.h>
+#include <brillo/flag_helper.h>
+#include <brillo/strings/string_utils.h>
+#include <brillo/syslog_logging.h>
#include "buffet/buffet_config.h"
#include "buffet/dbus_constants.h"
#include "buffet/manager.h"
-using chromeos::dbus_utils::AsyncEventSequencer;
-using chromeos::DBusServiceDaemon;
+using brillo::dbus_utils::AsyncEventSequencer;
+using brillo::DBusServiceDaemon;
using buffet::dbus_constants::kServiceName;
using buffet::dbus_constants::kRootServicePath;
@@ -76,18 +76,18 @@
"Path to directory containing additional command "
"and state definitions. For test only.");
- chromeos::FlagHelper::Init(argc, argv, "Privet protocol handler daemon");
+ brillo::FlagHelper::Init(argc, argv, "Privet protocol handler daemon");
if (FLAGS_config_path.empty())
FLAGS_config_path = kDefaultConfigFilePath;
if (FLAGS_state_path.empty())
FLAGS_state_path = kDefaultStateFilePath;
- int flags = chromeos::kLogToSyslog | chromeos::kLogHeader;
+ int flags = brillo::kLogToSyslog | brillo::kLogHeader;
if (FLAGS_log_to_stderr)
- flags |= chromeos::kLogToStderr;
- chromeos::InitLog(flags);
+ flags |= brillo::kLogToStderr;
+ brillo::InitLog(flags);
auto device_whitelist =
- chromeos::string_utils::Split(FLAGS_device_whitelist, ",", true, true);
+ brillo::string_utils::Split(FLAGS_device_whitelist, ",", true, true);
// We are handling write errors on closed sockets correctly and not relying on
// (nor handling) SIGPIPE signal, which just kills the process.
diff --git a/buffet/manager.cc b/buffet/manager.cc
index 752ab16..423a393 100644
--- a/buffet/manager.cc
+++ b/buffet/manager.cc
@@ -16,15 +16,15 @@
#include <base/json/json_writer.h>
#include <base/message_loop/message_loop.h>
#include <base/time/time.h>
-#include <chromeos/bind_lambda.h>
-#include <chromeos/dbus/async_event_sequencer.h>
-#include <chromeos/dbus/exported_object_manager.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/http/http_transport.h>
-#include <chromeos/http/http_utils.h>
-#include <chromeos/key_value_store.h>
-#include <chromeos/message_loops/message_loop.h>
-#include <chromeos/mime_utils.h>
+#include <brillo/bind_lambda.h>
+#include <brillo/dbus/async_event_sequencer.h>
+#include <brillo/dbus/exported_object_manager.h>
+#include <brillo/errors/error.h>
+#include <brillo/http/http_transport.h>
+#include <brillo/http/http_utils.h>
+#include <brillo/key_value_store.h>
+#include <brillo/message_loops/message_loop.h>
+#include <brillo/mime_utils.h>
#include <dbus/bus.h>
#include <dbus/object_path.h>
#include <dbus/values_util.h>
@@ -40,9 +40,9 @@
#include "buffet/weave_error_conversion.h"
#include "buffet/webserv_client.h"
-using chromeos::dbus_utils::AsyncEventSequencer;
-using chromeos::dbus_utils::DBusMethodResponse;
-using chromeos::dbus_utils::ExportedObjectManager;
+using brillo::dbus_utils::AsyncEventSequencer;
+using brillo::dbus_utils::DBusMethodResponse;
+using brillo::dbus_utils::ExportedObjectManager;
namespace buffet {
@@ -57,12 +57,12 @@
bool LoadFile(const base::FilePath& file_path,
std::string* data,
- chromeos::ErrorPtr* error) {
+ brillo::ErrorPtr* error) {
if (!base::ReadFileToString(file_path, data)) {
- chromeos::errors::system::AddSystemError(error, FROM_HERE, errno);
- chromeos::Error::AddToPrintf(error, FROM_HERE, kErrorDomain, kFileReadError,
- "Failed to read file '%s'",
- file_path.value().c_str());
+ brillo::errors::system::AddSystemError(error, FROM_HERE, errno);
+ brillo::Error::AddToPrintf(error, FROM_HERE, kErrorDomain, kFileReadError,
+ "Failed to read file '%s'",
+ file_path.value().c_str());
return false;
}
return true;
@@ -132,7 +132,7 @@
void RegisterDeviceError(
const std::shared_ptr<DBusMethodResponse<std::string>>& response,
weave::ErrorPtr weave_error) {
- chromeos::ErrorPtr error;
+ brillo::ErrorPtr error;
ConvertError(*weave_error, &error);
response->ReplyWithError(error.get());
}
@@ -144,7 +144,7 @@
void PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
base::TimeDelta delay) override {
- chromeos::MessageLoop::current()->PostDelayedTask(from_here, task, delay);
+ brillo::MessageLoop::current()->PostDelayedTask(from_here, task, delay);
}
};
@@ -188,8 +188,8 @@
if (options_.enable_ping) {
auto ping_handler = base::Bind(
[](std::unique_ptr<weave::provider::HttpServer::Request> request) {
- request->SendReply(chromeos::http::status_code::Ok, "Hello, world!",
- chromeos::mime::text::kPlain);
+ request->SendReply(brillo::http::status_code::Ok, "Hello, world!",
+ brillo::mime::text::kPlain);
});
http_server->AddHttpRequestHandler("/privet/ping", ping_handler);
http_server->AddHttpsRequestHandler("/privet/ping", ping_handler);
@@ -257,8 +257,8 @@
}
void Manager::UpdateState(DBusMethodResponsePtr<> response,
- const chromeos::VariantDictionary& property_set) {
- chromeos::ErrorPtr chromeos_error;
+ const brillo::VariantDictionary& property_set) {
+ brillo::ErrorPtr chromeos_error;
auto properties =
DictionaryFromDBusVariantDictionary(property_set, &chromeos_error);
if (!properties)
@@ -272,7 +272,7 @@
response->Return();
}
-bool Manager::GetState(chromeos::ErrorPtr* error, std::string* state) {
+bool Manager::GetState(brillo::ErrorPtr* error, std::string* state) {
auto json = device_->GetState();
CHECK(json);
base::JSONWriter::WriteWithOptions(
@@ -289,15 +289,15 @@
.release());
const base::DictionaryValue* command{nullptr};
if (!value || !value->GetAsDictionary(&command)) {
- return response->ReplyWithError(FROM_HERE, chromeos::errors::json::kDomain,
- chromeos::errors::json::kParseError,
+ return response->ReplyWithError(FROM_HERE, brillo::errors::json::kDomain,
+ brillo::errors::json::kParseError,
error_message);
}
std::string id;
weave::ErrorPtr error;
if (!device_->AddCommand(*command, &id, &error)) {
- chromeos::ErrorPtr chromeos_error;
+ brillo::ErrorPtr chromeos_error;
ConvertError(*error, &chromeos_error);
return response->ReplyWithError(chromeos_error.get());
}
@@ -338,7 +338,7 @@
const std::vector<uint8_t>& code) {
// For now, just overwrite the exposed PairInfo with
// the most recent pairing attempt.
- dbus_adaptor_.SetPairingInfo(chromeos::VariantDictionary{
+ dbus_adaptor_.SetPairingInfo(brillo::VariantDictionary{
{kPairingSessionIdKey, session_id},
{kPairingModeKey, weave::EnumToString(pairing_type)},
{kPairingCodeKey, code},
@@ -353,7 +353,7 @@
}
std::string exposed_session{it->second.TryGet<std::string>()};
if (exposed_session == session_id) {
- dbus_adaptor_.SetPairingInfo(chromeos::VariantDictionary{});
+ dbus_adaptor_.SetPairingInfo(brillo::VariantDictionary{});
}
}
diff --git a/buffet/manager.h b/buffet/manager.h
index a90925d..2a2b634 100644
--- a/buffet/manager.h
+++ b/buffet/manager.h
@@ -14,16 +14,16 @@
#include <base/macros.h>
#include <base/memory/weak_ptr.h>
#include <base/values.h>
-#include <chromeos/dbus/data_serialization.h>
-#include <chromeos/dbus/dbus_object.h>
-#include <chromeos/dbus/exported_property_set.h>
-#include <chromeos/errors/error.h>
+#include <brillo/dbus/data_serialization.h>
+#include <brillo/dbus/dbus_object.h>
+#include <brillo/dbus/exported_property_set.h>
+#include <brillo/errors/error.h>
#include <weave/device.h>
#include "buffet/buffet_config.h"
#include "buffet/dbus_bindings/com.android.Weave.Manager.h"
-namespace chromeos {
+namespace brillo {
namespace dbus_utils {
class ExportedObjectManager;
} // namespace dbus_utils
@@ -40,11 +40,11 @@
template<typename... Types>
using DBusMethodResponsePtr =
- std::unique_ptr<chromeos::dbus_utils::DBusMethodResponse<Types...>>;
+ std::unique_ptr<brillo::dbus_utils::DBusMethodResponse<Types...>>;
template<typename... Types>
using DBusMethodResponse =
- chromeos::dbus_utils::DBusMethodResponse<Types...>;
+ brillo::dbus_utils::DBusMethodResponse<Types...>;
// The Manager is responsible for global state of Buffet. It exposes
// interfaces which affect the entire device such as device registration and
@@ -62,30 +62,30 @@
explicit Manager(
const Options& options,
- const base::WeakPtr<chromeos::dbus_utils::ExportedObjectManager>&
+ const base::WeakPtr<brillo::dbus_utils::ExportedObjectManager>&
object_manager);
~Manager();
- void Start(chromeos::dbus_utils::AsyncEventSequencer* sequencer);
+ void Start(brillo::dbus_utils::AsyncEventSequencer* sequencer);
void Stop();
private:
- void RestartWeave(chromeos::dbus_utils::AsyncEventSequencer* sequencer);
+ void RestartWeave(brillo::dbus_utils::AsyncEventSequencer* sequencer);
void CreateDevice();
// DBus methods:
void RegisterDevice(DBusMethodResponsePtr<std::string> response,
const std::string& ticket_id) override;
void UpdateState(DBusMethodResponsePtr<> response,
- const chromeos::VariantDictionary& property_set) override;
- bool GetState(chromeos::ErrorPtr* error, std::string* state) override;
+ const brillo::VariantDictionary& property_set) override;
+ bool GetState(brillo::ErrorPtr* error, std::string* state) override;
void AddCommand(DBusMethodResponsePtr<std::string> response,
const std::string& json_command) override;
std::string TestMethod(const std::string& message) override;
void StartPrivet(const Options& options,
- chromeos::dbus_utils::AsyncEventSequencer* sequencer);
+ brillo::dbus_utils::AsyncEventSequencer* sequencer);
void OnStateChanged();
void OnGcdStateChanged(weave::GcdState state);
@@ -98,7 +98,7 @@
Options options_;
com::android::Weave::ManagerAdaptor dbus_adaptor_{this};
- chromeos::dbus_utils::DBusObject dbus_object_;
+ brillo::dbus_utils::DBusObject dbus_object_;
class TaskRunner;
std::unique_ptr<TaskRunner> task_runner_;
diff --git a/buffet/peerd_client.cc b/buffet/peerd_client.cc
index 9c56b53..67847bd 100644
--- a/buffet/peerd_client.cc
+++ b/buffet/peerd_client.cc
@@ -8,8 +8,8 @@
#include <vector>
#include <base/message_loop/message_loop.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/strings/string_utils.h>
+#include <brillo/errors/error.h>
+#include <brillo/strings/string_utils.h>
using org::chromium::peerd::PeerProxy;
@@ -22,7 +22,7 @@
// updates relevant for a short amount of time.
const int kCommitTimeoutSeconds = 1;
-void OnError(const std::string& operation, chromeos::Error* error) {
+void OnError(const std::string& operation, brillo::Error* error) {
LOG(ERROR) << operation << " failed:" << error->GetMessage();
}
@@ -89,13 +89,13 @@
VLOG(1) << "Starting peerd advertising.";
CHECK_NE(port_, 0);
CHECK(!txt_.empty());
- std::map<std::string, chromeos::Any> mdns_options{
- {"port", chromeos::Any{port_}},
+ std::map<std::string, brillo::Any> mdns_options{
+ {"port", brillo::Any{port_}},
};
std::map<std::string, std::string> txt;
for (const auto& record : txt_) {
- auto name_value = chromeos::string_utils::SplitAtFirst(record, "=");
+ auto name_value = brillo::string_utils::SplitAtFirst(record, "=");
CHECK(!name_value.second.empty());
txt.emplace(std::move(name_value));
}
diff --git a/buffet/shill_client.cc b/buffet/shill_client.cc
index 36918ab..7f67304 100644
--- a/buffet/shill_client.cc
+++ b/buffet/shill_client.cc
@@ -8,8 +8,8 @@
#include <base/message_loop/message_loop.h>
#include <base/stl_util.h>
-#include <chromeos/any.h>
-#include <chromeos/errors/error.h>
+#include <brillo/any.h>
+#include <brillo/errors/error.h>
#include <dbus/shill/dbus-constants.h>
#include <weave/enum_to_string.h>
@@ -17,8 +17,8 @@
#include "buffet/socket_stream.h"
#include "buffet/weave_error_conversion.h"
-using chromeos::Any;
-using chromeos::VariantDictionary;
+using brillo::Any;
+using brillo::VariantDictionary;
using dbus::ObjectPath;
using org::chromium::flimflam::DeviceProxy;
using org::chromium::flimflam::ServiceProxy;
@@ -149,7 +149,7 @@
service_properties[shill::kSaveCredentialsProperty] = Any{true};
service_properties[shill::kAutoConnectProperty] = Any{true};
ObjectPath service_path;
- chromeos::ErrorPtr chromeos_error;
+ brillo::ErrorPtr chromeos_error;
if (!manager_proxy_.ConfigureService(service_properties, &service_path,
&chromeos_error) ||
!manager_proxy_.RequestScan(shill::kTypeWifi, &chromeos_error)) {
@@ -566,8 +566,8 @@
std::unique_ptr<weave::Stream> raw_stream{
SocketStream::ConnectBlocking(host, port)};
if (!raw_stream) {
- chromeos::ErrorPtr error;
- chromeos::errors::system::AddSystemError(&error, FROM_HERE, errno);
+ brillo::ErrorPtr error;
+ brillo::errors::system::AddSystemError(&error, FROM_HERE, errno);
weave::ErrorPtr weave_error;
ConvertError(*error.get(), &weave_error);
base::MessageLoop::current()->PostTask(
diff --git a/buffet/shill_client.h b/buffet/shill_client.h
index 1a7bb19..9cf5b4f 100644
--- a/buffet/shill_client.h
+++ b/buffet/shill_client.h
@@ -69,21 +69,21 @@
const std::string& signal_name,
bool success);
void OnManagerPropertyChange(const std::string& property_name,
- const chromeos::Any& property_value);
+ const brillo::Any& property_value);
void OnDevicePropertyChangeRegistration(const dbus::ObjectPath& device_path,
const std::string& interface,
const std::string& signal_name,
bool success);
void OnDevicePropertyChange(const dbus::ObjectPath& device_path,
const std::string& property_name,
- const chromeos::Any& property_value);
+ const brillo::Any& property_value);
void OnServicePropertyChangeRegistration(const dbus::ObjectPath& path,
const std::string& interface,
const std::string& signal_name,
bool success);
void OnServicePropertyChange(const dbus::ObjectPath& service_path,
const std::string& property_name,
- const chromeos::Any& property_value);
+ const brillo::Any& property_value);
void OnStateChangeForConnectingService(const std::string& state);
void OnErrorChangeForConnectingService(const std::string& error);
diff --git a/buffet/socket_stream.cc b/buffet/socket_stream.cc
index 317a671..e7588f1 100644
--- a/buffet/socket_stream.cc
+++ b/buffet/socket_stream.cc
@@ -14,8 +14,8 @@
#include <base/files/file_util.h>
#include <base/message_loop/message_loop.h>
#include <base/strings/stringprintf.h>
-#include <chromeos/streams/file_stream.h>
-#include <chromeos/streams/tls_stream.h>
+#include <brillo/streams/file_stream.h>
+#include <brillo/streams/tls_stream.h>
#include "buffet/socket_stream.h"
#include "buffet/weave_error_conversion.h"
@@ -80,13 +80,13 @@
void OnSuccess(const base::Callback<void(std::unique_ptr<weave::Stream>)>&
success_callback,
- chromeos::StreamPtr tls_stream) {
+ brillo::StreamPtr tls_stream) {
success_callback.Run(
std::unique_ptr<weave::Stream>{new SocketStream{std::move(tls_stream)}});
}
void OnError(const base::Callback<void(weave::ErrorPtr)>& error_callback,
- const chromeos::Error* chromeos_error) {
+ const brillo::Error* chromeos_error) {
weave::ErrorPtr error;
ConvertError(*chromeos_error, &error);
error_callback.Run(std::move(error));
@@ -98,7 +98,7 @@
size_t size_to_read,
const ReadSuccessCallback& success_callback,
const weave::ErrorCallback& error_callback) {
- chromeos::ErrorPtr chromeos_error;
+ brillo::ErrorPtr chromeos_error;
if (!ptr_->ReadAsync(buffer, size_to_read, success_callback,
base::Bind(&OnError, error_callback), &chromeos_error)) {
weave::ErrorPtr error;
@@ -112,7 +112,7 @@
size_t size_to_write,
const weave::SuccessCallback& success_callback,
const weave::ErrorCallback& error_callback) {
- chromeos::ErrorPtr chromeos_error;
+ brillo::ErrorPtr chromeos_error;
if (!ptr_->WriteAllAsync(buffer, size_to_write, success_callback,
base::Bind(&OnError, error_callback),
&chromeos_error)) {
@@ -135,7 +135,7 @@
return nullptr;
auto ptr_ =
- chromeos::FileStream::FromFileDescriptor(socket_fd, true, nullptr);
+ brillo::FileStream::FromFileDescriptor(socket_fd, true, nullptr);
if (ptr_)
return std::unique_ptr<Stream>{new SocketStream{std::move(ptr_)}};
@@ -149,9 +149,9 @@
const base::Callback<void(std::unique_ptr<Stream>)>& success_callback,
const weave::ErrorCallback& error_callback) {
SocketStream* stream = static_cast<SocketStream*>(socket.get());
- chromeos::TlsStream::Connect(std::move(stream->ptr_), host,
- base::Bind(&OnSuccess, success_callback),
- base::Bind(&OnError, error_callback));
+ brillo::TlsStream::Connect(std::move(stream->ptr_), host,
+ base::Bind(&OnSuccess, success_callback),
+ base::Bind(&OnError, error_callback));
}
} // namespace buffet
diff --git a/buffet/socket_stream.h b/buffet/socket_stream.h
index 968acb9..9ad4b84 100644
--- a/buffet/socket_stream.h
+++ b/buffet/socket_stream.h
@@ -9,14 +9,14 @@
#include <base/callback.h>
#include <base/macros.h>
-#include <chromeos/streams/stream.h>
+#include <brillo/streams/stream.h>
#include <weave/stream.h>
namespace buffet {
class SocketStream : public weave::Stream {
public:
- explicit SocketStream(chromeos::StreamPtr ptr) : ptr_{std::move(ptr)} {}
+ explicit SocketStream(brillo::StreamPtr ptr) : ptr_{std::move(ptr)} {}
~SocketStream() override = default;
@@ -42,7 +42,7 @@
const weave::ErrorCallback& error_callback);
private:
- chromeos::StreamPtr ptr_;
+ brillo::StreamPtr ptr_;
DISALLOW_COPY_AND_ASSIGN(SocketStream);
};
diff --git a/buffet/test_daemon/main.cc b/buffet/test_daemon/main.cc
index 5016b0b..afb4cee 100644
--- a/buffet/test_daemon/main.cc
+++ b/buffet/test_daemon/main.cc
@@ -14,21 +14,21 @@
#include <base/format_macros.h>
#include <base/json/json_writer.h>
#include <base/values.h>
-#include <chromeos/daemons/dbus_daemon.h>
-#include <chromeos/map_utils.h>
-#include <chromeos/strings/string_utils.h>
-#include <chromeos/syslog_logging.h>
+#include <brillo/daemons/dbus_daemon.h>
+#include <brillo/map_utils.h>
+#include <brillo/strings/string_utils.h>
+#include <brillo/syslog_logging.h>
#include "buffet/dbus-proxies.h"
namespace {
std::unique_ptr<base::DictionaryValue> DictionaryToJson(
- const chromeos::VariantDictionary& dictionary);
+ const brillo::VariantDictionary& dictionary);
-std::unique_ptr<base::Value> AnyToJson(const chromeos::Any& value) {
- if (value.IsTypeCompatible<chromeos::VariantDictionary>())
- return DictionaryToJson(value.Get<chromeos::VariantDictionary>());
+std::unique_ptr<base::Value> AnyToJson(const brillo::Any& value) {
+ if (value.IsTypeCompatible<brillo::VariantDictionary>())
+ return DictionaryToJson(value.Get<brillo::VariantDictionary>());
if (value.IsTypeCompatible<std::string>()) {
return std::unique_ptr<base::Value>{
@@ -55,14 +55,14 @@
}
std::unique_ptr<base::DictionaryValue> DictionaryToJson(
- const chromeos::VariantDictionary& dictionary) {
+ const brillo::VariantDictionary& dictionary) {
std::unique_ptr<base::DictionaryValue> result{new base::DictionaryValue};
for (const auto& it : dictionary)
result->Set(it.first, AnyToJson(it.second).release());
return result;
}
-std::string DictionaryToString(const chromeos::VariantDictionary& dictionary) {
+std::string DictionaryToString(const brillo::VariantDictionary& dictionary) {
std::unique_ptr<base::DictionaryValue> json{DictionaryToJson(dictionary)};
std::string str;
base::JSONWriter::Write(*json, &str);
@@ -71,7 +71,7 @@
} // anonymous namespace
-class Daemon final : public chromeos::DBusDaemon {
+class Daemon final : public brillo::DBusDaemon {
public:
Daemon() = default;
@@ -93,7 +93,7 @@
};
int Daemon::OnInit() {
- int return_code = chromeos::DBusDaemon::OnInit();
+ int return_code = brillo::DBusDaemon::OnInit();
if (return_code != EX_OK)
return return_code;
@@ -166,9 +166,9 @@
int main(int argc, char* argv[]) {
base::CommandLine::Init(argc, argv);
- chromeos::InitLog(chromeos::kLogToSyslog |
- chromeos::kLogToStderr |
- chromeos::kLogHeader);
+ brillo::InitLog(brillo::kLogToSyslog |
+ brillo::kLogToStderr |
+ brillo::kLogHeader);
Daemon daemon;
return daemon.Run();
}
diff --git a/buffet/weave_error_conversion.h b/buffet/weave_error_conversion.h
index 581131e..2240c3a 100644
--- a/buffet/weave_error_conversion.h
+++ b/buffet/weave_error_conversion.h
@@ -8,7 +8,7 @@
#include <memory>
#include <string>
-#include <chromeos/errors/error.h>
+#include <brillo/errors/error.h>
#include <weave/error.h>
namespace buffet {
diff --git a/buffet/webserv_client.cc b/buffet/webserv_client.cc
index 4b464c8..ea99ea2 100644
--- a/buffet/webserv_client.cc
+++ b/buffet/webserv_client.cc
@@ -80,7 +80,7 @@
WebServClient::WebServClient(
const scoped_refptr<dbus::Bus>& bus,
- chromeos::dbus_utils::AsyncEventSequencer* sequencer,
+ brillo::dbus_utils::AsyncEventSequencer* sequencer,
const base::Closure& server_available_callback)
: server_available_callback_{server_available_callback} {
web_server_.reset(new libwebserv::Server);
@@ -125,7 +125,7 @@
return https_port_;
}
-chromeos::Blob WebServClient::GetHttpsCertificateFingerprint() const {
+brillo::Blob WebServClient::GetHttpsCertificateFingerprint() const {
return certificate_;
}
diff --git a/buffet/webserv_client.h b/buffet/webserv_client.h
index cf3b397..65d276f 100644
--- a/buffet/webserv_client.h
+++ b/buffet/webserv_client.h
@@ -16,7 +16,7 @@
class Bus;
}
-namespace chromeos {
+namespace brillo {
namespace dbus_utils {
class AsyncEventSequencer;
}
@@ -35,7 +35,7 @@
class WebServClient : public weave::provider::HttpServer {
public:
WebServClient(const scoped_refptr<dbus::Bus>& bus,
- chromeos::dbus_utils::AsyncEventSequencer* sequencer,
+ brillo::dbus_utils::AsyncEventSequencer* sequencer,
const base::Closure& server_available_callback);
~WebServClient() override;
diff --git a/libweaved/command.cc b/libweaved/command.cc
index 4df7c4f..55cfe2f 100644
--- a/libweaved/command.cc
+++ b/libweaved/command.cc
@@ -62,27 +62,27 @@
return Command::Origin::kLocal;
}
-const chromeos::VariantDictionary& Command::GetParameters() const {
+const brillo::VariantDictionary& Command::GetParameters() const {
return proxy_->parameters();
}
-bool Command::SetProgress(const chromeos::VariantDictionary& progress,
- chromeos::ErrorPtr* error) {
+bool Command::SetProgress(const brillo::VariantDictionary& progress,
+ brillo::ErrorPtr* error) {
return proxy_->SetProgress(progress, error);
}
-bool Command::Complete(const chromeos::VariantDictionary& results,
- chromeos::ErrorPtr* error) {
+bool Command::Complete(const brillo::VariantDictionary& results,
+ brillo::ErrorPtr* error) {
return proxy_->Complete(results, error);
}
bool Command::Abort(const std::string& error_code,
const std::string& error_message,
- chromeos::ErrorPtr* error) {
+ brillo::ErrorPtr* error) {
return proxy_->Abort(error_code, error_message, error);
}
-bool Command::Cancel(chromeos::ErrorPtr* error) {
+bool Command::Cancel(brillo::ErrorPtr* error) {
return proxy_->Cancel(error);
}
diff --git a/libweaved/command.h b/libweaved/command.h
index e9eb24b..34753fe 100644
--- a/libweaved/command.h
+++ b/libweaved/command.h
@@ -20,8 +20,8 @@
#include <string>
#include <base/macros.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/variant_dictionary.h>
+#include <brillo/errors/error.h>
+#include <brillo/variant_dictionary.h>
#include <libweaved/export.h>
namespace com {
@@ -65,7 +65,7 @@
Command::Origin GetOrigin() const;
// Returns the command parameters.
- const chromeos::VariantDictionary& GetParameters() const;
+ const brillo::VariantDictionary& GetParameters() const;
// Helper function to get a command parameter of particular type T from the
// command parameter list. Returns default value for type T (e.g. 0 for int or
@@ -73,7 +73,7 @@
// is of incorrect type.
template <typename T>
T GetParameter(const std::string& name) const {
- const chromeos::VariantDictionary& parameters = GetParameters();
+ const brillo::VariantDictionary& parameters = GetParameters();
T value{};
auto p = parameters.find(name);
if (p != parameters.end())
@@ -83,24 +83,24 @@
// Updates the command progress. The |progress| should match the schema.
// Returns false if |progress| value is incorrect.
- bool SetProgress(const chromeos::VariantDictionary& progress,
- chromeos::ErrorPtr* error);
+ bool SetProgress(const brillo::VariantDictionary& progress,
+ brillo::ErrorPtr* error);
// Sets command into terminal "done" state.
// Updates the command results. The |results| should match the schema.
// Returns false if |results| value is incorrect.
- bool Complete(const chromeos::VariantDictionary& results,
- chromeos::ErrorPtr* error);
+ bool Complete(const brillo::VariantDictionary& results,
+ brillo::ErrorPtr* error);
// Aborts command execution.
// Sets command into terminal "aborted" state.
bool Abort(const std::string& error_code,
const std::string& error_message,
- chromeos::ErrorPtr* error);
+ brillo::ErrorPtr* error);
// Cancels command execution.
// Sets command into terminal "canceled" state.
- bool Cancel(chromeos::ErrorPtr* error);
+ bool Cancel(brillo::ErrorPtr* error);
protected:
Command(com::android::Weave::CommandProxy* proxy);
diff --git a/libweaved/device.cc b/libweaved/device.cc
index 6e218ae..1c97233 100644
--- a/libweaved/device.cc
+++ b/libweaved/device.cc
@@ -60,20 +60,20 @@
}
}
-bool Device::SetStateProperties(const chromeos::VariantDictionary& dict,
- chromeos::ErrorPtr* error) {
+bool Device::SetStateProperties(const brillo::VariantDictionary& dict,
+ brillo::ErrorPtr* error) {
if (proxy_)
return proxy_->UpdateState(dict, error);
- chromeos::Error::AddTo(error, FROM_HERE, "weaved", "service_unavailable",
+ brillo::Error::AddTo(error, FROM_HERE, "weaved", "service_unavailable",
"Process 'weaved' is unreachable");
return false;
}
bool Device::SetStateProperty(const std::string& name,
- const chromeos::Any& value,
- chromeos::ErrorPtr* error) {
- return SetStateProperties(chromeos::VariantDictionary{{name, value}}, error);
+ const brillo::Any& value,
+ brillo::ErrorPtr* error) {
+ return SetStateProperties(brillo::VariantDictionary{{name, value}}, error);
}
void Device::OnCommandAdded(CommandProxy* proxy) {
diff --git a/libweaved/device.h b/libweaved/device.h
index 45e0c16..7ce52c4 100644
--- a/libweaved/device.h
+++ b/libweaved/device.h
@@ -25,9 +25,9 @@
#include <base/callback.h>
#include <base/macros.h>
#include <base/memory/ref_counted.h>
-#include <chromeos/any.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/variant_dictionary.h>
+#include <brillo/any.h>
+#include <brillo/errors/error.h>
+#include <brillo/variant_dictionary.h>
#include <libweaved/command.h>
#include <libweaved/export.h>
@@ -68,14 +68,14 @@
void AddCommandHandler(const std::string& command_name,
const CommandHandlerCallback& callback);
- bool SetStateProperties(const chromeos::VariantDictionary& dict,
- chromeos::ErrorPtr* error);
+ bool SetStateProperties(const brillo::VariantDictionary& dict,
+ brillo::ErrorPtr* error);
// Sets value of the single property.
// |name| is full property name, including package name. e.g. "base.network".
bool SetStateProperty(const std::string& name,
- const chromeos::Any& value,
- chromeos::ErrorPtr* error);
+ const brillo::Any& value,
+ brillo::ErrorPtr* error);
private:
Device(const scoped_refptr<dbus::Bus>& bus,