[fidl][cpp] Use std:: types for non-nullable strings and vectors.
See: https://fuchsia-review.googlesource.com/c/garnet/+/236996
Test: built everything, booted system and poked around
Change-Id: I97ef4a0cc6970339bf1665d0b915fd618f43d947
diff --git a/bin/acquirers/story_info/story_info.cc b/bin/acquirers/story_info/story_info.cc
index 74161a6..a295905 100644
--- a/bin/acquirers/story_info/story_info.cc
+++ b/bin/acquirers/story_info/story_info.cc
@@ -36,8 +36,8 @@
story_provider_.NewRequest());
story_provider_->GetStories(
story_provider_watcher_binding_.NewBinding(),
- [this](fidl::VectorPtr<fuchsia::modular::StoryInfo> stories) {
- for (const auto& story : *stories) {
+ [this](std::vector<fuchsia::modular::StoryInfo> stories) {
+ for (const auto& story : stories) {
stories_.emplace(
std::make_pair(story.id, std::make_unique<StoryWatcherImpl>(
this, context_writer_.get(),
@@ -95,7 +95,7 @@
}
void StoryInfoAcquirer::OnVisibleStoriesChange(
- fidl::VectorPtr<fidl::StringPtr> ids) {
+ fidl::VectorPtr<std::string> ids) {
// TODO(thatguy)
}
@@ -115,8 +115,8 @@
it->second->OnStoryStateChange(std::move(info), state);
}
-void StoryInfoAcquirer::OnDelete(fidl::StringPtr story_id) {
- const std::string id = story_id.get();
+void StoryInfoAcquirer::OnDelete(std::string story_id) {
+ const std::string id = story_id;
// TODO(thatguy)
}
diff --git a/bin/acquirers/story_info/story_info.h b/bin/acquirers/story_info/story_info.h
index 4fd2c88..6e4589b 100644
--- a/bin/acquirers/story_info/story_info.h
+++ b/bin/acquirers/story_info/story_info.h
@@ -54,13 +54,13 @@
void OnFocusChange(fuchsia::modular::FocusInfoPtr info) override;
// |fuchsia::modular::VisibleStoriesWatcher|
- void OnVisibleStoriesChange(fidl::VectorPtr<fidl::StringPtr> ids) override;
+ void OnVisibleStoriesChange(fidl::VectorPtr<std::string> ids) override;
// |fuchsia::modular::StoryProviderWatcher|
void OnChange(
fuchsia::modular::StoryInfo info, fuchsia::modular::StoryState state,
fuchsia::modular::StoryVisibilityState visibility_state) override;
- void OnDelete(fidl::StringPtr story_id) override;
+ void OnDelete(std::string story_id) override;
fuchsia::modular::ContextWriterPtr context_writer_;
fuchsia::modular::ContextReaderPtr context_reader_;
diff --git a/bin/acquirers/story_info/story_watcher_impl.cc b/bin/acquirers/story_info/story_watcher_impl.cc
index 0f9c905..6976b20 100644
--- a/bin/acquirers/story_info/story_watcher_impl.cc
+++ b/bin/acquirers/story_info/story_watcher_impl.cc
@@ -51,8 +51,8 @@
story_controller_->GetActiveLinks(
story_links_watcher_binding_.NewBinding(),
- [this](fidl::VectorPtr<fuchsia::modular::LinkPath> links) mutable {
- for (fuchsia::modular::LinkPath& link_path : *links) {
+ [this](std::vector<fuchsia::modular::LinkPath> links) mutable {
+ for (fuchsia::modular::LinkPath& link_path : links) {
WatchLink(std::move(link_path));
}
});
@@ -80,7 +80,7 @@
}
void StoryWatcherImpl::OnModuleFocused(
- fidl::VectorPtr<fidl::StringPtr> module_path) {
+ std::vector<std::string> module_path) {
auto key = modular::EncodeModulePath(module_path);
auto it = module_values_.find(key);
if (it == module_values_.end()) {
diff --git a/bin/acquirers/story_info/story_watcher_impl.h b/bin/acquirers/story_info/story_watcher_impl.h
index 0f4bc9b..09f4049 100644
--- a/bin/acquirers/story_info/story_watcher_impl.h
+++ b/bin/acquirers/story_info/story_watcher_impl.h
@@ -49,7 +49,7 @@
void OnModuleAdded(fuchsia::modular::ModuleData module_data) override;
// |fuchsia::modular::StoryWatcher|
- void OnModuleFocused(fidl::VectorPtr<fidl::StringPtr> module_path) override;
+ void OnModuleFocused(std::vector<std::string> module_path) override;
// |fuchsia::modular::StoryLinksWatcher|
void OnNewLink(fuchsia::modular::LinkPath link_path) override;
diff --git a/bin/agents/clipboard/clipboard_impl.cc b/bin/agents/clipboard/clipboard_impl.cc
index ecfcaae..33eb1a8 100644
--- a/bin/agents/clipboard/clipboard_impl.cc
+++ b/bin/agents/clipboard/clipboard_impl.cc
@@ -19,7 +19,7 @@
ClipboardImpl::~ClipboardImpl() = default;
-void ClipboardImpl::Push(fidl::StringPtr text) { storage_.Push(text); }
+void ClipboardImpl::Push(std::string text) { storage_.Push(text); }
void ClipboardImpl::Peek(PeekCallback callback) { storage_.Peek(callback); }
diff --git a/bin/agents/clipboard/clipboard_impl.h b/bin/agents/clipboard/clipboard_impl.h
index 5911cef..9f3b605 100644
--- a/bin/agents/clipboard/clipboard_impl.h
+++ b/bin/agents/clipboard/clipboard_impl.h
@@ -25,7 +25,7 @@
private:
// |fuchsia::modular::Clipboard|
- void Push(fidl::StringPtr text) override;
+ void Push(std::string text) override;
// |fuchsia::modular::Clipboard|
void Peek(PeekCallback callback) override;
diff --git a/bin/basemgr/basemgr_impl.cc b/bin/basemgr/basemgr_impl.cc
index 4ec0aed..00bd8df 100644
--- a/bin/basemgr/basemgr_impl.cc
+++ b/bin/basemgr/basemgr_impl.cc
@@ -431,8 +431,7 @@
fuchsia::ui::gfx::RendererParam param;
param.set_shadow_technique(presentation_state_.shadow_technique);
- auto renderer_params =
- fidl::VectorPtr<fuchsia::ui::gfx::RendererParam>::New(0);
+ std::vector<fuchsia::ui::gfx::RendererParam> renderer_params;
renderer_params.push_back(std::move(param));
presentation_state_.presentation->SetRendererParams(
@@ -480,12 +479,12 @@
user_provider_impl_->Login(fuchsia::modular::UserLoginParams());
} else {
user_provider_impl_->PreviousUsers(
- [this](fidl::VectorPtr<fuchsia::modular::auth::Account> accounts) {
- if (accounts->empty()) {
+ [this](std::vector<fuchsia::modular::auth::Account> accounts) {
+ if (accounts.empty()) {
StartBaseShell();
} else {
fuchsia::modular::UserLoginParams params;
- params.account_id = accounts->at(0).id;
+ params.account_id = accounts.at(0).id;
user_provider_impl_->Login(std::move(params));
}
});
@@ -514,11 +513,11 @@
user_provider_impl_->PreviousUsers(
[this](
- fidl::VectorPtr<fuchsia::modular::auth::Account> accounts) {
+ std::vector<fuchsia::modular::auth::Account> accounts) {
std::vector<FuturePtr<>> did_remove_users;
- did_remove_users.reserve(accounts->size());
+ did_remove_users.reserve(accounts.size());
- for (const auto& account : *accounts) {
+ for (const auto& account : accounts) {
auto did_remove_user = Future<>::Create(
"BasemgrImpl.ShowSetupOrLogin.did_remove_user");
user_provider_impl_->RemoveUser(
diff --git a/bin/basemgr/basemgr_settings.cc b/bin/basemgr/basemgr_settings.cc
index d358b9a..3cb9842 100644
--- a/bin/basemgr/basemgr_settings.cc
+++ b/bin/basemgr/basemgr_settings.cc
@@ -88,7 +88,7 @@
}
void BasemgrSettings::ParseShellArgs(const std::string& value,
- fidl::VectorPtr<fidl::StringPtr>* args) {
+ fidl::VectorPtr<std::string>* args) {
bool escape = false;
std::string arg;
for (char i : value) {
@@ -119,12 +119,11 @@
std::string BasemgrSettings::FindTestName(
const fidl::StringPtr& session_shell,
- const fidl::VectorPtr<fidl::StringPtr>& session_shell_args) {
+ const fidl::VectorPtr<std::string>& session_shell_args) {
const std::string kRootModule = "--root_module";
std::string result = session_shell;
- for (const auto& session_shell_arg : *session_shell_args) {
- const auto& arg = session_shell_arg.get();
+ for (const auto& arg : *session_shell_args) {
if (arg.substr(0, kRootModule.size()) == kRootModule) {
result = arg.substr(kRootModule.size());
}
diff --git a/bin/basemgr/basemgr_settings.h b/bin/basemgr/basemgr_settings.h
index e9244a9..1e91a06 100644
--- a/bin/basemgr/basemgr_settings.h
+++ b/bin/basemgr/basemgr_settings.h
@@ -35,13 +35,13 @@
private:
void ParseShellArgs(const std::string& value,
- fidl::VectorPtr<fidl::StringPtr>* args);
+ fidl::VectorPtr<std::string>* args);
// Extract the test name using knowledge of how Modular structures its
// command lines for testing.
static std::string FindTestName(
const fidl::StringPtr& session_shell,
- const fidl::VectorPtr<fidl::StringPtr>& session_shell_args);
+ const fidl::VectorPtr<std::string>& session_shell_args);
FXL_DISALLOW_COPY_AND_ASSIGN(BasemgrSettings);
};
diff --git a/bin/basemgr/dev_base_shell.cc b/bin/basemgr/dev_base_shell.cc
index f01490c..107ae11 100644
--- a/bin/basemgr/dev_base_shell.cc
+++ b/bin/basemgr/dev_base_shell.cc
@@ -156,18 +156,18 @@
}
user_provider_->PreviousUsers(
- [this](fidl::VectorPtr<fuchsia::modular::auth::Account> accounts) {
- FXL_LOG(INFO) << "Found " << accounts->size()
+ [this](std::vector<fuchsia::modular::auth::Account> accounts) {
+ FXL_LOG(INFO) << "Found " << accounts.size()
<< " users in the user "
<< "database";
// Not running in incognito mode. Add the user if not already
// added.
std::string account_id;
- for (const auto& account : *accounts) {
+ for (const auto& account : accounts) {
FXL_LOG(INFO) << "Found user " << account.display_name;
- if (account.display_name->size() >= settings_.user.size() &&
- account.display_name->substr(0, settings_.user.size()) ==
+ if (account.display_name.size() >= settings_.user.size() &&
+ account.display_name.substr(0, settings_.user.size()) ==
settings_.user) {
account_id = account.id;
break;
diff --git a/bin/basemgr/user_provider_impl.cc b/bin/basemgr/user_provider_impl.cc
index 7bfb4e4..8d619a5 100644
--- a/bin/basemgr/user_provider_impl.cc
+++ b/bin/basemgr/user_provider_impl.cc
@@ -90,7 +90,7 @@
// Returns a list of supported auth provider configurations that includes the
// type, startup parameters and the url of the auth provider component.
// TODO(ukode): This list will be derived from a config package in the future.
-fidl::VectorPtr<fuchsia::auth::AuthProviderConfig> GetAuthProviderConfigs() {
+std::vector<fuchsia::auth::AuthProviderConfig> GetAuthProviderConfigs() {
fuchsia::auth::AuthProviderConfig dev_auth_provider_config;
dev_auth_provider_config.auth_provider_type = kDevAuthProviderType;
dev_auth_provider_config.url = kDevAuthProviderUrl;
@@ -99,7 +99,7 @@
google_auth_provider_config.auth_provider_type = kGoogleAuthProviderType;
google_auth_provider_config.url = kGoogleAuthProviderUrl;
- fidl::VectorPtr<fuchsia::auth::AuthProviderConfig> auth_provider_configs;
+ std::vector<fuchsia::auth::AuthProviderConfig> auth_provider_configs;
auth_provider_configs.push_back(std::move(google_auth_provider_config));
auth_provider_configs.push_back(std::move(dev_auth_provider_config));
@@ -243,7 +243,7 @@
fuchsia::auth::AppConfig fuchsia_app_config;
fuchsia_app_config.auth_provider_type =
MapIdentityProviderToAuthProviderType(identity_provider);
- auto scopes = fidl::VectorPtr<fidl::StringPtr>::New(0);
+ std::vector<std::string> scopes;
token_manager->Authorize(
std::move(fuchsia_app_config), nullptr, std::move(scopes), "", "",
[this, identity_provider, account_id,
@@ -290,7 +290,7 @@
});
}
-void UserProviderImpl::RemoveUser(fidl::StringPtr account_id,
+void UserProviderImpl::RemoveUser(std::string account_id,
RemoveUserCallback callback) {
fuchsia::modular::auth::AccountPtr account;
if (users_storage_) {
@@ -435,8 +435,7 @@
}
fuchsia::auth::TokenManagerPtr UserProviderImpl::CreateTokenManager(
- fidl::StringPtr account_id) {
- FXL_DCHECK(account_id);
+ std::string account_id) {
FXL_DCHECK(token_manager_factory_);
fuchsia::auth::TokenManagerPtr token_mgr;
@@ -489,7 +488,7 @@
void UserProviderImpl::LoginInternal(fuchsia::modular::auth::AccountPtr account,
fuchsia::modular::UserLoginParams params) {
- auto account_id = account ? account->id.get() : GetRandomId();
+ auto account_id = account ? account->id : GetRandomId();
FXL_DLOG(INFO) << "Login() User:" << account_id;
// Instead of passing token_manager_factory all the way to agents and
diff --git a/bin/basemgr/user_provider_impl.h b/bin/basemgr/user_provider_impl.h
index 815315b..11b31b3 100644
--- a/bin/basemgr/user_provider_impl.h
+++ b/bin/basemgr/user_provider_impl.h
@@ -86,7 +86,7 @@
void PreviousUsers(PreviousUsersCallback callback) override;
// |fuchsia::modular::UserProvider|, also called by |basemgr_impl|.
- void RemoveUser(fidl::StringPtr account_id,
+ void RemoveUser(std::string account_id,
RemoveUserCallback callback) override;
private:
@@ -101,7 +101,7 @@
// Returns a new |fuchsia::auth::TokenManager| handle for the given user
// account |account_id|.
- fuchsia::auth::TokenManagerPtr CreateTokenManager(fidl::StringPtr account_id);
+ fuchsia::auth::TokenManagerPtr CreateTokenManager(std::string account_id);
bool AddUserToAccountsDB(const fuchsia::modular::auth::Account* account,
std::string* error);
diff --git a/bin/cloud_provider_firestore/app/cloud_provider_impl.cc b/bin/cloud_provider_firestore/app/cloud_provider_impl.cc
index 4e0df0e..2aa6297 100644
--- a/bin/cloud_provider_firestore/app/cloud_provider_impl.cc
+++ b/bin/cloud_provider_firestore/app/cloud_provider_impl.cc
@@ -129,7 +129,7 @@
}
void CloudProviderImpl::GetPageCloud(
- fidl::VectorPtr<uint8_t> app_id, fidl::VectorPtr<uint8_t> page_id,
+ std::vector<uint8_t> app_id, std::vector<uint8_t> page_id,
fidl::InterfaceRequest<cloud_provider::PageCloud> page_cloud,
GetPageCloudCallback callback) {
const std::string user_path =
diff --git a/bin/cloud_provider_firestore/app/cloud_provider_impl.h b/bin/cloud_provider_firestore/app/cloud_provider_impl.h
index 6fafe6b..a056be3 100644
--- a/bin/cloud_provider_firestore/app/cloud_provider_impl.h
+++ b/bin/cloud_provider_firestore/app/cloud_provider_impl.h
@@ -47,7 +47,7 @@
GetDeviceSetCallback callback) override;
void GetPageCloud(
- fidl::VectorPtr<uint8_t> app_id, fidl::VectorPtr<uint8_t> page_id,
+ std::vector<uint8_t> app_id, std::vector<uint8_t> page_id,
fidl::InterfaceRequest<cloud_provider::PageCloud> page_cloud,
GetPageCloudCallback callback) override;
diff --git a/bin/cloud_provider_firestore/app/device_set_impl.cc b/bin/cloud_provider_firestore/app/device_set_impl.cc
index b5c6225..ddcc4bf 100644
--- a/bin/cloud_provider_firestore/app/device_set_impl.cc
+++ b/bin/cloud_provider_firestore/app/device_set_impl.cc
@@ -86,7 +86,7 @@
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
-void DeviceSetImpl::CheckFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+void DeviceSetImpl::CheckFingerprint(std::vector<uint8_t> fingerprint,
CheckFingerprintCallback callback) {
auto request = google::firestore::v1beta1::GetDocumentRequest();
request.set_name(
@@ -108,7 +108,7 @@
});
}
-void DeviceSetImpl::SetFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+void DeviceSetImpl::SetFingerprint(std::vector<uint8_t> fingerprint,
SetFingerprintCallback callback) {
auto request = google::firestore::v1beta1::CreateDocumentRequest();
request.set_parent(user_path_);
@@ -136,7 +136,7 @@
}
void DeviceSetImpl::SetWatcher(
- fidl::VectorPtr<uint8_t> fingerprint,
+ std::vector<uint8_t> fingerprint,
fidl::InterfaceHandle<cloud_provider::DeviceSetWatcher> watcher,
SetWatcherCallback callback) {
watcher_ = watcher.Bind();
diff --git a/bin/cloud_provider_firestore/app/device_set_impl.h b/bin/cloud_provider_firestore/app/device_set_impl.h
index ef81338..b41d64c 100644
--- a/bin/cloud_provider_firestore/app/device_set_impl.h
+++ b/bin/cloud_provider_firestore/app/device_set_impl.h
@@ -40,14 +40,14 @@
fit::function<void(std::shared_ptr<grpc::CallCredentials>)> callback);
// cloud_provider::DeviceSet:
- void CheckFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+ void CheckFingerprint(std::vector<uint8_t> fingerprint,
CheckFingerprintCallback callback) override;
- void SetFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+ void SetFingerprint(std::vector<uint8_t> fingerprint,
SetFingerprintCallback callback) override;
void SetWatcher(
- fidl::VectorPtr<uint8_t> fingerprint,
+ std::vector<uint8_t> fingerprint,
fidl::InterfaceHandle<cloud_provider::DeviceSetWatcher> watcher,
SetWatcherCallback callback) override;
diff --git a/bin/cloud_provider_firestore/app/page_cloud_impl.cc b/bin/cloud_provider_firestore/app/page_cloud_impl.cc
index 22f389c..4265eef 100644
--- a/bin/cloud_provider_firestore/app/page_cloud_impl.cc
+++ b/bin/cloud_provider_firestore/app/page_cloud_impl.cc
@@ -225,7 +225,7 @@
});
}
-void PageCloudImpl::AddObject(fidl::VectorPtr<uint8_t> id,
+void PageCloudImpl::AddObject(std::vector<uint8_t> id,
fuchsia::mem::Buffer data,
AddObjectCallback callback) {
std::string data_str;
@@ -263,7 +263,7 @@
});
}
-void PageCloudImpl::GetObject(fidl::VectorPtr<uint8_t> id,
+void PageCloudImpl::GetObject(std::vector<uint8_t> id,
GetObjectCallback callback) {
auto request = google::firestore::v1beta1::GetDocumentRequest();
request.set_name(GetObjectPath(page_path_, convert::ToString(id)));
diff --git a/bin/cloud_provider_firestore/app/page_cloud_impl.h b/bin/cloud_provider_firestore/app/page_cloud_impl.h
index 3bda623..4eb5ad1 100644
--- a/bin/cloud_provider_firestore/app/page_cloud_impl.h
+++ b/bin/cloud_provider_firestore/app/page_cloud_impl.h
@@ -45,9 +45,9 @@
AddCommitsCallback callback) override;
void GetCommits(std::unique_ptr<cloud_provider::Token> min_position_token,
GetCommitsCallback callback) override;
- void AddObject(fidl::VectorPtr<uint8_t> id, fuchsia::mem::Buffer data,
+ void AddObject(std::vector<uint8_t> id, fuchsia::mem::Buffer data,
AddObjectCallback callback) override;
- void GetObject(fidl::VectorPtr<uint8_t> id,
+ void GetObject(std::vector<uint8_t> id,
GetObjectCallback callback) override;
void SetWatcher(
std::unique_ptr<cloud_provider::Token> min_position_token,
diff --git a/bin/cloud_provider_firestore/app/page_cloud_impl_unittest.cc b/bin/cloud_provider_firestore/app/page_cloud_impl_unittest.cc
index 96a6e65..f22eae4 100644
--- a/bin/cloud_provider_firestore/app/page_cloud_impl_unittest.cc
+++ b/bin/cloud_provider_firestore/app/page_cloud_impl_unittest.cc
@@ -60,7 +60,7 @@
pending_on_new_commit_callback = std::move(callback);
}
- void OnNewObject(fidl::VectorPtr<uint8_t> /*id*/,
+ void OnNewObject(std::vector<uint8_t> /*id*/,
fuchsia::mem::Buffer /*buffer*/,
OnNewObjectCallback /*callback*/) override {
FXL_NOTIMPLEMENTED();
diff --git a/bin/context_engine/context_repository.cc b/bin/context_engine/context_repository.cc
index 73be2eb..bcb74fe 100644
--- a/bin/context_engine/context_repository.cc
+++ b/bin/context_engine/context_repository.cc
@@ -310,7 +310,7 @@
// For each entry in |query->selector|, query the index for matching values.
IdAndVersionSet matching_id_version;
fuchsia::modular::ContextUpdate update;
- for (const auto& entry : *query.selector) {
+ for (const auto& entry : query.selector) {
const auto& key = entry.key;
const auto& selector = entry.value;
@@ -318,14 +318,12 @@
fuchsia::modular::ContextUpdateEntry update_entry;
update_entry.key = key;
- update_entry.value =
- fidl::VectorPtr<fuchsia::modular::ContextValue>::New(0);
update.values.push_back(std::move(update_entry));
for (const auto& id : values) {
auto it = values_.find(id);
FXL_DCHECK(it != values_.end()) << id;
matching_id_version.insert(std::make_pair(id, it->second.version));
- for (auto& it : *update.values) {
+ for (auto& it : update.values) {
if (it.key == key) {
it.value.push_back(std::move(*GetMerged(id)));
}
diff --git a/bin/context_engine/context_repository_unittest.cc b/bin/context_engine/context_repository_unittest.cc
index 19ce119..4fe5434 100644
--- a/bin/context_engine/context_repository_unittest.cc
+++ b/bin/context_engine/context_repository_unittest.cc
@@ -214,7 +214,7 @@
fuchsia::modular::SubscriptionDebugInfo());
auto maybe_result = TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_result.has_value());
- EXPECT_TRUE(maybe_result.value()->empty());
+ EXPECT_TRUE(maybe_result.value().empty());
listener.reset();
// (a)
@@ -247,8 +247,8 @@
ASSERT_TRUE(maybe_result.has_value());
{
auto& result = maybe_result.value();
- EXPECT_EQ(1lu, result->size());
- EXPECT_EQ("match", result->at(0).content);
+ EXPECT_EQ(1lu, result.size());
+ EXPECT_EQ("match", result.at(0).content);
}
listener.reset();
@@ -269,9 +269,9 @@
ASSERT_TRUE(maybe_result.has_value());
{
auto& result = maybe_result.value();
- EXPECT_EQ(2lu, result->size());
- EXPECT_EQ("now it matches", result->at(0).content);
- EXPECT_EQ("match", result->at(1).content);
+ EXPECT_EQ(2lu, result.size());
+ EXPECT_EQ("now it matches", result.at(0).content);
+ EXPECT_EQ("match", result.at(1).content);
}
listener.reset();
@@ -282,8 +282,8 @@
ASSERT_TRUE(maybe_result.has_value());
{
auto& result = maybe_result.value();
- EXPECT_EQ(1lu, result->size());
- EXPECT_EQ("match", result->at(0).content);
+ EXPECT_EQ(1lu, result.size());
+ EXPECT_EQ("match", result.at(0).content);
}
listener.reset();
}
@@ -305,7 +305,7 @@
ASSERT_TRUE(maybe_result.has_value());
{
auto& result = maybe_result.value();
- EXPECT_EQ(0lu, result->size());
+ EXPECT_EQ(0lu, result.size());
listener.reset();
}
@@ -343,11 +343,11 @@
ASSERT_TRUE(maybe_result.has_value());
{
auto& result = maybe_result.value();
- EXPECT_EQ(1lu, result->size());
- EXPECT_EQ("content", result->at(0).content);
+ EXPECT_EQ(1lu, result.size());
+ EXPECT_EQ("content", result.at(0).content);
// Make sure we adopted the parent metadata from the story node.
- ASSERT_TRUE(result->at(0).meta.story);
- EXPECT_EQ("match", result->at(0).meta.story->id);
+ ASSERT_TRUE(result.at(0).meta.story);
+ EXPECT_EQ("match", result.at(0).meta.story->id);
}
listener.reset();
@@ -357,7 +357,7 @@
ASSERT_TRUE(listener.last_update);
maybe_result = TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_result.has_value());
- EXPECT_EQ(0lu, maybe_result.value()->size());
+ EXPECT_EQ(0lu, maybe_result.value().size());
listener.reset();
// Set it back to something that matched, and this time remove the value
@@ -366,14 +366,14 @@
ASSERT_TRUE(listener.last_update);
maybe_result = TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_result.has_value());
- EXPECT_EQ(1lu, maybe_result.value()->size());
+ EXPECT_EQ(1lu, maybe_result.value().size());
listener.reset();
repository_.Remove(story_value_id);
ASSERT_TRUE(listener.last_update);
maybe_result = TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_result.has_value());
- EXPECT_TRUE(maybe_result.value()->empty());
+ EXPECT_TRUE(maybe_result.value().empty());
listener.reset();
}
diff --git a/bin/context_engine/context_writer_impl.cc b/bin/context_engine/context_writer_impl.cc
index d97d239..8efd0ba 100644
--- a/bin/context_engine/context_writer_impl.cc
+++ b/bin/context_engine/context_writer_impl.cc
@@ -37,8 +37,9 @@
parent_value_selector_.meta->story->id =
client_info.module_scope().story_id;
parent_value_selector_.meta->mod = fuchsia::modular::ModuleMetadata::New();
- fidl::Clone(client_info.module_scope().module_path,
- &parent_value_selector_.meta->mod->path);
+ std::vector<std::string> module_path;
+ fidl::Clone(client_info.module_scope().module_path, &module_path);
+ parent_value_selector_.meta->mod->path = fidl::VectorPtr(std::move(module_path));
}
}
@@ -46,7 +47,7 @@
namespace {
-fidl::VectorPtr<fidl::StringPtr> Deprecated_GetTypesFromJsonEntity(
+fidl::VectorPtr<std::string> Deprecated_GetTypesFromJsonEntity(
const fidl::StringPtr& content) {
// If the content has the @type attribute, take its contents and populate the
// fuchsia::modular::EntityMetadata appropriately, overriding whatever is
@@ -56,25 +57,19 @@
FXL_LOG(WARNING) << "Invalid entity metadata in JSON value: " << content;
return {};
}
- if (types.empty())
- return {};
- auto result = fidl::VectorPtr<fidl::StringPtr>();
- for (const auto& it : types) {
- result.push_back(it);
- }
- return result;
+ return fidl::VectorPtr(types);
}
-void MaybeFillEntityTypeMetadata(const fidl::VectorPtr<fidl::StringPtr>& types,
+void MaybeFillEntityTypeMetadata(const std::vector<std::string>& types,
fuchsia::modular::ContextValue& value) {
- if (value.type != fuchsia::modular::ContextValueType::ENTITY || !types)
+ if (value.type != fuchsia::modular::ContextValueType::ENTITY)
return;
if (!value.meta.entity) {
value.meta.entity = fuchsia::modular::EntityMetadata::New();
}
- fidl::Clone(types, &value.meta.entity->type);
+ value.meta.entity->type = fidl::VectorPtr(types);
}
bool MaybeFindParentValueId(ContextRepository* repository,
@@ -126,7 +121,7 @@
value_writer_storage_.erase(it, value_writer_storage_.end());
}
-void ContextWriterImpl::WriteEntityTopic(fidl::StringPtr topic,
+void ContextWriterImpl::WriteEntityTopic(std::string topic,
fidl::StringPtr value) {
auto activity =
repository_->debug()->GetIdleWaiter()->RegisterOngoingActivity();
@@ -142,13 +137,13 @@
GetEntityTypesFromEntityReference(
value, [this, activity, topic,
- value](const fidl::VectorPtr<fidl::StringPtr>& types) {
+ value](const std::vector<std::string>& types) {
fuchsia::modular::ContextValue context_value;
context_value.type = fuchsia::modular::ContextValueType::ENTITY;
context_value.content = value;
context_value.meta.entity = fuchsia::modular::EntityMetadata::New();
context_value.meta.entity->topic = topic;
- fidl::Clone(types, &context_value.meta.entity->type);
+ context_value.meta.entity->type = fidl::VectorPtr(types);
auto it = topic_value_ids_.find(topic);
if (it == topic_value_ids_.end()) {
@@ -169,7 +164,7 @@
void ContextWriterImpl::GetEntityTypesFromEntityReference(
const fidl::StringPtr& reference,
- std::function<void(const fidl::VectorPtr<fidl::StringPtr>&)> done) {
+ std::function<void(const std::vector<std::string>&)> done) {
auto activity =
repository_->debug()->GetIdleWaiter()->RegisterOngoingActivity();
@@ -188,7 +183,7 @@
(*entity)->GetTypes(fxl::MakeCopyable(
[this, activity, id = entities_.GetId(&entity), done = std::move(done),
fallback = std::move(fallback)](
- const fidl::VectorPtr<fidl::StringPtr>& types) mutable {
+ const std::vector<std::string>& types) mutable {
done(types);
fallback.cancel();
entities_.erase(id);
@@ -254,7 +249,7 @@
auto done_getting_types =
[weak_this = weak_factory_.GetWeakPtr(), activity, content,
metadata = std::move(metadata)](
- const fidl::VectorPtr<fidl::StringPtr>& entity_types) mutable {
+ const std::vector<std::string>& entity_types) mutable {
if (!weak_this)
return;
diff --git a/bin/context_engine/context_writer_impl.h b/bin/context_engine/context_writer_impl.h
index 4f74f4e..5ccb9dd 100644
--- a/bin/context_engine/context_writer_impl.h
+++ b/bin/context_engine/context_writer_impl.h
@@ -44,7 +44,7 @@
// Used by ContextValueWriterImpl.
void GetEntityTypesFromEntityReference(
const fidl::StringPtr& reference,
- std::function<void(const fidl::VectorPtr<fidl::StringPtr>&)> done);
+ std::function<void(const std::vector<std::string>&)> done);
private:
// |fuchsia::modular::ContextWriter|
@@ -53,7 +53,7 @@
fuchsia::modular::ContextValueType type) override;
// |fuchsia::modular::ContextWriter|
- void WriteEntityTopic(fidl::StringPtr topic, fidl::StringPtr value) override;
+ void WriteEntityTopic(std::string topic, fidl::StringPtr value) override;
fidl::Binding<fuchsia::modular::ContextWriter> binding_;
diff --git a/bin/context_engine/debug.cc b/bin/context_engine/debug.cc
index 821b5a0..8ddb375 100644
--- a/bin/context_engine/debug.cc
+++ b/bin/context_engine/debug.cc
@@ -68,8 +68,7 @@
FXL_LOG(INFO) << "Watch(): entered";
auto listener_ptr = listener.Bind();
// Build a complete state snapshot and send it to |listener|.
- auto all_values =
- fidl::VectorPtr<fuchsia::modular::ContextDebugValue>::New(0);
+ std::vector<fuchsia::modular::ContextDebugValue> all_values;
for (const auto& entry : repository_->values_) {
fuchsia::modular::ContextDebugValue update;
update.id = entry.first;
@@ -104,7 +103,7 @@
for (const auto& listener : listeners_.ptrs()) {
fidl::VectorPtr<fuchsia::modular::ContextDebugValue> values_clone;
fidl::Clone(values, &values_clone);
- (*listener)->OnValuesChanged(std::move(values_clone));
+ (*listener)->OnValuesChanged(values_clone.take());
}
}
@@ -121,7 +120,7 @@
fidl::VectorPtr<fuchsia::modular::ContextDebugSubscription>
subscriptions_clone;
fidl::Clone(subscriptions, &subscriptions_clone);
- (*listener)->OnSubscriptionsChanged(std::move(subscriptions_clone));
+ (*listener)->OnSubscriptionsChanged(subscriptions_clone.take());
}
}
diff --git a/bin/context_engine/index_unittest.cc b/bin/context_engine/index_unittest.cc
index 725d477..314ad5a 100644
--- a/bin/context_engine/index_unittest.cc
+++ b/bin/context_engine/index_unittest.cc
@@ -51,14 +51,14 @@
meta1.story->focused->state = fuchsia::modular::FocusedStateState::FOCUSED;
meta1.mod = fuchsia::modular::ModuleMetadata::New();
meta1.mod->url = "url1";
- meta1.mod->path = fidl::VectorPtr<fidl::StringPtr>::New(0);
+ meta1.mod->path = fidl::VectorPtr<std::string>::New(0);
meta1.mod->path.push_back("1");
meta1.mod->path.push_back("2");
meta1.mod->focused = fuchsia::modular::FocusedState::New();
meta1.mod->focused->state = fuchsia::modular::FocusedStateState::FOCUSED;
meta1.entity = fuchsia::modular::EntityMetadata::New();
meta1.entity->topic = "topic1";
- meta1.entity->type = fidl::VectorPtr<fidl::StringPtr>::New(0);
+ meta1.entity->type = fidl::VectorPtr<std::string>::New(0);
meta1.entity->type.push_back("type1");
meta1.entity->type.push_back("type2");
@@ -70,13 +70,13 @@
fuchsia::modular::FocusedStateState::NOT_FOCUSED;
meta2->mod = fuchsia::modular::ModuleMetadata::New();
meta2->mod->url = "url2";
- meta2->mod->path = fidl::VectorPtr<fidl::StringPtr>::New(0);
+ meta2->mod->path = fidl::VectorPtr<std::string>::New(0);
meta2->mod->path.push_back("2");
meta2->mod->focused = fuchsia::modular::FocusedState::New();
meta2->mod->focused->state = fuchsia::modular::FocusedStateState::NOT_FOCUSED;
meta2->entity = fuchsia::modular::EntityMetadata::New();
meta2->entity->topic = "topic2";
- meta2->entity->type = fidl::VectorPtr<fidl::StringPtr>::New(0);
+ meta2->entity->type = fidl::VectorPtr<std::string>::New(0);
meta2->entity->type.push_back("type3");
meta2->entity->type.push_back("type4");
meta2->entity->type.push_back("type5");
@@ -123,7 +123,7 @@
meta1.story->id = "story1";
meta1.entity = fuchsia::modular::EntityMetadata::New();
meta1.entity->topic = "topic1";
- meta1.entity->type = fidl::VectorPtr<fidl::StringPtr>::New(0);
+ meta1.entity->type = fidl::VectorPtr<std::string>::New(0);
meta1.entity->type.push_back("type1");
meta1.entity->type.push_back("type2");
diff --git a/bin/context_engine/scope_utils.cc b/bin/context_engine/scope_utils.cc
index faf7375..2338c33 100644
--- a/bin/context_engine/scope_utils.cc
+++ b/bin/context_engine/scope_utils.cc
@@ -26,8 +26,7 @@
selector->meta->story = fuchsia::modular::StoryMetadata::New();
selector->meta->story->id = scope->module_scope().story_id;
selector->meta->mod = fuchsia::modular::ModuleMetadata::New();
- fidl::VectorPtr<fidl::StringPtr> path;
- fidl::Clone(scope->module_scope().module_path, &selector->meta->mod->path);
+ selector->meta->mod->path = fidl::VectorPtr(scope->module_scope().module_path);
} else if (scope->is_agent_scope()) {
// TODO(thatguy): do.
} else if (scope->is_story_scope()) {
diff --git a/bin/ledger/app/branch_tracker.cc b/bin/ledger/app/branch_tracker.cc
index bae0f16..7695096 100644
--- a/bin/ledger/app/branch_tracker.cc
+++ b/bin/ledger/app/branch_tracker.cc
@@ -101,15 +101,15 @@
size_t timestamp = change->timestamp;
auto entries = std::move(change->changed_entries);
auto deletions = std::move(change->deleted_keys);
- for (size_t i = 0, j = 0; i < entries->size() || j < deletions->size();) {
- bool add_entry = i < entries->size() &&
- (j == deletions->size() ||
- convert::ExtendedStringView(entries->at(i).key) <
- convert::ExtendedStringView(deletions->at(j)));
+ for (size_t i = 0, j = 0; i < entries.size() || j < deletions.size();) {
+ bool add_entry = i < entries.size() &&
+ (j == deletions.size() ||
+ convert::ExtendedStringView(entries.at(i).key) <
+ convert::ExtendedStringView(deletions.at(j)));
size_t entry_size =
add_entry
- ? fidl_serialization::GetEntrySize(entries->at(i).key->size())
- : fidl_serialization::GetByteVectorSize(deletions->at(j)->size());
+ ? fidl_serialization::GetEntrySize(entries.at(i).key.size())
+ : fidl_serialization::GetByteVectorSize(deletions.at(j).size());
size_t entry_handle_count = add_entry ? 1 : 0;
if (changes.empty() ||
@@ -127,10 +127,10 @@
fidl_size += entry_size;
handle_count += entry_handle_count;
if (add_entry) {
- changes.back().changed_entries.push_back(std::move(entries->at(i)));
+ changes.back().changed_entries.push_back(std::move(entries.at(i)));
++i;
} else {
- changes.back().deleted_keys.push_back(std::move(deletions->at(j)));
+ changes.back().deleted_keys.push_back(std::move(deletions.at(j)));
++j;
}
}
diff --git a/bin/ledger/app/diff_utils.cc b/bin/ledger/app/diff_utils.cc
index 0d30367..d30e46e 100644
--- a/bin/ledger/app/diff_utils.cc
+++ b/bin/ledger/app/diff_utils.cc
@@ -152,8 +152,8 @@
callback(PageUtils::ConvertStatus(status), std::make_pair(nullptr, ""));
return;
}
- if (context->page_change->changed_entries->empty()) {
- if (context->page_change->deleted_keys->empty()) {
+ if (context->page_change->changed_entries.empty()) {
+ if (context->page_change->deleted_keys.empty()) {
callback(Status::OK, std::make_pair(nullptr, ""));
} else {
callback(Status::OK,
@@ -177,10 +177,10 @@
return;
}
FXL_DCHECK(results.size() ==
- context->page_change->changed_entries->size());
+ context->page_change->changed_entries.size());
for (size_t i = 0; i < results.size(); i++) {
FXL_DCHECK(results[i].vmo());
- context->page_change->changed_entries->at(i).value =
+ context->page_change->changed_entries.at(i).value =
fidl::MakeOptional(std::move(results[i]).ToTransport());
}
callback(Status::OK, std::make_pair(std::move(context->page_change),
@@ -197,11 +197,11 @@
const storage::Commit& left, const storage::Commit& right,
std::string prefix_key, std::string min_key, DiffType diff_type,
fit::function<void(Status,
- std::pair<fidl::VectorPtr<DiffEntry>, std::string>)>
+ std::pair<std::vector<DiffEntry>, std::string>)>
callback) {
struct Context {
// The array to be returned through the callback.
- fidl::VectorPtr<DiffEntry> changes = fidl::VectorPtr<DiffEntry>::New(0);
+ std::vector<DiffEntry> changes;
// The serialization size of all entries.
size_t fidl_size = fidl_serialization::kVectorHeaderSize;
// The number of handles.
@@ -272,12 +272,12 @@
FXL_LOG(ERROR) << "Unable to compute diff for PageChange: "
<< fidl::ToUnderlying(status);
callback(PageUtils::ConvertStatus(status),
- std::make_pair(fidl::VectorPtr<DiffEntry>::New(0), ""));
+ std::make_pair(std::vector<DiffEntry>(), ""));
return;
}
- if (context->changes->empty()) {
+ if (context->changes.empty()) {
callback(Status::OK,
- std::make_pair(fidl::VectorPtr<DiffEntry>::New(0), ""));
+ std::make_pair(std::vector<DiffEntry>(), ""));
return;
}
@@ -293,21 +293,21 @@
<< "Error while reading changed values when computing PageChange: "
<< fidl::ToUnderlying(status);
callback(status,
- std::make_pair(fidl::VectorPtr<DiffEntry>::New(0), ""));
+ std::make_pair(std::vector<DiffEntry>(), ""));
return;
}
- FXL_DCHECK(results.size() == 3 * context->changes->size());
- for (size_t i = 0; i < context->changes->size(); i++) {
+ FXL_DCHECK(results.size() == 3 * context->changes.size());
+ for (size_t i = 0; i < context->changes.size(); i++) {
if (results[3 * i]) {
- context->changes->at(i).base->value =
+ context->changes.at(i).base->value =
fidl::MakeOptional(std::move(results[3 * i]).ToTransport());
}
if (results[3 * i + 1]) {
- context->changes->at(i).left->value =
+ context->changes.at(i).left->value =
fidl::MakeOptional(std::move(results[3 * i + 1]).ToTransport());
}
if (results[3 * i + 2]) {
- context->changes->at(i).right->value =
+ context->changes.at(i).right->value =
fidl::MakeOptional(std::move(results[3 * i + 2]).ToTransport());
}
}
diff --git a/bin/ledger/app/diff_utils.h b/bin/ledger/app/diff_utils.h
index 68979b1..9101239 100644
--- a/bin/ledger/app/diff_utils.h
+++ b/bin/ledger/app/diff_utils.h
@@ -52,7 +52,7 @@
const storage::Commit& left, const storage::Commit& right,
std::string prefix_key, std::string min_key, DiffType diff_type,
fit::function<void(Status,
- std::pair<fidl::VectorPtr<DiffEntry>, std::string>)>
+ std::pair<std::vector<DiffEntry>, std::string>)>
callback);
} // namespace diff_utils
diff --git a/bin/ledger/app/fidl/serialization_size.cc b/bin/ledger/app/fidl/serialization_size.cc
index 74a6d7b..ca660a5 100644
--- a/bin/ledger/app/fidl/serialization_size.cc
+++ b/bin/ledger/app/fidl/serialization_size.cc
@@ -18,10 +18,10 @@
}
size_t GetInlinedEntrySize(const InlinedEntry& entry) {
- size_t key_size = GetByteVectorSize(entry.key->size());
+ size_t key_size = GetByteVectorSize(entry.key.size());
size_t object_size = kPointerSize;
if (entry.inlined_value) {
- object_size += GetByteVectorSize(entry.inlined_value->value->size());
+ object_size += GetByteVectorSize(entry.inlined_value->value.size());
}
return key_size + object_size + Align(kPriorityEnumSize);
}
diff --git a/bin/ledger/app/fidl/serialization_size_unittest.cc b/bin/ledger/app/fidl/serialization_size_unittest.cc
index 514b168..a8002f7 100644
--- a/bin/ledger/app/fidl/serialization_size_unittest.cc
+++ b/bin/ledger/app/fidl/serialization_size_unittest.cc
@@ -19,7 +19,7 @@
namespace ledger {
namespace fidl_serialization {
namespace {
-fidl::VectorPtr<uint8_t> GetKey(size_t index, size_t min_key_size = 0u) {
+std::vector<uint8_t> GetKey(size_t index, size_t min_key_size = 0u) {
std::string result = fxl::StringPrintf("key %04" PRIuMAX, index);
result.resize(std::max(result.size(), min_key_size));
return convert::ToArray(result);
@@ -65,37 +65,37 @@
GetInlineCallback get_inline_callback;
// PageSnapshot:
- void GetEntriesInline(fidl::VectorPtr<uint8_t> /*key_start*/,
+ void GetEntriesInline(std::vector<uint8_t> /*key_start*/,
std::unique_ptr<Token> /*token*/,
GetEntriesInlineCallback callback) override {
get_entries_inline_callback = std::move(callback);
}
- void GetEntries(fidl::VectorPtr<uint8_t> /*key_start*/,
+ void GetEntries(std::vector<uint8_t> /*key_start*/,
std::unique_ptr<Token> /*token*/,
GetEntriesCallback callback) override {
get_entries_callback = std::move(callback);
}
- void GetKeys(fidl::VectorPtr<uint8_t> /*key_start*/,
+ void GetKeys(std::vector<uint8_t> /*key_start*/,
std::unique_ptr<Token> /*token*/,
GetKeysCallback /*callback*/) override {}
- void Get(fidl::VectorPtr<uint8_t> /*key*/, GetCallback callback) override {
+ void Get(std::vector<uint8_t> /*key*/, GetCallback callback) override {
get_callback = std::move(callback);
}
- void GetInline(fidl::VectorPtr<uint8_t> /*key*/,
+ void GetInline(std::vector<uint8_t> /*key*/,
GetInlineCallback callback) override {
get_inline_callback = std::move(callback);
}
- void Fetch(fidl::VectorPtr<uint8_t> /*key*/,
+ void Fetch(std::vector<uint8_t> /*key*/,
FetchCallback /*callback*/) override {
FXL_NOTIMPLEMENTED();
}
- void FetchPartial(fidl::VectorPtr<uint8_t> /*key*/, int64_t /*offset*/,
+ void FetchPartial(std::vector<uint8_t> /*key*/, int64_t /*offset*/,
int64_t /*max_size*/,
FetchPartialCallback /*callback*/) override {
FXL_NOTIMPLEMENTED();
@@ -115,8 +115,8 @@
const size_t key_size = 125;
const size_t value_size = 125;
- fidl::VectorPtr<uint8_t> key = GetKey(0, key_size);
- fidl::VectorPtr<uint8_t> value = convert::ToArray(GetValue(0, value_size));
+ std::vector<uint8_t> key = GetKey(0, key_size);
+ std::vector<uint8_t> value = convert::ToArray(GetValue(0, value_size));
auto client_callback = [](Status /*status*/,
std::unique_ptr<InlinedValue> /*value*/) {};
@@ -154,7 +154,7 @@
const size_t key_size = 8;
const size_t value_size = 125;
- fidl::VectorPtr<uint8_t> key = GetKey(0, key_size);
+ std::vector<uint8_t> key = GetKey(0, key_size);
std::string object_data = GetValue(0, value_size);
fsl::SizedVmo vmo;
ASSERT_TRUE(fsl::VmoFromString(object_data, &vmo));
@@ -196,7 +196,7 @@
binding.Bind(std::move(writer));
auto client_callback = [](Status /*status*/,
- fidl::VectorPtr<InlinedEntry> /*entries*/,
+ std::vector<InlinedEntry> /*entries*/,
std::unique_ptr<Token> /*next_token*/) {};
// FakeSnapshot saves the callback instead of running it.
snapshot_proxy->GetEntriesInline(fidl::VectorPtr<uint8_t>::New(0), nullptr,
@@ -206,7 +206,7 @@
fidl::InterfaceHandle<PageSnapshot> handle = snapshot_proxy.Unbind();
reader = handle.TakeChannel();
- fidl::VectorPtr<InlinedEntry> entries_to_send;
+ std::vector<InlinedEntry> entries_to_send;
const size_t key_size = 125;
const size_t value_size = 125;
@@ -220,12 +220,12 @@
entry.inlined_value->value = convert::ToArray(GetValue(0, value_size));
size_t kExpectedEntrySize = GetInlinedEntrySize(entry);
for (size_t i = 0; i < n_entries; i++) {
- entries_to_send->push_back(fidl::Clone(entry));
+ entries_to_send.push_back(fidl::Clone(entry));
}
InlinedEntry empty_entry;
empty_entry.key = GetKey(0, key_size);
for (size_t i = 0; i < n_empty_entries; i++) {
- entries_to_send->push_back(fidl::Clone(empty_entry));
+ entries_to_send.push_back(fidl::Clone(empty_entry));
}
size_t kExpectedEmptyEntrySize = GetInlinedEntrySize(empty_entry);
@@ -258,7 +258,7 @@
binding.Bind(std::move(writer));
auto client_callback = [](Status /*status*/,
- fidl::VectorPtr<Entry> /*entries*/,
+ std::vector<Entry> /*entries*/,
std::unique_ptr<Token> /*next_token*/) {};
// FakeSnapshot saves the callback instead of running it.
snapshot_proxy->GetEntries(fidl::VectorPtr<uint8_t>::New(0), nullptr,
@@ -268,7 +268,7 @@
fidl::InterfaceHandle<PageSnapshot> handle = snapshot_proxy.Unbind();
reader = handle.TakeChannel();
- fidl::VectorPtr<Entry> entries_to_send;
+ std::vector<Entry> entries_to_send;
const size_t key_size = 125;
const size_t value_size = 125;
@@ -283,7 +283,7 @@
entry.value = fidl::MakeOptional(std::move(vmo).ToTransport());
entry.key = GetKey(0, key_size);
entry.priority = Priority::EAGER;
- entries_to_send->push_back(std::move(entry));
+ entries_to_send.push_back(std::move(entry));
}
// Run the callback directly.
diff --git a/bin/ledger/app/ledger_manager_unittest.cc b/bin/ledger/app/ledger_manager_unittest.cc
index ff80021..1faa3e6 100644
--- a/bin/ledger/app/ledger_manager_unittest.cc
+++ b/bin/ledger/app/ledger_manager_unittest.cc
@@ -705,9 +705,9 @@
Status status;
- fidl::VectorPtr<PageId> actual_pages_list;
+ std::vector<PageId> actual_pages_list;
- EXPECT_EQ(0u, actual_pages_list->size());
+ EXPECT_EQ(0u, actual_pages_list.size());
auto waiter = fxl::MakeRefCounted<callback::StatusWaiter<Status>>(Status::OK);
for (size_t i = 0; i < pages.size(); ++i) {
@@ -727,13 +727,13 @@
RunLoopUntilIdle();
EXPECT_TRUE(called);
- EXPECT_EQ(pages.size(), actual_pages_list->size());
+ EXPECT_EQ(pages.size(), actual_pages_list.size());
std::sort(ids.begin(), ids.end(), [](const PageId& lhs, const PageId& rhs) {
return convert::ToStringView(lhs.id) < convert::ToStringView(rhs.id);
});
for (size_t i = 0; i < ids.size(); i++)
- EXPECT_EQ(ids[i].id, actual_pages_list->at(i).id);
+ EXPECT_EQ(ids[i].id, actual_pages_list.at(i).id);
}
TEST_F(LedgerManagerTest, OnPageOpenedClosedCalls) {
diff --git a/bin/ledger/app/ledger_repository_factory_impl.cc b/bin/ledger/app/ledger_repository_factory_impl.cc
index 62554f1..4e4c11c 100644
--- a/bin/ledger/app/ledger_repository_factory_impl.cc
+++ b/bin/ledger/app/ledger_repository_factory_impl.cc
@@ -255,7 +255,7 @@
void LedgerRepositoryFactoryImpl::GetRepository(
zx::channel repository_handle,
fidl::InterfaceHandle<cloud_provider::CloudProvider> cloud_provider,
- fidl::StringPtr user_id,
+ std::string user_id,
fidl::InterfaceRequest<ledger_internal::LedgerRepository>
repository_request,
fit::function<void(Status)> callback) {
@@ -265,7 +265,7 @@
callback(Status::IO_ERROR);
return;
}
- GetRepositoryByFD(std::move(root_fd), std::move(cloud_provider), *user_id,
+ GetRepositoryByFD(std::move(root_fd), std::move(cloud_provider), user_id,
std::move(repository_request), std::move(callback));
}
diff --git a/bin/ledger/app/ledger_repository_factory_impl.h b/bin/ledger/app/ledger_repository_factory_impl.h
index 86569ff..631d50e 100644
--- a/bin/ledger/app/ledger_repository_factory_impl.h
+++ b/bin/ledger/app/ledger_repository_factory_impl.h
@@ -49,7 +49,7 @@
void GetRepository(
zx::channel repository_handle,
fidl::InterfaceHandle<cloud_provider::CloudProvider> cloud_provider,
- fidl::StringPtr user_id,
+ std::string user_id,
fidl::InterfaceRequest<ledger_internal::LedgerRepository>
repository_request,
fit::function<void(Status)> callback) override;
diff --git a/bin/ledger/app/ledger_repository_factory_impl_unittest.cc b/bin/ledger/app/ledger_repository_factory_impl_unittest.cc
index 87ce204..af543c6 100644
--- a/bin/ledger/app/ledger_repository_factory_impl_unittest.cc
+++ b/bin/ledger/app/ledger_repository_factory_impl_unittest.cc
@@ -57,17 +57,17 @@
ledger_internal::LedgerRepositoryPtr* ledger_repository_ptr);
::testing::AssertionResult ReadTopLevelData(fuchsia::inspect::Object* object);
::testing::AssertionResult ListTopLevelChildren(
- fidl::VectorPtr<fidl::StringPtr>* children);
+ std::vector<std::string>* children);
::testing::AssertionResult OpenTopLevelRepositoriesChild(
fuchsia::inspect::InspectPtr* repositories_inspect_ptr);
::testing::AssertionResult ReadData(fuchsia::inspect::InspectPtr* inspect_ptr,
fuchsia::inspect::Object* object);
::testing::AssertionResult ListChildren(
fuchsia::inspect::InspectPtr* inspect_ptr,
- fidl::VectorPtr<fidl::StringPtr>* children_names);
+ std::vector<std::string>* children_names);
::testing::AssertionResult OpenChild(
fuchsia::inspect::InspectPtr* parent_inspect_ptr,
- fidl::StringPtr child_name,
+ std::string child_name,
fuchsia::inspect::InspectPtr* child_inspect_ptr);
scoped_tmpfs::ScopedTmpFS tmpfs_;
@@ -132,7 +132,7 @@
::testing::AssertionResult
LedgerRepositoryFactoryImplTest::ListTopLevelChildren(
- fidl::VectorPtr<fidl::StringPtr>* children) {
+ std::vector<std::string>* children) {
bool callback_called;
object_dir_.object()->ListChildren(
@@ -187,7 +187,7 @@
::testing::AssertionResult LedgerRepositoryFactoryImplTest::ListChildren(
fuchsia::inspect::InspectPtr* inspect_ptr,
- fidl::VectorPtr<fidl::StringPtr>* children_names) {
+ std::vector<std::string>* children_names) {
bool callback_called;
(*inspect_ptr)
@@ -203,7 +203,7 @@
::testing::AssertionResult LedgerRepositoryFactoryImplTest::OpenChild(
fuchsia::inspect::InspectPtr* parent_inspect_ptr,
- fidl::StringPtr child_name,
+ std::string child_name,
fuchsia::inspect::InspectPtr* child_inspect_ptr) {
bool callback_called;
bool success = false;
@@ -225,15 +225,15 @@
TEST_F(LedgerRepositoryFactoryImplTest, InspectAPINoRepositories) {
fuchsia::inspect::Object object;
- fidl::VectorPtr<fidl::StringPtr> children;
+ std::vector<std::string> children;
ASSERT_TRUE(ReadTopLevelData(&object));
ASSERT_TRUE(ListTopLevelChildren(&children));
- EXPECT_EQ(kObjectsName, *object.name);
+ EXPECT_EQ(kObjectsName, object.name);
EXPECT_THAT(*object.properties, IsEmpty());
EXPECT_THAT(*object.metrics, IsEmpty());
- EXPECT_THAT(*children, ElementsAre(kRepositoriesInspectPathComponent));
+ EXPECT_THAT(children, ElementsAre(kRepositoriesInspectPathComponent));
}
TEST_F(LedgerRepositoryFactoryImplTest,
@@ -264,7 +264,7 @@
// Temporary objects populated and cleared throughout the test.
fuchsia::inspect::Object object;
- fidl::VectorPtr<fidl::StringPtr> children_names;
+ std::vector<std::string> children_names;
// Create the directories for the repositories.
ASSERT_TRUE(CreateDirectory(first_directory));
@@ -275,16 +275,16 @@
// it is listed) and that it was requested once.
ASSERT_TRUE(CallGetRepository(first_directory, &first_ledger_repository_ptr));
ASSERT_TRUE(ListTopLevelChildren(&children_names));
- EXPECT_THAT(*children_names, ElementsAre(kRepositoriesInspectPathComponent));
+ EXPECT_THAT(children_names, ElementsAre(kRepositoriesInspectPathComponent));
ASSERT_TRUE(OpenTopLevelRepositoriesChild(&repositories_inspect_ptr));
ASSERT_TRUE(ListChildren(&repositories_inspect_ptr, &children_names));
- EXPECT_THAT(*children_names, SizeIs(1));
- first_repository_name = children_names->at(0);
+ EXPECT_THAT(children_names, SizeIs(1));
+ first_repository_name = children_names.at(0);
EXPECT_THAT(*first_repository_name, Not(IsEmpty()));
ASSERT_TRUE(OpenChild(&repositories_inspect_ptr, first_repository_name,
&first_repository_inspect_ptr));
ASSERT_TRUE(ReadData(&first_repository_inspect_ptr, &object));
- EXPECT_EQ(first_repository_name, *object.name);
+ EXPECT_EQ(first_repository_name, object.name);
ExpectRequestsMetric(&object, 1UL);
// Request a second repository, then query the "repositories" Inspect object
@@ -294,16 +294,16 @@
ASSERT_TRUE(
CallGetRepository(second_directory, &second_ledger_repository_ptr));
ASSERT_TRUE(ListTopLevelChildren(&children_names));
- EXPECT_THAT(*children_names, ElementsAre(kRepositoriesInspectPathComponent));
+ EXPECT_THAT(children_names, ElementsAre(kRepositoriesInspectPathComponent));
ASSERT_TRUE(OpenTopLevelRepositoriesChild(&repositories_inspect_ptr));
ASSERT_TRUE(ListChildren(&repositories_inspect_ptr, &children_names));
- EXPECT_THAT(*children_names, SizeIs(2));
+ EXPECT_THAT(children_names, SizeIs(2));
second_repository_name =
- *find_if_not(children_names->begin(), children_names->end(),
+ *find_if_not(children_names.begin(), children_names.end(),
[&first_repository_name](const auto& name) {
return name == first_repository_name;
});
- EXPECT_THAT(*children_names, UnorderedElementsAre(first_repository_name,
+ EXPECT_THAT(children_names, UnorderedElementsAre(first_repository_name,
second_repository_name));
EXPECT_THAT(*second_repository_name, Not(IsEmpty()));
ASSERT_TRUE(OpenChild(&repositories_inspect_ptr, first_repository_name,
@@ -311,10 +311,10 @@
ASSERT_TRUE(OpenChild(&repositories_inspect_ptr, second_repository_name,
&second_repository_inspect_ptr));
ASSERT_TRUE(ReadData(&first_repository_inspect_ptr, &object));
- EXPECT_EQ(first_repository_name, *object.name);
+ EXPECT_EQ(first_repository_name, object.name);
ExpectRequestsMetric(&object, 1UL);
ASSERT_TRUE(ReadData(&second_repository_inspect_ptr, &object));
- EXPECT_EQ(second_repository_name, *object.name);
+ EXPECT_EQ(second_repository_name, object.name);
ExpectRequestsMetric(&object, 1UL);
// Request the first repository a second time, then query the "repositories"
@@ -324,20 +324,20 @@
ASSERT_TRUE(
CallGetRepository(first_directory, &first_again_ledger_repository_ptr));
ASSERT_TRUE(ListTopLevelChildren(&children_names));
- EXPECT_THAT(*children_names, ElementsAre(kRepositoriesInspectPathComponent));
+ EXPECT_THAT(children_names, ElementsAre(kRepositoriesInspectPathComponent));
ASSERT_TRUE(OpenTopLevelRepositoriesChild(&repositories_inspect_ptr));
ASSERT_TRUE(ListChildren(&repositories_inspect_ptr, &children_names));
- EXPECT_THAT(*children_names, UnorderedElementsAre(first_repository_name,
+ EXPECT_THAT(children_names, UnorderedElementsAre(first_repository_name,
second_repository_name));
ASSERT_TRUE(OpenChild(&repositories_inspect_ptr, first_repository_name,
&first_repository_inspect_ptr));
ASSERT_TRUE(OpenChild(&repositories_inspect_ptr, second_repository_name,
&second_repository_inspect_ptr));
ASSERT_TRUE(ReadData(&first_repository_inspect_ptr, &object));
- EXPECT_EQ(first_repository_name, *object.name);
+ EXPECT_EQ(first_repository_name, object.name);
ExpectRequestsMetric(&object, 2UL);
ASSERT_TRUE(ReadData(&second_repository_inspect_ptr, &object));
- EXPECT_EQ(second_repository_name, *object.name);
+ EXPECT_EQ(second_repository_name, object.name);
ExpectRequestsMetric(&object, 1UL);
}
diff --git a/bin/ledger/app/ledger_repository_impl.cc b/bin/ledger/app/ledger_repository_impl.cc
index a0ccbeb..3c95ba9 100644
--- a/bin/ledger/app/ledger_repository_impl.cc
+++ b/bin/ledger/app/ledger_repository_impl.cc
@@ -156,11 +156,11 @@
}
void LedgerRepositoryImpl::GetLedger(
- fidl::VectorPtr<uint8_t> ledger_name,
+ std::vector<uint8_t> ledger_name,
fidl::InterfaceRequest<Ledger> ledger_request,
fit::function<void(Status)> callback) {
TRACE_DURATION("ledger", "repository_get_ledger");
- if (ledger_name->empty()) {
+ if (ledger_name.empty()) {
callback(Status::INVALID_ARGUMENT);
return;
}
@@ -229,8 +229,7 @@
}
void LedgerRepositoryImpl::GetInstancesList(GetInstancesListCallback callback) {
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>> result =
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>>::New(0);
+ std::vector<std::vector<uint8_t>> result;
for (const auto& key_value : ledger_managers_) {
result.push_back(convert::ToArray(key_value.first));
}
@@ -238,7 +237,7 @@
}
void LedgerRepositoryImpl::GetLedgerDebug(
- fidl::VectorPtr<uint8_t> ledger_name,
+ std::vector<uint8_t> ledger_name,
fidl::InterfaceRequest<ledger_internal::LedgerDebug> request,
GetLedgerDebugCallback callback) {
auto it = ledger_managers_.find(ledger_name);
diff --git a/bin/ledger/app/ledger_repository_impl.h b/bin/ledger/app/ledger_repository_impl.h
index 5e9ef79..9ead887 100644
--- a/bin/ledger/app/ledger_repository_impl.h
+++ b/bin/ledger/app/ledger_repository_impl.h
@@ -74,7 +74,7 @@
fit::function<void(Status)> callback) override;
// LedgerRepository:
- void GetLedger(fidl::VectorPtr<uint8_t> ledger_name,
+ void GetLedger(std::vector<uint8_t> ledger_name,
fidl::InterfaceRequest<Ledger> ledger_request,
fit::function<void(Status)> callback) override;
void Duplicate(
@@ -101,7 +101,7 @@
void GetInstancesList(GetInstancesListCallback callback) override;
void GetLedgerDebug(
- fidl::VectorPtr<uint8_t> ledger_name,
+ std::vector<uint8_t> ledger_name,
fidl::InterfaceRequest<ledger_internal::LedgerDebug> request,
GetLedgerDebugCallback callback) override;
diff --git a/bin/ledger/app/merging/conflict_resolver_client.cc b/bin/ledger/app/merging/conflict_resolver_client.cc
index 469f5a7..e38690d 100644
--- a/bin/ledger/app/merging/conflict_resolver_client.cc
+++ b/bin/ledger/app/merging/conflict_resolver_client.cc
@@ -165,7 +165,7 @@
void ConflictResolverClient::GetFullDiffNew(
std::unique_ptr<Token> token,
- fit::function<void(Status, IterationStatus, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, IterationStatus, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) {
GetDiff(diff_utils::DiffType::FULL, std::move(token), std::move(callback));
@@ -173,14 +173,14 @@
void ConflictResolverClient::GetFullDiff(
std::unique_ptr<Token> token,
- fit::function<void(Status, Status, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, Status, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) {
GetFullDiffNew(
std::move(token),
[callback = std::move(callback)](
Status status, IterationStatus diff_status,
- fidl::VectorPtr<DiffEntry> entries, std::unique_ptr<Token> token) {
+ std::vector<DiffEntry> entries, std::unique_ptr<Token> token) {
if (status != Status::OK && status != Status::PARTIAL_RESULT) {
callback(status, status, std::move(entries), std::move(token));
return;
@@ -194,7 +194,7 @@
void ConflictResolverClient::GetConflictingDiffNew(
std::unique_ptr<Token> token,
- fit::function<void(Status, IterationStatus, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, IterationStatus, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) {
GetDiff(diff_utils::DiffType::CONFLICTING, std::move(token),
@@ -203,14 +203,14 @@
void ConflictResolverClient::GetConflictingDiff(
std::unique_ptr<Token> token,
- fit::function<void(Status, Status, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, Status, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) {
GetConflictingDiffNew(
std::move(token),
[callback = std::move(callback)](
Status status, IterationStatus diff_status,
- fidl::VectorPtr<DiffEntry> entries, std::unique_ptr<Token> token) {
+ std::vector<DiffEntry> entries, std::unique_ptr<Token> token) {
if (status != Status::OK && status != Status::PARTIAL_RESULT) {
callback(status, status, std::move(entries), std::move(token));
return;
@@ -224,7 +224,7 @@
void ConflictResolverClient::GetDiff(
diff_utils::DiffType type, std::unique_ptr<Token> token,
- fit::function<void(Status, IterationStatus, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, IterationStatus, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) {
diff_utils::ComputeThreeWayDiff(
@@ -234,10 +234,10 @@
weak_factory_.GetWeakPtr(),
[this, callback = std::move(callback)](
Status status,
- std::pair<fidl::VectorPtr<DiffEntry>, std::string> page_change) {
+ std::pair<std::vector<DiffEntry>, std::string> page_change) {
if (cancelled_) {
callback(Status::INTERNAL_ERROR, IterationStatus::OK,
- fidl::VectorPtr<DiffEntry>::New(0), nullptr);
+ {}, nullptr);
Finalize(Status::INTERNAL_ERROR);
return;
}
@@ -245,7 +245,7 @@
FXL_LOG(ERROR) << "Unable to compute diff due to error "
<< fidl::ToUnderlying(status) << ", aborting.";
callback(status, IterationStatus::OK,
- fidl::VectorPtr<DiffEntry>::New(0), nullptr);
+ {}, nullptr);
Finalize(status);
return;
}
@@ -265,7 +265,7 @@
}
void ConflictResolverClient::MergeNew(
- fidl::VectorPtr<MergedValue> merged_values,
+ std::vector<MergedValue> merged_values,
fit::function<void(Status)> callback) {
has_merged_values_ = true;
operation_serializer_.Serialize<Status>(
@@ -278,7 +278,7 @@
auto waiter = fxl::MakeRefCounted<
callback::Waiter<storage::Status, storage::ObjectIdentifier>>(
storage::Status::OK);
- for (const MergedValue& merged_value : *merged_values) {
+ for (const MergedValue& merged_value : merged_values) {
OnNextMergeResult(merged_value, waiter);
}
waiter->Finalize([this, weak_this,
@@ -299,8 +299,8 @@
if (!object_identifiers[i].object_digest().IsValid()) {
continue;
}
- journal_->Put(merged_values->at(i).key, object_identifiers[i],
- merged_values->at(i).priority == Priority::EAGER
+ journal_->Put(merged_values.at(i).key, object_identifiers[i],
+ merged_values.at(i).priority == Priority::EAGER
? storage::KeyPriority::EAGER
: storage::KeyPriority::LAZY,
waiter->NewCallback());
@@ -314,7 +314,7 @@
}
void ConflictResolverClient::Merge(
- fidl::VectorPtr<MergedValue> merged_values,
+ std::vector<MergedValue> merged_values,
fit::function<void(Status, Status)> callback) {
MergeNew(std::move(merged_values),
[callback = std::move(callback)](Status status) {
diff --git a/bin/ledger/app/merging/conflict_resolver_client.h b/bin/ledger/app/merging/conflict_resolver_client.h
index 626600a..b576866 100644
--- a/bin/ledger/app/merging/conflict_resolver_client.h
+++ b/bin/ledger/app/merging/conflict_resolver_client.h
@@ -55,34 +55,34 @@
// |IterationStatus|.
void GetDiff(
diff_utils::DiffType type, std::unique_ptr<Token> token,
- fit::function<void(Status, IterationStatus, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, IterationStatus, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback);
// MergeResultProviderNotifierDelegate:
void GetFullDiff(
std::unique_ptr<Token> token,
- fit::function<void(Status, Status, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, Status, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) override;
void GetFullDiffNew(
std::unique_ptr<Token> token,
- fit::function<void(Status, IterationStatus, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, IterationStatus, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) override;
void GetConflictingDiff(
std::unique_ptr<Token> token,
- fit::function<void(Status, Status, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, Status, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) override;
void GetConflictingDiffNew(
std::unique_ptr<Token> token,
- fit::function<void(Status, IterationStatus, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(Status, IterationStatus, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) override;
- void Merge(fidl::VectorPtr<MergedValue> merged_values,
+ void Merge(std::vector<MergedValue> merged_values,
fit::function<void(Status, Status)> callback) override;
- void MergeNew(fidl::VectorPtr<MergedValue> merged_values,
+ void MergeNew(std::vector<MergedValue> merged_values,
fit::function<void(Status)> callback) override;
void MergeNonConflictingEntries(
fit::function<void(Status, Status)> callback) override;
diff --git a/bin/ledger/app/merging/conflict_resolver_client_unittest.cc b/bin/ledger/app/merging/conflict_resolver_client_unittest.cc
index 49f7d6e..4924571 100644
--- a/bin/ledger/app/merging/conflict_resolver_client_unittest.cc
+++ b/bin/ledger/app/merging/conflict_resolver_client_unittest.cc
@@ -174,8 +174,7 @@
EXPECT_EQ(1u, conflict_resolver_impl.requests.size());
// Create a bogus conflict resolution.
- fidl::VectorPtr<MergedValue> merged_values =
- fidl::VectorPtr<MergedValue>::New(0);
+ std::vector<MergedValue> merged_values;
{
MergedValue merged_value;
merged_value.key = convert::ToArray("unknown_key");
@@ -286,8 +285,7 @@
EXPECT_FALSE(merge_resolver_->IsEmpty());
EXPECT_EQ(1u, conflict_resolver_impl.requests.size());
- fidl::VectorPtr<MergedValue> merged_values =
- fidl::VectorPtr<MergedValue>::New(0);
+ std::vector<MergedValue> merged_values;
{
MergedValue merged_value;
merged_value.key = convert::ToArray("key1");
diff --git a/bin/ledger/app/page_delaying_facade.cc b/bin/ledger/app/page_delaying_facade.cc
index 0d810ae..4ce0b4c 100644
--- a/bin/ledger/app/page_delaying_facade.cc
+++ b/bin/ledger/app/page_delaying_facade.cc
@@ -33,7 +33,7 @@
void PageDelayingFacade::GetSnapshot(
fidl::InterfaceRequest<PageSnapshot> snapshot_request,
- fidl::VectorPtr<uint8_t> key_prefix,
+ std::vector<uint8_t> key_prefix,
fidl::InterfaceHandle<PageWatcher> watcher,
Page::GetSnapshotCallback callback) {
delaying_facade_.EnqueueCall(
@@ -41,21 +41,21 @@
std::move(key_prefix), std::move(watcher), std::move(callback));
}
-void PageDelayingFacade::Put(fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value,
+void PageDelayingFacade::Put(std::vector<uint8_t> key,
+ std::vector<uint8_t> value,
Page::PutCallback callback) {
delaying_facade_.EnqueueCall(&PageDelegate::Put, std::move(key),
std::move(value), std::move(callback));
}
void PageDelayingFacade::PutWithPriority(
- fidl::VectorPtr<uint8_t> key, fidl::VectorPtr<uint8_t> value,
+ std::vector<uint8_t> key, std::vector<uint8_t> value,
Priority priority, Page::PutWithPriorityCallback callback) {
delaying_facade_.EnqueueCall(&PageDelegate::PutWithPriority, std::move(key),
std::move(value), priority, std::move(callback));
}
-void PageDelayingFacade::PutReference(fidl::VectorPtr<uint8_t> key,
+void PageDelayingFacade::PutReference(std::vector<uint8_t> key,
Reference reference, Priority priority,
Page::PutReferenceCallback callback) {
delaying_facade_.EnqueueCall(&PageDelegate::PutReference, std::move(key),
@@ -63,7 +63,7 @@
std::move(callback));
}
-void PageDelayingFacade::Delete(fidl::VectorPtr<uint8_t> key,
+void PageDelayingFacade::Delete(std::vector<uint8_t> key,
Page::DeleteCallback callback) {
delaying_facade_.EnqueueCall(&PageDelegate::Delete, std::move(key),
std::move(callback));
diff --git a/bin/ledger/app/page_delaying_facade.h b/bin/ledger/app/page_delaying_facade.h
index 53895e8..424ad89 100644
--- a/bin/ledger/app/page_delaying_facade.h
+++ b/bin/ledger/app/page_delaying_facade.h
@@ -41,17 +41,17 @@
void GetId(Page::GetIdCallback callback);
void GetSnapshot(fidl::InterfaceRequest<PageSnapshot> snapshot_request,
- fidl::VectorPtr<uint8_t> key_prefix,
+ std::vector<uint8_t> key_prefix,
fidl::InterfaceHandle<PageWatcher> watcher,
Page::GetSnapshotCallback callback);
- void Put(fidl::VectorPtr<uint8_t> key, fidl::VectorPtr<uint8_t> value,
+ void Put(std::vector<uint8_t> key, std::vector<uint8_t> value,
Page::PutCallback callback);
- void PutWithPriority(fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value, Priority priority,
+ void PutWithPriority(std::vector<uint8_t> key,
+ std::vector<uint8_t> value, Priority priority,
Page::PutWithPriorityCallback callback);
- void PutReference(fidl::VectorPtr<uint8_t> key, Reference reference,
+ void PutReference(std::vector<uint8_t> key, Reference reference,
Priority priority, Page::PutReferenceCallback callback);
- void Delete(fidl::VectorPtr<uint8_t> key, Page::DeleteCallback callback);
+ void Delete(std::vector<uint8_t> key, Page::DeleteCallback callback);
void Clear(Page::ClearCallback callback);
void CreateReference(std::unique_ptr<storage::DataSource> data,
fit::function<void(Status, ReferencePtr)> callback);
diff --git a/bin/ledger/app/page_delegate.cc b/bin/ledger/app/page_delegate.cc
index 3e87eb8..b42771b 100644
--- a/bin/ledger/app/page_delegate.cc
+++ b/bin/ledger/app/page_delegate.cc
@@ -64,7 +64,7 @@
void PageDelegate::GetSnapshot(
fidl::InterfaceRequest<PageSnapshot> snapshot_request,
- fidl::VectorPtr<uint8_t> key_prefix,
+ std::vector<uint8_t> key_prefix,
fidl::InterfaceHandle<PageWatcher> watcher,
Page::GetSnapshotCallback callback) {
// TODO(qsr): Update this so that only |GetCurrentCommitId| is done in a the
@@ -101,18 +101,18 @@
});
}
-void PageDelegate::Put(fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value,
+void PageDelegate::Put(std::vector<uint8_t> key,
+ std::vector<uint8_t> value,
Page::PutCallback callback) {
PutWithPriority(std::move(key), std::move(value), Priority::EAGER,
std::move(callback));
}
-void PageDelegate::PutWithPriority(fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value,
+void PageDelegate::PutWithPriority(std::vector<uint8_t> key,
+ std::vector<uint8_t> value,
Priority priority,
Page::PutWithPriorityCallback callback) {
- FXL_DCHECK(key->size() <= kMaxKeySize);
+ FXL_DCHECK(key.size() <= kMaxKeySize);
auto promise = fxl::MakeRefCounted<
callback::Promise<storage::Status, storage::ObjectIdentifier>>(
storage::Status::ILLEGAL_STATE);
@@ -144,10 +144,10 @@
});
}
-void PageDelegate::PutReference(fidl::VectorPtr<uint8_t> key,
+void PageDelegate::PutReference(std::vector<uint8_t> key,
Reference reference, Priority priority,
Page::PutReferenceCallback callback) {
- FXL_DCHECK(key->size() <= kMaxKeySize);
+ FXL_DCHECK(key.size() <= kMaxKeySize);
// |ResolveReference| also makes sure that the reference was created for this
// page.
storage::ObjectIdentifier object_identifier;
@@ -170,7 +170,7 @@
});
}
-void PageDelegate::Delete(fidl::VectorPtr<uint8_t> key,
+void PageDelegate::Delete(std::vector<uint8_t> key,
Page::DeleteCallback callback) {
operation_serializer_.Serialize<Status>(
std::move(callback),
@@ -318,7 +318,7 @@
return journal_parent_commit_;
}
-void PageDelegate::PutInCommit(fidl::VectorPtr<uint8_t> key,
+void PageDelegate::PutInCommit(std::vector<uint8_t> key,
storage::ObjectIdentifier object_identifier,
storage::KeyPriority priority,
fit::function<void(Status)> callback) {
diff --git a/bin/ledger/app/page_delegate.h b/bin/ledger/app/page_delegate.h
index 3eb260f..6520708 100644
--- a/bin/ledger/app/page_delegate.h
+++ b/bin/ledger/app/page_delegate.h
@@ -53,21 +53,21 @@
// From Page interface, called by PageDelayingFacade:
void GetSnapshot(fidl::InterfaceRequest<PageSnapshot> snapshot_request,
- fidl::VectorPtr<uint8_t> key_prefix,
+ std::vector<uint8_t> key_prefix,
fidl::InterfaceHandle<PageWatcher> watcher,
Page::GetSnapshotCallback callback);
- void Put(fidl::VectorPtr<uint8_t> key, fidl::VectorPtr<uint8_t> value,
+ void Put(std::vector<uint8_t> key, std::vector<uint8_t> value,
Page::PutCallback callback);
- void PutWithPriority(fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value, Priority priority,
+ void PutWithPriority(std::vector<uint8_t> key,
+ std::vector<uint8_t> value, Priority priority,
Page::PutWithPriorityCallback callback);
- void PutReference(fidl::VectorPtr<uint8_t> key, Reference reference,
+ void PutReference(std::vector<uint8_t> key, Reference reference,
Priority priority, Page::PutReferenceCallback callback);
- void Delete(fidl::VectorPtr<uint8_t> key, Page::DeleteCallback callback);
+ void Delete(std::vector<uint8_t> key, Page::DeleteCallback callback);
void Clear(Page::ClearCallback callback);
@@ -91,7 +91,7 @@
const storage::CommitId& GetCurrentCommitId();
- void PutInCommit(fidl::VectorPtr<uint8_t> key,
+ void PutInCommit(std::vector<uint8_t> key,
storage::ObjectIdentifier object_identifier,
storage::KeyPriority priority, StatusCallback callback);
diff --git a/bin/ledger/app/page_impl.cc b/bin/ledger/app/page_impl.cc
index fdce22c..32946f3 100644
--- a/bin/ledger/app/page_impl.cc
+++ b/bin/ledger/app/page_impl.cc
@@ -25,7 +25,7 @@
void PageImpl::GetSnapshot(
fidl::InterfaceRequest<PageSnapshot> snapshot_request,
- fidl::VectorPtr<uint8_t> key_prefix,
+ std::vector<uint8_t> key_prefix,
fidl::InterfaceHandle<PageWatcher> watcher, GetSnapshotCallback callback) {
auto timed_callback =
TRACE_CALLBACK(std::move(callback), "ledger", "page_get_snapshot");
@@ -34,14 +34,14 @@
std::move(timed_callback));
}
-void PageImpl::Put(fidl::VectorPtr<uint8_t> key, fidl::VectorPtr<uint8_t> value,
+void PageImpl::Put(std::vector<uint8_t> key, std::vector<uint8_t> value,
PutCallback callback) {
PutWithPriority(std::move(key), std::move(value), Priority::EAGER,
std::move(callback));
}
-void PageImpl::PutWithPriority(fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value,
+void PageImpl::PutWithPriority(std::vector<uint8_t> key,
+ std::vector<uint8_t> value,
Priority priority,
PutWithPriorityCallback callback) {
auto timed_callback =
@@ -50,7 +50,7 @@
std::move(timed_callback));
}
-void PageImpl::PutReference(fidl::VectorPtr<uint8_t> key, Reference reference,
+void PageImpl::PutReference(std::vector<uint8_t> key, Reference reference,
Priority priority, PutReferenceCallback callback) {
auto timed_callback =
TRACE_CALLBACK(std::move(callback), "ledger", "page_put_reference");
@@ -58,7 +58,7 @@
std::move(timed_callback));
}
-void PageImpl::Delete(fidl::VectorPtr<uint8_t> key, DeleteCallback callback) {
+void PageImpl::Delete(std::vector<uint8_t> key, DeleteCallback callback) {
auto timed_callback =
TRACE_CALLBACK(std::move(callback), "ledger", "page_delete");
delaying_facade_->Delete(std::move(key), std::move(timed_callback));
diff --git a/bin/ledger/app/page_impl.h b/bin/ledger/app/page_impl.h
index 87339c2..2c2c748 100644
--- a/bin/ledger/app/page_impl.h
+++ b/bin/ledger/app/page_impl.h
@@ -23,21 +23,21 @@
void GetId(GetIdCallback callback) override;
void GetSnapshot(fidl::InterfaceRequest<PageSnapshot> snapshot_request,
- fidl::VectorPtr<uint8_t> key_prefix,
+ std::vector<uint8_t> key_prefix,
fidl::InterfaceHandle<PageWatcher> watcher,
GetSnapshotCallback callback) override;
- void Put(fidl::VectorPtr<uint8_t> key, fidl::VectorPtr<uint8_t> value,
+ void Put(std::vector<uint8_t> key, std::vector<uint8_t> value,
PutCallback callback) override;
- void PutWithPriority(fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value, Priority priority,
+ void PutWithPriority(std::vector<uint8_t> key,
+ std::vector<uint8_t> value, Priority priority,
PutWithPriorityCallback callback) override;
- void PutReference(fidl::VectorPtr<uint8_t> key, Reference reference,
+ void PutReference(std::vector<uint8_t> key, Reference reference,
Priority priority, PutReferenceCallback callback) override;
- void Delete(fidl::VectorPtr<uint8_t> key, DeleteCallback callback) override;
+ void Delete(std::vector<uint8_t> key, DeleteCallback callback) override;
void Clear(ClearCallback callback) override;
diff --git a/bin/ledger/app/page_impl_unittest.cc b/bin/ledger/app/page_impl_unittest.cc
index f69f8da..bf0e35b 100644
--- a/bin/ledger/app/page_impl_unittest.cc
+++ b/bin/ledger/app/page_impl_unittest.cc
@@ -175,7 +175,7 @@
}
PageSnapshotPtr GetSnapshot(
- fidl::VectorPtr<uint8_t> prefix = fidl::VectorPtr<uint8_t>::New(0)) {
+ std::vector<uint8_t> prefix = std::vector<uint8_t>()) {
bool called;
Status status;
PageSnapshotPtr snapshot;
@@ -794,24 +794,24 @@
PageSnapshotPtr snapshot = GetSnapshot();
- fidl::VectorPtr<Entry> actual_entries;
+ std::vector<Entry> actual_entries;
std::unique_ptr<Token> next_token;
snapshot->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries, &next_token));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(next_token);
- ASSERT_EQ(2u, actual_entries->size());
- EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries->at(0).key));
- EXPECT_EQ(eager_value, ToString(actual_entries->at(0).value));
- EXPECT_EQ(Priority::EAGER, actual_entries->at(0).priority);
+ ASSERT_EQ(2u, actual_entries.size());
+ EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries.at(0).key));
+ EXPECT_EQ(eager_value, ToString(actual_entries.at(0).value));
+ EXPECT_EQ(Priority::EAGER, actual_entries.at(0).priority);
- EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries->at(1).key));
- EXPECT_EQ(lazy_value, ToString(actual_entries->at(1).value));
- EXPECT_EQ(Priority::LAZY, actual_entries->at(1).priority);
+ EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries.at(1).key));
+ EXPECT_EQ(lazy_value, ToString(actual_entries.at(1).value));
+ EXPECT_EQ(Priority::LAZY, actual_entries.at(1).priority);
}
TEST_F(PageImplTest, PutGetSnapshotGetEntriesInline) {
@@ -839,7 +839,7 @@
PageSnapshotPtr snapshot = GetSnapshot();
std::unique_ptr<Token> next_token;
- fidl::VectorPtr<InlinedEntry> actual_entries;
+ std::vector<InlinedEntry> actual_entries;
snapshot->GetEntriesInline(
fidl::VectorPtr<uint8_t>::New(0), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
@@ -849,18 +849,18 @@
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(next_token);
- ASSERT_EQ(2u, actual_entries->size());
- EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries->at(0).key));
- EXPECT_TRUE(actual_entries->at(0).inlined_value);
+ ASSERT_EQ(2u, actual_entries.size());
+ EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries.at(0).key));
+ EXPECT_TRUE(actual_entries.at(0).inlined_value);
EXPECT_EQ(eager_value,
- convert::ToString(actual_entries->at(0).inlined_value->value));
- EXPECT_EQ(Priority::EAGER, actual_entries->at(0).priority);
+ convert::ToString(actual_entries.at(0).inlined_value->value));
+ EXPECT_EQ(Priority::EAGER, actual_entries.at(0).priority);
- EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries->at(1).key));
- EXPECT_TRUE(actual_entries->at(1).inlined_value);
+ EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries.at(1).key));
+ EXPECT_TRUE(actual_entries.at(1).inlined_value);
EXPECT_EQ(lazy_value,
- convert::ToString(actual_entries->at(1).inlined_value->value));
- EXPECT_EQ(Priority::LAZY, actual_entries->at(1).priority);
+ convert::ToString(actual_entries.at(1).inlined_value->value));
+ EXPECT_EQ(Priority::LAZY, actual_entries.at(1).priority);
}
TEST_F(PageImplTest, PutGetSnapshotGetEntriesWithTokenForSize) {
@@ -881,10 +881,10 @@
// Call GetEntries and find a partial result.
bool called;
Status status;
- fidl::VectorPtr<Entry> actual_entries;
+ std::vector<Entry> actual_entries;
std::unique_ptr<Token> actual_next_token;
snapshot->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries, &actual_next_token));
DrainLoop();
@@ -893,9 +893,9 @@
EXPECT_TRUE(actual_next_token);
// Call GetEntries with the previous token and receive the remaining results.
- fidl::VectorPtr<Entry> actual_next_entries;
+ std::vector<Entry> actual_next_entries;
snapshot->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0), std::move(actual_next_token),
+ std::vector<uint8_t>(), std::move(actual_next_token),
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_next_entries, &actual_next_token));
DrainLoop();
@@ -903,17 +903,17 @@
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- for (auto& entry : actual_next_entries.take()) {
+ for (auto& entry : actual_next_entries) {
actual_entries.push_back(std::move(entry));
}
- EXPECT_EQ(static_cast<size_t>(entry_count), actual_entries->size());
+ EXPECT_EQ(static_cast<size_t>(entry_count), actual_entries.size());
// Check that the correct values of the keys are all present in the result and
// in the correct order.
- for (int i = 0; i < static_cast<int>(actual_entries->size()); ++i) {
+ for (int i = 0; i < static_cast<int>(actual_entries.size()); ++i) {
ASSERT_EQ(GetKey(i, min_key_size),
- convert::ToString(actual_entries->at(i).key));
- ASSERT_EQ(GetValue(i, 0), ToString(actual_entries->at(i).value));
+ convert::ToString(actual_entries.at(i).key));
+ ASSERT_EQ(GetValue(i, 0), ToString(actual_entries.at(i).value));
}
}
@@ -927,10 +927,10 @@
// Call GetEntries and find a partial result.
bool called;
Status status;
- fidl::VectorPtr<InlinedEntry> actual_entries;
+ std::vector<InlinedEntry> actual_entries;
std::unique_ptr<Token> actual_next_token;
snapshot->GetEntriesInline(
- fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries, &actual_next_token));
DrainLoop();
@@ -939,28 +939,28 @@
EXPECT_TRUE(actual_next_token);
// Call GetEntries with the previous token and receive the remaining results.
- fidl::VectorPtr<InlinedEntry> actual_entries2;
+ std::vector<InlinedEntry> actual_entries2;
std::unique_ptr<Token> actual_next_token2;
snapshot->GetEntriesInline(
- fidl::VectorPtr<uint8_t>::New(0), std::move(actual_next_token),
+ std::vector<uint8_t>(), std::move(actual_next_token),
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries2, &actual_next_token2));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token2);
- for (auto& entry : actual_entries2.take()) {
+ for (auto& entry : actual_entries2) {
actual_entries.push_back(std::move(entry));
}
- EXPECT_EQ(static_cast<size_t>(entry_count), actual_entries->size());
+ EXPECT_EQ(static_cast<size_t>(entry_count), actual_entries.size());
// Check that the correct values of the keys are all present in the result and
// in the correct order.
- for (int i = 0; i < static_cast<int>(actual_entries->size()); ++i) {
- ASSERT_EQ(GetKey(i, 0), convert::ToString(actual_entries->at(i).key));
- ASSERT_TRUE(actual_entries->at(i).inlined_value);
+ for (int i = 0; i < static_cast<int>(actual_entries.size()); ++i) {
+ ASSERT_EQ(GetKey(i, 0), convert::ToString(actual_entries.at(i).key));
+ ASSERT_TRUE(actual_entries.at(i).inlined_value);
ASSERT_EQ(GetValue(i, min_value_size),
- convert::ToString(actual_entries->at(i).inlined_value->value));
+ convert::ToString(actual_entries.at(i).inlined_value->value));
}
}
@@ -984,10 +984,10 @@
// Call GetEntries and find a partial result.
bool called;
Status status;
- fidl::VectorPtr<InlinedEntry> actual_entries;
+ std::vector<InlinedEntry> actual_entries;
std::unique_ptr<Token> actual_next_token;
snapshot->GetEntriesInline(
- fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries, &actual_next_token));
DrainLoop();
@@ -996,28 +996,28 @@
EXPECT_TRUE(actual_next_token);
// Call GetEntries with the previous token and receive the remaining results.
- fidl::VectorPtr<InlinedEntry> actual_entries2;
+ std::vector<InlinedEntry> actual_entries2;
std::unique_ptr<Token> actual_next_token2;
snapshot->GetEntriesInline(
- fidl::VectorPtr<uint8_t>::New(0), std::move(actual_next_token),
+ std::vector<uint8_t>(), std::move(actual_next_token),
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries2, &actual_next_token2));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token2);
- for (auto& entry : actual_entries2.take()) {
+ for (auto& entry : actual_entries2) {
actual_entries.push_back(std::move(entry));
}
- EXPECT_EQ(static_cast<size_t>(entry_count), actual_entries->size());
+ EXPECT_EQ(static_cast<size_t>(entry_count), actual_entries.size());
// Check that the correct values of the keys are all present in the result and
// in the correct order.
- for (int i = 0; i < static_cast<int>(actual_entries->size()); ++i) {
- ASSERT_EQ(GetKey(i, 0), convert::ToString(actual_entries->at(i).key));
- ASSERT_TRUE(actual_entries->at(i).inlined_value);
+ for (int i = 0; i < static_cast<int>(actual_entries.size()); ++i) {
+ ASSERT_EQ(GetKey(i, 0), convert::ToString(actual_entries.at(i).key));
+ ASSERT_TRUE(actual_entries.at(i).inlined_value);
ASSERT_EQ(GetValue(i, min_value_size),
- convert::ToString(actual_entries->at(i).inlined_value->value));
+ convert::ToString(actual_entries.at(i).inlined_value->value));
}
}
@@ -1029,10 +1029,10 @@
// Call GetEntries and find a partial result.
bool called;
Status status;
- fidl::VectorPtr<Entry> actual_entries;
+ std::vector<Entry> actual_entries;
std::unique_ptr<Token> actual_next_token;
snapshot->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries, &actual_next_token));
DrainLoop();
@@ -1041,25 +1041,25 @@
EXPECT_TRUE(actual_next_token);
// Call GetEntries with the previous token and receive the remaining results.
- fidl::VectorPtr<Entry> actual_next_entries;
+ std::vector<Entry> actual_next_entries;
snapshot->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0), std::move(actual_next_token),
+ std::vector<uint8_t>(), std::move(actual_next_token),
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_next_entries, &actual_next_token));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- for (auto& entry : actual_next_entries.take()) {
+ for (auto& entry : actual_next_entries) {
actual_entries.push_back(std::move(entry));
}
- EXPECT_EQ(static_cast<size_t>(entry_count), actual_entries->size());
+ EXPECT_EQ(static_cast<size_t>(entry_count), actual_entries.size());
// Check that the correct values of the keys are all present in the result and
// in the correct order.
- for (int i = 0; i < static_cast<int>(actual_entries->size()); ++i) {
- ASSERT_EQ(GetKey(i), convert::ToString(actual_entries->at(i).key));
- ASSERT_EQ(GetValue(i, 0), ToString(actual_entries->at(i).value));
+ for (int i = 0; i < static_cast<int>(actual_entries.size()); ++i) {
+ ASSERT_EQ(GetKey(i), convert::ToString(actual_entries.at(i).key));
+ ASSERT_EQ(GetValue(i, 0), ToString(actual_entries.at(i).value));
}
}
@@ -1092,24 +1092,24 @@
PageSnapshotPtr snapshot = GetSnapshot();
- fidl::VectorPtr<Entry> actual_entries;
+ std::vector<Entry> actual_entries;
std::unique_ptr<Token> actual_next_token;
snapshot->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries, &actual_next_token));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- ASSERT_EQ(2u, actual_entries->size());
- EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries->at(0).key));
- EXPECT_EQ(eager_value, ToString(actual_entries->at(0).value));
- EXPECT_EQ(Priority::EAGER, actual_entries->at(0).priority);
+ ASSERT_EQ(2u, actual_entries.size());
+ EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries.at(0).key));
+ EXPECT_EQ(eager_value, ToString(actual_entries.at(0).value));
+ EXPECT_EQ(Priority::EAGER, actual_entries.at(0).priority);
- EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries->at(1).key));
- EXPECT_FALSE(actual_entries->at(1).value);
- EXPECT_EQ(Priority::LAZY, actual_entries->at(1).priority);
+ EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries.at(1).key));
+ EXPECT_FALSE(actual_entries.at(1).value);
+ EXPECT_EQ(Priority::LAZY, actual_entries.at(1).priority);
}
TEST_F(PageImplTest, PutGetSnapshotGetEntriesWithPrefix) {
@@ -1135,30 +1135,30 @@
EXPECT_EQ(Status::OK, status);
PageSnapshotPtr snapshot = GetSnapshot(convert::ToArray("001"));
- fidl::VectorPtr<Entry> actual_entries;
+ std::vector<Entry> actual_entries;
std::unique_ptr<Token> actual_next_token;
snapshot->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries, &actual_next_token));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- ASSERT_EQ(1u, actual_entries->size());
- EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries->at(0).key));
+ ASSERT_EQ(1u, actual_entries.size());
+ EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries.at(0).key));
snapshot = GetSnapshot(convert::ToArray("00"));
snapshot->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_entries, &actual_next_token));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- ASSERT_EQ(2u, actual_entries->size());
- EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries->at(0).key));
- EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries->at(1).key));
+ ASSERT_EQ(2u, actual_entries.size());
+ EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries.at(0).key));
+ EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries.at(1).key));
}
TEST_F(PageImplTest, PutGetSnapshotGetEntriesWithStart) {
@@ -1184,7 +1184,7 @@
EXPECT_EQ(Status::OK, status);
PageSnapshotPtr snapshot = GetSnapshot();
- fidl::VectorPtr<Entry> actual_entries;
+ std::vector<Entry> actual_entries;
std::unique_ptr<Token> actual_next_token;
snapshot->GetEntries(
convert::ToArray("002"), nullptr,
@@ -1194,8 +1194,8 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- ASSERT_EQ(1u, actual_entries->size());
- EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries->at(0).key));
+ ASSERT_EQ(1u, actual_entries.size());
+ EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries.at(0).key));
snapshot->GetEntries(
convert::ToArray("001"), nullptr,
@@ -1205,9 +1205,9 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- ASSERT_EQ(2u, actual_entries->size());
- EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries->at(0).key));
- EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries->at(1).key));
+ ASSERT_EQ(2u, actual_entries.size());
+ EXPECT_EQ(eager_key, convert::ExtendedStringView(actual_entries.at(0).key));
+ EXPECT_EQ(lazy_key, convert::ExtendedStringView(actual_entries.at(1).key));
}
TEST_F(PageImplTest, PutGetSnapshotGetKeys) {
@@ -1244,17 +1244,17 @@
PageSnapshotPtr snapshot = GetSnapshot();
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>> actual_keys;
+ std::vector<std::vector<uint8_t>> actual_keys;
std::unique_ptr<Token> actual_next_token;
- snapshot->GetKeys(fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ snapshot->GetKeys(std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_keys, &actual_next_token));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- EXPECT_EQ(key1, convert::ExtendedStringView(actual_keys->at(0)));
- EXPECT_EQ(key2, convert::ExtendedStringView(actual_keys->at(1)));
+ EXPECT_EQ(key1, convert::ExtendedStringView(actual_keys.at(0)));
+ EXPECT_EQ(key2, convert::ExtendedStringView(actual_keys.at(1)));
}
TEST_F(PageImplTest, PutGetSnapshotGetKeysWithToken) {
@@ -1269,9 +1269,9 @@
// Call GetKeys and find a partial result.
bool called;
Status status;
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>> actual_keys;
+ std::vector<std::vector<uint8_t>> actual_keys;
std::unique_ptr<Token> actual_next_token;
- snapshot->GetKeys(fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ snapshot->GetKeys(std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_keys, &actual_next_token));
@@ -1281,8 +1281,8 @@
EXPECT_TRUE(actual_next_token);
// Call GetKeys with the previous token and receive the remaining results.
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>> actual_next_keys;
- snapshot->GetKeys(fidl::VectorPtr<uint8_t>::New(0),
+ std::vector<std::vector<uint8_t>> actual_next_keys;
+ snapshot->GetKeys(std::vector<uint8_t>(),
std::move(actual_next_token),
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_next_keys, &actual_next_token));
@@ -1291,15 +1291,15 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- for (auto& key : actual_next_keys.take()) {
+ for (auto& key : actual_next_keys) {
actual_keys.push_back(std::move(key));
}
- EXPECT_EQ(static_cast<size_t>(key_count), actual_keys->size());
+ EXPECT_EQ(static_cast<size_t>(key_count), actual_keys.size());
// Check that the correct values of the keys are all present in the result and
// in the correct order.
- for (size_t i = 0; i < actual_keys->size(); ++i) {
- ASSERT_EQ(GetKey(i, min_key_size), convert::ToString(actual_keys->at(i)));
+ for (size_t i = 0; i < actual_keys.size(); ++i) {
+ ASSERT_EQ(GetKey(i, min_key_size), convert::ToString(actual_keys.at(i)));
}
}
@@ -1337,9 +1337,9 @@
PageSnapshotPtr snapshot = GetSnapshot(convert::ToArray("001"));
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>> actual_keys;
+ std::vector<std::vector<uint8_t>> actual_keys;
std::unique_ptr<Token> actual_next_token;
- snapshot->GetKeys(fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ snapshot->GetKeys(std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_keys, &actual_next_token));
@@ -1347,20 +1347,20 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- EXPECT_EQ(1u, actual_keys->size());
- EXPECT_EQ(key1, convert::ExtendedStringView(actual_keys->at(0)));
+ EXPECT_EQ(1u, actual_keys.size());
+ EXPECT_EQ(key1, convert::ExtendedStringView(actual_keys.at(0)));
snapshot = GetSnapshot(convert::ToArray("00"));
- snapshot->GetKeys(fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ snapshot->GetKeys(std::vector<uint8_t>(), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
&actual_keys, &actual_next_token));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- EXPECT_EQ(2u, actual_keys->size());
- EXPECT_EQ(key1, convert::ExtendedStringView(actual_keys->at(0)));
- EXPECT_EQ(key2, convert::ExtendedStringView(actual_keys->at(1)));
+ EXPECT_EQ(2u, actual_keys.size());
+ EXPECT_EQ(key1, convert::ExtendedStringView(actual_keys.at(0)));
+ EXPECT_EQ(key2, convert::ExtendedStringView(actual_keys.at(1)));
}
TEST_F(PageImplTest, PutGetSnapshotGetKeysWithStart) {
@@ -1397,7 +1397,7 @@
PageSnapshotPtr snapshot = GetSnapshot();
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>> actual_keys;
+ std::vector<std::vector<uint8_t>> actual_keys;
std::unique_ptr<Token> actual_next_token;
snapshot->GetKeys(convert::ToArray("002"), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
@@ -1406,8 +1406,8 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- EXPECT_EQ(1u, actual_keys->size());
- EXPECT_EQ(key2, convert::ExtendedStringView(actual_keys->at(0)));
+ EXPECT_EQ(1u, actual_keys.size());
+ EXPECT_EQ(key2, convert::ExtendedStringView(actual_keys.at(0)));
snapshot = GetSnapshot();
snapshot->GetKeys(convert::ToArray("001"), nullptr,
@@ -1417,9 +1417,9 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
EXPECT_FALSE(actual_next_token);
- EXPECT_EQ(2u, actual_keys->size());
- EXPECT_EQ(key1, convert::ExtendedStringView(actual_keys->at(0)));
- EXPECT_EQ(key2, convert::ExtendedStringView(actual_keys->at(1)));
+ EXPECT_EQ(2u, actual_keys.size());
+ EXPECT_EQ(key1, convert::ExtendedStringView(actual_keys.at(0)));
+ EXPECT_EQ(key2, convert::ExtendedStringView(actual_keys.at(1)));
}
TEST_F(PageImplTest, SnapshotGetSmall) {
diff --git a/bin/ledger/app/page_manager.cc b/bin/ledger/app/page_manager.cc
index 8a4da1d..e9cb942 100644
--- a/bin/ledger/app/page_manager.cc
+++ b/bin/ledger/app/page_manager.cc
@@ -110,7 +110,7 @@
Status PageManager::ResolveReference(
Reference reference, storage::ObjectIdentifier* object_identifier) {
- if (reference.opaque_id->size() != sizeof(uint64_t)) {
+ if (reference.opaque_id.size() != sizeof(uint64_t)) {
return Status::REFERENCE_NOT_FOUND;
}
uint64_t index = storage::DeserializeData<uint64_t>(
diff --git a/bin/ledger/app/page_manager_unittest.cc b/bin/ledger/app/page_manager_unittest.cc
index 877f0f2..4eb5978 100644
--- a/bin/ledger/app/page_manager_unittest.cc
+++ b/bin/ledger/app/page_manager_unittest.cc
@@ -466,13 +466,13 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- fidl::VectorPtr<ledger_internal::CommitId> heads1;
+ std::vector<ledger_internal::CommitId> heads1;
page_debug->GetHeadCommitsIds(
callback::Capture(callback::SetWhenCalled(&called), &status, &heads1));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- EXPECT_EQ(1u, heads1->size());
+ EXPECT_EQ(1u, heads1.size());
std::string key2("002-some_key2");
std::string value2("another value");
@@ -483,20 +483,20 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- fidl::VectorPtr<ledger_internal::CommitId> heads2;
+ std::vector<ledger_internal::CommitId> heads2;
page_debug->GetHeadCommitsIds(
callback::Capture(callback::SetWhenCalled(&called), &status, &heads2));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- EXPECT_EQ(1u, heads2->size());
+ EXPECT_EQ(1u, heads2.size());
- EXPECT_NE(convert::ToString(heads1->at(0).id),
- convert::ToString(heads2->at(0).id));
+ EXPECT_NE(convert::ToString(heads1.at(0).id),
+ convert::ToString(heads2.at(0).id));
PageSnapshotPtr snapshot1;
page_debug->GetSnapshot(
- std::move(heads1->at(0)), snapshot1.NewRequest(),
+ std::move(heads1.at(0)), snapshot1.NewRequest(),
callback::Capture(callback::SetWhenCalled(&called), &status));
DrainLoop();
EXPECT_TRUE(called);
@@ -504,13 +504,13 @@
PageSnapshotPtr snapshot2;
page_debug->GetSnapshot(
- std::move(heads2->at(0)), snapshot2.NewRequest(),
+ std::move(heads2.at(0)), snapshot2.NewRequest(),
callback::Capture(callback::SetWhenCalled(&called), &status));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- fidl::VectorPtr<Entry> expected_entries1;
+ std::vector<Entry> expected_entries1;
std::unique_ptr<Token> next_token;
snapshot1->GetEntries(
fidl::VectorPtr<uint8_t>::New(0), nullptr,
@@ -519,11 +519,11 @@
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- EXPECT_EQ(1u, expected_entries1->size());
- EXPECT_EQ(key1, convert::ToString(expected_entries1->at(0).key));
- EXPECT_EQ(value1, ToString(expected_entries1->at(0).value));
+ EXPECT_EQ(1u, expected_entries1.size());
+ EXPECT_EQ(key1, convert::ToString(expected_entries1.at(0).key));
+ EXPECT_EQ(value1, ToString(expected_entries1.at(0).value));
- fidl::VectorPtr<Entry> expected_entries2;
+ std::vector<Entry> expected_entries2;
snapshot2->GetEntries(
fidl::VectorPtr<uint8_t>::New(0), nullptr,
callback::Capture(callback::SetWhenCalled(&called), &status,
@@ -531,11 +531,11 @@
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- EXPECT_EQ(2u, expected_entries2->size());
- EXPECT_EQ(key1, convert::ToString(expected_entries2->at(0).key));
- EXPECT_EQ(value1, ToString(expected_entries2->at(0).value));
- EXPECT_EQ(key2, convert::ToString(expected_entries2->at(1).key));
- EXPECT_EQ(value2, ToString(expected_entries2->at(1).value));
+ EXPECT_EQ(2u, expected_entries2.size());
+ EXPECT_EQ(key1, convert::ToString(expected_entries2.at(0).key));
+ EXPECT_EQ(value1, ToString(expected_entries2.at(0).value));
+ EXPECT_EQ(key2, convert::ToString(expected_entries2.at(1).key));
+ EXPECT_EQ(value2, ToString(expected_entries2.at(1).value));
}
TEST_F(PageManagerTest, GetCommit) {
@@ -573,13 +573,13 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- fidl::VectorPtr<ledger_internal::CommitId> heads1;
+ std::vector<ledger_internal::CommitId> heads1;
page_debug->GetHeadCommitsIds(
callback::Capture(callback::SetWhenCalled(&called), &status, &heads1));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- EXPECT_EQ(1u, heads1->size());
+ EXPECT_EQ(1u, heads1.size());
std::string key2("002-some_key2");
std::string value2("another value");
@@ -590,26 +590,26 @@
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- fidl::VectorPtr<ledger_internal::CommitId> heads2;
+ std::vector<ledger_internal::CommitId> heads2;
page_debug->GetHeadCommitsIds(
callback::Capture(callback::SetWhenCalled(&called), &status, &heads2));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- EXPECT_EQ(1u, heads2->size());
+ EXPECT_EQ(1u, heads2.size());
ledger_internal::CommitPtr commit_struct;
- ledger_internal::CommitId currHeadCommit = fidl::Clone(heads2->at(0));
+ ledger_internal::CommitId currHeadCommit = fidl::Clone(heads2.at(0));
page_debug->GetCommit(std::move(currHeadCommit),
callback::Capture(callback::SetWhenCalled(&called),
&status, &commit_struct));
DrainLoop();
EXPECT_TRUE(called);
EXPECT_EQ(Status::OK, status);
- EXPECT_EQ(heads2->at(0).id, commit_struct->commit_id.id);
- EXPECT_EQ(1u, commit_struct->parents_ids->size());
+ EXPECT_EQ(heads2.at(0).id, commit_struct->commit_id.id);
+ EXPECT_EQ(1u, commit_struct->parents_ids.size());
EXPECT_EQ(1u, commit_struct->generation);
- EXPECT_EQ(heads1->at(0).id, commit_struct->parents_ids->at(0).id);
+ EXPECT_EQ(heads1.at(0).id, commit_struct->parents_ids.at(0).id);
}
TEST_F(PageManagerTest, GetCommitError) {
diff --git a/bin/ledger/app/page_snapshot_impl.cc b/bin/ledger/app/page_snapshot_impl.cc
index 4170361..fe2e38a 100644
--- a/bin/ledger/app/page_snapshot_impl.cc
+++ b/bin/ledger/app/page_snapshot_impl.cc
@@ -62,7 +62,7 @@
// Computes the size of an Entry.
size_t ComputeEntrySize(const Entry& entry) {
- return fidl_serialization::GetEntrySize(entry.key->size());
+ return fidl_serialization::GetEntrySize(entry.key.size());
}
// Computes the size of an InlinedEntry.
@@ -101,9 +101,9 @@
template <typename EntryType>
void FillEntries(storage::PageStorage* page_storage,
const std::string& key_prefix, const storage::Commit* commit,
- fidl::VectorPtr<uint8_t> key_start,
+ std::vector<uint8_t> key_start,
std::unique_ptr<Token> token,
- fit::function<void(Status, fidl::VectorPtr<EntryType>,
+ fit::function<void(Status, std::vector<EntryType>,
std::unique_ptr<Token>)>
callback) {
// |token| represents the first key to be returned in the list of entries.
@@ -120,7 +120,7 @@
// Represents information shared between on_next and on_done callbacks.
struct Context {
- fidl::VectorPtr<EntryType> entries = fidl::VectorPtr<EntryType>::New(0);
+ std::vector<EntryType> entries;
// The serialization size of all entries.
size_t size = fidl_serialization::kVectorHeaderSize;
// The number of handles used.
@@ -150,7 +150,7 @@
context->handle_count += HandleUsed<EntryType>();
if ((context->size > fidl_serialization::kMaxInlineDataSize ||
context->handle_count > fidl_serialization::kMaxMessageHandles) &&
- !context->entries->empty()) {
+ !context->entries.empty()) {
context->next_token = std::make_unique<Token>();
context->next_token->opaque_id = convert::ToArray(entry.key);
return false;
@@ -176,7 +176,7 @@
storage::Status status) mutable {
if (status != storage::Status::OK) {
FXL_LOG(ERROR) << "Error while reading: " << status;
- callback(Status::IO_ERROR, fidl::VectorPtr<EntryType>::New(0), nullptr);
+ callback(Status::IO_ERROR, std::vector<EntryType>(), nullptr);
return;
}
fit::function<void(storage::Status,
@@ -188,20 +188,19 @@
results) mutable {
if (status != storage::Status::OK) {
FXL_LOG(ERROR) << "Error while reading: " << status;
- callback(Status::IO_ERROR, fidl::VectorPtr<EntryType>::New(0),
- nullptr);
+ callback(Status::IO_ERROR, std::vector<EntryType>(), nullptr);
return;
}
- FXL_DCHECK(context->entries->size() == results.size());
+ FXL_DCHECK(context->entries.size() == results.size());
size_t real_size = 0;
size_t i = 0;
for (; i < results.size(); i++) {
- EntryType& entry = context->entries->at(i);
+ EntryType& entry = context->entries.at(i);
size_t next_token_size =
i + 1 >= results.size()
? 0
: fidl_serialization::GetByteVectorSize(
- context->entries->at(i + 1).key->size());
+ context->entries.at(i + 1).key.size());
if (!results[i]) {
size_t entry_size = ComputeEntrySize(entry);
if (real_size + entry_size + next_token_size >
@@ -220,8 +219,7 @@
storage::Status read_status =
FillSingleEntry(*results[i], &entry);
if (read_status != storage::Status::OK) {
- callback(PageUtils::ConvertStatus(read_status),
- fidl::VectorPtr<EntryType>::New(0), nullptr);
+ callback(PageUtils::ConvertStatus(read_status), std::vector<EntryType>(), nullptr);
return;
}
size_t entry_size = ComputeEntrySize(entry);
@@ -233,15 +231,14 @@
}
if (i != results.size()) {
if (i == 0) {
- callback(Status::VALUE_TOO_LARGE,
- fidl::VectorPtr<EntryType>::New(0), nullptr);
+ callback(Status::VALUE_TOO_LARGE, std::vector<EntryType>(), nullptr);
return;
}
// We had to bail out early because the result would be too big
// otherwise.
context->next_token = std::make_unique<Token>();
context->next_token->opaque_id =
- std::move(context->entries->at(i).key);
+ std::move(context->entries.at(i).key);
context->entries.resize(i);
}
if (context->next_token) {
@@ -267,7 +264,7 @@
PageSnapshotImpl::~PageSnapshotImpl() {}
-void PageSnapshotImpl::GetEntries(fidl::VectorPtr<uint8_t> key_start,
+void PageSnapshotImpl::GetEntries(std::vector<uint8_t> key_start,
std::unique_ptr<Token> token,
GetEntriesCallback callback) {
FillEntries<Entry>(page_storage_, key_prefix_, commit_.get(),
@@ -275,7 +272,7 @@
std::move(callback));
}
-void PageSnapshotImpl::GetEntriesInline(fidl::VectorPtr<uint8_t> key_start,
+void PageSnapshotImpl::GetEntriesInline(std::vector<uint8_t> key_start,
std::unique_ptr<Token> token,
GetEntriesInlineCallback callback) {
FillEntries<InlinedEntry>(page_storage_, key_prefix_, commit_.get(),
@@ -283,15 +280,14 @@
std::move(callback));
}
-void PageSnapshotImpl::GetKeys(fidl::VectorPtr<uint8_t> key_start,
+void PageSnapshotImpl::GetKeys(std::vector<uint8_t> key_start,
std::unique_ptr<Token> token,
GetKeysCallback callback) {
// Represents the information that needs to be shared between on_next and
// on_done callbacks.
struct Context {
// The result of GetKeys. New keys from on_next are appended to this array.
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>> keys =
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>>::New(0);
+ std::vector<std::vector<uint8_t>> keys;
// The total size in number of bytes of the |keys| array.
size_t size = fidl_serialization::kVectorHeaderSize;
// If the |keys| array size exceeds the maximum allowed inlined data size,
@@ -323,7 +319,7 @@
if (status != storage::Status::OK) {
FXL_LOG(ERROR) << "Error while reading: " << status;
callback(Status::IO_ERROR,
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>>::New(0), nullptr);
+ std::vector<std::vector<uint8_t>>(), nullptr);
return;
}
if (context->next_token) {
@@ -344,7 +340,7 @@
}
}
-void PageSnapshotImpl::Get(fidl::VectorPtr<uint8_t> key, GetCallback callback) {
+void PageSnapshotImpl::Get(std::vector<uint8_t> key, GetCallback callback) {
auto timed_callback =
TRACE_CALLBACK(std::move(callback), "ledger", "snapshot_get");
@@ -368,7 +364,7 @@
});
}
-void PageSnapshotImpl::GetInline(fidl::VectorPtr<uint8_t> key,
+void PageSnapshotImpl::GetInline(std::vector<uint8_t> key,
GetInlineCallback callback) {
auto timed_callback =
TRACE_CALLBACK(std::move(callback), "ledger", "snapshot_get_inline");
@@ -404,7 +400,7 @@
});
}
-void PageSnapshotImpl::Fetch(fidl::VectorPtr<uint8_t> key,
+void PageSnapshotImpl::Fetch(std::vector<uint8_t> key,
FetchCallback callback) {
auto timed_callback =
TRACE_CALLBACK(std::move(callback), "ledger", "snapshot_fetch");
@@ -429,7 +425,7 @@
});
}
-void PageSnapshotImpl::FetchPartial(fidl::VectorPtr<uint8_t> key,
+void PageSnapshotImpl::FetchPartial(std::vector<uint8_t> key,
int64_t offset, int64_t max_size,
FetchPartialCallback callback) {
auto timed_callback =
diff --git a/bin/ledger/app/page_snapshot_impl.h b/bin/ledger/app/page_snapshot_impl.h
index 3fb35d2..fccac8d 100644
--- a/bin/ledger/app/page_snapshot_impl.h
+++ b/bin/ledger/app/page_snapshot_impl.h
@@ -23,19 +23,19 @@
private:
// PageSnapshot:
- void GetEntries(fidl::VectorPtr<uint8_t> key_start,
+ void GetEntries(std::vector<uint8_t> key_start,
std::unique_ptr<Token> token,
GetEntriesCallback callback) override;
- void GetEntriesInline(fidl::VectorPtr<uint8_t> key_start,
+ void GetEntriesInline(std::vector<uint8_t> key_start,
std::unique_ptr<Token> token,
GetEntriesInlineCallback callback) override;
- void GetKeys(fidl::VectorPtr<uint8_t> key_start, std::unique_ptr<Token> token,
+ void GetKeys(std::vector<uint8_t> key_start, std::unique_ptr<Token> token,
GetKeysCallback callback) override;
- void Get(fidl::VectorPtr<uint8_t> key, GetCallback callback) override;
- void GetInline(fidl::VectorPtr<uint8_t> key,
+ void Get(std::vector<uint8_t> key, GetCallback callback) override;
+ void GetInline(std::vector<uint8_t> key,
GetInlineCallback callback) override;
- void Fetch(fidl::VectorPtr<uint8_t> key, FetchCallback callback) override;
- void FetchPartial(fidl::VectorPtr<uint8_t> key, int64_t offset,
+ void Fetch(std::vector<uint8_t> key, FetchCallback callback) override;
+ void FetchPartial(std::vector<uint8_t> key, int64_t offset,
int64_t max_size, FetchPartialCallback callback) override;
storage::PageStorage* page_storage_;
diff --git a/bin/ledger/cloud_sync/impl/page_download.cc b/bin/ledger/cloud_sync/impl/page_download.cc
index 5a22ed6..b3f4794 100644
--- a/bin/ledger/cloud_sync/impl/page_download.cc
+++ b/bin/ledger/cloud_sync/impl/page_download.cc
@@ -236,7 +236,7 @@
std::move(callback));
}
-void PageDownload::OnNewObject(fidl::VectorPtr<uint8_t> /*id*/,
+void PageDownload::OnNewObject(std::vector<uint8_t> /*id*/,
fuchsia::mem::Buffer /*data*/,
OnNewObjectCallback /*callback*/) {
// No known cloud provider implementations use this method.
diff --git a/bin/ledger/cloud_sync/impl/page_download.h b/bin/ledger/cloud_sync/impl/page_download.h
index 83084e6..1221c81 100644
--- a/bin/ledger/cloud_sync/impl/page_download.h
+++ b/bin/ledger/cloud_sync/impl/page_download.h
@@ -56,7 +56,7 @@
cloud_provider::Token position_token,
OnNewCommitsCallback callback) override;
- void OnNewObject(fidl::VectorPtr<uint8_t> id, fuchsia::mem::Buffer data,
+ void OnNewObject(std::vector<uint8_t> id, fuchsia::mem::Buffer data,
OnNewObjectCallback callback) override;
void OnError(cloud_provider::Status status) override;
diff --git a/bin/ledger/cloud_sync/impl/testing/test_cloud_provider.cc b/bin/ledger/cloud_sync/impl/testing/test_cloud_provider.cc
index 0c1da5a..f94646c 100644
--- a/bin/ledger/cloud_sync/impl/testing/test_cloud_provider.cc
+++ b/bin/ledger/cloud_sync/impl/testing/test_cloud_provider.cc
@@ -22,7 +22,7 @@
}
void TestCloudProvider::GetPageCloud(
- fidl::VectorPtr<uint8_t> /*app_id*/, fidl::VectorPtr<uint8_t> /*page_id*/,
+ std::vector<uint8_t> /*app_id*/, std::vector<uint8_t> /*page_id*/,
fidl::InterfaceRequest<cloud_provider::PageCloud> /*page_cloud*/,
GetPageCloudCallback /*callback*/) {
FXL_NOTIMPLEMENTED();
diff --git a/bin/ledger/cloud_sync/impl/testing/test_cloud_provider.h b/bin/ledger/cloud_sync/impl/testing/test_cloud_provider.h
index 25d40b5..d4aa9ac 100644
--- a/bin/ledger/cloud_sync/impl/testing/test_cloud_provider.h
+++ b/bin/ledger/cloud_sync/impl/testing/test_cloud_provider.h
@@ -29,7 +29,7 @@
GetDeviceSetCallback callback) override;
void GetPageCloud(
- fidl::VectorPtr<uint8_t> app_id, fidl::VectorPtr<uint8_t> page_id,
+ std::vector<uint8_t> app_id, std::vector<uint8_t> page_id,
fidl::InterfaceRequest<cloud_provider::PageCloud> page_cloud,
GetPageCloudCallback callback) override;
diff --git a/bin/ledger/cloud_sync/impl/testing/test_device_set.cc b/bin/ledger/cloud_sync/impl/testing/test_device_set.cc
index 9547029..3bdfadf 100644
--- a/bin/ledger/cloud_sync/impl/testing/test_device_set.cc
+++ b/bin/ledger/cloud_sync/impl/testing/test_device_set.cc
@@ -11,20 +11,20 @@
TestDeviceSet::TestDeviceSet() {}
TestDeviceSet::~TestDeviceSet() {}
-void TestDeviceSet::CheckFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+void TestDeviceSet::CheckFingerprint(std::vector<uint8_t> fingerprint,
CheckFingerprintCallback callback) {
checked_fingerprint = convert::ToString(fingerprint);
callback(status_to_return);
}
-void TestDeviceSet::SetFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+void TestDeviceSet::SetFingerprint(std::vector<uint8_t> fingerprint,
SetFingerprintCallback callback) {
set_fingerprint = convert::ToString(fingerprint);
callback(status_to_return);
}
void TestDeviceSet::SetWatcher(
- fidl::VectorPtr<uint8_t> fingerprint,
+ std::vector<uint8_t> fingerprint,
fidl::InterfaceHandle<cloud_provider::DeviceSetWatcher> watcher,
SetWatcherCallback callback) {
set_watcher_calls++;
diff --git a/bin/ledger/cloud_sync/impl/testing/test_device_set.h b/bin/ledger/cloud_sync/impl/testing/test_device_set.h
index e950552..46eef1c 100644
--- a/bin/ledger/cloud_sync/impl/testing/test_device_set.h
+++ b/bin/ledger/cloud_sync/impl/testing/test_device_set.h
@@ -30,14 +30,14 @@
private:
// cloud_provider::DeviceSet:
- void CheckFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+ void CheckFingerprint(std::vector<uint8_t> fingerprint,
CheckFingerprintCallback callback) override;
- void SetFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+ void SetFingerprint(std::vector<uint8_t> fingerprint,
SetFingerprintCallback callback) override;
void SetWatcher(
- fidl::VectorPtr<uint8_t> fingerprint,
+ std::vector<uint8_t> fingerprint,
fidl::InterfaceHandle<cloud_provider::DeviceSetWatcher> watcher,
SetWatcherCallback callback) override;
diff --git a/bin/ledger/cloud_sync/impl/testing/test_page_cloud.cc b/bin/ledger/cloud_sync/impl/testing/test_page_cloud.cc
index 0a5a1b1..8dd530f 100644
--- a/bin/ledger/cloud_sync/impl/testing/test_page_cloud.cc
+++ b/bin/ledger/cloud_sync/impl/testing/test_page_cloud.cc
@@ -78,7 +78,7 @@
std::move(position_token_to_return));
}
-void TestPageCloud::AddObject(fidl::VectorPtr<uint8_t> id,
+void TestPageCloud::AddObject(std::vector<uint8_t> id,
fuchsia::mem::Buffer data,
AddObjectCallback callback) {
add_object_calls++;
@@ -103,7 +103,7 @@
}
}
-void TestPageCloud::GetObject(fidl::VectorPtr<uint8_t> id,
+void TestPageCloud::GetObject(std::vector<uint8_t> id,
GetObjectCallback callback) {
get_object_calls++;
if (status_to_return != cloud_provider::Status::OK) {
diff --git a/bin/ledger/cloud_sync/impl/testing/test_page_cloud.h b/bin/ledger/cloud_sync/impl/testing/test_page_cloud.h
index 26f5f9a..95d55ff 100644
--- a/bin/ledger/cloud_sync/impl/testing/test_page_cloud.h
+++ b/bin/ledger/cloud_sync/impl/testing/test_page_cloud.h
@@ -74,9 +74,9 @@
AddCommitsCallback callback) override;
void GetCommits(std::unique_ptr<cloud_provider::Token> min_position_token,
GetCommitsCallback callback) override;
- void AddObject(fidl::VectorPtr<uint8_t> id, fuchsia::mem::Buffer data,
+ void AddObject(std::vector<uint8_t> id, fuchsia::mem::Buffer data,
AddObjectCallback callback) override;
- void GetObject(fidl::VectorPtr<uint8_t> id,
+ void GetObject(std::vector<uint8_t> id,
GetObjectCallback callback) override;
void SetWatcher(
std::unique_ptr<cloud_provider::Token> min_position_token,
diff --git a/bin/ledger/fidl/error_notifier/error_notifier.fidlmerge b/bin/ledger/fidl/error_notifier/error_notifier.fidlmerge
index 9b0e82f..58bd8d0 100644
--- a/bin/ledger/fidl/error_notifier/error_notifier.fidlmerge
+++ b/bin/ledger/fidl/error_notifier/error_notifier.fidlmerge
@@ -61,7 +61,11 @@
{{- template "CppHandleType" . }}
{{- end -}}
{{- if eq .Kind "vector" -}}
+ {{- if .Nullable }}
::fidl::VectorPtr<{{- template "CppType" .ElementType }}>
+ {{- else }}
+::std::vector<{{- template "CppType" .ElementType }}>
+ {{- end }}
{{- end -}}
{{- if eq .Kind "request" -}}
::fidl::InterfaceRequest<{{- template "QualifiedId" .RequestSubtype }}>
@@ -70,7 +74,11 @@
{{ .PrimitiveSubtype }}_t
{{- end }}
{{- if eq .Kind "string" -}}
+ {{- if .Nullable }}
::fidl::StringPtr
+ {{- else }}
+::std::string
+ {{- end }}
{{- end }}
{{- end -}}
diff --git a/bin/ledger/p2p_provider/impl/p2p_provider_impl.cc b/bin/ledger/p2p_provider/impl/p2p_provider_impl.cc
index 7438dcd..f710fd4 100644
--- a/bin/ledger/p2p_provider/impl/p2p_provider_impl.cc
+++ b/bin/ledger/p2p_provider/impl/p2p_provider_impl.cc
@@ -176,9 +176,9 @@
void P2PProviderImpl::ListenForNewDevices(uint64_t version) {
net_connector_->GetKnownDeviceNames(
version,
- [this](uint64_t new_version, fidl::VectorPtr<fidl::StringPtr> devices) {
+ [this](uint64_t new_version, std::vector<std::string> devices) {
std::vector<std::string> seen_devices;
- for (auto& remote_name : *devices) {
+ for (auto& remote_name : devices) {
seen_devices.push_back(remote_name);
if (contacted_hosts_.find(remote_name) != contacted_hosts_.end()) {
continue;
diff --git a/bin/ledger/testing/cloud_provider/fake_cloud_provider.cc b/bin/ledger/testing/cloud_provider/fake_cloud_provider.cc
index 8132aeb..c4da516 100644
--- a/bin/ledger/testing/cloud_provider/fake_cloud_provider.cc
+++ b/bin/ledger/testing/cloud_provider/fake_cloud_provider.cc
@@ -52,7 +52,7 @@
}
void FakeCloudProvider::GetPageCloud(
- fidl::VectorPtr<uint8_t> app_id, fidl::VectorPtr<uint8_t> page_id,
+ std::vector<uint8_t> app_id, std::vector<uint8_t> page_id,
fidl::InterfaceRequest<cloud_provider::PageCloud> page_cloud,
GetPageCloudCallback callback) {
const std::string key =
diff --git a/bin/ledger/testing/cloud_provider/fake_cloud_provider.h b/bin/ledger/testing/cloud_provider/fake_cloud_provider.h
index 4872875..f9e0dee 100644
--- a/bin/ledger/testing/cloud_provider/fake_cloud_provider.h
+++ b/bin/ledger/testing/cloud_provider/fake_cloud_provider.h
@@ -49,7 +49,7 @@
GetDeviceSetCallback callback) override;
void GetPageCloud(
- fidl::VectorPtr<uint8_t> app_id, fidl::VectorPtr<uint8_t> page_id,
+ std::vector<uint8_t> app_id, std::vector<uint8_t> page_id,
fidl::InterfaceRequest<cloud_provider::PageCloud> page_cloud,
GetPageCloudCallback callback) override;
diff --git a/bin/ledger/testing/cloud_provider/fake_device_set.cc b/bin/ledger/testing/cloud_provider/fake_device_set.cc
index 73d20d1..dfd9d55 100644
--- a/bin/ledger/testing/cloud_provider/fake_device_set.cc
+++ b/bin/ledger/testing/cloud_provider/fake_device_set.cc
@@ -15,7 +15,7 @@
FakeDeviceSet::~FakeDeviceSet() {}
-void FakeDeviceSet::CheckFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+void FakeDeviceSet::CheckFingerprint(std::vector<uint8_t> fingerprint,
CheckFingerprintCallback callback) {
if (cloud_erase_on_check_ == CloudEraseOnCheck::YES ||
!fingerprints_.count(convert::ToString(fingerprint))) {
@@ -26,14 +26,14 @@
callback(cloud_provider::Status::OK);
}
-void FakeDeviceSet::SetFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+void FakeDeviceSet::SetFingerprint(std::vector<uint8_t> fingerprint,
SetFingerprintCallback callback) {
fingerprints_.insert(convert::ToString(fingerprint));
callback(cloud_provider::Status::OK);
}
void FakeDeviceSet::SetWatcher(
- fidl::VectorPtr<uint8_t> /*fingerprint*/,
+ std::vector<uint8_t> /*fingerprint*/,
fidl::InterfaceHandle<cloud_provider::DeviceSetWatcher> watcher,
SetWatcherCallback callback) {
watcher_ = watcher.Bind();
diff --git a/bin/ledger/testing/cloud_provider/fake_device_set.h b/bin/ledger/testing/cloud_provider/fake_device_set.h
index 246d5ee..90a3787 100644
--- a/bin/ledger/testing/cloud_provider/fake_device_set.h
+++ b/bin/ledger/testing/cloud_provider/fake_device_set.h
@@ -27,14 +27,14 @@
void set_on_empty(fit::closure on_empty) { on_empty_ = std::move(on_empty); }
private:
- void CheckFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+ void CheckFingerprint(std::vector<uint8_t> fingerprint,
CheckFingerprintCallback callback) override;
- void SetFingerprint(fidl::VectorPtr<uint8_t> fingerprint,
+ void SetFingerprint(std::vector<uint8_t> fingerprint,
SetFingerprintCallback callback) override;
void SetWatcher(
- fidl::VectorPtr<uint8_t> fingerprint,
+ std::vector<uint8_t> fingerprint,
fidl::InterfaceHandle<cloud_provider::DeviceSetWatcher> watcher,
SetWatcherCallback callback) override;
diff --git a/bin/ledger/testing/cloud_provider/fake_page_cloud.cc b/bin/ledger/testing/cloud_provider/fake_page_cloud.cc
index aba18bb..589a9f2 100644
--- a/bin/ledger/testing/cloud_provider/fake_page_cloud.cc
+++ b/bin/ledger/testing/cloud_provider/fake_page_cloud.cc
@@ -44,18 +44,18 @@
return true;
}
- if (token->opaque_id->size() != sizeof(*result)) {
+ if (token->opaque_id.size() != sizeof(*result)) {
return false;
}
- memcpy(result, token->opaque_id->data(), sizeof(*result));
+ memcpy(result, token->opaque_id.data(), sizeof(*result));
return true;
}
-uint64_t GetVectorSignature(const fidl::VectorPtr<uint8_t>& vector,
+uint64_t GetVectorSignature(const std::vector<uint8_t>& vector,
uint32_t seed) {
- return murmurhash(reinterpret_cast<const char*>(vector.get().data()),
- vector.get().size(), seed);
+ return murmurhash(reinterpret_cast<const char*>(vector.data()),
+ vector.size(), seed);
}
uint64_t GetCommitsSignature(
@@ -200,7 +200,7 @@
std::unique_ptr<cloud_provider::Token> min_position_token,
GetCommitsCallback callback) {
if (MustReturnError(GetVectorSignature(
- min_position_token ? min_position_token->opaque_id.Clone() : nullptr,
+ min_position_token ? min_position_token->opaque_id : std::vector<uint8_t>(),
kGetCommitsSeed))) {
callback(cloud_provider::Status::NETWORK_ERROR, nullptr, nullptr);
return;
@@ -231,7 +231,7 @@
fidl::MakeOptional(std::move(commit_pack)), std::move(token));
}
-void FakePageCloud::AddObject(fidl::VectorPtr<uint8_t> id,
+void FakePageCloud::AddObject(std::vector<uint8_t> id,
fuchsia::mem::Buffer data,
AddObjectCallback callback) {
if (MustReturnError(GetVectorSignature(id, kAddObjectSeed))) {
@@ -248,7 +248,7 @@
callback(cloud_provider::Status::OK);
}
-void FakePageCloud::GetObject(fidl::VectorPtr<uint8_t> id,
+void FakePageCloud::GetObject(std::vector<uint8_t> id,
GetObjectCallback callback) {
if (MustReturnError(GetVectorSignature(id, kGetObjectSeed))) {
callback(cloud_provider::Status::NETWORK_ERROR, nullptr);
diff --git a/bin/ledger/testing/cloud_provider/fake_page_cloud.h b/bin/ledger/testing/cloud_provider/fake_page_cloud.h
index 746ef7d..6a54106 100644
--- a/bin/ledger/testing/cloud_provider/fake_page_cloud.h
+++ b/bin/ledger/testing/cloud_provider/fake_page_cloud.h
@@ -36,9 +36,9 @@
AddCommitsCallback callback) override;
void GetCommits(std::unique_ptr<cloud_provider::Token> min_position_token,
GetCommitsCallback callback) override;
- void AddObject(fidl::VectorPtr<uint8_t> id, fuchsia::mem::Buffer data,
+ void AddObject(std::vector<uint8_t> id, fuchsia::mem::Buffer data,
AddObjectCallback callback) override;
- void GetObject(fidl::VectorPtr<uint8_t> id,
+ void GetObject(std::vector<uint8_t> id,
GetObjectCallback callback) override;
void SetWatcher(
std::unique_ptr<cloud_provider::Token> min_position_token,
diff --git a/bin/ledger/testing/data_generator.cc b/bin/ledger/testing/data_generator.cc
index 4d36c2c..e282d32 100644
--- a/bin/ledger/testing/data_generator.cc
+++ b/bin/ledger/testing/data_generator.cc
@@ -21,7 +21,7 @@
DataGenerator::~DataGenerator() {}
-fidl::VectorPtr<uint8_t> DataGenerator::MakeKey(int i, size_t size) {
+std::vector<uint8_t> DataGenerator::MakeKey(int i, size_t size) {
std::string i_str = std::to_string(i);
FXL_DCHECK(i_str.size() + 1 <= size);
auto rand_bytes = MakeValue(size - i_str.size() - 1);
@@ -42,15 +42,15 @@
return data;
}
-std::vector<fidl::VectorPtr<uint8_t>> DataGenerator::MakeKeys(
+std::vector<std::vector<uint8_t>> DataGenerator::MakeKeys(
size_t key_count, size_t key_size, size_t unique_key_count) {
FXL_DCHECK(unique_key_count <= key_count);
- std::vector<fidl::VectorPtr<uint8_t>> keys(key_count);
+ std::vector<std::vector<uint8_t>> keys(key_count);
for (size_t i = 0; i < unique_key_count; i++) {
keys[i] = MakeKey(i, key_size);
}
for (size_t i = unique_key_count; i < key_count; i++) {
- keys[i] = fidl::Clone(keys[i - unique_key_count]);
+ keys[i] = keys[i - unique_key_count];
}
return keys;
}
diff --git a/bin/ledger/testing/data_generator.h b/bin/ledger/testing/data_generator.h
index d1afca9..47cbf57 100644
--- a/bin/ledger/testing/data_generator.h
+++ b/bin/ledger/testing/data_generator.h
@@ -25,7 +25,7 @@
// Builds a key of the given length as "<the given int>-<random data>", so
// that deterministic ordering of entries can be ensured by using a different
// |i| value each time, but the resulting B-tree nodes are always distinct.
- fidl::VectorPtr<uint8_t> MakeKey(int i, size_t size);
+ std::vector<uint8_t> MakeKey(int i, size_t size);
// Builds a random value that can be used as a page id.
PageId MakePageId();
@@ -35,7 +35,7 @@
// Builds a vector of length |key_count| containing keys of size |key_size|,
// |unique_key_count| of which are unique.
- std::vector<fidl::VectorPtr<uint8_t>> MakeKeys(size_t key_count,
+ std::vector<std::vector<uint8_t>> MakeKeys(size_t key_count,
size_t key_size,
size_t unique_key_count);
diff --git a/bin/ledger/testing/ledger_app_instance_factory.cc b/bin/ledger/testing/ledger_app_instance_factory.cc
index 8fcd734..8cf1b1b 100644
--- a/bin/ledger/testing/ledger_app_instance_factory.cc
+++ b/bin/ledger/testing/ledger_app_instance_factory.cc
@@ -14,7 +14,7 @@
namespace ledger {
LedgerAppInstanceFactory::LedgerAppInstance::LedgerAppInstance(
- LoopController* loop_controller, fidl::VectorPtr<uint8_t> test_ledger_name,
+ LoopController* loop_controller, std::vector<uint8_t> test_ledger_name,
ledger_internal::LedgerRepositoryFactoryPtr ledger_repository_factory)
: loop_controller_(loop_controller),
test_ledger_name_(std::move(test_ledger_name)),
diff --git a/bin/ledger/testing/ledger_app_instance_factory.h b/bin/ledger/testing/ledger_app_instance_factory.h
index 3a74a95..68f4187 100644
--- a/bin/ledger/testing/ledger_app_instance_factory.h
+++ b/bin/ledger/testing/ledger_app_instance_factory.h
@@ -39,7 +39,7 @@
public:
LedgerAppInstance(
LoopController* loop_controller,
- fidl::VectorPtr<uint8_t> test_ledger_name,
+ std::vector<uint8_t> test_ledger_name,
ledger_internal::LedgerRepositoryFactoryPtr ledger_repository_factory);
virtual ~LedgerAppInstance();
@@ -62,7 +62,7 @@
virtual std::string GetUserId() = 0;
LoopController* loop_controller_;
- fidl::VectorPtr<uint8_t> test_ledger_name_;
+ std::vector<uint8_t> test_ledger_name_;
ledger_internal::LedgerRepositoryFactoryPtr ledger_repository_factory_;
scoped_tmpfs::ScopedTmpFS tmpfs_;
diff --git a/bin/ledger/testing/netconnector/fake_netconnector.cc b/bin/ledger/testing/netconnector/fake_netconnector.cc
index d165060..c0eaa12 100644
--- a/bin/ledger/testing/netconnector/fake_netconnector.cc
+++ b/bin/ledger/testing/netconnector/fake_netconnector.cc
@@ -13,7 +13,7 @@
}
void FakeNetConnector::RegisterServiceProvider(
- fidl::StringPtr name,
+ std::string name,
fidl::InterfaceHandle<fuchsia::sys::ServiceProvider> service_provider) {
fuchsia::sys::ServiceProviderPtr service_provider_ptr =
service_provider.Bind();
@@ -26,7 +26,7 @@
}
void FakeNetConnector::GetDeviceServiceProvider(
- fidl::StringPtr device_name,
+ std::string device_name,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider> service_provider) {
delegate_->ConnectToServiceProvider(device_name, std::move(service_provider));
}
diff --git a/bin/ledger/testing/netconnector/fake_netconnector.h b/bin/ledger/testing/netconnector/fake_netconnector.h
index ee19f66..ddd3565 100644
--- a/bin/ledger/testing/netconnector/fake_netconnector.h
+++ b/bin/ledger/testing/netconnector/fake_netconnector.h
@@ -24,7 +24,7 @@
// for more details.
virtual void GetDevicesNames(
uint64_t last_version,
- fit::function<void(uint64_t, fidl::VectorPtr<fidl::StringPtr>)>
+ fit::function<void(uint64_t, std::vector<std::string>)>
callback) = 0;
// Connects to the ServiceProvider from host |device_name|.
@@ -43,11 +43,11 @@
private:
// NetConnector implementation:
void RegisterServiceProvider(
- fidl::StringPtr name,
+ std::string name,
fidl::InterfaceHandle<fuchsia::sys::ServiceProvider> service_provider)
override;
void GetDeviceServiceProvider(
- fidl::StringPtr device_name,
+ std::string device_name,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider> service_provider)
override;
void GetKnownDeviceNames(uint64_t version_last_seen,
diff --git a/bin/ledger/testing/netconnector/netconnector_factory.cc b/bin/ledger/testing/netconnector/netconnector_factory.cc
index e728d85..21b0efe 100644
--- a/bin/ledger/testing/netconnector/netconnector_factory.cc
+++ b/bin/ledger/testing/netconnector/netconnector_factory.cc
@@ -82,19 +82,19 @@
if (pending_device_list_callbacks_.empty()) {
return;
}
- fidl::VectorPtr<fidl::StringPtr> device_names;
+ std::vector<std::string> device_names;
for (const auto& holder_pair : net_connectors_) {
device_names.push_back(holder_pair.first);
}
for (const auto& callback : pending_device_list_callbacks_) {
- callback(current_version_, fidl::Clone(device_names));
+ callback(current_version_, device_names);
}
pending_device_list_callbacks_.clear();
}
void NetConnectorFactory::GetDevicesNames(
uint64_t last_version,
- fit::function<void(uint64_t, fidl::VectorPtr<fidl::StringPtr>)> callback) {
+ fit::function<void(uint64_t, std::vector<std::string>)> callback) {
FXL_CHECK(last_version <= current_version_)
<< "Last seen version (" << last_version
<< ") is more recent than current version (" << current_version_
@@ -103,7 +103,7 @@
pending_device_list_callbacks_.push_back(std::move(callback));
return;
}
- fidl::VectorPtr<fidl::StringPtr> device_names;
+ std::vector<std::string> device_names;
for (const auto& holder_pair : net_connectors_) {
device_names.push_back(holder_pair.first);
}
diff --git a/bin/ledger/testing/netconnector/netconnector_factory.h b/bin/ledger/testing/netconnector/netconnector_factory.h
index 9246f6e..3b618d7 100644
--- a/bin/ledger/testing/netconnector/netconnector_factory.h
+++ b/bin/ledger/testing/netconnector/netconnector_factory.h
@@ -41,7 +41,7 @@
// FakeNetConnector::Delegate:
void GetDevicesNames(
uint64_t last_version,
- fit::function<void(uint64_t, fidl::VectorPtr<fidl::StringPtr>)> callback)
+ fit::function<void(uint64_t, std::vector<std::string>)> callback)
override;
void ConnectToServiceProvider(
std::string device_name,
@@ -50,7 +50,7 @@
// Counter incremented each time a NetConnector is added or removed; denotes
// the version of the current device list.
uint64_t current_version_ = 0;
- std::vector<fit::function<void(uint64_t, fidl::VectorPtr<fidl::StringPtr>)>>
+ std::vector<fit::function<void(uint64_t, std::vector<std::string>)>>
pending_device_list_callbacks_;
callback::AutoCleanableMap<std::string, Holder> net_connectors_;
diff --git a/bin/ledger/testing/netconnector/netconnector_factory_unittest.cc b/bin/ledger/testing/netconnector/netconnector_factory_unittest.cc
index e38cab5..7346c1a 100644
--- a/bin/ledger/testing/netconnector/netconnector_factory_unittest.cc
+++ b/bin/ledger/testing/netconnector/netconnector_factory_unittest.cc
@@ -38,7 +38,7 @@
bool called = false;
uint64_t version = 0;
- fidl::VectorPtr<fidl::StringPtr> host_list;
+ std::vector<std::string> host_list;
netconnector1->GetKnownDeviceNames(
fuchsia::netconnector::kInitialKnownDeviceNames,
callback::Capture(callback::SetWhenCalled(&called), &version,
@@ -48,9 +48,9 @@
EXPECT_TRUE(called);
EXPECT_NE(fuchsia::netconnector::kInitialKnownDeviceNames, version);
- ASSERT_GE(1u, host_list->size());
- EXPECT_EQ(1u, host_list->size());
- EXPECT_EQ("host1", host_list->at(0));
+ ASSERT_GE(1u, host_list.size());
+ EXPECT_EQ(1u, host_list.size());
+ EXPECT_EQ("host1", host_list.at(0));
called = false;
netconnector1->GetKnownDeviceNames(
@@ -68,7 +68,7 @@
bool called = false;
uint64_t version = 0;
- fidl::VectorPtr<fidl::StringPtr> host_list;
+ std::vector<std::string> host_list;
netconnector1->GetKnownDeviceNames(
fuchsia::netconnector::kInitialKnownDeviceNames,
callback::Capture(callback::SetWhenCalled(&called), &version,
@@ -92,10 +92,10 @@
RunLoopUntilIdle();
EXPECT_TRUE(called);
EXPECT_NE(new_version, version);
- ASSERT_GE(2u, host_list->size());
- EXPECT_EQ(2u, host_list->size());
- EXPECT_EQ("host1", host_list->at(0));
- EXPECT_EQ("host2", host_list->at(1));
+ ASSERT_GE(2u, host_list.size());
+ EXPECT_EQ(2u, host_list.size());
+ EXPECT_EQ("host1", host_list.at(0));
+ EXPECT_EQ("host2", host_list.at(1));
called = false;
netconnector2->GetKnownDeviceNames(
@@ -105,10 +105,10 @@
RunLoopUntilIdle();
EXPECT_TRUE(called);
- ASSERT_GE(2u, host_list->size());
- EXPECT_EQ(2u, host_list->size());
- EXPECT_EQ("host1", host_list->at(0));
- EXPECT_EQ("host2", host_list->at(1));
+ ASSERT_GE(2u, host_list.size());
+ EXPECT_EQ(2u, host_list.size());
+ EXPECT_EQ("host1", host_list.at(0));
+ EXPECT_EQ("host2", host_list.at(1));
netconnector2.Unbind();
@@ -117,9 +117,9 @@
&new_version, &host_list));
RunLoopUntilIdle();
EXPECT_TRUE(called);
- ASSERT_GE(1u, host_list->size());
- EXPECT_EQ(1u, host_list->size());
- EXPECT_EQ("host1", host_list->at(0));
+ ASSERT_GE(1u, host_list.size());
+ EXPECT_EQ(1u, host_list.size());
+ EXPECT_EQ("host1", host_list.at(0));
}
// Verifies that the host list is correct for two hosts when calls are chained,
@@ -131,7 +131,7 @@
bool called = false;
uint64_t version = 0;
- fidl::VectorPtr<fidl::StringPtr> host_list;
+ std::vector<std::string> host_list;
netconnector1->GetKnownDeviceNames(
fuchsia::netconnector::kInitialKnownDeviceNames,
callback::Capture(callback::SetWhenCalled(&called), &version,
@@ -155,10 +155,10 @@
RunLoopUntilIdle();
EXPECT_TRUE(called);
EXPECT_NE(new_version, version);
- ASSERT_GE(2u, host_list->size());
- EXPECT_EQ(2u, host_list->size());
- EXPECT_EQ("host1", host_list->at(0));
- EXPECT_EQ("host2", host_list->at(1));
+ ASSERT_GE(2u, host_list.size());
+ EXPECT_EQ(2u, host_list.size());
+ EXPECT_EQ("host1", host_list.at(0));
+ EXPECT_EQ("host2", host_list.at(1));
netconnector1->GetKnownDeviceNames(
new_version, callback::Capture(callback::SetWhenCalled(&called),
@@ -171,9 +171,9 @@
RunLoopUntilIdle();
EXPECT_TRUE(called);
- ASSERT_GE(1u, host_list->size());
- EXPECT_EQ(1u, host_list->size());
- EXPECT_EQ("host1", host_list->at(0));
+ ASSERT_GE(1u, host_list.size());
+ EXPECT_EQ(1u, host_list.size());
+ EXPECT_EQ("host1", host_list.at(0));
}
TEST_F(NetConnectorFactoryTest, HostList_TwoHosts_Callback) {
@@ -182,7 +182,7 @@
bool called = false;
uint64_t version = 0;
- fidl::VectorPtr<fidl::StringPtr> host_list;
+ std::vector<std::string> host_list;
netconnector1->GetKnownDeviceNames(
fuchsia::netconnector::kInitialKnownDeviceNames,
callback::Capture(callback::SetWhenCalled(&called), &version,
@@ -206,10 +206,10 @@
RunLoopUntilIdle();
EXPECT_TRUE(called);
EXPECT_NE(new_version, version);
- ASSERT_GE(2u, host_list->size());
- EXPECT_EQ(2u, host_list->size());
- EXPECT_EQ("host1", host_list->at(0));
- EXPECT_EQ("host2", host_list->at(1));
+ ASSERT_GE(2u, host_list.size());
+ EXPECT_EQ(2u, host_list.size());
+ EXPECT_EQ("host1", host_list.at(0));
+ EXPECT_EQ("host2", host_list.at(1));
bool called2;
netconnector1->GetKnownDeviceNames(
@@ -228,9 +228,9 @@
EXPECT_TRUE(called);
EXPECT_FALSE(called2);
- ASSERT_GE(1u, host_list->size());
- EXPECT_EQ(1u, host_list->size());
- EXPECT_EQ("host1", host_list->at(0));
+ ASSERT_GE(1u, host_list.size());
+ EXPECT_EQ(1u, host_list.size());
+ EXPECT_EQ("host1", host_list.at(0));
}
// Tests that two "hosts" can talk to each other through the NetConnector
diff --git a/bin/ledger/testing/page_data_generator.cc b/bin/ledger/testing/page_data_generator.cc
index 2ce9ceb..533ac74 100644
--- a/bin/ledger/testing/page_data_generator.cc
+++ b/bin/ledger/testing/page_data_generator.cc
@@ -34,15 +34,15 @@
PageDataGenerator::PageDataGenerator(rng::Random* random)
: generator_(random) {}
-void PageDataGenerator::PutEntry(PagePtr* page, fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value,
+void PageDataGenerator::PutEntry(PagePtr* page, std::vector<uint8_t> key,
+ std::vector<uint8_t> value,
ReferenceStrategy ref_strategy,
Priority priority,
fit::function<void(Status)> callback) {
if (ref_strategy == ReferenceStrategy::INLINE) {
- if (value->size() >= kMaxInlineDataSize) {
+ if (value.size() >= kMaxInlineDataSize) {
FXL_LOG(ERROR)
- << "Value too large (" << value->size()
+ << "Value too large (" << value.size()
<< ") to be put inline. Consider putting as reference instead.";
callback(Status::IO_ERROR);
return;
@@ -77,7 +77,7 @@
}
void PageDataGenerator::Populate(PagePtr* page,
- std::vector<fidl::VectorPtr<uint8_t>> keys,
+ std::vector<std::vector<uint8_t>> keys,
size_t value_size, size_t transaction_size,
ReferenceStrategy ref_strategy,
Priority priority,
@@ -92,7 +92,7 @@
}
void PageDataGenerator::PutInTransaction(
- PagePtr* page, std::vector<fidl::VectorPtr<uint8_t>> keys,
+ PagePtr* page, std::vector<std::vector<uint8_t>> keys,
size_t current_key_index, size_t value_size, size_t transaction_size,
ReferenceStrategy ref_strategy, Priority priority,
fit::function<void(Status)> callback) {
@@ -102,7 +102,7 @@
}
size_t this_transaction_size =
std::min(transaction_size, keys.size() - current_key_index);
- std::vector<fidl::VectorPtr<uint8_t>> partial_keys;
+ std::vector<std::vector<uint8_t>> partial_keys;
std::move(keys.begin() + current_key_index,
keys.begin() + current_key_index + this_transaction_size,
std::back_inserter(partial_keys));
@@ -143,12 +143,12 @@
}
void PageDataGenerator::PutMultipleEntries(
- PagePtr* page, std::vector<fidl::VectorPtr<uint8_t>> keys,
+ PagePtr* page, std::vector<std::vector<uint8_t>> keys,
size_t value_size, ReferenceStrategy ref_strategy, Priority priority,
fit::function<void(Status)> callback) {
auto waiter = fxl::MakeRefCounted<callback::StatusWaiter<Status>>(Status::OK);
for (auto& key : keys) {
- fidl::VectorPtr<uint8_t> value = generator_.MakeValue(value_size);
+ std::vector<uint8_t> value = generator_.MakeValue(value_size);
PutEntry(page, std::move(key), std::move(value), ref_strategy, priority,
waiter->NewCallback());
}
diff --git a/bin/ledger/testing/page_data_generator.h b/bin/ledger/testing/page_data_generator.h
index 731c8a8..2330a15 100644
--- a/bin/ledger/testing/page_data_generator.h
+++ b/bin/ledger/testing/page_data_generator.h
@@ -32,14 +32,14 @@
// Put an entry (|key|, |value|) to the given page |page|, inline or as
// reference depending on |ref_strategy| and with priority specified by
// |priority|.
- void PutEntry(PagePtr* page, fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value, ReferenceStrategy ref_strategy,
+ void PutEntry(PagePtr* page, std::vector<uint8_t> key,
+ std::vector<uint8_t> value, ReferenceStrategy ref_strategy,
Priority priority, fit::function<void(Status)> callback);
// Fill the page |page| with entries with keys |keys| and random values of
// size |value_size|, performing at maximum
// |transaction_size| Put operations per commit.
- void Populate(PagePtr* page, std::vector<fidl::VectorPtr<uint8_t>> keys,
+ void Populate(PagePtr* page, std::vector<std::vector<uint8_t>> keys,
size_t value_size, size_t transaction_size,
ReferenceStrategy ref_strategy, Priority priority,
fit::function<void(Status)> /*callback*/);
@@ -51,7 +51,7 @@
// recursively. Call |callback| with Status::OK once all keys have been put,
// or with a first encountered status that is different from Status::OK.
void PutInTransaction(PagePtr* page,
- std::vector<fidl::VectorPtr<uint8_t>> keys,
+ std::vector<std::vector<uint8_t>> keys,
size_t current_key_index, size_t value_size,
size_t transaction_size, ReferenceStrategy ref_strategy,
Priority priority,
@@ -60,7 +60,7 @@
// Run PutEntry on all the provided keys in |keys| with random value of size
// |value_size|.
void PutMultipleEntries(PagePtr* page,
- std::vector<fidl::VectorPtr<uint8_t>> keys,
+ std::vector<std::vector<uint8_t>> keys,
size_t value_size, ReferenceStrategy ref_strategy,
Priority priority,
fit::function<void(Status)> /*callback*/);
diff --git a/bin/ledger/tests/benchmark/backlog/backlog.cc b/bin/ledger/tests/benchmark/backlog/backlog.cc
index 1c0e2a8..2a6f8ec 100644
--- a/bin/ledger/tests/benchmark/backlog/backlog.cc
+++ b/bin/ledger/tests/benchmark/backlog/backlog.cc
@@ -375,20 +375,20 @@
TRACE_ASYNC_BEGIN("benchmark", "get_entries_partial", entries_left);
if (reference_strategy_ == PageDataGenerator::ReferenceStrategy::INLINE) {
reader_snapshot_->GetEntriesInline(
- fidl::VectorPtr<uint8_t>::New(0), std::move(token),
+ std::vector<uint8_t>(), std::move(token),
[this, entries_left](Status status, auto entries,
auto next_token) mutable {
TRACE_ASYNC_END("benchmark", "get_entries_partial", entries_left);
- CheckStatusAndGetMore(status, entries_left - entries->size(),
+ CheckStatusAndGetMore(status, entries_left - entries.size(),
std::move(next_token));
});
} else {
reader_snapshot_->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0), std::move(token),
+ std::vector<uint8_t>(), std::move(token),
[this, entries_left](Status status, auto entries,
auto next_token) mutable {
TRACE_ASYNC_END("benchmark", "get_entries_partial", entries_left);
- CheckStatusAndGetMore(status, entries_left - entries->size(),
+ CheckStatusAndGetMore(status, entries_left - entries.size(),
std::move(next_token));
});
}
diff --git a/bin/ledger/tests/benchmark/convergence/convergence.cc b/bin/ledger/tests/benchmark/convergence/convergence.cc
index 78c5545..1935455 100644
--- a/bin/ledger/tests/benchmark/convergence/convergence.cc
+++ b/bin/ledger/tests/benchmark/convergence/convergence.cc
@@ -194,7 +194,7 @@
}
for (int device_id = 0; device_id < device_count_; device_id++) {
- fidl::VectorPtr<uint8_t> key =
+ std::vector<uint8_t> key =
generator_.MakeKey(device_count_ * step + device_id, kKeySize);
// Insert each key N times, as we will receive N notifications - one for
// each connection, sender included.
@@ -218,7 +218,7 @@
ResultState result_state,
OnChangeCallback callback) {
FXL_DCHECK(result_state == ResultState::COMPLETED);
- for (auto& change : *page_change.changed_entries) {
+ for (auto& change : page_change.changed_entries) {
auto find_one = remaining_keys_.find(convert::ToString(change.key));
remaining_keys_.erase(find_one);
}
diff --git a/bin/ledger/tests/benchmark/delete_entry/delete_entry.cc b/bin/ledger/tests/benchmark/delete_entry/delete_entry.cc
index 5f2fd02..e22437d 100644
--- a/bin/ledger/tests/benchmark/delete_entry/delete_entry.cc
+++ b/bin/ledger/tests/benchmark/delete_entry/delete_entry.cc
@@ -89,7 +89,7 @@
fuchsia::sys::ComponentControllerPtr component_controller_;
LedgerPtr ledger_;
PagePtr page_;
- std::vector<fidl::VectorPtr<uint8_t>> keys_;
+ std::vector<std::vector<uint8_t>> keys_;
FXL_DISALLOW_COPY_AND_ASSIGN(DeleteEntryBenchmark);
};
@@ -139,7 +139,7 @@
void DeleteEntryBenchmark::Populate() {
auto keys = generator_.MakeKeys(entry_count_, key_size_, entry_count_);
for (size_t i = 0; i < entry_count_; i++) {
- keys_.push_back(keys[i].Clone());
+ keys_.push_back(keys[i]);
}
page_data_generator_.Populate(
diff --git a/bin/ledger/tests/benchmark/fetch/fetch.cc b/bin/ledger/tests/benchmark/fetch/fetch.cc
index 81c2475..55efd61 100644
--- a/bin/ledger/tests/benchmark/fetch/fetch.cc
+++ b/bin/ledger/tests/benchmark/fetch/fetch.cc
@@ -109,7 +109,7 @@
PageId page_id_;
PagePtr writer_page_;
PagePtr reader_page_;
- std::vector<fidl::VectorPtr<uint8_t>> keys_;
+ std::vector<std::vector<uint8_t>> keys_;
fit::function<void(SyncState, SyncState)> on_sync_state_changed_;
FXL_DISALLOW_COPY_AND_ASSIGN(FetchBenchmark);
@@ -185,7 +185,7 @@
void FetchBenchmark::Populate() {
auto keys = generator_.MakeKeys(entry_count_, kKeySize, entry_count_);
for (size_t i = 0; i < entry_count_; i++) {
- keys_.push_back(keys[i].Clone());
+ keys_.push_back(keys[i]);
}
page_data_generator_.Populate(
@@ -293,7 +293,7 @@
auto trace_event_id = TRACE_NONCE();
TRACE_ASYNC_BEGIN("benchmark", "FetchPartial", trace_event_id);
snapshot_ptr->FetchPartial(
- keys_[i].Clone(), part * part_size_, part_size_,
+ keys_[i], part * part_size_, part_size_,
[this, snapshot = std::move(snapshot), i, part, trace_event_id](
Status status, fuchsia::mem::BufferPtr value) mutable {
if (QuitOnError(QuitLoopClosure(), status,
diff --git a/bin/ledger/tests/benchmark/put/put.cc b/bin/ledger/tests/benchmark/put/put.cc
index f1516db..b55d54a 100644
--- a/bin/ledger/tests/benchmark/put/put.cc
+++ b/bin/ledger/tests/benchmark/put/put.cc
@@ -64,13 +64,13 @@
// on updating entries, it also adds these keys in the ledger with some
// initial values.
void InitializeKeys(
- fit::function<void(std::vector<fidl::VectorPtr<uint8_t>>)> on_done);
+ fit::function<void(std::vector<std::vector<uint8_t>>)> on_done);
- void BindWatcher(std::vector<fidl::VectorPtr<uint8_t>> keys);
- void RunSingle(int i, std::vector<fidl::VectorPtr<uint8_t>> keys);
+ void BindWatcher(std::vector<std::vector<uint8_t>> keys);
+ void RunSingle(int i, std::vector<std::vector<uint8_t>> keys);
void CommitAndRunNext(int i, size_t key_number,
- std::vector<fidl::VectorPtr<uint8_t>> keys);
- void PutEntry(fidl::VectorPtr<uint8_t> key, fidl::VectorPtr<uint8_t> value,
+ std::vector<std::vector<uint8_t>> keys);
+ void PutEntry(std::vector<uint8_t> key, std::vector<uint8_t> value,
fit::function<void()> on_done);
void ShutDown();
@@ -163,7 +163,7 @@
page_ = std::move(page);
InitializeKeys(
- [this](std::vector<fidl::VectorPtr<uint8_t>> keys) mutable {
+ [this](std::vector<std::vector<uint8_t>> keys) mutable {
if (transaction_size_ > 0) {
page_->StartTransaction(
[this, keys = std::move(keys)](Status status) mutable {
@@ -184,7 +184,7 @@
void PutBenchmark::OnChange(PageChange page_change,
ResultState /*result_state*/,
OnChangeCallback callback) {
- for (auto const& change : *page_change.changed_entries) {
+ for (auto const& change : page_change.changed_entries) {
size_t key_number = std::stoul(convert::ToString(change.key));
if (keys_to_receive_.find(key_number) != keys_to_receive_.end()) {
TRACE_ASYNC_END("benchmark", "local_change_notification", key_number);
@@ -198,12 +198,12 @@
}
void PutBenchmark::InitializeKeys(
- fit::function<void(std::vector<fidl::VectorPtr<uint8_t>>)> on_done) {
- std::vector<fidl::VectorPtr<uint8_t>> keys =
+ fit::function<void(std::vector<std::vector<uint8_t>>)> on_done) {
+ std::vector<std::vector<uint8_t>> keys =
generator_.MakeKeys(entry_count_, key_size_, entry_count_);
- std::vector<fidl::VectorPtr<uint8_t>> keys_cloned;
+ std::vector<std::vector<uint8_t>> keys_cloned;
for (int i = 0; i < entry_count_; ++i) {
- keys_cloned.push_back(keys[i].Clone());
+ keys_cloned.push_back(keys[i]);
if (transaction_size_ == 0 ||
i % transaction_size_ == transaction_size_ - 1) {
keys_to_receive_.insert(std::stoul(convert::ToString(keys[i])));
@@ -229,7 +229,7 @@
});
}
-void PutBenchmark::BindWatcher(std::vector<fidl::VectorPtr<uint8_t>> keys) {
+void PutBenchmark::BindWatcher(std::vector<std::vector<uint8_t>> keys) {
PageSnapshotPtr snapshot;
page_->GetSnapshot(
snapshot.NewRequest(), fidl::VectorPtr<uint8_t>::New(0),
@@ -243,7 +243,7 @@
}
void PutBenchmark::RunSingle(int i,
- std::vector<fidl::VectorPtr<uint8_t>> keys) {
+ std::vector<std::vector<uint8_t>> keys) {
if (i == entry_count_) {
// All sent, waiting for watcher notification before shutting down.
return;
@@ -266,8 +266,8 @@
});
}
-void PutBenchmark::PutEntry(fidl::VectorPtr<uint8_t> key,
- fidl::VectorPtr<uint8_t> value,
+void PutBenchmark::PutEntry(std::vector<uint8_t> key,
+ std::vector<uint8_t> value,
fit::function<void()> on_done) {
auto trace_event_id = TRACE_NONCE();
TRACE_ASYNC_BEGIN("benchmark", "put", trace_event_id);
@@ -313,7 +313,7 @@
}
void PutBenchmark::CommitAndRunNext(
- int i, size_t key_number, std::vector<fidl::VectorPtr<uint8_t>> keys) {
+ int i, size_t key_number, std::vector<std::vector<uint8_t>> keys) {
TRACE_ASYNC_BEGIN("benchmark", "local_change_notification", key_number);
TRACE_ASYNC_BEGIN("benchmark", "commit", i / transaction_size_);
page_->Commit([this, i, keys = std::move(keys)](Status status) mutable {
diff --git a/bin/ledger/tests/benchmark/sync/sync.cc b/bin/ledger/tests/benchmark/sync/sync.cc
index 412da81..7f38b34 100644
--- a/bin/ledger/tests/benchmark/sync/sync.cc
+++ b/bin/ledger/tests/benchmark/sync/sync.cc
@@ -209,10 +209,10 @@
void SyncBenchmark::OnChange(PageChange page_change, ResultState result_state,
OnChangeCallback callback) {
- FXL_DCHECK(!page_change.changed_entries->empty());
+ FXL_DCHECK(!page_change.changed_entries.empty());
size_t i =
- std::stoul(convert::ToString(page_change.changed_entries->at(0).key));
- changed_entries_received_ += page_change.changed_entries->size();
+ std::stoul(convert::ToString(page_change.changed_entries.at(0).key));
+ changed_entries_received_ += page_change.changed_entries.size();
if (result_state == ResultState::COMPLETED ||
result_state == ResultState::PARTIAL_STARTED) {
TRACE_ASYNC_END("benchmark", "sync latency", i);
@@ -231,7 +231,7 @@
return;
}
- std::vector<fidl::VectorPtr<uint8_t>> keys(entries_per_change_);
+ std::vector<std::vector<uint8_t>> keys(entries_per_change_);
for (size_t i = 0; i < entries_per_change_; i++) {
// Keys are distinct, but have the common prefix <i>.
keys[i] = generator_.MakeKey(change_number, kKeySize);
diff --git a/bin/ledger/tests/benchmark/update_entry/update_entry.cc b/bin/ledger/tests/benchmark/update_entry/update_entry.cc
index 3505b55..b076080 100644
--- a/bin/ledger/tests/benchmark/update_entry/update_entry.cc
+++ b/bin/ledger/tests/benchmark/update_entry/update_entry.cc
@@ -68,8 +68,8 @@
void Run();
private:
- void RunSingle(int i, fidl::VectorPtr<uint8_t> key);
- void CommitAndRunNext(int i, fidl::VectorPtr<uint8_t> key);
+ void RunSingle(int i, std::vector<uint8_t> key);
+ void CommitAndRunNext(int i, std::vector<uint8_t> key);
void ShutDown();
fit::closure QuitLoopClosure();
@@ -130,7 +130,7 @@
return;
}
page_ = std::move(page);
- fidl::VectorPtr<uint8_t> key = generator_.MakeKey(0, key_size_);
+ std::vector<uint8_t> key = generator_.MakeKey(0, key_size_);
if (transaction_size_ > 0) {
page_->StartTransaction(
[this, key = std::move(key)](Status status) mutable {
@@ -147,15 +147,15 @@
});
}
-void UpdateEntryBenchmark::RunSingle(int i, fidl::VectorPtr<uint8_t> key) {
+void UpdateEntryBenchmark::RunSingle(int i, std::vector<uint8_t> key) {
if (i == entry_count_) {
ShutDown();
return;
}
- fidl::VectorPtr<uint8_t> value = generator_.MakeValue(value_size_);
+ std::vector<uint8_t> value = generator_.MakeValue(value_size_);
TRACE_ASYNC_BEGIN("benchmark", "put", i);
- page_->Put(fidl::Clone(key), std::move(value),
+ page_->Put(key, std::move(value),
[this, i, key = std::move(key)](Status status) mutable {
if (QuitOnError(QuitLoopClosure(), status, "Page::Put")) {
return;
@@ -172,7 +172,7 @@
}
void UpdateEntryBenchmark::CommitAndRunNext(int i,
- fidl::VectorPtr<uint8_t> key) {
+ std::vector<uint8_t> key) {
TRACE_ASYNC_BEGIN("benchmark", "commit", i / transaction_size_);
page_->Commit([this, i, key = std::move(key)](Status status) mutable {
if (QuitOnError(QuitLoopClosure(), status, "Page::Commit")) {
diff --git a/bin/ledger/tests/cloud_provider/page_cloud_test.cc b/bin/ledger/tests/cloud_provider/page_cloud_test.cc
index d797be4..9dcf140 100644
--- a/bin/ledger/tests/cloud_provider/page_cloud_test.cc
+++ b/bin/ledger/tests/cloud_provider/page_cloud_test.cc
@@ -112,7 +112,7 @@
on_new_commits_commits_callback_ = std::move(callback);
}
- void OnNewObject(fidl::VectorPtr<uint8_t> /*id*/,
+ void OnNewObject(std::vector<uint8_t> /*id*/,
fuchsia::mem::Buffer /*data*/,
OnNewObjectCallback /*callback*/) override {
// We don't have any implementations yet that support this API.
diff --git a/bin/ledger/tests/integration/merging_tests.cc b/bin/ledger/tests/integration/merging_tests.cc
index 8fe9ad3..852d79f 100644
--- a/bin/ledger/tests/integration/merging_tests.cc
+++ b/bin/ledger/tests/integration/merging_tests.cc
@@ -110,7 +110,7 @@
size_t min_queries = 0) {
return GetDiff(
[this](std::unique_ptr<Token> token,
- fit::function<void(IterationStatus, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(IterationStatus, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) mutable {
result_provider->GetFullDiffNew(std::move(token),
@@ -123,7 +123,7 @@
std::vector<DiffEntry>* entries, size_t min_queries = 0) {
return GetDiff(
[this](std::unique_ptr<Token> token,
- fit::function<void(IterationStatus, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(IterationStatus, std::vector<DiffEntry>,
std::unique_ptr<Token>)>
callback) mutable {
result_provider->GetConflictingDiffNew(std::move(token),
@@ -135,9 +135,9 @@
// Resolves the conflict by sending the given merge results. If
// |merge_type| is MULTIPART, the merge will be send in two parts, each
// sending half of |results|' elements.
- ::testing::AssertionResult Merge(fidl::VectorPtr<MergedValue> results,
+ ::testing::AssertionResult Merge(std::vector<MergedValue> results,
MergeType merge_type = MergeType::SIMPLE) {
- FXL_DCHECK(merge_type == MergeType::SIMPLE || results->size() >= 2);
+ FXL_DCHECK(merge_type == MergeType::SIMPLE || results.size() >= 2);
if (!result_provider) {
return ::testing::AssertionFailure()
@@ -151,10 +151,10 @@
return merge_status;
}
} else {
- size_t part1_size = results->size() / 2;
- fidl::VectorPtr<MergedValue> part2;
- for (size_t i = part1_size; i < results->size(); ++i) {
- part2.push_back(std::move(results->at(i)));
+ size_t part1_size = results.size() / 2;
+ std::vector<MergedValue> part2;
+ for (size_t i = part1_size; i < results.size(); ++i) {
+ part2.push_back(std::move(results.at(i)));
}
results.resize(part1_size);
@@ -204,7 +204,7 @@
::testing::AssertionResult GetDiff(
fit::function<
void(std::unique_ptr<Token>,
- fit::function<void(IterationStatus, fidl::VectorPtr<DiffEntry>,
+ fit::function<void(IterationStatus, std::vector<DiffEntry>,
std::unique_ptr<Token>)>)>
get_diff,
std::vector<DiffEntry>* entries, size_t min_queries) {
@@ -212,7 +212,7 @@
size_t num_queries = 0u;
std::unique_ptr<Token> token;
do {
- fidl::VectorPtr<DiffEntry> new_entries;
+ std::vector<DiffEntry> new_entries;
IterationStatus status;
auto waiter = loop_controller_->NewWaiter();
std::unique_ptr<Token> new_token;
@@ -231,8 +231,8 @@
<< ", but status is:" << fidl::ToUnderlying(status);
}
entries->insert(entries->end(),
- std::make_move_iterator(new_entries->begin()),
- std::make_move_iterator(new_entries->end()));
+ std::make_move_iterator(new_entries.begin()),
+ std::make_move_iterator(new_entries.end()));
++num_queries;
} while (token);
@@ -246,7 +246,7 @@
}
::testing::AssertionResult PartialMerge(
- fidl::VectorPtr<MergedValue> partial_result) {
+ std::vector<MergedValue> partial_result) {
result_provider->MergeNew(std::move(partial_result));
return Sync();
}
@@ -508,11 +508,11 @@
ASSERT_TRUE(watcher1_waiter->RunUntilCalled());
EXPECT_EQ(1u, watcher1.changes_seen);
PageChange change = std::move(watcher1.last_page_change_);
- ASSERT_EQ(2u, change.changed_entries->size());
- EXPECT_EQ("city", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Paris", ToString(change.changed_entries->at(0).value));
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(1).key));
- EXPECT_EQ("Alice", ToString(change.changed_entries->at(1).value));
+ ASSERT_EQ(2u, change.changed_entries.size());
+ EXPECT_EQ("city", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Paris", ToString(change.changed_entries.at(0).value));
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(1).key));
+ EXPECT_EQ("Alice", ToString(change.changed_entries.at(1).value));
waiter = NewWaiter();
page2->Commit(callback::Capture(waiter->GetCallback(), &status));
@@ -522,11 +522,11 @@
EXPECT_EQ(1u, watcher2.changes_seen);
change = std::move(watcher2.last_page_change_);
- ASSERT_EQ(2u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Bob", ToString(change.changed_entries->at(0).value));
- EXPECT_EQ("phone", convert::ToString(change.changed_entries->at(1).key));
- EXPECT_EQ("0123456789", ToString(change.changed_entries->at(1).value));
+ ASSERT_EQ(2u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Bob", ToString(change.changed_entries.at(0).value));
+ EXPECT_EQ("phone", convert::ToString(change.changed_entries.at(1).key));
+ EXPECT_EQ("0123456789", ToString(change.changed_entries.at(1).value));
ASSERT_TRUE(watcher1_waiter->RunUntilCalled());
ASSERT_TRUE(watcher2_waiter->RunUntilCalled());
@@ -534,17 +534,17 @@
// Each change is seen once, and by the correct watcher only.
EXPECT_EQ(2u, watcher1.changes_seen);
change = std::move(watcher1.last_page_change_);
- ASSERT_EQ(2u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Bob", ToString(change.changed_entries->at(0).value));
- EXPECT_EQ("phone", convert::ToString(change.changed_entries->at(1).key));
- EXPECT_EQ("0123456789", ToString(change.changed_entries->at(1).value));
+ ASSERT_EQ(2u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Bob", ToString(change.changed_entries.at(0).value));
+ EXPECT_EQ("phone", convert::ToString(change.changed_entries.at(1).key));
+ EXPECT_EQ("0123456789", ToString(change.changed_entries.at(1).value));
EXPECT_EQ(2u, watcher2.changes_seen);
change = std::move(watcher2.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("city", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Paris", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("city", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Paris", ToString(change.changed_entries.at(0).value));
}
TEST_P(MergingIntegrationTest, MergingWithConflictResolutionFactory) {
@@ -638,11 +638,11 @@
ASSERT_TRUE(watcher1_waiter->RunUntilCalled());
EXPECT_EQ(1u, watcher1.changes_seen);
PageChange change = std::move(watcher1.last_page_change_);
- ASSERT_EQ(2u, change.changed_entries->size());
- EXPECT_EQ("city", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Paris", ToString(change.changed_entries->at(0).value));
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(1).key));
- EXPECT_EQ("Alice", ToString(change.changed_entries->at(1).value));
+ ASSERT_EQ(2u, change.changed_entries.size());
+ EXPECT_EQ("city", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Paris", ToString(change.changed_entries.at(0).value));
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(1).key));
+ EXPECT_EQ("Alice", ToString(change.changed_entries.at(1).value));
waiter = NewWaiter();
page2->Commit(callback::Capture(waiter->GetCallback(), &status));
@@ -652,11 +652,11 @@
ASSERT_TRUE(watcher2_waiter->RunUntilCalled());
EXPECT_EQ(1u, watcher2.changes_seen);
change = std::move(watcher2.last_page_change_);
- ASSERT_EQ(2u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Bob", ToString(change.changed_entries->at(0).value));
- EXPECT_EQ("phone", convert::ToString(change.changed_entries->at(1).key));
- EXPECT_EQ("0123456789", ToString(change.changed_entries->at(1).value));
+ ASSERT_EQ(2u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Bob", ToString(change.changed_entries.at(0).value));
+ EXPECT_EQ("phone", convert::ToString(change.changed_entries.at(1).key));
+ EXPECT_EQ("0123456789", ToString(change.changed_entries.at(1).value));
// Check that the resolver fectory GetPolicy method is not called.
RunLoopFor(zx::sec(1));
@@ -683,17 +683,17 @@
// Each change is seen once, and by the correct watcher only.
EXPECT_EQ(2u, watcher1.changes_seen);
change = std::move(watcher1.last_page_change_);
- ASSERT_EQ(2u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Bob", ToString(change.changed_entries->at(0).value));
- EXPECT_EQ("phone", convert::ToString(change.changed_entries->at(1).key));
- EXPECT_EQ("0123456789", ToString(change.changed_entries->at(1).value));
+ ASSERT_EQ(2u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Bob", ToString(change.changed_entries.at(0).value));
+ EXPECT_EQ("phone", convert::ToString(change.changed_entries.at(1).key));
+ EXPECT_EQ("0123456789", ToString(change.changed_entries.at(1).value));
EXPECT_EQ(2u, watcher2.changes_seen);
change = std::move(watcher2.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("city", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Paris", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("city", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Paris", ToString(change.changed_entries.at(0).value));
EXPECT_EQ(1u, resolver_factory->get_policy_calls);
}
@@ -795,7 +795,7 @@
EXPECT_EQ(0u, entries.size());
// Prepare the merged values
- fidl::VectorPtr<MergedValue> merged_values;
+ std::vector<MergedValue> merged_values;
{
MergedValue merged_value;
merged_value.key = convert::ToArray("name");
@@ -1020,8 +1020,7 @@
RunLoopFor(zx::msec(500));
// Resolution should not crash the Ledger
- fidl::VectorPtr<MergedValue> merged_values =
- fidl::VectorPtr<MergedValue>::New(0);
+ std::vector<MergedValue> merged_values;
EXPECT_TRUE(resolver_impl->requests[0].Merge(std::move(merged_values)));
RunLoopFor(zx::msec(200));
}
@@ -1124,8 +1123,7 @@
RunLoopFor(zx::msec(500));
// Resolution should not crash the Ledger
- fidl::VectorPtr<MergedValue> merged_values =
- fidl::VectorPtr<MergedValue>::New(0);
+ std::vector<MergedValue> merged_values;
EXPECT_TRUE(resolver_impl2->requests[0].Merge(std::move(merged_values)));
RunLoopFor(zx::msec(200));
@@ -1195,8 +1193,7 @@
ASSERT_EQ(1u, resolver_impl->requests.size());
// Prepare the merged values
- fidl::VectorPtr<MergedValue> merged_values =
- fidl::VectorPtr<MergedValue>::New(0);
+ std::vector<MergedValue> merged_values;
{
MergedValue merged_value;
merged_value.key = convert::ToArray("name");
@@ -1435,8 +1432,7 @@
EXPECT_EQ(0u, entries.size());
// Prepare the merged values
- fidl::VectorPtr<MergedValue> merged_values =
- fidl::VectorPtr<MergedValue>::New(0);
+ std::vector<MergedValue> merged_values;
{
MergedValue merged_value;
merged_value.key = convert::ToArray("city");
@@ -1539,8 +1535,7 @@
ASSERT_EQ(1u, resolver_impl->requests.size());
// Prepare the merged values
- fidl::VectorPtr<MergedValue> merged_values =
- fidl::VectorPtr<MergedValue>::New(0);
+ std::vector<MergedValue> merged_values;
{
MergedValue merged_value;
merged_value.key = convert::ToArray("city");
@@ -1774,8 +1769,7 @@
EXPECT_TRUE(conflicts_resolved_callback_waiter->NotCalledYet());
// Merge manually.
- fidl::VectorPtr<MergedValue> merged_values =
- fidl::VectorPtr<MergedValue>::New(0);
+ std::vector<MergedValue> merged_values;
EXPECT_TRUE(resolver_impl->requests[0].Merge(std::move(merged_values),
MergeType::SIMPLE));
EXPECT_TRUE(conflicts_resolved_callback_waiter->NotCalledYet());
@@ -1868,8 +1862,7 @@
Optional<std::string>("Alice"), changes[0]));
// Prepare the merged values
- fidl::VectorPtr<MergedValue> merged_values =
- fidl::VectorPtr<MergedValue>::New(0);
+ std::vector<MergedValue> merged_values;
{
MergedValue merged_value;
merged_value.key = convert::ToArray("name");
@@ -2090,9 +2083,9 @@
ASSERT_TRUE(watcher_waiter->RunUntilCalled());
EXPECT_EQ(1u, watcher1.changes_seen);
PageChange change = std::move(watcher1.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Alice", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Alice", ToString(change.changed_entries.at(0).value));
waiter = NewWaiter();
page_conn2->Commit(callback::Capture(waiter->GetCallback(), &status));
@@ -2102,9 +2095,9 @@
ASSERT_TRUE(watcher_waiter->RunUntilCalled());
EXPECT_EQ(1u, watcher2.changes_seen);
change = std::move(watcher2.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Bob", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Bob", ToString(change.changed_entries.at(0).value));
ASSERT_TRUE(watcher_waiter->RunUntilCalled());
PageSnapshotPtr snapshot3;
@@ -2229,9 +2222,9 @@
ASSERT_TRUE(watcher_waiter->RunUntilCalled());
EXPECT_EQ(1u, watcher1.changes_seen);
PageChange change = std::move(watcher1.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Alice", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Alice", ToString(change.changed_entries.at(0).value));
waiter = NewWaiter();
page_conn2->Commit(callback::Capture(waiter->GetCallback(), &status));
@@ -2241,9 +2234,9 @@
ASSERT_TRUE(watcher_waiter->RunUntilCalled());
EXPECT_EQ(1u, watcher2.changes_seen);
change = std::move(watcher2.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Bob", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Bob", ToString(change.changed_entries.at(0).value));
RunLoopFor(zx::sec(1));
EXPECT_TRUE(watcher_waiter->NotCalledYet());
diff --git a/bin/ledger/tests/integration/page_snapshot_tests.cc b/bin/ledger/tests/integration/page_snapshot_tests.cc
index e2f5f30..3f3fdbb 100644
--- a/bin/ledger/tests/integration/page_snapshot_tests.cc
+++ b/bin/ledger/tests/integration/page_snapshot_tests.cc
@@ -50,21 +50,21 @@
// Returns all keys from |snapshot|, starting at |start|. If |num_queries| is
// not null, stores the number of calls to GetKeys.
- std::vector<fidl::VectorPtr<uint8_t>> SnapshotGetKeys(
+ std::vector<std::vector<uint8_t>> SnapshotGetKeys(
PageSnapshotPtr* snapshot,
- fidl::VectorPtr<uint8_t> start = fidl::VectorPtr<uint8_t>::New(0),
+ std::vector<uint8_t> start = std::vector<uint8_t>(),
int* num_queries = nullptr) {
- std::vector<fidl::VectorPtr<uint8_t>> result;
+ std::vector<std::vector<uint8_t>> result;
std::unique_ptr<Token> token;
if (num_queries) {
*num_queries = 0;
}
do {
Status status;
- fidl::VectorPtr<fidl::VectorPtr<uint8_t>> keys;
+ std::vector<std::vector<uint8_t>> keys;
auto waiter = NewWaiter();
(*snapshot)->GetKeys(
- start.Clone(), std::move(token),
+ start, std::move(token),
callback::Capture(waiter->GetCallback(), &status, &keys, &token));
if (!waiter->RunUntilCalled()) {
ADD_FAILURE() << "|GetKeys| failed to call back.";
@@ -74,7 +74,7 @@
if (num_queries) {
(*num_queries)++;
}
- for (auto& key : keys.take()) {
+ for (auto& key : keys) {
result.push_back(std::move(key));
}
} while (token);
@@ -82,7 +82,7 @@
}
std::string SnapshotFetchPartial(PageSnapshotPtr* snapshot,
- fidl::VectorPtr<uint8_t> key, int64_t offset,
+ std::vector<uint8_t> key, int64_t offset,
int64_t max_size) {
Status status;
fuchsia::mem::BufferPtr buffer;
@@ -246,12 +246,12 @@
// Grab a snapshot before adding any entries and verify that GetKeys()
// returns empty results.
PageSnapshotPtr snapshot = PageGetSnapshot(&page);
- std::vector<fidl::VectorPtr<uint8_t>> result = SnapshotGetKeys(&snapshot);
+ std::vector<std::vector<uint8_t>> result = SnapshotGetKeys(&snapshot);
EXPECT_EQ(0u, result.size());
// Add entries and grab a new snapshot.
const size_t N = 4;
- fidl::VectorPtr<uint8_t> keys[N] = {
+ std::vector<uint8_t> keys[N] = {
RandomArray(GetRandom(), 20, {0, 0, 0}),
RandomArray(GetRandom(), 20, {0, 0, 1}),
RandomArray(GetRandom(), 20, {0, 1, 0}),
@@ -260,7 +260,7 @@
Status status;
for (auto& key : keys) {
auto waiter = NewWaiter();
- page->Put(key.Clone(), RandomArray(GetRandom(), 50),
+ page->Put(key, RandomArray(GetRandom(), 50),
callback::Capture(waiter->GetCallback(), &status));
ASSERT_TRUE(waiter->RunUntilCalled());
EXPECT_EQ(Status::OK, status);
@@ -309,7 +309,7 @@
snapshot =
PageGetSnapshot(&page, fidl::VectorPtr<uint8_t>(std::vector<uint8_t>{0}));
result = SnapshotGetKeys(
- &snapshot, fidl::VectorPtr<uint8_t>(std::vector<uint8_t>{0, 1, 0}));
+ &snapshot, std::vector<uint8_t>(std::vector<uint8_t>{0, 1, 0}));
EXPECT_EQ(2u, result.size());
}
@@ -321,8 +321,8 @@
// returns empty results.
PageSnapshotPtr snapshot = PageGetSnapshot(&page);
int num_queries;
- std::vector<fidl::VectorPtr<uint8_t>> result = SnapshotGetKeys(
- &snapshot, fidl::VectorPtr<uint8_t>::New(0), &num_queries);
+ std::vector<std::vector<uint8_t>> result = SnapshotGetKeys(
+ &snapshot, std::vector<uint8_t>(), &num_queries);
EXPECT_EQ(0u, result.size());
EXPECT_EQ(1, num_queries);
@@ -331,7 +331,7 @@
// multiple queries.
const size_t key_size = kMaxKeySize;
const size_t N = fidl_serialization::kMaxInlineDataSize / key_size + 1;
- fidl::VectorPtr<uint8_t> keys[N];
+ std::vector<uint8_t> keys[N];
for (size_t i = 0; i < N; ++i) {
// Generate keys so that they are in increasing order to match the order
// of results from GetKeys().
@@ -343,7 +343,7 @@
Status status;
for (auto& key : keys) {
auto waiter = NewWaiter();
- page->Put(key.Clone(), RandomArray(GetRandom(), 10),
+ page->Put(key, RandomArray(GetRandom(), 10),
callback::Capture(waiter->GetCallback(), &status));
ASSERT_TRUE(waiter->RunUntilCalled());
EXPECT_EQ(Status::OK, status);
@@ -372,13 +372,13 @@
// Add entries and grab a new snapshot.
const size_t N = 4;
- fidl::VectorPtr<uint8_t> keys[N] = {
+ std::vector<uint8_t> keys[N] = {
RandomArray(GetRandom(), 20, {0, 0, 0}),
RandomArray(GetRandom(), 20, {0, 0, 1}),
RandomArray(GetRandom(), 20, {0, 1, 0}),
RandomArray(GetRandom(), 20, {0, 1, 1}),
};
- fidl::VectorPtr<uint8_t> values[N] = {
+ std::vector<uint8_t> values[N] = {
RandomArray(GetRandom(), 50),
RandomArray(GetRandom(), 50),
RandomArray(GetRandom(), 50),
@@ -387,7 +387,7 @@
Status status;
for (size_t i = 0; i < N; ++i) {
auto waiter = NewWaiter();
- page->Put(keys[i].Clone(), values[i].Clone(),
+ page->Put(keys[i], values[i],
callback::Capture(waiter->GetCallback(), &status));
ASSERT_TRUE(waiter->RunUntilCalled());
EXPECT_EQ(Status::OK, status);
@@ -458,8 +458,8 @@
const size_t key_size = kMaxKeySize;
const size_t N =
fidl_serialization::kMaxInlineDataSize / (key_size + value_size) + 1;
- fidl::VectorPtr<uint8_t> keys[N];
- fidl::VectorPtr<uint8_t> values[N];
+ std::vector<uint8_t> keys[N];
+ std::vector<uint8_t> values[N];
for (size_t i = 0; i < N; ++i) {
// Generate keys so that they are in increasing order to match the order
// of results from GetEntries().
@@ -472,7 +472,7 @@
Status status;
for (size_t i = 0; i < N; ++i) {
auto waiter = NewWaiter();
- page->Put(keys[i].Clone(), values[i].Clone(),
+ page->Put(keys[i], values[i],
callback::Capture(waiter->GetCallback(), &status));
ASSERT_TRUE(waiter->RunUntilCalled());
@@ -507,8 +507,8 @@
// Add entries and grab a new snapshot.
const size_t N = 100;
- fidl::VectorPtr<uint8_t> keys[N];
- fidl::VectorPtr<uint8_t> values[N];
+ std::vector<uint8_t> keys[N];
+ std::vector<uint8_t> values[N];
for (size_t i = 0; i < N; ++i) {
// Generate keys so that they are in increasing order to match the order
// of results from GetEntries().
@@ -521,7 +521,7 @@
for (size_t i = 0; i < N; ++i) {
Status status;
auto waiter = NewWaiter();
- page->Put(keys[i].Clone(), values[i].Clone(),
+ page->Put(keys[i], values[i],
callback::Capture(waiter->GetCallback(), &status));
ASSERT_TRUE(waiter->RunUntilCalled());
EXPECT_EQ(Status::OK, status);
@@ -544,13 +544,13 @@
PagePtr page = instance->GetTestPage();
const size_t N = 4;
- fidl::VectorPtr<uint8_t> keys[N] = {
+ std::vector<uint8_t> keys[N] = {
RandomArray(GetRandom(), 20, {2}),
RandomArray(GetRandom(), 20, {5}),
RandomArray(GetRandom(), 20, {3}),
RandomArray(GetRandom(), 20, {0}),
};
- fidl::VectorPtr<uint8_t> values[N] = {
+ std::vector<uint8_t> values[N] = {
RandomArray(GetRandom(), 20),
RandomArray(GetRandom(), 20),
RandomArray(GetRandom(), 20),
@@ -559,7 +559,7 @@
for (size_t i = 0; i < N; ++i) {
Status status;
auto waiter = NewWaiter();
- page->Put(keys[i].Clone(), values[i].Clone(),
+ page->Put(keys[i], values[i],
callback::Capture(waiter->GetCallback(), &status));
ASSERT_TRUE(waiter->RunUntilCalled());
EXPECT_EQ(Status::OK, status);
@@ -569,7 +569,7 @@
PageSnapshotPtr snapshot = PageGetSnapshot(&page);
// Verify that GetKeys() results are sorted.
- std::vector<fidl::VectorPtr<uint8_t>> result = SnapshotGetKeys(&snapshot);
+ std::vector<std::vector<uint8_t>> result = SnapshotGetKeys(&snapshot);
EXPECT_EQ(keys[3], result.at(0));
EXPECT_EQ(keys[0], result.at(1));
EXPECT_EQ(keys[2], result.at(2));
diff --git a/bin/ledger/tests/integration/page_watcher_tests.cc b/bin/ledger/tests/integration/page_watcher_tests.cc
index 935da3a..f7955da 100644
--- a/bin/ledger/tests/integration/page_watcher_tests.cc
+++ b/bin/ledger/tests/integration/page_watcher_tests.cc
@@ -107,9 +107,9 @@
EXPECT_EQ(1u, watcher.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher.last_result_state_);
PageChange change = std::move(watcher.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Alice", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Alice", ToString(change.changed_entries.at(0).value));
}
TEST_P(PageWatcherIntegrationTest, PageWatcherAggregatedNotifications) {
@@ -139,9 +139,9 @@
EXPECT_EQ(1u, watcher.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher.last_result_state_);
auto changed_entries = std::move(watcher.last_page_change_.changed_entries);
- ASSERT_THAT(*changed_entries, SizeIs(1));
- EXPECT_EQ("key", convert::ToString(changed_entries->at(0).key));
- EXPECT_EQ("value1", ToString(changed_entries->at(0).value));
+ ASSERT_THAT(changed_entries, SizeIs(1));
+ EXPECT_EQ("key", convert::ToString(changed_entries.at(0).key));
+ EXPECT_EQ("value1", ToString(changed_entries.at(0).value));
// Update the value of "key" initially to "value2" and then to "value3".
page->Put(convert::ToArray("key"), convert::ToArray("value2"),
@@ -166,9 +166,9 @@
EXPECT_EQ(2u, watcher.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher.last_result_state_);
changed_entries = std::move(watcher.last_page_change_.changed_entries);
- ASSERT_THAT(*changed_entries, SizeIs(1));
- EXPECT_EQ("key", convert::ToString(changed_entries->at(0).key));
- EXPECT_EQ("value3", ToString(changed_entries->at(0).value));
+ ASSERT_THAT(changed_entries, SizeIs(1));
+ EXPECT_EQ("key", convert::ToString(changed_entries.at(0).key));
+ EXPECT_EQ("value3", ToString(changed_entries.at(0).value));
}
TEST_P(PageWatcherIntegrationTest, PageWatcherDisconnectClient) {
@@ -268,9 +268,9 @@
ASSERT_EQ(1u, watcher.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher.last_result_state_);
PageChange change = std::move(watcher.last_page_change_);
- EXPECT_EQ(0u, change.changed_entries->size());
- ASSERT_EQ(1u, change.deleted_keys->size());
- EXPECT_EQ("foo", convert::ToString(change.deleted_keys->at(0)));
+ EXPECT_EQ(0u, change.changed_entries.size());
+ ASSERT_EQ(1u, change.deleted_keys.size());
+ EXPECT_EQ("foo", convert::ToString(change.deleted_keys.at(0)));
}
TEST_P(PageWatcherIntegrationTest, PageWatcherBigChangeSize) {
@@ -329,12 +329,12 @@
EXPECT_EQ(1u, watcher.changes_seen);
EXPECT_EQ(watcher.last_result_state_, ResultState::PARTIAL_STARTED);
PageChange change = std::move(watcher.last_page_change_);
- size_t initial_size = change.changed_entries->size();
+ size_t initial_size = change.changed_entries.size();
for (size_t i = 0; i < initial_size; ++i) {
EXPECT_EQ(key_generator(i),
- convert::ToString(change.changed_entries->at(i).key));
- EXPECT_EQ("value", ToString(change.changed_entries->at(i).value));
- EXPECT_EQ(Priority::EAGER, change.changed_entries->at(i).priority);
+ convert::ToString(change.changed_entries.at(i).key));
+ EXPECT_EQ("value", ToString(change.changed_entries.at(i).value));
+ EXPECT_EQ(Priority::EAGER, change.changed_entries.at(i).priority);
}
// Get the second OnChagne call.
@@ -343,12 +343,12 @@
EXPECT_EQ(ResultState::PARTIAL_COMPLETED, watcher.last_result_state_);
change = std::move(watcher.last_page_change_);
- ASSERT_EQ(entry_count, initial_size + change.changed_entries->size());
- for (size_t i = 0; i < change.changed_entries->size(); ++i) {
+ ASSERT_EQ(entry_count, initial_size + change.changed_entries.size());
+ for (size_t i = 0; i < change.changed_entries.size(); ++i) {
EXPECT_EQ(key_generator(i + initial_size),
- convert::ToString(change.changed_entries->at(i).key));
- EXPECT_EQ("value", ToString(change.changed_entries->at(i).value));
- EXPECT_EQ(Priority::EAGER, change.changed_entries->at(i).priority);
+ convert::ToString(change.changed_entries.at(i).key));
+ EXPECT_EQ("value", ToString(change.changed_entries.at(i).value));
+ EXPECT_EQ(Priority::EAGER, change.changed_entries.at(i).priority);
}
}
@@ -395,12 +395,12 @@
EXPECT_EQ(1u, watcher.changes_seen);
EXPECT_EQ(watcher.last_result_state_, ResultState::PARTIAL_STARTED);
PageChange change = std::move(watcher.last_page_change_);
- size_t initial_size = change.changed_entries->size();
+ size_t initial_size = change.changed_entries.size();
for (size_t i = 0; i < initial_size; ++i) {
EXPECT_EQ(fxl::StringPrintf("key%02" PRIuMAX, i),
- convert::ToString(change.changed_entries->at(i).key));
- EXPECT_EQ("value", ToString(change.changed_entries->at(i).value));
- EXPECT_EQ(Priority::EAGER, change.changed_entries->at(i).priority);
+ convert::ToString(change.changed_entries.at(i).key));
+ EXPECT_EQ("value", ToString(change.changed_entries.at(i).value));
+ EXPECT_EQ(Priority::EAGER, change.changed_entries.at(i).priority);
}
// Get the second OnChagne call.
@@ -409,12 +409,12 @@
EXPECT_EQ(ResultState::PARTIAL_COMPLETED, watcher.last_result_state_);
change = std::move(watcher.last_page_change_);
- ASSERT_EQ(entry_count, initial_size + change.changed_entries->size());
- for (size_t i = 0; i < change.changed_entries->size(); ++i) {
+ ASSERT_EQ(entry_count, initial_size + change.changed_entries.size());
+ for (size_t i = 0; i < change.changed_entries.size(); ++i) {
EXPECT_EQ(fxl::StringPrintf("key%02" PRIuMAX, i + initial_size),
- convert::ToString(change.changed_entries->at(i).key));
- EXPECT_EQ("value", ToString(change.changed_entries->at(i).value));
- EXPECT_EQ(Priority::EAGER, change.changed_entries->at(i).priority);
+ convert::ToString(change.changed_entries.at(i).key));
+ EXPECT_EQ("value", ToString(change.changed_entries.at(i).value));
+ EXPECT_EQ(Priority::EAGER, change.changed_entries.at(i).priority);
}
}
@@ -488,9 +488,9 @@
EXPECT_EQ(1u, watcher.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher.last_result_state_);
PageChange change = std::move(watcher.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Alice", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Alice", ToString(change.changed_entries.at(0).value));
}
TEST_P(PageWatcherIntegrationTest, PageWatcherParallel) {
@@ -557,9 +557,9 @@
EXPECT_EQ(1u, watcher1.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher1.last_result_state_);
PageChange change = std::move(watcher1.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Alice", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Alice", ToString(change.changed_entries.at(0).value));
waiter = NewWaiter();
page2->Commit(callback::Capture(waiter->GetCallback(), &status));
@@ -570,9 +570,9 @@
EXPECT_EQ(1u, watcher2.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher2.last_result_state_);
change = std::move(watcher2.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Bob", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Bob", ToString(change.changed_entries.at(0).value));
RunLoopFor(zx::msec(100));
@@ -583,9 +583,9 @@
EXPECT_EQ(1u, watcher2.changes_seen);
change = std::move(watcher1.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Bob", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Bob", ToString(change.changed_entries.at(0).value));
}
TEST_P(PageWatcherIntegrationTest, PageWatcherEmptyTransaction) {
@@ -663,16 +663,16 @@
ASSERT_EQ(1u, watcher1.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher1.last_result_state_);
PageChange change = std::move(watcher1.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Alice", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Alice", ToString(change.changed_entries.at(0).value));
ASSERT_EQ(1u, watcher2.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher2.last_result_state_);
change = std::move(watcher2.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("name", convert::ToString(change.changed_entries->at(0).key));
- EXPECT_EQ("Alice", ToString(change.changed_entries->at(0).value));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("name", convert::ToString(change.changed_entries.at(0).key));
+ EXPECT_EQ("Alice", ToString(change.changed_entries.at(0).value));
}
class WaitingWatcher : public PageWatcher {
@@ -816,8 +816,8 @@
EXPECT_EQ(1u, watcher.changes_seen);
EXPECT_EQ(ResultState::COMPLETED, watcher.last_result_state_);
PageChange change = std::move(watcher.last_page_change_);
- ASSERT_EQ(1u, change.changed_entries->size());
- EXPECT_EQ("01-key", convert::ToString(change.changed_entries->at(0).key));
+ ASSERT_EQ(1u, change.changed_entries.size());
+ EXPECT_EQ("01-key", convert::ToString(change.changed_entries.at(0).key));
}
TEST_P(PageWatcherIntegrationTest, PageWatcherPrefixNoChange) {
diff --git a/bin/ledger/tests/integration/sync/convergence.cc b/bin/ledger/tests/integration/sync/convergence.cc
index d316d11..8a3c96f 100644
--- a/bin/ledger/tests/integration/sync/convergence.cc
+++ b/bin/ledger/tests/integration/sync/convergence.cc
@@ -67,7 +67,7 @@
int changes = 0;
- void GetInlineOnLatestSnapshot(fidl::VectorPtr<uint8_t> key,
+ void GetInlineOnLatestSnapshot(std::vector<uint8_t> key,
PageSnapshot::GetInlineCallback callback) {
// We need to make sure the PageSnapshotPtr used to make the |GetInline|
// call survives as long as the call is active, even if a new snapshot
@@ -149,21 +149,21 @@
merge_result_provider->get();
merge_result_provider_ptr->GetFullDiffNew(
nullptr, [merge_result_provider = std::move(merge_result_provider)](
- IterationStatus status, fidl::VectorPtr<DiffEntry> changes,
+ IterationStatus status, std::vector<DiffEntry> changes,
std::unique_ptr<Token> next_token) mutable {
ASSERT_EQ(IterationStatus::OK, status);
- ASSERT_EQ(1u, changes->size());
+ ASSERT_EQ(1u, changes.size());
double d1, d2;
- EXPECT_TRUE(VmoToDouble(changes->at(0).left->value, &d1));
- EXPECT_TRUE(VmoToDouble(changes->at(0).right->value, &d2));
+ EXPECT_TRUE(VmoToDouble(changes.at(0).left->value, &d1));
+ EXPECT_TRUE(VmoToDouble(changes.at(0).right->value, &d2));
double new_value = (4 * d1 + d2) / 3;
MergedValue merged_value;
- merged_value.key = std::move(changes->at(0).key);
+ merged_value.key = std::move(changes.at(0).key);
merged_value.source = ValueSource::NEW;
merged_value.new_value = BytesOrReference::New();
merged_value.new_value->set_bytes(DoubleToArray(new_value));
- fidl::VectorPtr<MergedValue> merged_values;
+ std::vector<MergedValue> merged_values;
merged_values.push_back(std::move(merged_value));
(*merge_result_provider)->MergeNew(std::move(merged_values));
(*merge_result_provider)->DoneNew();
diff --git a/bin/ledger/tests/integration/test_utils.cc b/bin/ledger/tests/integration/test_utils.cc
index 330f2ea..809a1c1 100644
--- a/bin/ledger/tests/integration/test_utils.cc
+++ b/bin/ledger/tests/integration/test_utils.cc
@@ -23,14 +23,14 @@
namespace ledger {
-fidl::VectorPtr<uint8_t> RandomArray(rng::Random* random, size_t size,
+std::vector<uint8_t> RandomArray(rng::Random* random, size_t size,
const std::vector<uint8_t>& prefix) {
EXPECT_TRUE(size >= prefix.size());
- fidl::VectorPtr<uint8_t> array = fidl::VectorPtr<uint8_t>::New(size);
+ std::vector<uint8_t> array(size);
for (size_t i = 0; i < prefix.size(); ++i) {
- array->at(i) = prefix[i];
+ array.at(i) = prefix[i];
}
- random->Draw(&(*array)[prefix.size()], size - prefix.size());
+ random->Draw(&array[prefix.size()], size - prefix.size());
return array;
}
@@ -41,7 +41,7 @@
return value;
}
-fidl::VectorPtr<uint8_t> ToArray(const fuchsia::mem::BufferPtr& vmo) {
+std::vector<uint8_t> ToArray(const fuchsia::mem::BufferPtr& vmo) {
return convert::ToArray(ToString(vmo));
}
@@ -56,7 +56,7 @@
}
do {
Status status;
- fidl::VectorPtr<Entry> entries;
+ std::vector<Entry> entries;
auto waiter = loop_controller->NewWaiter();
(*snapshot)->GetEntries(
start.Clone(), std::move(token),
@@ -72,7 +72,7 @@
if (num_queries) {
(*num_queries)++;
}
- for (auto& entry : entries.take()) {
+ for (auto& entry : entries) {
result.push_back(std::move(entry));
}
} while (token);
diff --git a/bin/ledger/tests/integration/test_utils.h b/bin/ledger/tests/integration/test_utils.h
index 92c4dec..01f27f8 100644
--- a/bin/ledger/tests/integration/test_utils.h
+++ b/bin/ledger/tests/integration/test_utils.h
@@ -18,14 +18,14 @@
// Builds an array of length |size|, starting with |prefix| and completed with
// random data.
-fidl::VectorPtr<uint8_t> RandomArray(rng::Random* random, size_t size,
+std::vector<uint8_t> RandomArray(rng::Random* random, size_t size,
const std::vector<uint8_t>& prefix = {});
// Extracts the content of |vmo| as a std::string.
std::string ToString(const fuchsia::mem::BufferPtr& vmo);
// Extracts the content of |vmo| as a FIDL vector.
-fidl::VectorPtr<uint8_t> ToArray(const fuchsia::mem::BufferPtr& vmo);
+std::vector<uint8_t> ToArray(const fuchsia::mem::BufferPtr& vmo);
// Retrieves all entries from the snapshot with a key greater of equals to
// |start|. If |num_queries| is not null, returns the number of calls to
diff --git a/bin/module_resolver/local_module_resolver.cc b/bin/module_resolver/local_module_resolver.cc
index c3d8890..630542f 100644
--- a/bin/module_resolver/local_module_resolver.cc
+++ b/bin/module_resolver/local_module_resolver.cc
@@ -138,8 +138,8 @@
// 3. For each parameter in the FindModulesQuery, try to filter
// |candidates_| to only the modules that provide the types in the parameter
// constraints.
- if (!candidates_.empty() && !query_.parameter_constraints.is_null()) {
- for (const auto& parameter_entry : *query_.parameter_constraints) {
+ if (!candidates_.empty()) {
+ for (const auto& parameter_entry : query_.parameter_constraints) {
ProcessParameterTypes(parameter_entry.param_name,
parameter_entry.param_types);
}
@@ -151,9 +151,9 @@
private:
// |parameter_name| and |types| come from the FindModulesQuery.
void ProcessParameterTypes(const std::string& parameter_name,
- const fidl::VectorPtr<fidl::StringPtr>& types) {
+ const std::vector<std::string>& types) {
std::set<ManifestId> parameter_type_entries;
- for (const auto& type : *types) {
+ for (const auto& type : types) {
std::set<ManifestId> found_entries =
GetManifestsMatchingParameterByTypeAndName(type, parameter_name);
parameter_type_entries.insert(found_entries.begin(), found_entries.end());
@@ -247,11 +247,11 @@
response_ = CreateEmptyResponseWithStatus();
std::set<ManifestId> candidates;
- for (auto& constraint : *query_.parameter_constraints) {
+ for (auto& constraint : query_.parameter_constraints) {
std::set<ManifestId> param_type_entries;
parameter_types_cache_[constraint.constraint_name] =
- constraint.param_types.Clone();
- for (auto& type : *constraint.param_types) {
+ constraint.param_types;
+ for (auto& type : constraint.param_types) {
auto found_entries = GetManifestsMatchingParameterByType(type);
candidates.insert(found_entries.begin(), found_entries.end());
}
@@ -262,7 +262,7 @@
local_module_resolver_->manifests_[candidate]);
using iter = decltype(results->begin());
- response_.results->insert(response_.results->end(),
+ response_.results.insert(response_.results.end(),
std::move_iterator<iter>(results->begin()),
std::move_iterator<iter>(results->end()));
}
@@ -305,8 +305,8 @@
modules.resize(0);
for (const auto& intent_filter : *manifest.intent_filters) {
- if (query_.parameter_constraints->size() <
- intent_filter.parameter_constraints->size()) {
+ if (query_.parameter_constraints.size() <
+ intent_filter.parameter_constraints.size()) {
return modules;
}
@@ -355,15 +355,15 @@
std::map<ParameterName, std::vector<ParameterName>>
intent_filter_param_to_query_constraints;
for (const auto& intent_filter_param :
- *intent_filter.parameter_constraints) {
+ intent_filter.parameter_constraints) {
std::vector<ParameterName> matching_query_constraints;
- for (const auto& query_constraint : *query_.parameter_constraints) {
+ for (const auto& query_constraint : query_.parameter_constraints) {
const auto& this_query_constraint_cache =
parameter_types_cache_[query_constraint.constraint_name];
- if (std::find(this_query_constraint_cache->begin(),
- this_query_constraint_cache->end(),
+ if (std::find(this_query_constraint_cache.begin(),
+ this_query_constraint_cache.end(),
intent_filter_param.type) !=
- this_query_constraint_cache->end()) {
+ this_query_constraint_cache.end()) {
matching_query_constraints.push_back(
query_constraint.constraint_name);
}
@@ -455,7 +455,7 @@
fuchsia::modular::FindModulesByTypesQuery const query_;
fuchsia::modular::FindModulesByTypesResponse response_;
// A cache of the parameter types for each parameter name in |query_|.
- std::map<std::string, fidl::VectorPtr<fidl::StringPtr>>
+ std::map<std::string, std::vector<std::string>>
parameter_types_cache_;
FXL_DISALLOW_COPY_AND_ASSIGN(FindModulesByTypesCall);
@@ -463,8 +463,6 @@
void LocalModuleResolver::FindModules(fuchsia::modular::FindModulesQuery query,
FindModulesCallback callback) {
- FXL_DCHECK(!query.action.is_null());
-
operations_.Add(new FindModulesCall(this, std::move(query), callback));
}
@@ -475,9 +473,7 @@
}
void LocalModuleResolver::GetModuleManifest(
- fidl::StringPtr module_id, GetModuleManifestCallback callback) {
- FXL_DCHECK(!module_id.is_null());
-
+ std::string module_id, GetModuleManifestCallback callback) {
auto found_handlers = FindHandlers(module_id);
if (!found_handlers.empty()) {
callback(CloneOptional(manifests_[*found_handlers.begin()]));
@@ -501,8 +497,8 @@
// please split the index-building & querying portion of LocalModuleResolver
// out into its own class. Then, make a new class to handle OnQuery() and
// share the same index instance here and there.
- auto proposals = fidl::VectorPtr<fuchsia::modular::Proposal>::New(0);
- if (query.text->empty()) {
+ std::vector<fuchsia::modular::Proposal> proposals;
+ if (query.text.empty()) {
fuchsia::modular::QueryResponse response;
response.proposals = std::move(proposals);
done(std::move(response));
@@ -546,7 +542,7 @@
}
}
- if (proposals->size() > 10) {
+ if (proposals.size() > 10) {
proposals.resize(10);
}
@@ -593,7 +589,7 @@
for (const auto& intent_filter : *manifest.intent_filters) {
action_to_manifests_[intent_filter.action].insert(manifest_id);
- for (const auto& constraint : *intent_filter.parameter_constraints) {
+ for (const auto& constraint : intent_filter.parameter_constraints) {
parameter_type_and_name_to_manifests_[std::make_pair(constraint.type,
constraint.name)]
.insert(manifest_id);
@@ -616,7 +612,7 @@
for (const auto& intent_filter : *manifest.intent_filters) {
action_to_manifests_[intent_filter.action].erase(manifest_id);
- for (const auto& constraint : *intent_filter.parameter_constraints) {
+ for (const auto& constraint : intent_filter.parameter_constraints) {
parameter_type_and_name_to_manifests_[std::make_pair(constraint.type,
constraint.name)]
.erase(manifest_id);
diff --git a/bin/module_resolver/local_module_resolver.h b/bin/module_resolver/local_module_resolver.h
index f2cc8ae..e59e75b 100644
--- a/bin/module_resolver/local_module_resolver.h
+++ b/bin/module_resolver/local_module_resolver.h
@@ -42,7 +42,7 @@
void FindModulesByTypes(fuchsia::modular::FindModulesByTypesQuery query,
FindModulesByTypesCallback callback) override;
// |ModuleResolver|
- void GetModuleManifest(fidl::StringPtr module_id,
+ void GetModuleManifest(std::string module_id,
GetModuleManifestCallback callback) override;
private:
diff --git a/bin/module_resolver/local_module_resolver_unittest.cc b/bin/module_resolver/local_module_resolver_unittest.cc
index d8deb3a..5072342 100644
--- a/bin/module_resolver/local_module_resolver_unittest.cc
+++ b/bin/module_resolver/local_module_resolver_unittest.cc
@@ -21,7 +21,7 @@
std::vector<fuchsia::modular::ParameterConstraint> param_constraints) {
fuchsia::modular::IntentFilter f;
f.action = action;
- f.parameter_constraints.reset(param_constraints);
+ f.parameter_constraints = param_constraints;
return f;
}
@@ -73,7 +73,7 @@
ASSERT_TRUE(got_response);
}
- const fidl::VectorPtr<fuchsia::modular::FindModulesResult>& results() const {
+ const std::vector<fuchsia::modular::FindModulesResult>& results() const {
return response_.results;
}
@@ -93,7 +93,7 @@
std::vector<std::string> types) {
fuchsia::modular::FindModulesParameterConstraint constraint;
constraint.param_name = name;
- constraint.param_types = fxl::To<fidl::VectorPtr<fidl::StringPtr>>(types);
+ constraint.param_types = types;
query.parameter_constraints.push_back(std::move(constraint));
return *this;
}
@@ -144,7 +144,7 @@
ASSERT_TRUE(got_response);
}
- const fidl::VectorPtr<fuchsia::modular::FindModulesByTypesResult>& results()
+ const std::vector<fuchsia::modular::FindModulesByTypesResult>& results()
const {
return response_.results;
}
@@ -159,7 +159,7 @@
std::vector<std::string> types) {
fuchsia::modular::FindModulesByTypesParameterConstraint constraint;
constraint.constraint_name = name;
- constraint.param_types = fxl::To<fidl::VectorPtr<fidl::StringPtr>>(types);
+ constraint.param_types = types;
query.parameter_constraints.push_back(std::move(constraint));
return *this;
}
@@ -169,10 +169,10 @@
};
std::string GetMappingFromQuery(
- const fidl::VectorPtr<
+ const std::vector<
fuchsia::modular::FindModulesByTypesParameterMapping>& mapping,
std::string query_constraint_name) {
- for (auto& item : *mapping) {
+ for (auto& item : mapping) {
if (item.query_constraint_name == query_constraint_name) {
return item.result_param_name;
}
@@ -201,7 +201,7 @@
FindModules(QueryBuilder("no matchy!").build());
// The Resolver returns an empty candidate list
- ASSERT_EQ(0lu, results()->size());
+ ASSERT_EQ(0lu, results().size());
}
TEST_F(FindModulesTest, Simpleaction) {
@@ -253,9 +253,9 @@
RunLoopUntilIdle();
ASSERT_TRUE(got_response);
- ASSERT_EQ(2lu, results()->size());
- EXPECT_EQ("module1", results()->at(0).module_id);
- EXPECT_EQ("module2", results()->at(1).module_id);
+ ASSERT_EQ(2lu, results().size());
+ EXPECT_EQ("module1", results().at(0).module_id);
+ EXPECT_EQ("module2", results().at(1).module_id);
// Remove the entries and we should see no more results. Our
// TestManifestSource implementation above doesn't send its tasks to the
@@ -264,7 +264,7 @@
source2->remove("module2");
FindModules(QueryBuilder("com.google.fuchsia.navigate.v1").build());
- ASSERT_EQ(0lu, results()->size());
+ ASSERT_EQ(0lu, results().size());
}
TEST_F(FindModulesTest, SimpleParameterTypes) {
@@ -316,8 +316,8 @@
FindModules(QueryBuilder("com.google.fuchsia.navigate.v1")
.AddParameter("start", {"foo", "tangoTown"})
.build());
- ASSERT_EQ(1lu, results()->size());
- EXPECT_EQ("module1", results()->at(0).module_id);
+ ASSERT_EQ(1lu, results().size());
+ EXPECT_EQ("module1", results().at(0).module_id);
// This one will match one of the two parameter constraints on module1, but
// not both, so no match at all is expected.
@@ -325,15 +325,15 @@
.AddParameter("start", {"foo", "tangoTown"})
.AddParameter("destination", {"notbaz"})
.build());
- ASSERT_EQ(0lu, results()->size());
+ ASSERT_EQ(0lu, results().size());
// Given parameter of type "frob", find a module with action
// com.google.fuchsia.navigate.v1.
FindModules(QueryBuilder("com.google.fuchsia.navigate.v1")
.AddParameter("start", {"frob"})
.build());
- ASSERT_EQ(1u, results()->size());
- auto& res = results()->at(0);
+ ASSERT_EQ(1u, results().size());
+ auto& res = results().at(0);
EXPECT_EQ("module2", res.module_id);
}
@@ -352,15 +352,15 @@
source->add("1", std::move(entry1));
source->idle();
FindModules(QueryBuilder("action1").build());
- ASSERT_EQ(1lu, results()->size());
- EXPECT_EQ("id1", results()->at(0).module_id);
+ ASSERT_EQ(1lu, results().size());
+ EXPECT_EQ("id1", results().at(0).module_id);
fuchsia::modular::ModuleManifest entry2;
entry.Clone(&entry2);
source->add("1", std::move(entry2));
FindModules(QueryBuilder("action1").build());
- ASSERT_EQ(1lu, results()->size());
- EXPECT_EQ("id1", results()->at(0).module_id);
+ ASSERT_EQ(1lu, results().size());
+ EXPECT_EQ("id1", results().at(0).module_id);
}
// Tests that a query that does not contain a action or a URL matches a
@@ -385,8 +385,8 @@
FindModulesByTypes(
QueryBuilder().AddParameter("start", {"foo", "bar"}).build());
- ASSERT_EQ(1lu, results()->size());
- EXPECT_EQ("module1", results()->at(0).module_id);
+ ASSERT_EQ(1lu, results().size());
+ EXPECT_EQ("module1", results().at(0).module_id);
}
// Tests that a query that does not contain a action or a URL matches when the
@@ -411,8 +411,8 @@
FindModulesByTypes(
QueryBuilder().AddParameter("start", {"foo", "bar"}).build());
- ASSERT_EQ(1lu, results()->size());
- EXPECT_EQ("module1", results()->at(0).module_id);
+ ASSERT_EQ(1lu, results().size());
+ EXPECT_EQ("module1", results().at(0).module_id);
}
// Tests that a query that does not contain a action or a URL returns results
@@ -448,9 +448,9 @@
FindModulesByTypes(
QueryBuilder().AddParameter("start", {"foo", "bar"}).build());
- ASSERT_EQ(2lu, results()->size());
- EXPECT_EQ("module1", results()->at(0).module_id);
- EXPECT_EQ("module2", results()->at(1).module_id);
+ ASSERT_EQ(2lu, results().size());
+ EXPECT_EQ("module1", results().at(0).module_id);
+ EXPECT_EQ("module2", results().at(1).module_id);
}
// Tests that a query that does not contain a action or a URL does not match
@@ -475,7 +475,7 @@
FindModulesByTypes(
QueryBuilder().AddParameter("start", {"foo", "bar"}).build());
- EXPECT_EQ(0lu, results()->size());
+ EXPECT_EQ(0lu, results().size());
}
// Tests that a query without a action or url, that contains more parameters
@@ -502,7 +502,7 @@
.AddParameter("end", {"foo", "bar"})
.build());
- EXPECT_EQ(1lu, results()->size());
+ EXPECT_EQ(1lu, results().size());
}
// Tests that for a query with multiple parameters, each parameter gets assigned
@@ -533,8 +533,8 @@
.AddParameter("parameter2", {"not_gps"})
.build());
- ASSERT_EQ(1lu, results()->size());
- auto& result = results()->at(0);
+ ASSERT_EQ(1lu, results().size());
+ auto& result = results().at(0);
EXPECT_EQ("start",
GetMappingFromQuery(result.parameter_mappings, "parameter1"));
@@ -570,12 +570,12 @@
.AddParameter("parameter2", {"gps"})
.build());
- EXPECT_EQ(2lu, results()->size());
+ EXPECT_EQ(2lu, results().size());
bool found_first_mapping = false;
bool found_second_mapping = false;
- for (const auto& result : *results()) {
+ for (const auto& result : results()) {
bool start_mapped_to_p1 =
GetMappingFromQuery(result.parameter_mappings, "parameter1") == "start";
@@ -628,7 +628,7 @@
.AddParameter("parameter3", {"gps"})
.build());
- EXPECT_EQ(6lu, results()->size());
+ EXPECT_EQ(6lu, results().size());
}
// Tests that a query with three parameters of the same type matches an entry
@@ -661,7 +661,7 @@
.AddParameter("parameter3", {"gps"})
.build());
- EXPECT_EQ(6lu, results()->size());
+ EXPECT_EQ(6lu, results().size());
}
// Tests that a query without a action does not match a module that requires a
@@ -693,7 +693,7 @@
FindModulesByTypes(
QueryBuilder().AddParameter("parameter1", {"gps"}).build());
- EXPECT_EQ(0lu, results()->size());
+ EXPECT_EQ(0lu, results().size());
}
// Tests that a query without a action does not match an entry where the
@@ -720,7 +720,7 @@
FindModulesByTypes(
QueryBuilder().AddParameter("parameter1", {"not_gps"}).build());
- EXPECT_EQ(0lu, results()->size());
+ EXPECT_EQ(0lu, results().size());
}
// Tests that a query with a action requires parameter name and type to match
@@ -747,7 +747,7 @@
.AddParameter("start", {"foo", "baz"})
.build());
- EXPECT_EQ(0lu, results()->size());
+ EXPECT_EQ(0lu, results().size());
}
TEST_F(FindModulesTest, MultipleIntentFilters) {
@@ -773,19 +773,19 @@
FindModules(QueryBuilder("com.google.fuchsia.navigate.v1")
.AddParameter("end", {"foo"})
.build());
- ASSERT_EQ(1lu, results()->size());
- EXPECT_EQ("module1", results()->at(0).module_id);
+ ASSERT_EQ(1lu, results().size());
+ EXPECT_EQ("module1", results().at(0).module_id);
FindModules(QueryBuilder("com.google.fuchsia.navigate.v2")
.AddParameter("end", {"foo"})
.build());
- ASSERT_EQ(1lu, results()->size());
- EXPECT_EQ("module1", results()->at(0).module_id);
+ ASSERT_EQ(1lu, results().size());
+ EXPECT_EQ("module1", results().at(0).module_id);
FindModules(QueryBuilder("com.google.fuchsia.navigate.v3")
.AddParameter("end", {"foo"})
.build());
- ASSERT_EQ(0lu, results()->size());
+ ASSERT_EQ(0lu, results().size());
}
TEST_F(FindModulesByTypesTest, MultipleIntentFilters) {
@@ -810,12 +810,12 @@
FindModulesByTypes(QueryBuilder().AddParameter("end", {"foo"}).build());
- ASSERT_EQ(2lu, results()->size());
+ ASSERT_EQ(2lu, results().size());
// expected action =>.
std::set<std::string> actual_actions;
for (size_t i = 0; i < 2u; i++) {
- EXPECT_EQ("module1", results()->at(i).module_id);
- actual_actions.insert(results()->at(i).action);
+ EXPECT_EQ("module1", results().at(i).module_id);
+ actual_actions.insert(results().at(i).action);
}
EXPECT_EQ(1u, actual_actions.count("com.google.fuchsia.navigate.v1"));
EXPECT_EQ(1u, actual_actions.count("com.google.fuchsia.navigate.v2"));
diff --git a/bin/module_resolver/module_resolver_main.cc b/bin/module_resolver/module_resolver_main.cc
index 2fbfece..da923fb 100644
--- a/bin/module_resolver/module_resolver_main.cc
+++ b/bin/module_resolver/module_resolver_main.cc
@@ -58,7 +58,7 @@
fuchsia::modular::ContextQueryEntry selector_entry;
selector_entry.key = kContextListenerEntitiesKey;
selector_entry.value = std::move(selector);
- fidl::VectorPtr<fuchsia::modular::ContextQueryEntry> selector_array;
+ std::vector<fuchsia::modular::ContextQueryEntry> selector_array;
selector_array.push_back(std::move(selector_entry));
query.selector = std::move(selector_array);
context_reader_->Subscribe(std::move(query),
@@ -78,14 +78,14 @@
// |ContextListener|
void OnContextUpdate(fuchsia::modular::ContextUpdate update) override {
- fidl::VectorPtr<fuchsia::modular::ContextValue> values;
- for (auto& entry : *update.values) {
+ std::vector<fuchsia::modular::ContextValue> values;
+ for (auto& entry : update.values) {
if (entry.key == kContextListenerEntitiesKey) {
values = std::move(entry.value);
break;
}
}
- if (values->empty()) {
+ if (values.empty()) {
return;
}
@@ -94,7 +94,7 @@
std::string story_id;
std::map<QueryParamName, fuchsia::modular::LinkMetadata> remember;
- for (const auto& value : *values) {
+ for (const auto& value : values) {
if (!value.meta.story || !value.meta.link || !value.meta.entity) {
continue;
}
@@ -115,7 +115,7 @@
std::vector<fuchsia::modular::Intent>
new_intents; // Only for comparison.
int proposal_count = 0;
- for (const auto& module_result : *response.results) {
+ for (const auto& module_result : response.results) {
fuchsia::modular::Intent intent;
new_proposals.push_back(CreateProposalFromModuleResolverResult(
module_result, story_id, proposal_count++, remember,
@@ -158,13 +158,13 @@
fuchsia::modular::Intent intent;
intent.handler = module_result.module_id;
fidl::VectorPtr<fuchsia::modular::IntentParameter> parameters;
- fidl::VectorPtr<fidl::StringPtr> parent_mod_path;
+ fidl::VectorPtr<std::string> parent_mod_path;
- for (const auto& mapping : *module_result.parameter_mappings) {
+ for (const auto& mapping : module_result.parameter_mappings) {
fuchsia::modular::IntentParameter parameter;
parameter.name = mapping.result_param_name;
- const auto& metadata = remember.at(mapping.query_constraint_name.get());
+ const auto& metadata = remember.at(mapping.query_constraint_name);
fuchsia::modular::LinkPath link_path;
link_path.module_path = metadata.module_path.Clone();
link_path.link_name = metadata.name;
diff --git a/bin/sessionctl/logger.cc b/bin/sessionctl/logger.cc
index f8dfafa..5caa25b 100644
--- a/bin/sessionctl/logger.cc
+++ b/bin/sessionctl/logger.cc
@@ -33,7 +33,7 @@
}
void Logger::Log(const std::string& command,
- const fidl::VectorPtr<fidl::StringPtr>& params) const {
+ const std::vector<std::string>& params) const {
std::stringstream output;
if (json_out_) {
@@ -43,7 +43,7 @@
output << "Stories in this session:" << std::endl;
}
- for (auto& param : *params) {
+ for (auto& param : params) {
output << param << std::endl;
}
@@ -62,15 +62,15 @@
std::string Logger::GenerateJsonLogString(
const std::string& command,
- const fidl::VectorPtr<fidl::StringPtr>& params) const {
+ const std::vector<std::string>& params) const {
rapidjson::Document document = GetDocument(command);
// Generate array of |params| strings.
rapidjson::Document stories;
stories.SetArray();
- for (auto& param : *params) {
+ for (auto& param : params) {
rapidjson::Value story;
- story.SetString(param.get().data(), param.get().size());
+ story.SetString(param.data(), param.size());
stories.PushBack(story, stories.GetAllocator());
}
diff --git a/bin/sessionctl/logger.h b/bin/sessionctl/logger.h
index 09b9d47..b5235eb 100644
--- a/bin/sessionctl/logger.h
+++ b/bin/sessionctl/logger.h
@@ -26,7 +26,7 @@
void LogError(const std::string& command, const std::string& error) const;
void Log(const std::string& command,
- const fidl::VectorPtr<fidl::StringPtr>& params) const;
+ const std::vector<std::string>& params) const;
void Log(const std::string& command,
const std::map<std::string, std::string>& params) const;
@@ -36,7 +36,7 @@
// |params| to be logged.
std::string GenerateJsonLogString(
const std::string& command,
- const fidl::VectorPtr<fidl::StringPtr>& params) const;
+ const std::vector<std::string>& params) const;
std::string GenerateJsonLogString(
const std::string& command,
diff --git a/bin/sessionctl/session_ctl_app.cc b/bin/sessionctl/session_ctl_app.cc
index e9ffbb6..11b7956 100644
--- a/bin/sessionctl/session_ctl_app.cc
+++ b/bin/sessionctl/session_ctl_app.cc
@@ -137,7 +137,7 @@
std::string SessionCtlApp::ExecuteListStoriesCommand() {
async::PostTask(dispatcher_, [this]() mutable {
puppet_master_->GetStories(
- [this](fidl::VectorPtr<fidl::StringPtr> story_names) {
+ [this](std::vector<std::string> story_names) {
logger_.Log(kListStoriesCommandString, std::move(story_names));
on_command_executed_();
});
@@ -148,7 +148,7 @@
std::string SessionCtlApp::ExecuteRestartSessionCommand() {
basemgr_->RestartSession();
- logger_.Log(kRestartSessionCommandString, nullptr);
+ logger_.Log(kRestartSessionCommandString, std::vector<std::string>());
on_command_executed_();
return "";
@@ -171,13 +171,13 @@
return command;
}
-fidl::VectorPtr<fuchsia::modular::StoryCommand>
+std::vector<fuchsia::modular::StoryCommand>
SessionCtlApp::MakeAddModCommands(const std::string& mod_url,
const std::string& mod_name) {
fuchsia::modular::Intent intent;
intent.handler = mod_url;
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
fuchsia::modular::StoryCommand command;
// Add command to add or update the mod (it will be updated if the mod_name
@@ -193,9 +193,9 @@
return commands;
}
-fidl::VectorPtr<fuchsia::modular::StoryCommand>
+std::vector<fuchsia::modular::StoryCommand>
SessionCtlApp::MakeRemoveModCommands(const std::string& mod_name) {
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
fuchsia::modular::StoryCommand command;
fuchsia::modular::RemoveMod remove_mod;
@@ -207,7 +207,7 @@
void SessionCtlApp::PostTaskExecuteStoryCommand(
const std::string command_name,
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands,
+ std::vector<fuchsia::modular::StoryCommand> commands,
std::map<std::string, std::string> params) {
async::PostTask(dispatcher_, [this, command_name,
commands = std::move(commands),
@@ -228,7 +228,7 @@
}
modular::FuturePtr<bool, std::string> SessionCtlApp::ExecuteStoryCommand(
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands,
+ std::vector<fuchsia::modular::StoryCommand> commands,
const std::string& story_name) {
story_puppet_master_->Enqueue(std::move(commands));
diff --git a/bin/sessionctl/session_ctl_app.h b/bin/sessionctl/session_ctl_app.h
index 20fabb9..c618435 100644
--- a/bin/sessionctl/session_ctl_app.h
+++ b/bin/sessionctl/session_ctl_app.h
@@ -62,10 +62,10 @@
fuchsia::modular::StoryCommand MakeFocusModCommand(
const std::string& mod_name);
- fidl::VectorPtr<fuchsia::modular::StoryCommand> MakeAddModCommands(
+ std::vector<fuchsia::modular::StoryCommand> MakeAddModCommands(
const std::string& mod_url, const std::string& mod_name);
- fidl::VectorPtr<fuchsia::modular::StoryCommand> MakeRemoveModCommands(
+ std::vector<fuchsia::modular::StoryCommand> MakeRemoveModCommands(
const std::string& mod_name);
// Does a PostTask to Execute the commands on StoryPuppetMaster.
@@ -76,11 +76,11 @@
// |params| map of {command_line arg : command_line value}. Used for logging.
void PostTaskExecuteStoryCommand(
const std::string command_name,
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands,
+ std::vector<fuchsia::modular::StoryCommand> commands,
std::map<std::string, std::string> params);
modular::FuturePtr<bool, std::string> ExecuteStoryCommand(
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands,
+ std::vector<fuchsia::modular::StoryCommand> commands,
const std::string& story_name);
std::string GenerateMissingFlagString(
diff --git a/bin/sessionctl/session_ctl_app_unittest.cc b/bin/sessionctl/session_ctl_app_unittest.cc
index 2b998e5..652a2b6 100644
--- a/bin/sessionctl/session_ctl_app_unittest.cc
+++ b/bin/sessionctl/session_ctl_app_unittest.cc
@@ -94,7 +94,7 @@
ASSERT_TRUE(story_data);
EXPECT_EQ("mod_url", story_data->story_name);
EXPECT_EQ("mod_url",
- test_executor_.last_commands().at(0).add_mod().mod_name->at(0));
+ test_executor_.last_commands().at(0).add_mod().mod_name.at(0));
EXPECT_EQ(1, test_executor_.execute_count());
}
@@ -112,7 +112,7 @@
ASSERT_TRUE(story_data);
EXPECT_EQ("s", story_data->story_name);
EXPECT_EQ("m",
- test_executor_.last_commands().at(0).add_mod().mod_name->at(0));
+ test_executor_.last_commands().at(0).add_mod().mod_name.at(0));
EXPECT_EQ(1, test_executor_.execute_count());
}
@@ -149,7 +149,7 @@
ASSERT_TRUE(story_data);
EXPECT_EQ("mod", story_data->story_name);
EXPECT_EQ("mod",
- test_executor_.last_commands().at(0).remove_mod().mod_name->at(0));
+ test_executor_.last_commands().at(0).remove_mod().mod_name.at(0));
EXPECT_EQ(2, test_executor_.execute_count());
}
@@ -174,7 +174,7 @@
ASSERT_TRUE(story_data);
EXPECT_EQ("s", story_data->story_name);
EXPECT_EQ("m",
- test_executor_.last_commands().at(0).remove_mod().mod_name->at(0));
+ test_executor_.last_commands().at(0).remove_mod().mod_name.at(0));
EXPECT_EQ(2, test_executor_.execute_count());
}
diff --git a/bin/sessionmgr/agent_launcher.cc b/bin/sessionmgr/agent_launcher.cc
index 5cf5dad..e843039 100644
--- a/bin/sessionmgr/agent_launcher.cc
+++ b/bin/sessionmgr/agent_launcher.cc
@@ -18,7 +18,7 @@
std::unique_ptr<maxwell::MaxwellServiceProviderBridge> bridge) {
bridge_ = std::move(bridge);
fuchsia::sys::ServiceListPtr service_list(new fuchsia::sys::ServiceList);
- service_list->names = bridge_->service_names().Clone();
+ service_list->names = bridge_->service_names();
service_list->host_directory = bridge_->OpenAsDirectory();
fuchsia::sys::EnvironmentPtr agent_env;
environment_->CreateNestedEnvironment(
diff --git a/bin/sessionmgr/agent_runner/agent_context_impl.cc b/bin/sessionmgr/agent_runner/agent_context_impl.cc
index 2cc54eb..0ec1887 100644
--- a/bin/sessionmgr/agent_runner/agent_context_impl.cc
+++ b/bin/sessionmgr/agent_runner/agent_context_impl.cc
@@ -272,7 +272,7 @@
agent_runner_->ScheduleTask(url_, std::move(task_info));
}
-void AgentContextImpl::DeleteTask(fidl::StringPtr task_id) {
+void AgentContextImpl::DeleteTask(std::string task_id) {
agent_runner_->DeleteTask(url_, task_id);
}
@@ -280,7 +280,7 @@
fuchsia::auth::AppConfig app_config,
fidl::InterfaceHandle<fuchsia::auth::AuthenticationUIContext>
auth_ui_context,
- fidl::VectorPtr<::fidl::StringPtr> app_scopes,
+ std::vector<::std::string> app_scopes,
fidl::StringPtr user_profile_id, fidl::StringPtr auth_code,
AuthorizeCallback callback) {
FXL_LOG(ERROR) << "AgentContextImpl::Authorize() not supported from agent "
@@ -289,8 +289,8 @@
}
void AgentContextImpl::GetAccessToken(
- fuchsia::auth::AppConfig app_config, fidl::StringPtr user_profile_id,
- fidl::VectorPtr<::fidl::StringPtr> app_scopes,
+ fuchsia::auth::AppConfig app_config, std::string user_profile_id,
+ std::vector<::std::string> app_scopes,
GetAccessTokenCallback callback) {
FXL_CHECK(token_manager_);
@@ -302,7 +302,7 @@
}
void AgentContextImpl::GetIdToken(fuchsia::auth::AppConfig app_config,
- fidl::StringPtr user_profile_id,
+ std::string user_profile_id,
fidl::StringPtr audience,
GetIdTokenCallback callback) {
FXL_CHECK(token_manager_);
@@ -314,9 +314,9 @@
}
void AgentContextImpl::GetFirebaseToken(fuchsia::auth::AppConfig app_config,
- fidl::StringPtr user_profile_id,
- fidl::StringPtr audience,
- fidl::StringPtr firebase_api_key,
+ std::string user_profile_id,
+ std::string audience,
+ std::string firebase_api_key,
GetFirebaseTokenCallback callback) {
FXL_CHECK(token_manager_);
@@ -328,7 +328,7 @@
}
void AgentContextImpl::DeleteAllTokens(fuchsia::auth::AppConfig app_config,
- fidl::StringPtr user_profile_id,
+ std::string user_profile_id,
DeleteAllTokensCallback callback) {
FXL_LOG(ERROR) << "AgentContextImpl::DeleteAllTokens() not supported from "
<< "agent context";
diff --git a/bin/sessionmgr/agent_runner/agent_context_impl.h b/bin/sessionmgr/agent_runner/agent_context_impl.h
index c8a4f0c..be9c736 100644
--- a/bin/sessionmgr/agent_runner/agent_context_impl.h
+++ b/bin/sessionmgr/agent_runner/agent_context_impl.h
@@ -88,7 +88,7 @@
// |fuchsia::modular::AgentContext|
void ScheduleTask(fuchsia::modular::TaskInfo task_info) override;
// |fuchsia::modular::AgentContext|
- void DeleteTask(fidl::StringPtr task_id) override;
+ void DeleteTask(std::string task_id) override;
// |fuchsia::modular::AgentContext|
void GetEntityReferenceFactory(
fidl::InterfaceRequest<fuchsia::modular::EntityReferenceFactory> request)
@@ -98,31 +98,31 @@
void Authorize(fuchsia::auth::AppConfig app_config,
fidl::InterfaceHandle<fuchsia::auth::AuthenticationUIContext>
auth_ui_context,
- fidl::VectorPtr<::fidl::StringPtr> app_scopes,
+ std::vector<::std::string> app_scopes,
fidl::StringPtr user_profile_id, fidl::StringPtr auth_code,
AuthorizeCallback callback) override;
// |fuchsia::auth::TokenManager|
void GetAccessToken(fuchsia::auth::AppConfig app_config,
- fidl::StringPtr user_profile_id,
- fidl::VectorPtr<::fidl::StringPtr> app_scopes,
+ std::string user_profile_id,
+ std::vector<::std::string> app_scopes,
GetAccessTokenCallback callback) override;
// |fuchsia::auth::TokenManager|
void GetIdToken(fuchsia::auth::AppConfig app_config,
- fidl::StringPtr user_profile_id, fidl::StringPtr audience,
+ std::string user_profile_id, fidl::StringPtr audience,
GetIdTokenCallback callback) override;
// |fuchsia::auth::TokenManager|
void GetFirebaseToken(fuchsia::auth::AppConfig app_config,
- fidl::StringPtr user_profile_id,
- fidl::StringPtr audience,
- fidl::StringPtr firebase_api_key,
+ std::string user_profile_id,
+ std::string audience,
+ std::string firebase_api_key,
GetFirebaseTokenCallback callback) override;
// |fuchsia::auth::TokenManager|
void DeleteAllTokens(fuchsia::auth::AppConfig app_config,
- fidl::StringPtr user_profile_id,
+ std::string user_profile_id,
DeleteAllTokensCallback callback) override;
// |fuchsia::auth::TokenManager|
diff --git a/bin/sessionmgr/agent_runner/agent_runner.cc b/bin/sessionmgr/agent_runner/agent_runner.cc
index 6948526..ef38087 100644
--- a/bin/sessionmgr/agent_runner/agent_runner.cc
+++ b/bin/sessionmgr/agent_runner/agent_runner.cc
@@ -222,7 +222,7 @@
fuchsia::modular::TaskInfo task_info) {
AgentRunnerStorage::TriggerInfo data;
data.agent_url = agent_url;
- data.task_id = task_info.task_id.get();
+ data.task_id = task_info.task_id;
if (task_info.trigger_condition.is_message_on_queue()) {
data.queue_name = task_info.trigger_condition.message_on_queue();
@@ -462,7 +462,7 @@
agent_runner_storage_->DeleteTask(agent_url, task_id, [](bool) {});
}
-fidl::VectorPtr<fidl::StringPtr> AgentRunner::GetAllAgents() {
+std::vector<std::string> AgentRunner::GetAllAgents() {
// A set of all agents that are either running or scheduled to be run.
std::set<std::string> agents;
for (auto const& it : running_agents_) {
@@ -475,9 +475,7 @@
agents.insert(it.first);
}
- fidl::VectorPtr<fidl::StringPtr> agent_urls;
- // Initialize the size to force non-null.
- agent_urls.resize(0);
+ std::vector<std::string> agent_urls;
for (auto const& it : agents) {
agent_urls.push_back(it);
}
diff --git a/bin/sessionmgr/agent_runner/agent_runner.h b/bin/sessionmgr/agent_runner/agent_runner.h
index f15586e..48ddf28 100644
--- a/bin/sessionmgr/agent_runner/agent_runner.h
+++ b/bin/sessionmgr/agent_runner/agent_runner.h
@@ -137,7 +137,7 @@
const std::string& task_id);
// A set of all agents that are either running or scheduled to be run.
- fidl::VectorPtr<fidl::StringPtr> GetAllAgents();
+ std::vector<std::string> GetAllAgents();
// |UpdateWatchers| will not notify watchers if we are tearing down.
void UpdateWatchers();
diff --git a/bin/sessionmgr/agent_runner/agent_runner_storage_impl.cc b/bin/sessionmgr/agent_runner/agent_runner_storage_impl.cc
index 5029913..193457a 100644
--- a/bin/sessionmgr/agent_runner/agent_runner_storage_impl.cc
+++ b/bin/sessionmgr/agent_runner/agent_runner_storage_impl.cc
@@ -82,8 +82,8 @@
}
for (const auto& entry : entries_) {
- std::string key(reinterpret_cast<const char*>(entry.key->data()),
- entry.key->size());
+ std::string key(reinterpret_cast<const char*>(entry.key.data()),
+ entry.key.size());
std::string value;
if (!fsl::StringFromVmo(*entry.value, &value)) {
FXL_LOG(ERROR) << trace_name() << " " << key << " "
diff --git a/bin/sessionmgr/agent_runner/agent_runner_unittest.cc b/bin/sessionmgr/agent_runner/agent_runner_unittest.cc
index ce76453..0ec09da 100644
--- a/bin/sessionmgr/agent_runner/agent_runner_unittest.cc
+++ b/bin/sessionmgr/agent_runner/agent_runner_unittest.cc
@@ -107,14 +107,14 @@
// |fuchsia::modular::Agent|
void Connect(
- fidl::StringPtr /*requestor_url*/,
+ std::string /*requestor_url*/,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider> /*services*/)
override {
++counts["Connect"];
}
// |fuchsia::modular::Agent|
- void RunTask(fidl::StringPtr /*task_id*/,
+ void RunTask(std::string /*task_id*/,
RunTaskCallback /*callback*/) override {
++counts["RunTask"];
}
diff --git a/bin/sessionmgr/component_context_impl.cc b/bin/sessionmgr/component_context_impl.cc
index ebf8388..cd7dc9c 100644
--- a/bin/sessionmgr/component_context_impl.cc
+++ b/bin/sessionmgr/component_context_impl.cc
@@ -49,7 +49,7 @@
}
void ComponentContextImpl::ConnectToAgent(
- fidl::StringPtr url,
+ std::string url,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider>
incoming_services_request,
fidl::InterfaceRequest<fuchsia::modular::AgentController>
@@ -60,19 +60,19 @@
}
void ComponentContextImpl::ObtainMessageQueue(
- fidl::StringPtr name,
+ std::string name,
fidl::InterfaceRequest<fuchsia::modular::MessageQueue> request) {
message_queue_manager_->ObtainMessageQueue(
component_namespace_, component_instance_id_, name, std::move(request));
}
-void ComponentContextImpl::DeleteMessageQueue(fidl::StringPtr name) {
+void ComponentContextImpl::DeleteMessageQueue(std::string name) {
message_queue_manager_->DeleteMessageQueue(component_namespace_,
component_instance_id_, name);
}
void ComponentContextImpl::GetMessageSender(
- fidl::StringPtr queue_token,
+ std::string queue_token,
fidl::InterfaceRequest<fuchsia::modular::MessageSender> request) {
message_queue_manager_->GetMessageSender(queue_token, std::move(request));
}
@@ -83,10 +83,10 @@
}
void ComponentContextImpl::CreateEntityWithData(
- fidl::VectorPtr<fuchsia::modular::TypeToDataEntry> type_to_data,
+ std::vector<fuchsia::modular::TypeToDataEntry> type_to_data,
CreateEntityWithDataCallback result) {
std::map<std::string, std::string> copy;
- for (const auto& it : *type_to_data) {
+ for (const auto& it : type_to_data) {
copy[it.type] = it.data;
}
result(entity_provider_runner_->CreateReferenceFromData(std::move(copy)));
diff --git a/bin/sessionmgr/component_context_impl.h b/bin/sessionmgr/component_context_impl.h
index c21f7bf..15416cf 100644
--- a/bin/sessionmgr/component_context_impl.h
+++ b/bin/sessionmgr/component_context_impl.h
@@ -61,7 +61,7 @@
fidl::InterfaceRequest<fuchsia::ledger::Ledger> request) override;
// |fuchsia::modular::ComponentContext|
- void ConnectToAgent(fidl::StringPtr url,
+ void ConnectToAgent(std::string url,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider>
incoming_services_request,
fidl::InterfaceRequest<fuchsia::modular::AgentController>
@@ -69,15 +69,15 @@
// |fuchsia::modular::ComponentContext|
void ObtainMessageQueue(
- fidl::StringPtr name,
+ std::string name,
fidl::InterfaceRequest<fuchsia::modular::MessageQueue> request) override;
// |fuchsia::modular::ComponentContext|
- void DeleteMessageQueue(fidl::StringPtr name) override;
+ void DeleteMessageQueue(std::string name) override;
// |fuchsia::modular::ComponentContext|
void GetMessageSender(
- fidl::StringPtr queue_token,
+ std::string queue_token,
fidl::InterfaceRequest<fuchsia::modular::MessageSender> request) override;
// |fuchsia::modular::ComponentContext|
@@ -87,7 +87,7 @@
// |fuchsia::modular::ComponentContext|
void CreateEntityWithData(
- fidl::VectorPtr<fuchsia::modular::TypeToDataEntry> type_to_data,
+ std::vector<fuchsia::modular::TypeToDataEntry> type_to_data,
CreateEntityWithDataCallback result) override;
// |fuchsia::modular::ComponentContext|
diff --git a/bin/sessionmgr/dev_session_shell.cc b/bin/sessionmgr/dev_session_shell.cc
index 80b1c38..8e60acd 100644
--- a/bin/sessionmgr/dev_session_shell.cc
+++ b/bin/sessionmgr/dev_session_shell.cc
@@ -120,7 +120,7 @@
puppet_master_->ControlStory(settings_.story_id,
story_puppet_master_.NewRequest());
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
fuchsia::modular::AddMod add_mod;
add_mod.mod_name.push_back("root");
add_mod.intent.handler = settings_.root_module;
@@ -187,7 +187,7 @@
story_controller_->RequestStart();
focus_controller_->Set(story_id);
- auto visible_stories = fidl::VectorPtr<fidl::StringPtr>::New(0);
+ auto visible_stories = fidl::VectorPtr<std::string>::New(0);
visible_stories.push_back(story_id);
visible_stories_controller_->Set(std::move(visible_stories));
@@ -195,7 +195,6 @@
fuchsia::modular::LinkPtr root;
fuchsia::modular::LinkPath link_path = fuchsia::modular::LinkPath();
- link_path.module_path = ::fidl::VectorPtr<::fidl::StringPtr>::New(0);
link_path.link_name = "root";
story_controller_->GetLink(std::move(link_path), root.NewRequest());
@@ -230,14 +229,14 @@
// |fuchsia::modular::StoryWatcher|
void OnModuleFocused(
- fidl::VectorPtr<fidl::StringPtr> /*module_path*/) override {}
+ std::vector<std::string> /*module_path*/) override {}
// |fuchsia::modular::NextListener|
void OnNextResults(
- fidl::VectorPtr<fuchsia::modular::Suggestion> suggestions) override {
+ std::vector<fuchsia::modular::Suggestion> suggestions) override {
FXL_VLOG(4)
<< "DevSessionShell/fuchsia::modular::NextListener::OnNextResults()";
- for (auto& suggestion : *suggestions) {
+ for (auto& suggestion : suggestions) {
FXL_LOG(INFO) << " " << suggestion.uuid << " "
<< suggestion.display.headline;
}
diff --git a/bin/sessionmgr/device_map_impl.cc b/bin/sessionmgr/device_map_impl.cc
index 20036c8..6938713 100644
--- a/bin/sessionmgr/device_map_impl.cc
+++ b/bin/sessionmgr/device_map_impl.cc
@@ -118,7 +118,7 @@
callback(devices_[current_device_id_]);
}
-void DeviceMapImpl::SetCurrentDeviceProfile(::fidl::StringPtr profile) {
+void DeviceMapImpl::SetCurrentDeviceProfile(::std::string profile) {
devices_[current_device_id_].profile = profile;
Notify(current_device_id_);
SaveCurrentDevice();
diff --git a/bin/sessionmgr/device_map_impl.h b/bin/sessionmgr/device_map_impl.h
index 6b56d5f..a8b9163 100644
--- a/bin/sessionmgr/device_map_impl.h
+++ b/bin/sessionmgr/device_map_impl.h
@@ -43,7 +43,7 @@
void GetCurrentDevice(GetCurrentDeviceCallback callback) override;
// |fuchsia::modular::DeviceMap|
- void SetCurrentDeviceProfile(::fidl::StringPtr profile) override;
+ void SetCurrentDeviceProfile(::std::string profile) override;
// |fuchsia::modular::DeviceMap|
void WatchDeviceMap(fidl::InterfaceHandle<fuchsia::modular::DeviceMapWatcher>
diff --git a/bin/sessionmgr/entity_provider_runner/entity_provider_controller.cc b/bin/sessionmgr/entity_provider_runner/entity_provider_controller.cc
index 214c8f6..2d50f46 100644
--- a/bin/sessionmgr/entity_provider_runner/entity_provider_controller.cc
+++ b/bin/sessionmgr/entity_provider_runner/entity_provider_controller.cc
@@ -38,12 +38,12 @@
}
// |fuchsia::modular::Entity|
- void GetData(fidl::StringPtr type, GetDataCallback callback) override {
+ void GetData(std::string type, GetDataCallback callback) override {
entity_provider_->GetData(cookie_, type, callback);
}
// |fuchsia::modular::Entity|
- void WriteData(fidl::StringPtr type, fuchsia::mem::Buffer data,
+ void WriteData(std::string type, fuchsia::mem::Buffer data,
WriteDataCallback callback) override {
entity_provider_->WriteData(cookie_, type, std::move(data), callback);
}
@@ -55,7 +55,7 @@
// |fuchsia::modular::Entity|
void Watch(
- fidl::StringPtr type,
+ std::string type,
fidl::InterfaceHandle<fuchsia::modular::EntityWatcher> watcher) override {
entity_provider_->Watch(cookie_, type, std::move(watcher));
}
diff --git a/bin/sessionmgr/entity_provider_runner/entity_provider_runner.cc b/bin/sessionmgr/entity_provider_runner/entity_provider_runner.cc
index be63ef4..759b529 100644
--- a/bin/sessionmgr/entity_provider_runner/entity_provider_runner.cc
+++ b/bin/sessionmgr/entity_provider_runner/entity_provider_runner.cc
@@ -110,7 +110,7 @@
private:
// |fuchsia::modular::EntityReferenceFactory|
- void CreateReference(fidl::StringPtr cookie,
+ void CreateReference(std::string cookie,
CreateReferenceCallback callback) override {
entity_provider_runner_->CreateReference(agent_url_, cookie, callback);
}
@@ -150,10 +150,10 @@
private:
// |fuchsia::modular::Entity|
void GetTypes(GetTypesCallback result) override {
- result(fxl::To<fidl::VectorPtr<fidl::StringPtr>>(types_));
+ result(types_);
}
// |fuchsia::modular::Entity|
- void GetData(fidl::StringPtr type, GetDataCallback result) override {
+ void GetData(std::string type, GetDataCallback result) override {
auto it = data_.find(type);
if (it != data_.end()) {
fsl::SizedVmo vmo;
@@ -167,7 +167,7 @@
}
}
// |fuchsia::modular::Entity|
- void WriteData(fidl::StringPtr type, fuchsia::mem::Buffer data,
+ void WriteData(std::string type, fuchsia::mem::Buffer data,
WriteDataCallback callback) override {
// TODO(MI4-1301)
callback(fuchsia::modular::EntityWriteStatus::READ_ONLY);
@@ -179,7 +179,7 @@
}
// |fuchsia::modular::Entity|
void Watch(
- fidl::StringPtr type,
+ std::string type,
fidl::InterfaceHandle<fuchsia::modular::EntityWatcher> watcher) override {
// TODO(MI4-1301)
FXL_NOTIMPLEMENTED();
@@ -282,9 +282,9 @@
}
void EntityProviderRunner::ResolveEntity(
- fidl::StringPtr entity_reference,
+ std::string entity_reference,
fidl::InterfaceRequest<fuchsia::modular::Entity> entity_request) {
- if (entity_reference.get().find(kEntityDataReferencePrefix) == 0ul) {
+ if (entity_reference.find(kEntityDataReferencePrefix) == 0ul) {
ResolveDataEntity(entity_reference, std::move(entity_request));
return;
}
diff --git a/bin/sessionmgr/entity_provider_runner/entity_provider_runner.h b/bin/sessionmgr/entity_provider_runner/entity_provider_runner.h
index dc59fb1..a76207a 100644
--- a/bin/sessionmgr/entity_provider_runner/entity_provider_runner.h
+++ b/bin/sessionmgr/entity_provider_runner/entity_provider_runner.h
@@ -77,7 +77,7 @@
// |fuchsia::modular::EntityResolver|
void ResolveEntity(
- fidl::StringPtr entity_reference,
+ std::string entity_reference,
fidl::InterfaceRequest<fuchsia::modular::Entity> entity_request) override;
void ResolveDataEntity(
diff --git a/bin/sessionmgr/entity_provider_runner/entity_provider_runner_unittest.cc b/bin/sessionmgr/entity_provider_runner/entity_provider_runner_unittest.cc
index bc628de..fdcd966 100644
--- a/bin/sessionmgr/entity_provider_runner/entity_provider_runner_unittest.cc
+++ b/bin/sessionmgr/entity_provider_runner/entity_provider_runner_unittest.cc
@@ -167,17 +167,17 @@
}
// |fuchsia::modular::EntityProvider|
- void GetTypes(fidl::StringPtr cookie, GetTypesCallback callback) override {
- fidl::VectorPtr<fidl::StringPtr> types;
+ void GetTypes(std::string cookie, GetTypesCallback callback) override {
+ std::vector<std::string> types;
types.push_back("MyType");
callback(std::move(types));
}
// |fuchsia::modular::EntityProvider|
- void GetData(fidl::StringPtr cookie, fidl::StringPtr type,
+ void GetData(std::string cookie, std::string type,
GetDataCallback callback) override {
fsl::SizedVmo vmo;
- FXL_CHECK(fsl::VmoFromString(type.get() + ":MyData", &vmo));
+ FXL_CHECK(fsl::VmoFromString(type + ":MyData", &vmo));
auto vmo_ptr =
std::make_unique<fuchsia::mem::Buffer>(std::move(vmo).ToTransport());
@@ -185,7 +185,7 @@
}
// |fuchsia::modular::EntityProvider|
- void WriteData(fidl::StringPtr cookie, fidl::StringPtr type,
+ void WriteData(std::string cookie, std::string type,
fuchsia::mem::Buffer data,
WriteDataCallback callback) override {
// TODO(MI4-1301)
@@ -194,7 +194,7 @@
// |fuchsia::modular::EntityProvider|
void Watch(
- fidl::StringPtr cookie, fidl::StringPtr type,
+ std::string cookie, std::string type,
fidl::InterfaceHandle<fuchsia::modular::EntityWatcher> watcher) override {
// TODO(MI4-1301)
FXL_NOTIMPLEMENTED();
@@ -259,9 +259,9 @@
entity.NewRequest());
std::map<std::string, uint32_t> counts;
- entity->GetTypes([&counts](const fidl::VectorPtr<fidl::StringPtr>& types) {
- EXPECT_EQ(1u, types->size());
- EXPECT_EQ("MyType", types->at(0));
+ entity->GetTypes([&counts](const std::vector<std::string>& types) {
+ EXPECT_EQ(1u, types.size());
+ EXPECT_EQ("MyType", types.at(0));
counts["GetTypes"]++;
});
entity->GetData("MyType",
@@ -288,9 +288,9 @@
fuchsia::modular::EntityPtr entity;
entity_resolver->ResolveEntity(entity_ref, entity.NewRequest());
- fidl::VectorPtr<fidl::StringPtr> output_types;
- entity->GetTypes([&output_types](fidl::VectorPtr<fidl::StringPtr> result) {
- output_types = std::move(result);
+ fidl::VectorPtr<std::string> output_types;
+ entity->GetTypes([&output_types](std::vector<std::string> result) {
+ output_types.reset(std::move(result));
});
RunLoopWithTimeoutOrUntil(
[&output_types] { return !output_types.is_null(); });
diff --git a/bin/sessionmgr/focus.cc b/bin/sessionmgr/focus.cc
index 77cf74e..0af8337 100644
--- a/bin/sessionmgr/focus.cc
+++ b/bin/sessionmgr/focus.cc
@@ -69,7 +69,7 @@
void FocusHandler::Query(QueryCallback callback) {
operation_queue_.Add(new ReadAllDataCall<fuchsia::modular::FocusInfo>(
page(), kFocusKeyPrefix, XdrFocusInfo,
- [callback](fidl::VectorPtr<fuchsia::modular::FocusInfo> infos) {
+ [callback](std::vector<fuchsia::modular::FocusInfo> infos) {
callback(std::move(infos));
}));
}
@@ -117,8 +117,7 @@
}
}
-VisibleStoriesHandler::VisibleStoriesHandler()
- : visible_stories_(fidl::VectorPtr<fidl::StringPtr>::New(0)) {}
+VisibleStoriesHandler::VisibleStoriesHandler() {}
VisibleStoriesHandler::~VisibleStoriesHandler() = default;
@@ -134,7 +133,7 @@
}
void VisibleStoriesHandler::Query(QueryCallback callback) {
- callback(visible_stories_.Clone());
+ callback(visible_stories_);
}
void VisibleStoriesHandler::Watch(
@@ -142,7 +141,7 @@
change_watchers_.push_back(watcher.Bind());
}
-void VisibleStoriesHandler::Set(fidl::VectorPtr<fidl::StringPtr> story_ids) {
+void VisibleStoriesHandler::Set(fidl::VectorPtr<std::string> story_ids) {
visible_stories_ = std::move(story_ids);
for (const auto& watcher : change_watchers_) {
watcher->OnVisibleStoriesChange(visible_stories_.Clone());
diff --git a/bin/sessionmgr/focus.h b/bin/sessionmgr/focus.h
index c6e002c..2b8b43a 100644
--- a/bin/sessionmgr/focus.h
+++ b/bin/sessionmgr/focus.h
@@ -87,7 +87,7 @@
watcher) override;
// |fuchsia::modular::VisibleStoriesController|
- void Set(fidl::VectorPtr<fidl::StringPtr> story_ids) override;
+ void Set(fidl::VectorPtr<std::string> story_ids) override;
fidl::BindingSet<fuchsia::modular::VisibleStoriesProvider> provider_bindings_;
fidl::BindingSet<fuchsia::modular::VisibleStoriesController>
@@ -95,7 +95,7 @@
std::vector<fuchsia::modular::VisibleStoriesWatcherPtr> change_watchers_;
- fidl::VectorPtr<fidl::StringPtr> visible_stories_;
+ fidl::VectorPtr<std::string> visible_stories_;
FXL_DISALLOW_COPY_AND_ASSIGN(VisibleStoriesHandler);
};
diff --git a/bin/sessionmgr/message_queue/message_queue_manager.cc b/bin/sessionmgr/message_queue/message_queue_manager.cc
index 85f3178..35f8127 100644
--- a/bin/sessionmgr/message_queue/message_queue_manager.cc
+++ b/bin/sessionmgr/message_queue/message_queue_manager.cc
@@ -335,7 +335,7 @@
void Run() override {
FlowToken flow{this};
- page()->GetSnapshot(snapshot_.NewRequest(), nullptr, nullptr,
+ page()->GetSnapshot(snapshot_.NewRequest(), std::vector<uint8_t>(), nullptr,
Protect([this, flow](fuchsia::ledger::Status status) {
if (status != fuchsia::ledger::Status::OK) {
FXL_LOG(ERROR) << trace_name() << " "
diff --git a/bin/sessionmgr/puppet_master/command_runners/add_mod_command_runner_unittest.cc b/bin/sessionmgr/puppet_master/command_runners/add_mod_command_runner_unittest.cc
index df05840..4327806 100644
--- a/bin/sessionmgr/puppet_master/command_runners/add_mod_command_runner_unittest.cc
+++ b/bin/sessionmgr/puppet_master/command_runners/add_mod_command_runner_unittest.cc
@@ -26,7 +26,7 @@
std::vector<fuchsia::modular::ParameterConstraint> param_constraints) {
fuchsia::modular::IntentFilter f;
f.action = action;
- f.parameter_constraints.reset(param_constraints);
+ f.parameter_constraints = param_constraints;
return f;
}
@@ -101,6 +101,7 @@
if (old_param.entity_reference() != new_param.entity_reference()) {
return false;
}
+ break;
case fuchsia::modular::IntentParameterData::Tag::kJson: {
std::string old_string;
std::string new_string;
@@ -144,7 +145,7 @@
const std::string& mod_name, const std::string& parent_mod_name,
float surface_emphasis, const fuchsia::modular::Intent& intent) {
fuchsia::modular::AddMod add_mod;
- add_mod.mod_name.reset({mod_name});
+ add_mod.mod_name = {mod_name};
if (!parent_mod_name.empty()) {
add_mod.surface_parent_mod_name.reset({parent_mod_name});
}
@@ -179,8 +180,7 @@
std::vector<std::string> types) {
fuchsia::modular::IntentParameter parameter;
parameter.name = name;
- parameter.data.set_entity_type(
- fxl::To<fidl::VectorPtr<fidl::StringPtr>>(std::move(types)));
+ parameter.data.set_entity_type(types);
intent->parameters.push_back(std::move(parameter));
}
@@ -302,7 +302,7 @@
RunLoopUntil([&] { return done; });
done = false;
- fidl::VectorPtr<fidl::StringPtr> full_path{{"parent_mod", "mod"}};
+ std::vector<std::string> full_path{"parent_mod", "mod"};
story_storage_->ReadModuleData(std::move(full_path))
->Then([&](fuchsia::modular::ModuleDataPtr module_data) {
EXPECT_EQ("mod_url", module_data->module_url);
@@ -313,7 +313,7 @@
EXPECT_EQ(0.5, module_data->surface_relation->emphasis);
EXPECT_TRUE(AreIntentsEqual(intent, *module_data->intent));
EXPECT_EQ(*manifest, *module_data->module_manifest);
- EXPECT_EQ(0u, module_data->parameter_map.entries->size());
+ EXPECT_EQ(0u, module_data->parameter_map.entries.size());
done = true;
});
@@ -360,7 +360,7 @@
RunLoopUntil([&] { return done; });
done = false;
- fidl::VectorPtr<fidl::StringPtr> full_path{{"mod"}};
+ std::vector<std::string> full_path{"mod"};
story_storage_->ReadModuleData(std::move(full_path))
->Then([&](fuchsia::modular::ModuleDataPtr module_data) {
EXPECT_EQ("mod_url", module_data->module_url);
@@ -371,7 +371,7 @@
EXPECT_EQ(0.5, module_data->surface_relation->emphasis);
EXPECT_TRUE(AreIntentsEqual(intent, *module_data->intent));
EXPECT_EQ(*manifest, *module_data->module_manifest);
- EXPECT_EQ(0u, module_data->parameter_map.entries->size());
+ EXPECT_EQ(0u, module_data->parameter_map.entries.size());
done = true;
});
@@ -409,22 +409,22 @@
[&](const fuchsia::modular::FindModulesQuery& query) {
EXPECT_EQ("intent_action", query.action);
auto& constraints = query.parameter_constraints;
- EXPECT_EQ(5u, constraints->size());
- for (auto& constraint : *constraints) {
- EXPECT_EQ(1u, constraint.param_types->size());
+ EXPECT_EQ(5u, constraints.size());
+ for (auto& constraint : constraints) {
+ EXPECT_EQ(1u, constraint.param_types.size());
}
- EXPECT_EQ("param_json", constraints->at(0).param_name);
- EXPECT_EQ("foo", constraints->at(0).param_types->at(0));
- EXPECT_EQ("param_ref", constraints->at(1).param_name);
- EXPECT_EQ("entity_type1", constraints->at(1).param_types->at(0));
- EXPECT_EQ("param_ref", constraints->at(1).param_name);
- EXPECT_EQ("entity_type1", constraints->at(1).param_types->at(0));
- EXPECT_EQ("param_type", constraints->at(2).param_name);
- EXPECT_EQ("entity_type2", constraints->at(2).param_types->at(0));
- EXPECT_EQ("param_linkpath", constraints->at(3).param_name);
- EXPECT_EQ("bar", constraints->at(3).param_types->at(0));
- EXPECT_EQ("param_linkname", constraints->at(4).param_name);
- EXPECT_EQ("baz", constraints->at(4).param_types->at(0));
+ EXPECT_EQ("param_json", constraints.at(0).param_name);
+ EXPECT_EQ("foo", constraints.at(0).param_types.at(0));
+ EXPECT_EQ("param_ref", constraints.at(1).param_name);
+ EXPECT_EQ("entity_type1", constraints.at(1).param_types.at(0));
+ EXPECT_EQ("param_ref", constraints.at(1).param_name);
+ EXPECT_EQ("entity_type1", constraints.at(1).param_types.at(0));
+ EXPECT_EQ("param_type", constraints.at(2).param_name);
+ EXPECT_EQ("entity_type2", constraints.at(2).param_types.at(0));
+ EXPECT_EQ("param_linkpath", constraints.at(3).param_name);
+ EXPECT_EQ("bar", constraints.at(3).param_types.at(0));
+ EXPECT_EQ("param_linkname", constraints.at(4).param_name);
+ EXPECT_EQ("baz", constraints.at(4).param_types.at(0));
});
bool done{};
@@ -437,7 +437,7 @@
RunLoopUntil([&] { return done; });
done = false;
- fidl::VectorPtr<fidl::StringPtr> full_path{{"parent_mod", "mod"}};
+ std::vector<std::string> full_path{"parent_mod", "mod"};
fuchsia::modular::ModuleDataPtr module_data;
story_storage_->ReadModuleData(std::move(full_path))
->Then([&](fuchsia::modular::ModuleDataPtr result) {
@@ -454,40 +454,40 @@
EXPECT_EQ(0.5, module_data->surface_relation->emphasis);
EXPECT_TRUE(AreIntentsEqual(intent, *module_data->intent));
EXPECT_EQ(*manifest, *module_data->module_manifest);
- EXPECT_EQ(5u, module_data->parameter_map.entries->size());
+ EXPECT_EQ(5u, module_data->parameter_map.entries.size());
// Verify parameters
- auto& link_path1 = module_data->parameter_map.entries->at(0).link_path;
- EXPECT_EQ("param_json", module_data->parameter_map.entries->at(0).name);
+ auto& link_path1 = module_data->parameter_map.entries.at(0).link_path;
+ EXPECT_EQ("param_json", module_data->parameter_map.entries.at(0).name);
EXPECT_EQ(full_path, link_path1.module_path);
EXPECT_EQ("param_json", link_path1.link_name);
EXPECT_EQ(R"({"@type": "foo"})",
GetLinkValue(story_storage_.get(), link_path1));
- auto& link_path2 = module_data->parameter_map.entries->at(1).link_path;
- EXPECT_EQ("param_ref", module_data->parameter_map.entries->at(1).name);
+ auto& link_path2 = module_data->parameter_map.entries.at(1).link_path;
+ EXPECT_EQ("param_ref", module_data->parameter_map.entries.at(1).name);
EXPECT_EQ(full_path, link_path2.module_path);
EXPECT_EQ("param_ref", link_path2.link_name);
EXPECT_EQ(R"({"@entityRef":")" + *reference + R"("})",
GetLinkValue(story_storage_.get(), link_path2));
- auto& link_path3 = module_data->parameter_map.entries->at(2).link_path;
- EXPECT_EQ("param_type", module_data->parameter_map.entries->at(2).name);
+ auto& link_path3 = module_data->parameter_map.entries.at(2).link_path;
+ EXPECT_EQ("param_type", module_data->parameter_map.entries.at(2).name);
EXPECT_EQ(full_path, link_path3.module_path);
EXPECT_EQ("param_type", link_path3.link_name);
EXPECT_EQ("null", GetLinkValue(story_storage_.get(), link_path3));
- auto& link_path4 = module_data->parameter_map.entries->at(3).link_path;
- EXPECT_EQ("param_linkpath", module_data->parameter_map.entries->at(3).name);
- EXPECT_TRUE(link_path4.module_path->empty());
+ auto& link_path4 = module_data->parameter_map.entries.at(3).link_path;
+ EXPECT_EQ("param_linkpath", module_data->parameter_map.entries.at(3).name);
+ EXPECT_TRUE(link_path4.module_path.empty());
EXPECT_EQ("link_path1", link_path4.link_name);
EXPECT_EQ(R"({"@type": "bar"})",
GetLinkValue(story_storage_.get(), link_path4));
- auto& link_path5 = module_data->parameter_map.entries->at(4).link_path;
- EXPECT_EQ("param_linkname", module_data->parameter_map.entries->at(4).name);
- EXPECT_EQ(1u, link_path5.module_path->size());
- EXPECT_EQ("parent_mod", link_path5.module_path->at(0));
+ auto& link_path5 = module_data->parameter_map.entries.at(4).link_path;
+ EXPECT_EQ("param_linkname", module_data->parameter_map.entries.at(4).name);
+ EXPECT_EQ(1u, link_path5.module_path.size());
+ EXPECT_EQ("parent_mod", link_path5.module_path.at(0));
EXPECT_EQ("parent_link_name", link_path5.link_name);
EXPECT_EQ(R"({"@type": "baz"})",
GetLinkValue(story_storage_.get(), link_path5));
@@ -719,10 +719,10 @@
// Get the link path for the param of the mod we created.
fuchsia::modular::LinkPath link_path;
- fidl::VectorPtr<fidl::StringPtr> full_path{{"parent_mod", "mod"}};
- story_storage_->ReadModuleData(full_path.Clone())
+ std::vector<std::string> full_path{"parent_mod", "mod"};
+ story_storage_->ReadModuleData(full_path)
->Then([&](fuchsia::modular::ModuleDataPtr result) {
- for (auto& entry : *result->parameter_map.entries) {
+ for (auto& entry : result->parameter_map.entries) {
if (entry.name == "param_json") {
fidl::Clone(entry.link_path, &link_path);
}
@@ -734,7 +734,7 @@
auto intent2 = CreateEmptyIntent("intent_action", "mod_url");
AddJsonParameter(&intent2, "param_json", R"({"@type": "baz"})");
fuchsia::modular::AddMod add_mod;
- add_mod.mod_name.reset({"parent_mod", "mod"});
+ add_mod.mod_name = {"parent_mod", "mod"};
intent2.Clone(&add_mod.intent);
fuchsia::modular::StoryCommand command2;
command2.set_add_mod(std::move(add_mod));
diff --git a/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner.cc b/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner.cc
index c59c331..b91b0e8 100644
--- a/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner.cc
+++ b/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner.cc
@@ -7,7 +7,7 @@
namespace modular {
FocusModCommandRunner::FocusModCommandRunner(
- fit::function<void(fidl::StringPtr, fidl::VectorPtr<fidl::StringPtr>)>
+ fit::function<void(std::string, std::vector<std::string>)>
module_focuser)
: module_focuser_(std::move(module_focuser)) {}
@@ -19,7 +19,7 @@
std::function<void(fuchsia::modular::ExecuteResult)> done) {
fuchsia::modular::ExecuteResult result;
- if (command.focus_mod().mod_name->empty()) {
+ if (command.focus_mod().mod_name.empty()) {
result.status = fuchsia::modular::ExecuteStatus::INVALID_COMMAND;
result.error_message = "No mod_name provided.";
done(std::move(result));
diff --git a/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner.h b/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner.h
index b12e5e4..812e3ab 100644
--- a/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner.h
+++ b/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner.h
@@ -14,7 +14,7 @@
class FocusModCommandRunner : public CommandRunner {
public:
FocusModCommandRunner(
- fit::function<void(fidl::StringPtr, fidl::VectorPtr<fidl::StringPtr>)>
+ fit::function<void(std::string, std::vector<std::string>)>
module_focuser);
~FocusModCommandRunner();
@@ -24,7 +24,7 @@
std::function<void(fuchsia::modular::ExecuteResult)> done) override;
private:
- fit::function<void(fidl::StringPtr, fidl::VectorPtr<fidl::StringPtr>)>
+ fit::function<void(std::string, std::vector<std::string>)>
module_focuser_;
};
diff --git a/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner_unittest.cc b/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner_unittest.cc
index dc1da9f..761c8ec 100644
--- a/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner_unittest.cc
+++ b/bin/sessionmgr/puppet_master/command_runners/focus_mod_command_runner_unittest.cc
@@ -16,8 +16,8 @@
void SetUp() override {
focused_called_ = false;
runner_ = std::make_unique<FocusModCommandRunner>(
- [&](fidl::StringPtr story_id,
- fidl::VectorPtr<fidl::StringPtr> mod_name) {
+ [&](std::string story_id,
+ std::vector<std::string> mod_name) {
focused_called_ = true;
});
}
diff --git a/bin/sessionmgr/puppet_master/command_runners/operation_calls/add_mod_call.cc b/bin/sessionmgr/puppet_master/command_runners/operation_calls/add_mod_call.cc
index b783f33..f7205b8 100644
--- a/bin/sessionmgr/puppet_master/command_runners/operation_calls/add_mod_call.cc
+++ b/bin/sessionmgr/puppet_master/command_runners/operation_calls/add_mod_call.cc
@@ -27,10 +27,10 @@
fuchsia::modular::ModuleResolver* const module_resolver,
fuchsia::modular::EntityResolver* const entity_resolver,
modular::ModuleFacetReader* const module_facet_reader,
- fidl::VectorPtr<fidl::StringPtr> mod_name,
+ std::vector<std::string> mod_name,
fuchsia::modular::Intent intent,
fuchsia::modular::SurfaceRelationPtr surface_relation,
- fidl::VectorPtr<fidl::StringPtr> surface_parent_mod_name,
+ std::vector<std::string> surface_parent_mod_name,
fuchsia::modular::ModuleSource module_source, ResultCall done)
: Operation("AddModCommandRunner::AddModCall", std::move(done)),
story_storage_(story_storage),
@@ -47,10 +47,6 @@
void Run() override {
FlowToken flow{this, &out_result_, &out_module_data_};
- if (!surface_parent_mod_name_) {
- surface_parent_mod_name_.resize(0);
- }
-
// Success status by default, it will be update it if an error state is
// found.
out_result_.status = fuchsia::modular::ExecuteStatus::OK;
@@ -62,7 +58,7 @@
if (!intent_.action.is_null()) {
AddFindModulesOperation(
&operation_queue_, story_storage_, module_resolver_, entity_resolver_,
- CloneOptional(intent_), surface_parent_mod_name_.Clone(),
+ CloneOptional(intent_), surface_parent_mod_name_,
[this, flow](fuchsia::modular::ExecuteResult result,
fuchsia::modular::FindModulesResponse response) {
if (result.status != fuchsia::modular::ExecuteStatus::OK) {
@@ -75,7 +71,7 @@
// compiler will make sure we're handling all error cases.
switch (response.status) {
case fuchsia::modular::FindModulesStatus::SUCCESS: {
- if (response.results->empty()) {
+ if (response.results.empty()) {
out_result_.status =
fuchsia::modular::ExecuteStatus::NO_MODULES_FOUND;
out_result_.error_message =
@@ -84,7 +80,7 @@
// Operation finishes since |flow| goes out of scope.
}
- candidate_module_ = std::move(response.results->at(0));
+ candidate_module_ = std::move(response.results.at(0));
} break;
case fuchsia::modular::FindModulesStatus::UNKNOWN_HANDLER: {
@@ -115,9 +111,9 @@
return;
// Operation finishes since |flow| goes out of scope.
}
- auto full_module_path = surface_parent_mod_name_.Clone();
- full_module_path->insert(full_module_path->end(), mod_name_->begin(),
- mod_name_->end());
+ auto full_module_path = surface_parent_mod_name_;
+ full_module_path.insert(full_module_path.end(), mod_name_.begin(),
+ mod_name_.end());
AddInitializeChainOperation(
&operation_queue_, story_storage_, std::move(full_module_path),
std::move(parameter_info_),
@@ -181,7 +177,7 @@
// way. Maybe INVALID status should be returned here since using
// this parameter in a StoryCommand doesn't make much sense.
AddGetLinkPathForParameterNameOperation(
- &operations_, story_storage_, surface_parent_mod_name_.Clone(),
+ &operations_, story_storage_, surface_parent_mod_name_,
param.data.link_name(), did_get_lp->Completer());
did_get_entries.emplace_back(
@@ -245,9 +241,9 @@
fuchsia::modular::ModuleParameterMapPtr map) {
fidl::Clone(*map, &out_module_data_.parameter_map);
out_module_data_.module_url = candidate_module_.module_id;
- out_module_data_.module_path = surface_parent_mod_name_.Clone();
- out_module_data_.module_path->insert(out_module_data_.module_path->end(),
- mod_name_->begin(), mod_name_->end());
+ out_module_data_.module_path = surface_parent_mod_name_;
+ out_module_data_.module_path.insert(out_module_data_.module_path.end(),
+ mod_name_.begin(), mod_name_.end());
out_module_data_.module_source = module_source_;
out_module_data_.module_deleted = false;
fidl::Clone(surface_relation_, &out_module_data_.surface_relation);
@@ -284,10 +280,10 @@
fuchsia::modular::ModuleResolver* const module_resolver_; // Not owned.
fuchsia::modular::EntityResolver* const entity_resolver_; // Not owned.
modular::ModuleFacetReader* const module_facet_reader_; // Not owned.
- fidl::VectorPtr<fidl::StringPtr> mod_name_;
+ std::vector<std::string> mod_name_;
fuchsia::modular::Intent intent_;
fuchsia::modular::SurfaceRelationPtr surface_relation_;
- fidl::VectorPtr<fidl::StringPtr> surface_parent_mod_name_;
+ std::vector<std::string> surface_parent_mod_name_;
fuchsia::modular::ModuleSource module_source_;
fuchsia::modular::FindModulesResult candidate_module_;
fuchsia::modular::CreateModuleParameterMapInfoPtr parameter_info_;
@@ -309,9 +305,9 @@
fuchsia::modular::ModuleResolver* const module_resolver,
fuchsia::modular::EntityResolver* const entity_resolver,
modular::ModuleFacetReader* const module_facet_reader,
- fidl::VectorPtr<fidl::StringPtr> mod_name, fuchsia::modular::Intent intent,
+ std::vector<std::string> mod_name, fuchsia::modular::Intent intent,
fuchsia::modular::SurfaceRelationPtr surface_relation,
- fidl::VectorPtr<fidl::StringPtr> surface_parent_mod_name,
+ std::vector<std::string> surface_parent_mod_name,
fuchsia::modular::ModuleSource module_source,
std::function<void(fuchsia::modular::ExecuteResult,
fuchsia::modular::ModuleData)>
diff --git a/bin/sessionmgr/puppet_master/command_runners/operation_calls/add_mod_call.h b/bin/sessionmgr/puppet_master/command_runners/operation_calls/add_mod_call.h
index 6f85bcd..64dbceb 100644
--- a/bin/sessionmgr/puppet_master/command_runners/operation_calls/add_mod_call.h
+++ b/bin/sessionmgr/puppet_master/command_runners/operation_calls/add_mod_call.h
@@ -18,9 +18,9 @@
fuchsia::modular::ModuleResolver* module_resolver,
fuchsia::modular::EntityResolver* entity_resolver,
modular::ModuleFacetReader* module_facet_reader,
- fidl::VectorPtr<fidl::StringPtr> mod_name, fuchsia::modular::Intent intent,
+ std::vector<std::string> mod_name, fuchsia::modular::Intent intent,
fuchsia::modular::SurfaceRelationPtr surface_relation,
- fidl::VectorPtr<fidl::StringPtr> surface_parent_mod_name,
+ std::vector<std::string> surface_parent_mod_name,
fuchsia::modular::ModuleSource module_source,
std::function<void(fuchsia::modular::ExecuteResult,
fuchsia::modular::ModuleData)>
diff --git a/bin/sessionmgr/puppet_master/command_runners/operation_calls/find_modules_call.cc b/bin/sessionmgr/puppet_master/command_runners/operation_calls/find_modules_call.cc
index 5ef3542..08eeb5e 100644
--- a/bin/sessionmgr/puppet_master/command_runners/operation_calls/find_modules_call.cc
+++ b/bin/sessionmgr/puppet_master/command_runners/operation_calls/find_modules_call.cc
@@ -34,7 +34,7 @@
fuchsia::modular::ModuleResolver* const module_resolver,
fuchsia::modular::EntityResolver* const entity_resolver,
fuchsia::modular::IntentPtr intent,
- fidl::VectorPtr<fidl::StringPtr> requesting_module_path,
+ std::vector<std::string> requesting_module_path,
ResultCall result_call)
: Operation("FindModulesCall", std::move(result_call)),
story_storage_(story_storage),
@@ -79,8 +79,7 @@
->Map([this, name = param.name](std::vector<std::string> types) {
fuchsia::modular::FindModulesParameterConstraint constraint;
constraint.param_name = name;
- constraint.param_types =
- fxl::To<fidl::VectorPtr<fidl::StringPtr>>(std::move(types));
+ constraint.param_types = std::move(types);
return constraint;
}));
}
@@ -93,8 +92,7 @@
// Operation finishes since |flow| goes out of scope.
return;
}
- resolver_query_.parameter_constraints.reset(
- std::move(constraint_params));
+ resolver_query_.parameter_constraints = std::move(constraint_params);
module_resolver_->FindModules(
std::move(resolver_query_),
[this, flow](fuchsia::modular::FindModulesResponse response) {
@@ -142,7 +140,7 @@
auto did_get_lp = Future<fuchsia::modular::LinkPathPtr>::Create(
"AddModCommandRunner::GetTypesFromIntentParameter.did_get_lp");
AddGetLinkPathForParameterNameOperation(
- &operations_, story_storage_, requesting_module_path_.Clone(),
+ &operations_, story_storage_, requesting_module_path_,
input.link_name(), did_get_lp->Completer());
did_get_lp->Then([this, fut,
param_name](fuchsia::modular::LinkPathPtr lp) {
@@ -220,7 +218,7 @@
fuchsia::modular::ModuleResolver* const module_resolver_; // Not Owned
fuchsia::modular::EntityResolver* const entity_resolver_; // Not owned.
const fuchsia::modular::IntentPtr intent_;
- const fidl::VectorPtr<fidl::StringPtr> requesting_module_path_;
+ const std::vector<std::string> requesting_module_path_;
fuchsia::modular::FindModulesQuery resolver_query_;
std::vector<FuturePtr<fuchsia::modular::FindModulesParameterConstraint>>
@@ -240,7 +238,7 @@
fuchsia::modular::ModuleResolver* const module_resolver,
fuchsia::modular::EntityResolver* const entity_resolver,
fuchsia::modular::IntentPtr intent,
- fidl::VectorPtr<fidl::StringPtr> requesting_module_path,
+ std::vector<std::string> requesting_module_path,
std::function<void(fuchsia::modular::ExecuteResult,
fuchsia::modular::FindModulesResponse)>
result_call) {
diff --git a/bin/sessionmgr/puppet_master/command_runners/operation_calls/find_modules_call.h b/bin/sessionmgr/puppet_master/command_runners/operation_calls/find_modules_call.h
index 460c3d7..97e6a67 100644
--- a/bin/sessionmgr/puppet_master/command_runners/operation_calls/find_modules_call.h
+++ b/bin/sessionmgr/puppet_master/command_runners/operation_calls/find_modules_call.h
@@ -16,7 +16,7 @@
fuchsia::modular::ModuleResolver* module_resolver,
fuchsia::modular::EntityResolver* entity_resolver,
fuchsia::modular::IntentPtr intent,
- fidl::VectorPtr<fidl::StringPtr> requesting_module_path,
+ std::vector<std::string> requesting_module_path,
std::function<void(fuchsia::modular::ExecuteResult,
fuchsia::modular::FindModulesResponse)>
result_call);
diff --git a/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_link_path_for_parameter_name_call.cc b/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_link_path_for_parameter_name_call.cc
index 9cba496..fc57d28 100644
--- a/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_link_path_for_parameter_name_call.cc
+++ b/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_link_path_for_parameter_name_call.cc
@@ -13,8 +13,8 @@
: public Operation<fuchsia::modular::LinkPathPtr> {
public:
GetLinkPathForParameterNameCall(StoryStorage* const story_storage,
- fidl::VectorPtr<fidl::StringPtr> module_name,
- fidl::StringPtr link_name,
+ std::vector<std::string> module_name,
+ std::string link_name,
ResultCall result_call)
: Operation("AddModCommandRunner::GetLinkPathForParameterNameCall",
std::move(result_call)),
@@ -33,17 +33,17 @@
}
auto& param_map = module_data->parameter_map;
auto it = std::find_if(
- param_map.entries->begin(), param_map.entries->end(),
+ param_map.entries.begin(), param_map.entries.end(),
[this](const fuchsia::modular::ModuleParameterMapEntry& entry) {
return entry.name == link_name_;
});
- if (it != param_map.entries->end()) {
+ if (it != param_map.entries.end()) {
link_path_ = CloneOptional(it->link_path);
}
if (!link_path_) {
link_path_ = fuchsia::modular::LinkPath::New();
- link_path_->module_path = module_name_.Clone();
+ link_path_->module_path = module_name_;
link_path_->link_name = link_name_;
}
// Flow goes out of scope, finish operation returning link_path.
@@ -51,8 +51,8 @@
}
StoryStorage* const story_storage_; // Not owned.
- fidl::VectorPtr<fidl::StringPtr> module_name_;
- fidl::StringPtr link_name_;
+ std::vector<std::string> module_name_;
+ std::string link_name_;
fuchsia::modular::LinkPathPtr link_path_;
};
@@ -61,7 +61,7 @@
void AddGetLinkPathForParameterNameOperation(
OperationContainer* const operation_container,
StoryStorage* const story_storage,
- fidl::VectorPtr<fidl::StringPtr> module_name, fidl::StringPtr link_name,
+ std::vector<std::string> module_name, std::string link_name,
std::function<void(fuchsia::modular::LinkPathPtr)> result_call) {
operation_container->Add(new GetLinkPathForParameterNameCall(
story_storage, std::move(module_name), std::move(link_name),
diff --git a/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_link_path_for_parameter_name_call.h b/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_link_path_for_parameter_name_call.h
index e0846a8..cbe901f 100644
--- a/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_link_path_for_parameter_name_call.h
+++ b/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_link_path_for_parameter_name_call.h
@@ -13,7 +13,7 @@
void AddGetLinkPathForParameterNameOperation(
OperationContainer* operation_container, StoryStorage* const story_storage,
- fidl::VectorPtr<fidl::StringPtr> module_name, fidl::StringPtr link_name,
+ std::vector<std::string> module_name, std::string link_name,
std::function<void(fuchsia::modular::LinkPathPtr)> result_call);
} // namespace modular
diff --git a/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_types_from_entity_call.cc b/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_types_from_entity_call.cc
index fea29c3..7bf4020 100644
--- a/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_types_from_entity_call.cc
+++ b/bin/sessionmgr/puppet_master/command_runners/operation_calls/get_types_from_entity_call.cc
@@ -23,8 +23,8 @@
private:
void Run() override {
entity_resolver_->ResolveEntity(entity_reference_, entity_.NewRequest());
- entity_->GetTypes([this](const fidl::VectorPtr<fidl::StringPtr>& types) {
- Done(fxl::To<std::vector<std::string>>(types));
+ entity_->GetTypes([this](const std::vector<std::string>& types) {
+ Done(types);
});
}
diff --git a/bin/sessionmgr/puppet_master/command_runners/operation_calls/initialize_chain_call.cc b/bin/sessionmgr/puppet_master/command_runners/operation_calls/initialize_chain_call.cc
index c9d3478..0fd3d38 100644
--- a/bin/sessionmgr/puppet_master/command_runners/operation_calls/initialize_chain_call.cc
+++ b/bin/sessionmgr/puppet_master/command_runners/operation_calls/initialize_chain_call.cc
@@ -19,7 +19,7 @@
fuchsia::modular::ModuleParameterMapPtr> {
public:
InitializeChainCall(StoryStorage* const story_storage,
- fidl::VectorPtr<fidl::StringPtr> module_path,
+ std::vector<std::string> module_path,
fuchsia::modular::CreateModuleParameterMapInfoPtr
create_parameter_map_info,
ResultCall result_call)
@@ -53,7 +53,7 @@
info.link_path().Clone(&mapping->link_path);
} else { // info->is_create_link()
mapping->link_path.module_path.resize(0);
- for (const auto& i : *module_path_) {
+ for (const auto& i : module_path_) {
mapping->link_path.module_path.push_back(i);
}
mapping->link_path.link_name = key;
@@ -83,7 +83,7 @@
}
StoryStorage* const story_storage_;
- const fidl::VectorPtr<fidl::StringPtr> module_path_;
+ const std::vector<std::string> module_path_;
const fuchsia::modular::CreateModuleParameterMapInfoPtr
create_parameter_map_info_;
fuchsia::modular::ModuleParameterMapPtr parameter_map_;
@@ -98,7 +98,7 @@
void AddInitializeChainOperation(
OperationContainer* const operation_container,
StoryStorage* const story_storage,
- fidl::VectorPtr<fidl::StringPtr> module_path,
+ std::vector<std::string> module_path,
fuchsia::modular::CreateModuleParameterMapInfoPtr create_parameter_map_info,
std::function<void(fuchsia::modular::ExecuteResult,
fuchsia::modular::ModuleParameterMapPtr)>
diff --git a/bin/sessionmgr/puppet_master/command_runners/operation_calls/initialize_chain_call.h b/bin/sessionmgr/puppet_master/command_runners/operation_calls/initialize_chain_call.h
index 6357f9c..9977376 100644
--- a/bin/sessionmgr/puppet_master/command_runners/operation_calls/initialize_chain_call.h
+++ b/bin/sessionmgr/puppet_master/command_runners/operation_calls/initialize_chain_call.h
@@ -13,7 +13,7 @@
void AddInitializeChainOperation(
OperationContainer* operation_container, StoryStorage* story_storage,
- fidl::VectorPtr<fidl::StringPtr> module_path,
+ std::vector<std::string> module_path,
fuchsia::modular::CreateModuleParameterMapInfoPtr create_parameter_map_info,
std::function<void(fuchsia::modular::ExecuteResult,
fuchsia::modular::ModuleParameterMapPtr)>
diff --git a/bin/sessionmgr/puppet_master/command_runners/remove_mod_command_runner_unittest.cc b/bin/sessionmgr/puppet_master/command_runners/remove_mod_command_runner_unittest.cc
index 6fe774f..302356e 100644
--- a/bin/sessionmgr/puppet_master/command_runners/remove_mod_command_runner_unittest.cc
+++ b/bin/sessionmgr/puppet_master/command_runners/remove_mod_command_runner_unittest.cc
@@ -16,14 +16,14 @@
return std::make_unique<RemoveModCommandRunner>();
}
- fidl::VectorPtr<fidl::StringPtr> MakeModulePath(fidl::StringPtr path) {
- fidl::VectorPtr<fidl::StringPtr> module_path;
+ std::vector<std::string> MakeModulePath(std::string path) {
+ std::vector<std::string> module_path;
module_path.push_back(path);
return module_path;
}
void InitModuleData(StoryStorage* const story_storage,
- fidl::VectorPtr<fidl::StringPtr> path) {
+ std::vector<std::string> path) {
fuchsia::modular::ModuleData module_data;
module_data.module_path = std::move(path);
module_data.intent = fuchsia::modular::Intent::New();
@@ -40,10 +40,10 @@
auto story_storage = GetStoryStorage(storage.get(), story_id);
auto mod_name = MakeModulePath("mod");
- InitModuleData(story_storage.get(), mod_name.Clone());
+ InitModuleData(story_storage.get(), mod_name);
fuchsia::modular::RemoveMod remove_mod;
- remove_mod.mod_name = mod_name.Clone();
+ remove_mod.mod_name = mod_name;
fuchsia::modular::StoryCommand command;
command.set_remove_mod(std::move(remove_mod));
diff --git a/bin/sessionmgr/puppet_master/dispatch_story_command_executor_unittest.cc b/bin/sessionmgr/puppet_master/dispatch_story_command_executor_unittest.cc
index ac94013..bd4182a 100644
--- a/bin/sessionmgr/puppet_master/dispatch_story_command_executor_unittest.cc
+++ b/bin/sessionmgr/puppet_master/dispatch_story_command_executor_unittest.cc
@@ -165,14 +165,14 @@
AddCommandRunner(
fuchsia::modular::StoryCommand::Tag::kAddMod,
[&](fidl::StringPtr story_id, fuchsia::modular::StoryCommand command) {
- names.push_back(command.add_mod().mod_name->at(0));
+ names.push_back(command.add_mod().mod_name.at(0));
return fuchsia::modular::ExecuteStatus::OK;
},
true /* delay_done */);
AddCommandRunner(
fuchsia::modular::StoryCommand::Tag::kRemoveMod,
[&](fidl::StringPtr story_id, fuchsia::modular::StoryCommand command) {
- names.push_back(command.remove_mod().mod_name->at(0));
+ names.push_back(command.remove_mod().mod_name.at(0));
return fuchsia::modular::ExecuteStatus::OK;
});
diff --git a/bin/sessionmgr/puppet_master/make_production_impl.cc b/bin/sessionmgr/puppet_master/make_production_impl.cc
index 2350afe..0e49652 100644
--- a/bin/sessionmgr/puppet_master/make_production_impl.cc
+++ b/bin/sessionmgr/puppet_master/make_production_impl.cc
@@ -31,7 +31,7 @@
// TODO(miguelfrde): we shouldn't create this dependency here. Instead
// an interface similar to StoryStorage should be created for Runtime
// use cases.
- fit::function<void(fidl::StringPtr, fidl::VectorPtr<fidl::StringPtr>)>
+ fit::function<void(std::string, std::vector<std::string>)>
module_focuser) {
std::map<fuchsia::modular::StoryCommand::Tag, std::unique_ptr<CommandRunner>>
command_runners;
diff --git a/bin/sessionmgr/puppet_master/make_production_impl.h b/bin/sessionmgr/puppet_master/make_production_impl.h
index 7d77d0a..8b79a4d 100644
--- a/bin/sessionmgr/puppet_master/make_production_impl.h
+++ b/bin/sessionmgr/puppet_master/make_production_impl.h
@@ -21,7 +21,7 @@
fuchsia::modular::ModuleResolver* module_resolver,
fuchsia::modular::EntityResolver* entity_resolver,
modular::ModuleFacetReader* module_facet_reader,
- fit::function<void(fidl::StringPtr, fidl::VectorPtr<fidl::StringPtr>)>
+ fit::function<void(std::string, std::vector<std::string>)>
module_focuser);
} // namespace modular
diff --git a/bin/sessionmgr/puppet_master/puppet_master_impl.cc b/bin/sessionmgr/puppet_master/puppet_master_impl.cc
index 7d10e05..cb0f934 100644
--- a/bin/sessionmgr/puppet_master/puppet_master_impl.cc
+++ b/bin/sessionmgr/puppet_master/puppet_master_impl.cc
@@ -27,14 +27,14 @@
}
void PuppetMasterImpl::ControlStory(
- fidl::StringPtr story_name,
+ std::string story_name,
fidl::InterfaceRequest<fuchsia::modular::StoryPuppetMaster> request) {
auto controller = std::make_unique<StoryPuppetMasterImpl>(
story_name, &operations_, session_storage_, executor_);
story_puppet_masters_.AddBinding(std::move(controller), std::move(request));
}
-void PuppetMasterImpl::DeleteStory(fidl::StringPtr story_name,
+void PuppetMasterImpl::DeleteStory(std::string story_name,
DeleteStoryCallback done) {
session_storage_->DeleteStory(story_name)->Then(std::move(done));
}
@@ -42,10 +42,10 @@
void PuppetMasterImpl::GetStories(GetStoriesCallback done) {
session_storage_->GetAllStoryData()->Then(
[done = std::move(done)](
- fidl::VectorPtr<fuchsia::modular::internal::StoryData>
+ std::vector<fuchsia::modular::internal::StoryData>
all_story_data) {
- auto result = fidl::VectorPtr<fidl::StringPtr>::New(0);
- for (auto& story : *all_story_data) {
+ std::vector<std::string> result;
+ for (auto& story : all_story_data) {
result.push_back(std::move(story.story_info.id));
}
diff --git a/bin/sessionmgr/puppet_master/puppet_master_impl.h b/bin/sessionmgr/puppet_master/puppet_master_impl.h
index d124bd9..748e1f5 100644
--- a/bin/sessionmgr/puppet_master/puppet_master_impl.h
+++ b/bin/sessionmgr/puppet_master/puppet_master_impl.h
@@ -31,12 +31,12 @@
private:
// |PuppetMaster|
- void ControlStory(fidl::StringPtr story_name,
+ void ControlStory(std::string story_name,
fidl::InterfaceRequest<fuchsia::modular::StoryPuppetMaster>
request) override;
// |PuppetMaster|
- void DeleteStory(fidl::StringPtr story_name,
+ void DeleteStory(std::string story_name,
DeleteStoryCallback done) override;
// |PuppetMaster|
diff --git a/bin/sessionmgr/puppet_master/puppet_master_impl_unittest.cc b/bin/sessionmgr/puppet_master/puppet_master_impl_unittest.cc
index 43508d6..bd97653 100644
--- a/bin/sessionmgr/puppet_master/puppet_master_impl_unittest.cc
+++ b/bin/sessionmgr/puppet_master/puppet_master_impl_unittest.cc
@@ -50,7 +50,7 @@
// Enqueue some commands. Do this twice and show that all the commands show
// up as one batch.
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(MakeRemoveModCommand("one"));
story->Enqueue(std::move(commands));
commands.push_back(MakeRemoveModCommand("two"));
@@ -77,11 +77,11 @@
EXPECT_EQ("foo", executor_.last_story_id());
ASSERT_EQ(3u, executor_.last_commands().size());
EXPECT_EQ("one",
- executor_.last_commands().at(0).remove_mod().mod_name->at(0));
+ executor_.last_commands().at(0).remove_mod().mod_name.at(0));
EXPECT_EQ("two",
- executor_.last_commands().at(1).remove_mod().mod_name->at(0));
+ executor_.last_commands().at(1).remove_mod().mod_name.at(0));
EXPECT_EQ("three",
- executor_.last_commands().at(2).remove_mod().mod_name->at(0));
+ executor_.last_commands().at(2).remove_mod().mod_name.at(0));
}
TEST_F(PuppetMasterTest, CommandsAreSentToExecutor_IfWeCloseStoryChannel) {
@@ -92,7 +92,7 @@
// Enqueue some commands. Do this twice and show that all the commands show
// up as one batch.
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(MakeRemoveModCommand("one"));
story->Enqueue(std::move(commands));
@@ -117,7 +117,7 @@
// execution.
auto story = ControlStory("foo");
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(MakeRemoveModCommand("one"));
executor_.SetExecuteReturnResult(fuchsia::modular::ExecuteStatus::OK,
nullptr);
@@ -141,7 +141,7 @@
auto story1 = ControlStory("story1");
auto story2 = ControlStory("story2");
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(MakeRemoveModCommand("one"));
story1->Enqueue(std::move(commands));
// We must run the loop to ensure that our message is dispatched.
@@ -164,7 +164,7 @@
auto story1_id = executor_.last_story_id();
ASSERT_EQ(1u, executor_.last_commands().size());
EXPECT_EQ("one",
- executor_.last_commands().at(0).remove_mod().mod_name->at(0));
+ executor_.last_commands().at(0).remove_mod().mod_name.at(0));
executor_.SetExecuteReturnResult(fuchsia::modular::ExecuteStatus::OK,
nullptr);
@@ -178,7 +178,7 @@
auto story2_id = executor_.last_story_id();
ASSERT_EQ(1u, executor_.last_commands().size());
EXPECT_EQ("two",
- executor_.last_commands().at(0).remove_mod().mod_name->at(0));
+ executor_.last_commands().at(0).remove_mod().mod_name.at(0));
// The two IDs should be different, because we gave the two stories different
// names.
@@ -192,7 +192,7 @@
auto story1 = ControlStory("foo");
auto story2 = ControlStory("foo");
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(MakeRemoveModCommand("one"));
story1->Enqueue(std::move(commands));
// We must run the loop to ensure that our message is dispatched.
@@ -215,7 +215,7 @@
auto story_id = executor_.last_story_id();
ASSERT_EQ(1u, executor_.last_commands().size());
EXPECT_EQ("one",
- executor_.last_commands().at(0).remove_mod().mod_name->at(0));
+ executor_.last_commands().at(0).remove_mod().mod_name.at(0));
executor_.SetExecuteReturnResult(fuchsia::modular::ExecuteStatus::OK,
nullptr);
@@ -229,7 +229,7 @@
EXPECT_EQ(story_id, executor_.last_story_id());
ASSERT_EQ(1u, executor_.last_commands().size());
EXPECT_EQ("two",
- executor_.last_commands().at(0).remove_mod().mod_name->at(0));
+ executor_.last_commands().at(0).remove_mod().mod_name.at(0));
}
TEST_F(PuppetMasterTest, CreateStoryWithOptions) {
@@ -242,7 +242,7 @@
story->SetCreateOptions(std::move(options));
// Enqueue some commands.
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(MakeRemoveModCommand("one"));
story->Enqueue(std::move(commands));
@@ -278,7 +278,7 @@
story->SetCreateOptions(std::move(options2));
// Enqueue some commands.
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands2;
+ std::vector<fuchsia::modular::StoryCommand> commands2;
commands2.push_back(MakeRemoveModCommand("two"));
story->Enqueue(std::move(commands2));
@@ -329,8 +329,8 @@
TEST_F(PuppetMasterTest, GetStories) {
// Zero stories to should exist.
bool done{};
- ptr_->GetStories([&](fidl::VectorPtr<fidl::StringPtr> story_names) {
- EXPECT_EQ(0u, story_names->size());
+ ptr_->GetStories([&](std::vector<std::string> story_names) {
+ EXPECT_EQ(0u, story_names.size());
done = true;
});
RunLoopUntil([&] { return done; });
@@ -340,9 +340,9 @@
// "foo" should be listed.
done = false;
- ptr_->GetStories([&](fidl::VectorPtr<fidl::StringPtr> story_names) {
- ASSERT_EQ(1u, story_names->size());
- EXPECT_EQ("foo", story_names->at(0));
+ ptr_->GetStories([&](std::vector<std::string> story_names) {
+ ASSERT_EQ(1u, story_names.size());
+ EXPECT_EQ("foo", story_names.at(0));
done = true;
});
RunLoopUntil([&] { return done; });
diff --git a/bin/sessionmgr/puppet_master/story_puppet_master_impl.cc b/bin/sessionmgr/puppet_master/story_puppet_master_impl.cc
index 588a5f4..b20d652 100644
--- a/bin/sessionmgr/puppet_master/story_puppet_master_impl.cc
+++ b/bin/sessionmgr/puppet_master/story_puppet_master_impl.cc
@@ -18,7 +18,7 @@
public:
ExecuteOperation(SessionStorage* const session_storage,
StoryCommandExecutor* const executor,
- fidl::StringPtr story_name,
+ std::string story_name,
fuchsia::modular::StoryOptions story_options,
std::vector<fuchsia::modular::StoryCommand> commands,
ResultCall done)
@@ -65,7 +65,7 @@
SessionStorage* const session_storage_;
StoryCommandExecutor* const executor_;
- fidl::StringPtr story_name_;
+ std::string story_name_;
fuchsia::modular::StoryOptions story_options_;
std::vector<fuchsia::modular::StoryCommand> commands_;
@@ -75,7 +75,7 @@
} // namespace
StoryPuppetMasterImpl::StoryPuppetMasterImpl(
- fidl::StringPtr story_name, OperationContainer* const operations,
+ std::string story_name, OperationContainer* const operations,
SessionStorage* const session_storage, StoryCommandExecutor* const executor)
: story_name_(story_name),
session_storage_(session_storage),
@@ -88,13 +88,10 @@
StoryPuppetMasterImpl::~StoryPuppetMasterImpl() = default;
void StoryPuppetMasterImpl::Enqueue(
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands) {
- if (!commands) {
- return;
- }
+ std::vector<fuchsia::modular::StoryCommand> commands) {
enqueued_commands_.insert(enqueued_commands_.end(),
- make_move_iterator(commands->begin()),
- make_move_iterator(commands->end()));
+ make_move_iterator(commands.begin()),
+ make_move_iterator(commands.end()));
}
void StoryPuppetMasterImpl::Execute(ExecuteCallback done) {
diff --git a/bin/sessionmgr/puppet_master/story_puppet_master_impl.h b/bin/sessionmgr/puppet_master/story_puppet_master_impl.h
index 40d3ecd..f9a0b09 100644
--- a/bin/sessionmgr/puppet_master/story_puppet_master_impl.h
+++ b/bin/sessionmgr/puppet_master/story_puppet_master_impl.h
@@ -21,7 +21,7 @@
// story command execution to a StoryCommandExecutor.
class StoryPuppetMasterImpl : public fuchsia::modular::StoryPuppetMaster {
public:
- StoryPuppetMasterImpl(fidl::StringPtr story_name,
+ StoryPuppetMasterImpl(std::string story_name,
OperationContainer* operations,
SessionStorage* session_storage,
StoryCommandExecutor* executor);
@@ -30,7 +30,7 @@
private:
// |StoryPuppetMaster|
void Enqueue(
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands) override;
+ std::vector<fuchsia::modular::StoryCommand> commands) override;
// |StoryPuppetMaster|
void Execute(ExecuteCallback done) override;
@@ -38,7 +38,7 @@
// |StoryPuppetMaster|
void SetCreateOptions(fuchsia::modular::StoryOptions story_options) override;
- fidl::StringPtr story_name_;
+ std::string story_name_;
SessionStorage* const session_storage_; // Not owned.
StoryCommandExecutor* const executor_; // Not owned.
diff --git a/bin/sessionmgr/sessionmgr_impl.cc b/bin/sessionmgr/sessionmgr_impl.cc
index c64d75d..e22870b 100644
--- a/bin/sessionmgr/sessionmgr_impl.cc
+++ b/bin/sessionmgr/sessionmgr_impl.cc
@@ -277,7 +277,6 @@
// for syncing.
fuchsia::modular::AppConfig cloud_provider_config;
cloud_provider_config.url = kCloudProviderFirestoreAppUrl;
- cloud_provider_config.args = fidl::VectorPtr<fidl::StringPtr>::New(0);
cloud_provider_app_ =
std::make_unique<AppClient<fuchsia::modular::Lifecycle>>(
user_environment_->GetLauncher(), std::move(cloud_provider_config));
@@ -478,8 +477,8 @@
user_intelligence_provider_impl_->StartAgents(
std::move(maxwell_app_component_context),
- fxl::To<fidl::VectorPtr<fidl::StringPtr>>(options_.session_agents),
- fxl::To<fidl::VectorPtr<fidl::StringPtr>>(options_.startup_agents));
+ options_.session_agents,
+ options_.startup_agents);
// Setup for kModuleResolverUrl
{
@@ -590,7 +589,7 @@
// similar to Story/SessionStorage but for runtime management.
auto module_focuser =
[story_provider = std::move(story_provider_puppet_master)](
- fidl::StringPtr story_id, fidl::VectorPtr<fidl::StringPtr> mod_name) {
+ std::string story_id, std::vector<std::string> mod_name) {
fuchsia::modular::StoryControllerPtr story_controller;
story_provider->GetController(story_id, story_controller.NewRequest());
@@ -781,7 +780,7 @@
}
void SessionmgrImpl::GetDeviceName(
- std::function<void(::fidl::StringPtr)> callback) {
+ std::function<void(::std::string)> callback) {
callback(device_name_);
}
diff --git a/bin/sessionmgr/sessionmgr_impl.h b/bin/sessionmgr/sessionmgr_impl.h
index f1571ae..5f435a3 100644
--- a/bin/sessionmgr/sessionmgr_impl.h
+++ b/bin/sessionmgr/sessionmgr_impl.h
@@ -133,7 +133,7 @@
void GetComponentContext(
fidl::InterfaceRequest<fuchsia::modular::ComponentContext> request)
override;
- void GetDeviceName(std::function<void(::fidl::StringPtr)> callback) override;
+ void GetDeviceName(std::function<void(::std::string)> callback) override;
void GetFocusController(
fidl::InterfaceRequest<fuchsia::modular::FocusController> request)
override;
diff --git a/bin/sessionmgr/storage/constants_and_utils.cc b/bin/sessionmgr/storage/constants_and_utils.cc
index 9cebbd6..88e2793 100644
--- a/bin/sessionmgr/storage/constants_and_utils.cc
+++ b/bin/sessionmgr/storage/constants_and_utils.cc
@@ -48,15 +48,12 @@
}
std::string EncodeModulePath(
- const fidl::VectorPtr<fidl::StringPtr>& module_path) {
- if (!module_path)
- return "";
-
+ const std::vector<std::string>& module_path) {
std::vector<std::string> segments;
- segments.reserve(module_path->size());
- for (const auto& module_path_part : *module_path) {
+ segments.reserve(module_path.size());
+ for (const auto& module_path_part : module_path) {
segments.emplace_back(
- StringEscape(module_path_part.get(), kCharsToEscape, kEscaper));
+ StringEscape(module_path_part, kCharsToEscape, kEscaper));
}
return fxl::JoinStrings(segments, kSubSeparator);
}
@@ -95,10 +92,10 @@
return key;
}
-std::string MakeModuleKey(const fidl::VectorPtr<fidl::StringPtr>& module_path) {
- FXL_DCHECK(!module_path.is_null() && module_path->size() > 0)
+std::string MakeModuleKey(const std::vector<std::string>& module_path) {
+ FXL_DCHECK(module_path.size() > 0)
<< EncodeModulePath(module_path);
- FXL_DCHECK(module_path->at(0)->size() > 0) << EncodeModulePath(module_path);
+ FXL_DCHECK(module_path.at(0).size() > 0) << EncodeModulePath(module_path);
std::string key{kModuleKeyPrefix};
key.append(EncodeModulePath(module_path));
return key;
diff --git a/bin/sessionmgr/storage/constants_and_utils.h b/bin/sessionmgr/storage/constants_and_utils.h
index 4a69177..5bf85da 100644
--- a/bin/sessionmgr/storage/constants_and_utils.h
+++ b/bin/sessionmgr/storage/constants_and_utils.h
@@ -77,7 +77,7 @@
const std::string& task_id);
std::string MakeLinkKey(const fuchsia::modular::LinkPathPtr& link_path);
std::string MakeLinkKey(const fuchsia::modular::LinkPath& link_path);
-std::string MakeModuleKey(const fidl::VectorPtr<fidl::StringPtr>& module_path);
+std::string MakeModuleKey(const std::vector<std::string>& module_path);
// 3. The slash separator is escaped by a backslash inside the ID
// values. Backslashes inside the ID values are escaped by backslash too.
@@ -93,7 +93,7 @@
std::string EncodeLinkPath(const fuchsia::modular::LinkPath& link_path);
std::string EncodeModulePath(
- const fidl::VectorPtr<fidl::StringPtr>& module_path);
+ const std::vector<std::string>& module_path);
std::string EncodeModuleComponentNamespace(const std::string& story_id);
// More notes:
diff --git a/bin/sessionmgr/storage/constants_and_utils_unittest.cc b/bin/sessionmgr/storage/constants_and_utils_unittest.cc
index 22ab36e..ed149ee 100644
--- a/bin/sessionmgr/storage/constants_and_utils_unittest.cc
+++ b/bin/sessionmgr/storage/constants_and_utils_unittest.cc
@@ -15,19 +15,12 @@
namespace {
TEST(Storage, EncodeModulePath) {
- fidl::VectorPtr<fidl::StringPtr> fidl_array;
- for (auto s : {"foo", ":bar", "/baz"}) {
- fidl_array.push_back(s);
- }
+ std::vector<std::string> fidl_array = {"foo", ":bar", "/baz"};
EXPECT_EQ("foo:\\:bar:\\/baz", EncodeModulePath(fidl_array));
}
TEST(Storage, EncodeLinkPath) {
- fidl::VectorPtr<fidl::StringPtr> fidl_array;
- for (auto s : {"foo", ":bar"}) {
- fidl_array.push_back(s);
- }
-
+ std::vector<std::string> fidl_array = {"foo", ":bar"};
fuchsia::modular::LinkPath link_path;
link_path.link_name = "Fred";
link_path.module_path = std::move(fidl_array);
diff --git a/bin/sessionmgr/storage/session_storage.cc b/bin/sessionmgr/storage/session_storage.cc
index 7ae04a9..28c4db7 100644
--- a/bin/sessionmgr/storage/session_storage.cc
+++ b/bin/sessionmgr/storage/session_storage.cc
@@ -323,10 +323,10 @@
}
// Returns a Future vector of StoryData for all stories in this session.
-FuturePtr<fidl::VectorPtr<fuchsia::modular::internal::StoryData>>
+FuturePtr<std::vector<fuchsia::modular::internal::StoryData>>
SessionStorage::GetAllStoryData() {
auto ret =
- Future<fidl::VectorPtr<fuchsia::modular::internal::StoryData>>::Create(
+ Future<std::vector<fuchsia::modular::internal::StoryData>>::Create(
"SessionStorage.GetAllStoryData.ret");
operation_queue_.Add(
new ReadAllDataCall<fuchsia::modular::internal::StoryData>(
diff --git a/bin/sessionmgr/storage/session_storage.h b/bin/sessionmgr/storage/session_storage.h
index 74bfddb..5dc1323 100644
--- a/bin/sessionmgr/storage/session_storage.h
+++ b/bin/sessionmgr/storage/session_storage.h
@@ -111,7 +111,7 @@
//
// TODO(thatguy): If the return value grows large, an dispatcher stream would
// be a more appropriate return value.
- FuturePtr<fidl::VectorPtr<fuchsia::modular::internal::StoryData>>
+ FuturePtr<std::vector<fuchsia::modular::internal::StoryData>>
GetAllStoryData();
FuturePtr<> UpdateStoryOptions(fidl::StringPtr story_id,
diff --git a/bin/sessionmgr/storage/session_storage_unittest.cc b/bin/sessionmgr/storage/session_storage_unittest.cc
index dc1c3aa..55ec518 100644
--- a/bin/sessionmgr/storage/session_storage_unittest.cc
+++ b/bin/sessionmgr/storage/session_storage_unittest.cc
@@ -112,8 +112,8 @@
fidl::VectorPtr<fuchsia::modular::internal::StoryData> all_data;
auto future_all_data = storage->GetAllStoryData();
future_all_data->Then(
- [&](fidl::VectorPtr<fuchsia::modular::internal::StoryData> data) {
- all_data = std::move(data);
+ [&](std::vector<fuchsia::modular::internal::StoryData> data) {
+ all_data.reset(std::move(data));
});
RunLoopUntil([&] { return !!all_data; });
@@ -141,8 +141,8 @@
auto future_all_data = storage->GetAllStoryData();
fidl::VectorPtr<fuchsia::modular::internal::StoryData> all_data;
future_all_data->Then(
- [&](fidl::VectorPtr<fuchsia::modular::internal::StoryData> data) {
- all_data = std::move(data);
+ [&](std::vector<fuchsia::modular::internal::StoryData> data) {
+ all_data.reset(std::move(data));
});
RunLoopUntil([&] { return !!all_data; });
@@ -154,8 +154,8 @@
future_all_data = storage->GetAllStoryData();
all_data.reset();
future_all_data->Then(
- [&](fidl::VectorPtr<fuchsia::modular::internal::StoryData> data) {
- all_data = std::move(data);
+ [&](std::vector<fuchsia::modular::internal::StoryData> data) {
+ all_data.reset(std::move(data));
});
RunLoopUntil([&] { return !!all_data; });
EXPECT_EQ(0u, all_data->size());
@@ -196,8 +196,8 @@
auto future_all_data = storage->GetAllStoryData();
fidl::VectorPtr<fuchsia::modular::internal::StoryData> all_data;
future_all_data->Then(
- [&](fidl::VectorPtr<fuchsia::modular::internal::StoryData> data) {
- all_data = std::move(data);
+ [&](std::vector<fuchsia::modular::internal::StoryData> data) {
+ all_data.reset(std::move(data));
});
RunLoopUntil([&] { return !!all_data; });
@@ -211,8 +211,8 @@
future_all_data = storage->GetAllStoryData();
all_data.reset();
future_all_data->Then(
- [&](fidl::VectorPtr<fuchsia::modular::internal::StoryData> data) {
- all_data = std::move(data);
+ [&](std::vector<fuchsia::modular::internal::StoryData> data) {
+ all_data.reset(std::move(data));
});
RunLoopUntil([&] { return !!all_data; });
@@ -282,11 +282,11 @@
done = false;
snapshot->GetEntries(to_array("") /* key_start */, nullptr /* token */,
[&](fuchsia::ledger::Status status,
- fidl::VectorPtr<fuchsia::ledger::Entry> entries,
+ std::vector<fuchsia::ledger::Entry> entries,
fuchsia::ledger::TokenPtr next_token) {
ASSERT_EQ(fuchsia::ledger::Status::OK, status);
EXPECT_EQ(nullptr, next_token);
- EXPECT_TRUE(entries->empty());
+ EXPECT_TRUE(entries.empty());
done = true;
});
RunLoopUntil([&] { return done; });
diff --git a/bin/sessionmgr/storage/story_storage.cc b/bin/sessionmgr/storage/story_storage.cc
index 07581ad..070fb17 100644
--- a/bin/sessionmgr/storage/story_storage.cc
+++ b/bin/sessionmgr/storage/story_storage.cc
@@ -60,7 +60,7 @@
namespace {
struct UpdateModuleDataState {
- fidl::VectorPtr<fidl::StringPtr> module_path;
+ std::vector<std::string> module_path;
std::function<void(ModuleDataPtr*)> mutate_fn;
OperationQueue sub_operations;
};
@@ -68,10 +68,10 @@
} // namespace
FuturePtr<> StoryStorage::UpdateModuleData(
- const fidl::VectorPtr<fidl::StringPtr>& module_path,
+ const std::vector<std::string>& module_path,
std::function<void(ModuleDataPtr*)> mutate_fn) {
auto op_state = std::make_shared<UpdateModuleDataState>();
- op_state->module_path = fidl::Clone(module_path);
+ op_state->module_path = module_path;
op_state->mutate_fn = std::move(mutate_fn);
auto key = MakeModuleKey(module_path);
@@ -141,7 +141,7 @@
}
FuturePtr<ModuleDataPtr> StoryStorage::ReadModuleData(
- const fidl::VectorPtr<fidl::StringPtr>& module_path) {
+ const std::vector<std::string>& module_path) {
auto key = MakeModuleKey(module_path);
auto ret = Future<ModuleDataPtr>::Create("StoryStorage.ReadModuleData.ret");
operation_queue_.Add(
@@ -150,8 +150,8 @@
return ret;
}
-FuturePtr<fidl::VectorPtr<ModuleData>> StoryStorage::ReadAllModuleData() {
- auto ret = Future<fidl::VectorPtr<ModuleData>>::Create(
+FuturePtr<std::vector<ModuleData>> StoryStorage::ReadAllModuleData() {
+ auto ret = Future<std::vector<ModuleData>>::Create(
"StoryStorage.ReadAllModuleData.ret");
operation_queue_.Add(new ReadAllDataCall<ModuleData>(
page(), kModuleKeyPrefix, XdrModuleData, ret->Completer()));
diff --git a/bin/sessionmgr/storage/story_storage.h b/bin/sessionmgr/storage/story_storage.h
index 6df96d7..1ed370d 100644
--- a/bin/sessionmgr/storage/story_storage.h
+++ b/bin/sessionmgr/storage/story_storage.h
@@ -68,7 +68,7 @@
// Returns the current ModuleData for |module_path|. If not found, the
// returned value is null.
FuturePtr<ModuleDataPtr> ReadModuleData(
- const fidl::VectorPtr<fidl::StringPtr>& module_path);
+ const std::vector<std::string>& module_path);
// Writes |module_data| to storage. The returned future is completed
// once |module_data| has been written and a notification confirming the
@@ -87,11 +87,11 @@
// It is illegal to change ModuleDataPtr->module_path in |mutate_fn| or to
// reset to null an otherwise initialized ModuleDataPtr.
FuturePtr<> UpdateModuleData(
- const fidl::VectorPtr<fidl::StringPtr>& module_path,
+ const std::vector<std::string>& module_path,
std::function<void(ModuleDataPtr*)> mutate_fn);
// Returns all ModuleData entries for all mods.
- FuturePtr<fidl::VectorPtr<ModuleData>> ReadAllModuleData();
+ FuturePtr<std::vector<ModuleData>> ReadAllModuleData();
// =========================================================================
// Link data
diff --git a/bin/sessionmgr/storage/story_storage_unittest.cc b/bin/sessionmgr/storage/story_storage_unittest.cc
index 0cd1352..0e58dd9 100644
--- a/bin/sessionmgr/storage/story_storage_unittest.cc
+++ b/bin/sessionmgr/storage/story_storage_unittest.cc
@@ -37,7 +37,7 @@
auto storage = CreateStorage("page");
bool read_done{};
- fidl::VectorPtr<fidl::StringPtr> path;
+ std::vector<std::string> path;
path.push_back("a");
storage->ReadModuleData(path)->Then([&](ModuleDataPtr data) {
read_done = true;
@@ -52,9 +52,9 @@
bool read_done{};
fidl::VectorPtr<ModuleData> all_module_data;
- storage->ReadAllModuleData()->Then([&](fidl::VectorPtr<ModuleData> data) {
+ storage->ReadAllModuleData()->Then([&](std::vector<ModuleData> data) {
read_done = true;
- all_module_data = std::move(data);
+ all_module_data.reset(std::move(data));
});
RunLoopUntil([&] { return read_done; });
@@ -108,8 +108,8 @@
// Read the same data back with ReadAllModuleData().
fidl::VectorPtr<ModuleData> all_module_data;
- storage->ReadAllModuleData()->Then([&](fidl::VectorPtr<ModuleData> data) {
- all_module_data = std::move(data);
+ storage->ReadAllModuleData()->Then([&](std::vector<ModuleData> data) {
+ all_module_data.reset(std::move(data));
});
RunLoopUntil([&] { return !!all_module_data; });
EXPECT_EQ(2u, all_module_data->size());
@@ -134,7 +134,7 @@
notified_module_data = std::move(data);
});
- fidl::VectorPtr<fidl::StringPtr> path;
+ std::vector<std::string> path;
path.push_back("a");
// Case 1: Don't mutate anything.
@@ -162,7 +162,7 @@
EXPECT_FALSE(*ptr);
*ptr = ModuleData::New();
- (*ptr)->module_path = path.Clone();
+ (*ptr)->module_path = path;
(*ptr)->module_url = "foobar";
})
->Then([&] { update_done = true; });
diff --git a/bin/sessionmgr/storage/story_storage_xdr.cc b/bin/sessionmgr/storage/story_storage_xdr.cc
index 5b5526a..22fbde4 100644
--- a/bin/sessionmgr/storage/story_storage_xdr.cc
+++ b/bin/sessionmgr/storage/story_storage_xdr.cc
@@ -64,7 +64,7 @@
FXL_CHECK(fsl::VmoFromString(*value, &vmo));
data->set_json(std::move(vmo).ToTransport());
} else if (tag == kEntityType) {
- ::fidl::VectorPtr<::fidl::StringPtr> value;
+ ::std::vector<::std::string> value;
xdr->Field(kEntityType, &value);
data->set_entity_type(std::move(value));
} else if (tag == kLinkName) {
@@ -102,7 +102,7 @@
}
case fuchsia::modular::IntentParameterData::Tag::kEntityType: {
tag = kEntityType;
- fidl::VectorPtr<fidl::StringPtr> value = Clone(data->entity_type());
+ std::vector<std::string> value = data->entity_type();
xdr->Field(kEntityType, &value);
break;
}
diff --git a/bin/sessionmgr/story/model/story_model_owner.cc b/bin/sessionmgr/story/model/story_model_owner.cc
index 0481849..362bd1d 100644
--- a/bin/sessionmgr/story/model/story_model_owner.cc
+++ b/bin/sessionmgr/story/model/story_model_owner.cc
@@ -24,7 +24,7 @@
void InitializeModelDefaults(StoryModel* model) {
model->set_runtime_state(fuchsia::modular::StoryState::STOPPED);
model->set_visibility_state(fuchsia::modular::StoryVisibilityState::DEFAULT);
- model->set_modules(fidl::VectorPtr<ModuleModel>::New(0));
+ model->set_modules({});
}
} // namespace
@@ -97,7 +97,7 @@
weak_ptr_factory_(this),
executor_(executor) {
FXL_CHECK(model_storage_ != nullptr);
- model_.mutable_name()->reset(story_name);
+ model_.mutable_name()->assign(story_name);
InitializeModelDefaults(&model_);
model_storage_->SetObserveCallback(
[this](std::vector<StoryModelMutation> commands) {
diff --git a/bin/sessionmgr/story_runner/dev_story_shell.cc b/bin/sessionmgr/story_runner/dev_story_shell.cc
index 238461a..3d1aca5 100644
--- a/bin/sessionmgr/story_runner/dev_story_shell.cc
+++ b/bin/sessionmgr/story_runner/dev_story_shell.cc
@@ -64,25 +64,25 @@
}
// |fuchsia::modular::StoryShell|
- void FocusSurface(fidl::StringPtr /*surface_id*/) override {}
+ void FocusSurface(std::string /*surface_id*/) override {}
// |fuchsia::modular::StoryShell|
- void DefocusSurface(fidl::StringPtr /*surface_id*/,
+ void DefocusSurface(std::string /*surface_id*/,
DefocusSurfaceCallback callback) override {
callback();
}
// |fuchsia::modular::StoryShell|
void AddContainer(
- fidl::StringPtr /*container_name*/, fidl::StringPtr /*parent_id*/,
+ std::string /*container_name*/, fidl::StringPtr /*parent_id*/,
fuchsia::modular::SurfaceRelation /* relation */,
- fidl::VectorPtr<fuchsia::modular::ContainerLayout> /*layout*/,
- fidl::VectorPtr<
+ std::vector<fuchsia::modular::ContainerLayout> /*layout*/,
+ std::vector<
fuchsia::modular::ContainerRelationEntry> /* relationships */,
- fidl::VectorPtr<fuchsia::modular::ContainerView> /* views */) override {}
+ std::vector<fuchsia::modular::ContainerView> /* views */) override {}
// |fuchsia::modular::StoryShell|
- void RemoveSurface(fidl::StringPtr /*surface_id*/) override {}
+ void RemoveSurface(std::string /*surface_id*/) override {}
// |fuchsia::modular::StoryShell|
void ReconnectView(fuchsia::modular::ViewConnection view_connection) override {}
diff --git a/bin/sessionmgr/story_runner/link_impl.cc b/bin/sessionmgr/story_runner/link_impl.cc
index 6013625..55d04a1 100644
--- a/bin/sessionmgr/story_runner/link_impl.cc
+++ b/bin/sessionmgr/story_runner/link_impl.cc
@@ -24,7 +24,7 @@
namespace {
std::ostream& operator<<(std::ostream& o, const LinkPath& link_path) {
- for (const auto& part : *link_path.module_path) {
+ for (const auto& part : link_path.module_path) {
o << part << ":";
}
o << link_path.link_name;
@@ -34,19 +34,19 @@
// Applies a JSON mutation operation using |apply_fn|. Its parameters are
// references because we treat |apply_fn| as part of ApplyOp's body.
void ApplyOp(
- fidl::StringPtr* value_str, const fidl::VectorPtr<fidl::StringPtr>& path,
+ fidl::StringPtr* value_str, const std::vector<std::string>& path,
std::function<void(CrtJsonDoc& doc, CrtJsonPointer& pointer)> apply_fn) {
CrtJsonDoc value;
if (!value_str->is_null()) {
value.Parse(*value_str);
}
- auto pointer = CreatePointer(value, *path);
+ auto pointer = CreatePointer(value, path);
apply_fn(value, pointer);
*value_str = JsonValueToString(value);
}
bool ApplySetOp(fidl::StringPtr* value_str,
- const fidl::VectorPtr<fidl::StringPtr>& path,
+ const fidl::VectorPtr<std::string>& path,
const fidl::StringPtr& new_value_at_path_str) {
CrtJsonDoc new_value_at_path;
new_value_at_path.Parse(new_value_at_path_str);
@@ -62,7 +62,7 @@
}
void ApplyEraseOp(fidl::StringPtr* value_str,
- const fidl::VectorPtr<fidl::StringPtr>& path) {
+ const std::vector<std::string>& path) {
auto apply_fn = [](CrtJsonDoc& doc, CrtJsonPointer& p) { p.Erase(doc); };
ApplyOp(value_str, path, apply_fn);
}
@@ -92,7 +92,7 @@
LinkImpl::~LinkImpl() = default;
-void LinkImpl::Get(fidl::VectorPtr<fidl::StringPtr> path,
+void LinkImpl::Get(fidl::VectorPtr<std::string> path,
GetCallback callback) {
// TODO: Need error reporting. MI4-1082
story_storage_->GetLinkValue(link_path_)
@@ -133,14 +133,14 @@
});
}
-void LinkImpl::Set(fidl::VectorPtr<fidl::StringPtr> path,
+void LinkImpl::Set(fidl::VectorPtr<std::string> path,
fuchsia::mem::Buffer json) {
std::string json_string;
FXL_CHECK(fsl::StringFromVmo(json, &json_string));
Set(std::move(path), json_string);
}
-void LinkImpl::Set(fidl::VectorPtr<fidl::StringPtr> path,
+void LinkImpl::Set(fidl::VectorPtr<std::string> path,
const std::string& json) {
// TODO: Need error reporting. MI4-1082
story_storage_
@@ -159,7 +159,7 @@
});
}
-void LinkImpl::Erase(fidl::VectorPtr<fidl::StringPtr> path) {
+void LinkImpl::Erase(std::vector<std::string> path) {
// TODO: Need error reporting. MI4-1082
story_storage_
->UpdateLinkValue(
diff --git a/bin/sessionmgr/story_runner/link_impl.h b/bin/sessionmgr/story_runner/link_impl.h
index 62ed37c..8afbb87 100644
--- a/bin/sessionmgr/story_runner/link_impl.h
+++ b/bin/sessionmgr/story_runner/link_impl.h
@@ -63,11 +63,11 @@
~LinkImpl() override;
- void Set(fidl::VectorPtr<fidl::StringPtr> path,
+ void Set(fidl::VectorPtr<std::string> path,
fuchsia::mem::Buffer json) override;
- void Get(fidl::VectorPtr<fidl::StringPtr> path,
+ void Get(fidl::VectorPtr<std::string> path,
GetCallback callback) override;
- void Erase(fidl::VectorPtr<fidl::StringPtr> path) override;
+ void Erase(std::vector<std::string> path) override;
void GetEntity(GetEntityCallback callback) override;
void SetEntity(fidl::StringPtr entity_reference) override;
void Watch(fidl::InterfaceHandle<LinkWatcher> watcher) override;
@@ -82,7 +82,7 @@
void OnLinkValueChanged(const fidl::StringPtr& value, const void* context);
// Convenience method which interacts with the story storage.
- void Set(fidl::VectorPtr<fidl::StringPtr> path, const std::string& json);
+ void Set(fidl::VectorPtr<std::string> path, const std::string& json);
fxl::WeakPtr<LinkImpl> GetWeakPtr();
diff --git a/bin/sessionmgr/story_runner/link_impl_unittest.cc b/bin/sessionmgr/story_runner/link_impl_unittest.cc
index 9ccee65..e23a838 100644
--- a/bin/sessionmgr/story_runner/link_impl_unittest.cc
+++ b/bin/sessionmgr/story_runner/link_impl_unittest.cc
@@ -77,11 +77,11 @@
link->WatchAll(std::move(ptr));
}
- void SetLink(Link* link, fidl::VectorPtr<fidl::StringPtr> path,
+ void SetLink(Link* link, std::vector<std::string> path,
const std::string& value) {
fsl::SizedVmo vmo;
FXL_CHECK(fsl::VmoFromString(value, &vmo));
- link->Set(std::move(path), std::move(vmo).ToTransport());
+ link->Set(fidl::VectorPtr(std::move(path)), std::move(vmo).ToTransport());
}
fidl::BindingSet<Link, std::unique_ptr<LinkImpl>> links_;
@@ -103,7 +103,7 @@
EXPECT_TRUE(RunLoopWithTimeoutOrUntil([&] { return get_done; }));
get_done = false;
- fidl::VectorPtr<fidl::StringPtr> path;
+ fidl::VectorPtr<std::string> path;
path->push_back("one");
link->Get(std::move(path), [&](std::unique_ptr<fuchsia::mem::Buffer> value) {
std::string content_string;
@@ -154,7 +154,7 @@
++notified_count;
});
- SetLink(link.get(), nullptr, "42");
+ SetLink(link.get(), {}, "42");
bool synced{};
link->Sync([&synced] { synced = true; });
@@ -175,11 +175,11 @@
++notified_count;
});
- SetLink(link.get(), nullptr, R"({
+ SetLink(link.get(), {}, R"({
"one": 1,
"two": 2
})");
- fidl::VectorPtr<fidl::StringPtr> path;
+ fidl::VectorPtr<std::string> path;
path->push_back("two");
SetLink(link.get(), std::move(path), R"("two")");
@@ -210,7 +210,7 @@
auto storage = MakeStorage("page");
auto link = MakeLink(storage.get(), "mylink");
- SetLink(link.get(), nullptr, R"({
+ SetLink(link.get(), {}, R"({
"one": 1,
"two": 2invalidjson
})");
@@ -219,7 +219,7 @@
link->Sync([&synced] { synced = true; });
EXPECT_TRUE(RunLoopWithTimeoutOrUntil([&] { return synced; }));
- fidl::VectorPtr<fidl::StringPtr> path;
+ fidl::VectorPtr<std::string> path;
path->push_back("one");
bool get_done{};
link->Get(std::move(path), [&](std::unique_ptr<fuchsia::mem::Buffer> value) {
@@ -235,11 +235,11 @@
auto storage = MakeStorage("page");
auto link = MakeLink(storage.get(), "mylink");
- SetLink(link.get(), nullptr, R"({
+ SetLink(link.get(), {}, R"({
"one": 1,
"two": 2
})");
- fidl::VectorPtr<fidl::StringPtr> path;
+ std::vector<std::string> path;
path.push_back("two");
link->Erase(std::move(path));
@@ -286,8 +286,8 @@
// Set two values on |link2|. On |link1|, we are guaranteed to get a
// notification about the second value, eventually.
- SetLink(link2.get(), nullptr, "3");
- SetLink(link2.get(), nullptr, "4");
+ SetLink(link2.get(), {}, "3");
+ SetLink(link2.get(), {}, "4");
EXPECT_TRUE(RunLoopWithTimeoutOrUntil([&] { return last_value == "4"; }));
// There is always an initial notification of the current state, so we
// will have been notified either 2 or 3 times: 2 if we only got a
diff --git a/bin/sessionmgr/story_runner/module_context_impl.cc b/bin/sessionmgr/story_runner/module_context_impl.cc
index 7e93b54..c2fb931 100644
--- a/bin/sessionmgr/story_runner/module_context_impl.cc
+++ b/bin/sessionmgr/story_runner/module_context_impl.cc
@@ -44,7 +44,7 @@
[this](fidl::InterfaceRequest<fuchsia::modular::IntelligenceServices>
request) {
auto module_scope = fuchsia::modular::ModuleScope::New();
- module_scope->module_path = module_data_->module_path.Clone();
+ module_scope->module_path = module_data_->module_path;
module_scope->url = module_data_->module_url;
module_scope->story_id = story_controller_impl_->GetStoryId();
@@ -70,7 +70,7 @@
}
void ModuleContextImpl::EmbedModule(
- fidl::StringPtr name, fuchsia::modular::Intent intent,
+ std::string name, fuchsia::modular::Intent intent,
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
module_controller,
fidl::InterfaceRequest<fuchsia::ui::viewsv1token::ViewOwner> view_owner,
@@ -82,7 +82,7 @@
}
void ModuleContextImpl::AddModuleToStory(
- fidl::StringPtr name, fuchsia::modular::Intent intent,
+ std::string name, fuchsia::modular::Intent intent,
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
module_controller,
fuchsia::modular::SurfaceRelationPtr surface_relation,
@@ -94,13 +94,13 @@
}
void ModuleContextImpl::StartContainerInShell(
- fidl::StringPtr name, fuchsia::modular::SurfaceRelation parent_relation,
- fidl::VectorPtr<fuchsia::modular::ContainerLayout> layout,
- fidl::VectorPtr<fuchsia::modular::ContainerRelationEntry> relationships,
- fidl::VectorPtr<fuchsia::modular::ContainerNode> nodes) {
- fidl::VectorPtr<fuchsia::modular::ContainerNodePtr> node_ptrs;
- node_ptrs->reserve(nodes->size());
- for (auto& i : *nodes) {
+ std::string name, fuchsia::modular::SurfaceRelation parent_relation,
+ std::vector<fuchsia::modular::ContainerLayout> layout,
+ std::vector<fuchsia::modular::ContainerRelationEntry> relationships,
+ std::vector<fuchsia::modular::ContainerNode> nodes) {
+ std::vector<fuchsia::modular::ContainerNodePtr> node_ptrs;
+ node_ptrs.reserve(nodes.size());
+ for (auto& i : nodes) {
node_ptrs.push_back(fidl::MakeOptional(std::move(i)));
}
story_controller_impl_->StartContainerInShell(
@@ -143,7 +143,7 @@
}
void ModuleContextImpl::CreateEntity(
- fidl::StringPtr type, fuchsia::mem::Buffer data,
+ std::string type, fuchsia::mem::Buffer data,
fidl::InterfaceRequest<fuchsia::modular::Entity> entity_request,
CreateEntityCallback callback) {
story_controller_impl_->CreateEntity(
diff --git a/bin/sessionmgr/story_runner/module_context_impl.h b/bin/sessionmgr/story_runner/module_context_impl.h
index 42f6839..7150642 100644
--- a/bin/sessionmgr/story_runner/module_context_impl.h
+++ b/bin/sessionmgr/story_runner/module_context_impl.h
@@ -55,7 +55,7 @@
// |fuchsia::modular::ModuleContext|
void EmbedModule(
- fidl::StringPtr name, fuchsia::modular::Intent intent,
+ std::string name, fuchsia::modular::Intent intent,
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
module_controller,
fidl::InterfaceRequest<fuchsia::ui::viewsv1token::ViewOwner> view_owner,
@@ -63,7 +63,7 @@
// |fuchsia::modular::ModuleContext|
void AddModuleToStory(
- fidl::StringPtr name, fuchsia::modular::Intent intent,
+ std::string name, fuchsia::modular::Intent intent,
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
module_controller,
fuchsia::modular::SurfaceRelationPtr surface_relation,
@@ -71,10 +71,10 @@
// |fuchsia::modular::ModuleContext|
void StartContainerInShell(
- fidl::StringPtr name, fuchsia::modular::SurfaceRelation parent_relation,
- fidl::VectorPtr<fuchsia::modular::ContainerLayout> layout,
- fidl::VectorPtr<fuchsia::modular::ContainerRelationEntry> relationships,
- fidl::VectorPtr<fuchsia::modular::ContainerNode> nodes) override;
+ std::string name, fuchsia::modular::SurfaceRelation parent_relation,
+ std::vector<fuchsia::modular::ContainerLayout> layout,
+ std::vector<fuchsia::modular::ContainerRelationEntry> relationships,
+ std::vector<fuchsia::modular::ContainerNode> nodes) override;
// |fuchsia::modular::ModuleContext|
void GetComponentContext(
@@ -105,7 +105,7 @@
// |fuchsia::modular::ModuleContext|
void CreateEntity(
- fidl::StringPtr type, fuchsia::mem::Buffer data,
+ std::string type, fuchsia::mem::Buffer data,
fidl::InterfaceRequest<fuchsia::modular::Entity> entity_request,
CreateEntityCallback callback) override;
diff --git a/bin/sessionmgr/story_runner/story_controller_impl.cc b/bin/sessionmgr/story_runner/story_controller_impl.cc
index de21e60..5e76939 100644
--- a/bin/sessionmgr/story_runner/story_controller_impl.cc
+++ b/bin/sessionmgr/story_runner/story_controller_impl.cc
@@ -63,7 +63,7 @@
if (left.module_path == right.module_path) {
return left.link_name < right.link_name;
}
- return *left.module_path < *right.module_path;
+ return left.module_path < right.module_path;
}
};
} // namespace std
@@ -77,33 +77,32 @@
constexpr char kSurfaceIDSeparator[] = ":";
fidl::StringPtr ModulePathToSurfaceID(
- const fidl::VectorPtr<fidl::StringPtr>& module_path) {
+ const std::vector<std::string>& module_path) {
std::vector<std::string> path;
// Sanitize all the |module_name|s that make up this |module_path|.
- for (const auto& module_name : module_path.get()) {
- path.push_back(StringEscape(module_name.get(), kSurfaceIDSeparator));
+ for (const auto& module_name : module_path) {
+ path.push_back(StringEscape(module_name, kSurfaceIDSeparator));
}
return fxl::JoinStrings(path, kSurfaceIDSeparator);
}
-fidl::VectorPtr<fidl::StringPtr> ModulePathFromSurfaceID(
- const fidl::StringPtr& surface_id) {
+std::vector<std::string> ModulePathFromSurfaceID(
+ const std::string& surface_id) {
std::vector<std::string> path;
- for (const auto& parts : SplitEscapedString(fxl::StringView(surface_id.get()),
+ for (const auto& parts : SplitEscapedString(fxl::StringView(surface_id),
kSurfaceIDSeparator[0])) {
path.push_back(parts.ToString());
}
- return fxl::To<fidl::VectorPtr<fidl::StringPtr>>(path);
+ return path;
}
-fidl::VectorPtr<fidl::StringPtr> ParentModulePath(
- const fidl::VectorPtr<fidl::StringPtr>& module_path) {
- fidl::VectorPtr<fidl::StringPtr> ret =
- fidl::VectorPtr<fidl::StringPtr>::New(0);
+std::vector<std::string> ParentModulePath(
+ const std::vector<std::string>& module_path) {
+ std::vector<std::string> ret;
- if (module_path->size() > 0) {
- for (size_t i = 0; i < module_path->size() - 1; i++) {
- ret.push_back(module_path->at(i));
+ if (module_path.size() > 0) {
+ for (size_t i = 0; i < module_path.size() - 1; i++) {
+ ret.push_back(module_path.at(i));
}
}
return ret;
@@ -142,7 +141,6 @@
module_controller_request_(std::move(module_controller_request)),
view_owner_request_(std::move(view_owner_request)),
start_time_(zx_clock_get(ZX_CLOCK_UTC)) {
- FXL_DCHECK(!module_data_.module_path.is_null());
}
private:
@@ -416,7 +414,7 @@
// We only add a module to story shell if its either a root module or its
// anchor is already known to story shell.
- if (module_data_.module_path->size() == 1) {
+ if (module_data_.module_path.size() == 1) {
ConnectView(flow, "");
return;
}
@@ -441,7 +439,7 @@
module_data_.surface_relation->Clone(surface_relation_clone.get());
story_controller_impl_->pending_views_.emplace(
ModulePathToSurfaceID(module_data_.module_path),
- PendingView{module_data_.module_path.Clone(), std::move(manifest_clone),
+ PendingView{module_data_.module_path, std::move(manifest_clone),
std::move(surface_relation_clone),
module_data_.module_source, std::move(view_owner_)});
}
@@ -621,11 +619,11 @@
class StoryControllerImpl::StopModuleCall : public Operation<> {
public:
StopModuleCall(StoryStorage* const story_storage,
- const fidl::VectorPtr<fidl::StringPtr>& module_path,
+ const std::vector<std::string>& module_path,
const std::function<void()>& done)
: Operation("StoryControllerImpl::StopModuleCall", done),
story_storage_(story_storage),
- module_path_(module_path.Clone()) {}
+ module_path_(module_path) {}
private:
void Run() override {
@@ -643,7 +641,7 @@
}
StoryStorage* const story_storage_; // not owned
- const fidl::VectorPtr<fidl::StringPtr> module_path_;
+ const std::vector<std::string> module_path_;
FXL_DISALLOW_COPY_AND_ASSIGN(StopModuleCall);
};
@@ -652,11 +650,11 @@
public:
StopModuleAndStoryIfEmptyCall(
StoryControllerImpl* const story_controller_impl,
- const fidl::VectorPtr<fidl::StringPtr>& module_path,
+ const std::vector<std::string>& module_path,
const std::function<void()>& done)
: Operation("StoryControllerImpl::StopModuleAndStoryIfEmptyCall", done),
story_controller_impl_(story_controller_impl),
- module_path_(module_path.Clone()) {}
+ module_path_(module_path) {}
private:
void Run() override {
@@ -677,7 +675,7 @@
}
StoryControllerImpl* const story_controller_impl_; // not owned
- const fidl::VectorPtr<fidl::StringPtr> module_path_;
+ const std::vector<std::string> module_path_;
OperationQueue operation_queue_;
@@ -741,7 +739,7 @@
class StoryControllerImpl::FocusCall : public Operation<> {
public:
FocusCall(StoryControllerImpl* const story_controller_impl,
- fidl::VectorPtr<fidl::StringPtr> module_path)
+ std::vector<std::string> module_path)
: Operation("StoryControllerImpl::FocusCall", [] {}),
story_controller_impl_(story_controller_impl),
module_path_(std::move(module_path)) {}
@@ -760,7 +758,7 @@
OperationQueue operation_queue_;
StoryControllerImpl* const story_controller_impl_; // not owned
- const fidl::VectorPtr<fidl::StringPtr> module_path_;
+ const std::vector<std::string> module_path_;
FXL_DISALLOW_COPY_AND_ASSIGN(FocusCall);
};
@@ -768,7 +766,7 @@
class StoryControllerImpl::DefocusCall : public Operation<> {
public:
DefocusCall(StoryControllerImpl* const story_controller_impl,
- fidl::VectorPtr<fidl::StringPtr> module_path)
+ std::vector<std::string> module_path)
: Operation("StoryControllerImpl::DefocusCall", [] {}),
story_controller_impl_(story_controller_impl),
module_path_(std::move(module_path)) {}
@@ -789,7 +787,7 @@
OperationQueue operation_queue_;
StoryControllerImpl* const story_controller_impl_; // not owned
- const fidl::VectorPtr<fidl::StringPtr> module_path_;
+ const std::vector<std::string> module_path_;
FXL_DISALLOW_COPY_AND_ASSIGN(DefocusCall);
};
@@ -801,7 +799,7 @@
: public Operation<fuchsia::modular::StartModuleStatus> {
public:
AddIntentCall(StoryControllerImpl* const story_controller_impl,
- fidl::VectorPtr<fidl::StringPtr> requesting_module_path,
+ std::vector<std::string> requesting_module_path,
const std::string& module_name,
fuchsia::modular::IntentPtr intent,
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
@@ -829,7 +827,7 @@
story_controller_impl_->story_provider_impl_->module_resolver(),
story_controller_impl_->story_provider_impl_->entity_resolver(),
story_controller_impl_->story_provider_impl_->module_facet_reader(),
- fidl::VectorPtr<fidl::StringPtr>({module_name_}), std::move(*intent_),
+ std::vector<std::string>({module_name_}), std::move(*intent_),
std::move(surface_relation_), std::move(requesting_module_path_),
module_source_,
[this, flow](fuchsia::modular::ExecuteResult result,
@@ -885,7 +883,7 @@
// Arguments passed in from the constructor. Some are used to initialize
// module_data_ in AddModuleFromResult().
- fidl::VectorPtr<fidl::StringPtr> requesting_module_path_;
+ std::vector<std::string> requesting_module_path_;
const std::string module_name_;
fuchsia::modular::IntentPtr intent_;
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
@@ -908,12 +906,12 @@
public:
StartContainerInShellCall(
StoryControllerImpl* const story_controller_impl,
- fidl::VectorPtr<fidl::StringPtr> parent_module_path,
- fidl::StringPtr container_name,
+ std::vector<std::string> parent_module_path,
+ std::string container_name,
fuchsia::modular::SurfaceRelationPtr parent_relation,
- fidl::VectorPtr<fuchsia::modular::ContainerLayout> layout,
- fidl::VectorPtr<fuchsia::modular::ContainerRelationEntry> relationships,
- fidl::VectorPtr<fuchsia::modular::ContainerNodePtr> nodes)
+ std::vector<fuchsia::modular::ContainerLayout> layout,
+ std::vector<fuchsia::modular::ContainerRelationEntry> relationships,
+ std::vector<fuchsia::modular::ContainerNodePtr> nodes)
: Operation("StoryControllerImpl::StartContainerInShellCall", [] {}),
story_controller_impl_(story_controller_impl),
parent_module_path_(std::move(parent_module_path)),
@@ -922,7 +920,7 @@
layout_(std::move(layout)),
relationships_(std::move(relationships)),
nodes_(std::move(nodes)) {
- for (auto& relationship : *relationships_) {
+ for (auto& relationship : relationships_) {
relation_map_[relationship.node_name] = CloneOptional(relationship);
}
}
@@ -932,26 +930,26 @@
FlowToken flow{this};
// parent + container used as module path of requesting module for
// containers
- fidl::VectorPtr<fidl::StringPtr> module_path = parent_module_path_.Clone();
+ std::vector<std::string> module_path = parent_module_path_;
// module_path.push_back(container_name_);
// Adding non-module 'container_name_' to the module path results in
// Ledger Client issuing a ReadData() call and failing with a fatal error
// when module_data cannot be found
// TODO(djmurphy): follow up, probably make containers modules
std::vector<FuturePtr<fuchsia::modular::StartModuleStatus>> did_add_intents;
- did_add_intents.reserve(nodes_->size());
+ did_add_intents.reserve(nodes_.size());
- for (size_t i = 0; i < nodes_->size(); ++i) {
+ for (size_t i = 0; i < nodes_.size(); ++i) {
auto did_add_intent = Future<fuchsia::modular::StartModuleStatus>::Create(
"StoryControllerImpl.StartContainerInShellCall.Run.did_add_intent");
auto intent = fuchsia::modular::Intent::New();
- nodes_->at(i)->intent.Clone(intent.get());
+ nodes_.at(i)->intent.Clone(intent.get());
operation_queue_.Add(new AddIntentCall(
- story_controller_impl_, parent_module_path_.Clone(),
- nodes_->at(i)->node_name, std::move(intent),
+ story_controller_impl_, parent_module_path_,
+ nodes_.at(i)->node_name, std::move(intent),
nullptr /* module_controller_request */,
fidl::MakeOptional(
- relation_map_[nodes_->at(i)->node_name]->relationship),
+ relation_map_[nodes_.at(i)->node_name]->relationship),
nullptr /* view_owner_request */,
fuchsia::modular::ModuleSource::INTERNAL,
did_add_intent->Completer()));
@@ -965,13 +963,12 @@
if (!story_controller_impl_->story_shell_) {
return;
}
- auto views = fidl::VectorPtr<fuchsia::modular::ContainerView>::New(
- nodes_->size());
- for (size_t i = 0; i < nodes_->size(); i++) {
+ std::vector<fuchsia::modular::ContainerView> views(nodes_.size());
+ for (size_t i = 0; i < nodes_.size(); i++) {
fuchsia::modular::ContainerView view;
- view.node_name = nodes_->at(i)->node_name;
- view.owner = std::move(node_views_[nodes_->at(i)->node_name]);
- views->at(i) = std::move(view);
+ view.node_name = nodes_.at(i)->node_name;
+ view.owner = std::move(node_views_[nodes_.at(i)->node_name]);
+ views.at(i) = std::move(view);
}
story_controller_impl_->story_shell_->AddContainer(
container_name_, ModulePathToSurfaceID(parent_module_path_),
@@ -982,18 +979,18 @@
StoryControllerImpl* const story_controller_impl_; // not owned
OperationQueue operation_queue_;
- const fidl::VectorPtr<fidl::StringPtr> parent_module_path_;
- const fidl::StringPtr container_name_;
+ const std::vector<std::string> parent_module_path_;
+ const std::string container_name_;
fuchsia::modular::SurfaceRelationPtr parent_relation_;
- fidl::VectorPtr<fuchsia::modular::ContainerLayout> layout_;
- fidl::VectorPtr<fuchsia::modular::ContainerRelationEntry> relationships_;
- const fidl::VectorPtr<fuchsia::modular::ContainerNodePtr> nodes_;
+ std::vector<fuchsia::modular::ContainerLayout> layout_;
+ std::vector<fuchsia::modular::ContainerRelationEntry> relationships_;
+ const std::vector<fuchsia::modular::ContainerNodePtr> nodes_;
std::map<std::string, fuchsia::modular::ContainerRelationEntryPtr>
relation_map_;
// map of node_name to view_owners
- std::map<fidl::StringPtr, fuchsia::ui::viewsv1token::ViewOwnerPtr>
+ std::map<std::string, fuchsia::ui::viewsv1token::ViewOwnerPtr>
node_views_;
FXL_DISALLOW_COPY_AND_ASSIGN(StartContainerInShellCall);
@@ -1024,10 +1021,10 @@
// Start all modules that were not themselves explicitly started by another
// module.
storage_->ReadAllModuleData()->Then(
- [this, flow](fidl::VectorPtr<fuchsia::modular::ModuleData> data) {
+ [this, flow](std::vector<fuchsia::modular::ModuleData> data) {
story_controller_impl_->InitStoryEnvironment();
- for (auto& module_data : *data) {
+ for (auto& module_data : data) {
if (module_data.module_deleted) {
continue;
}
@@ -1236,17 +1233,17 @@
}
void StoryControllerImpl::FocusModule(
- const fidl::VectorPtr<fidl::StringPtr>& module_path) {
- operation_queue_.Add(new FocusCall(this, module_path.Clone()));
+ const std::vector<std::string>& module_path) {
+ operation_queue_.Add(new FocusCall(this, module_path));
}
void StoryControllerImpl::DefocusModule(
- const fidl::VectorPtr<fidl::StringPtr>& module_path) {
- operation_queue_.Add(new DefocusCall(this, module_path.Clone()));
+ const std::vector<std::string>& module_path) {
+ operation_queue_.Add(new DefocusCall(this, module_path));
}
void StoryControllerImpl::StopModule(
- const fidl::VectorPtr<fidl::StringPtr>& module_path,
+ const std::vector<std::string>& module_path,
const std::function<void()>& done) {
operation_queue_.Add(new StopModuleCall(story_storage_, module_path, done));
}
@@ -1298,7 +1295,7 @@
}
fuchsia::modular::LinkPathPtr StoryControllerImpl::GetLinkPathForParameterName(
- const fidl::VectorPtr<fidl::StringPtr>& module_path, fidl::StringPtr name) {
+ const std::vector<std::string>& module_path, std::string name) {
auto mod_info = FindRunningModInfo(module_path);
// NOTE: |mod_info| will only be valid if the module at |module_path| is
// running. Strictly speaking, this is unsafe. The source of truth is the
@@ -1309,19 +1306,19 @@
const auto& param_map = mod_info->module_data->parameter_map;
auto it = std::find_if(
- param_map.entries->begin(), param_map.entries->end(),
+ param_map.entries.begin(), param_map.entries.end(),
[&name](const fuchsia::modular::ModuleParameterMapEntry& data) {
return data.name == name;
});
fuchsia::modular::LinkPathPtr link_path = nullptr;
- if (it != param_map.entries->end()) {
+ if (it != param_map.entries.end()) {
link_path = CloneOptional(it->link_path);
}
if (!link_path) {
link_path = fuchsia::modular::LinkPath::New();
- link_path->module_path = module_path.Clone();
+ link_path->module_path = module_path;
link_path->link_name = name;
}
@@ -1329,8 +1326,8 @@
}
void StoryControllerImpl::EmbedModule(
- const fidl::VectorPtr<fidl::StringPtr>& parent_module_path,
- fidl::StringPtr module_name, fuchsia::modular::IntentPtr intent,
+ const std::vector<std::string>& parent_module_path,
+ std::string module_name, fuchsia::modular::IntentPtr intent,
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
module_controller_request,
fidl::InterfaceRequest<fuchsia::ui::viewsv1token::ViewOwner>
@@ -1338,35 +1335,35 @@
fuchsia::modular::ModuleSource module_source,
std::function<void(fuchsia::modular::StartModuleStatus)> callback) {
operation_queue_.Add(new AddIntentCall(
- this, parent_module_path.Clone(), module_name, std::move(intent),
+ this, parent_module_path, module_name, std::move(intent),
std::move(module_controller_request), nullptr /* surface_relation */,
std::move(view_owner_request), std::move(module_source),
std::move(callback)));
}
void StoryControllerImpl::StartModule(
- const fidl::VectorPtr<fidl::StringPtr>& parent_module_path,
- fidl::StringPtr module_name, fuchsia::modular::IntentPtr intent,
+ const std::vector<std::string>& parent_module_path,
+ std::string module_name, fuchsia::modular::IntentPtr intent,
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
module_controller_request,
fuchsia::modular::SurfaceRelationPtr surface_relation,
fuchsia::modular::ModuleSource module_source,
std::function<void(fuchsia::modular::StartModuleStatus)> callback) {
operation_queue_.Add(new AddIntentCall(
- this, parent_module_path.Clone(), module_name, std::move(intent),
+ this, parent_module_path, module_name, std::move(intent),
std::move(module_controller_request), std::move(surface_relation),
nullptr /* view_owner_request */, std::move(module_source),
std::move(callback)));
}
void StoryControllerImpl::StartContainerInShell(
- const fidl::VectorPtr<fidl::StringPtr>& parent_module_path,
- fidl::StringPtr name, fuchsia::modular::SurfaceRelationPtr parent_relation,
- fidl::VectorPtr<fuchsia::modular::ContainerLayout> layout,
- fidl::VectorPtr<fuchsia::modular::ContainerRelationEntry> relationships,
- fidl::VectorPtr<fuchsia::modular::ContainerNodePtr> nodes) {
+ const std::vector<std::string>& parent_module_path,
+ std::string name, fuchsia::modular::SurfaceRelationPtr parent_relation,
+ std::vector<fuchsia::modular::ContainerLayout> layout,
+ std::vector<fuchsia::modular::ContainerRelationEntry> relationships,
+ std::vector<fuchsia::modular::ContainerNodePtr> nodes) {
operation_queue_.Add(new StartContainerInShellCall(
- this, parent_module_path.Clone(), name, std::move(parent_relation),
+ this, parent_module_path, name, std::move(parent_relation),
std::move(layout), std::move(relationships), std::move(nodes)));
}
@@ -1491,10 +1488,11 @@
// collection during some Operation.
operation_queue_.Add(
new SyncCall(fxl::MakeCopyable([this, callback]() mutable {
- fidl::VectorPtr<fuchsia::modular::ModuleData> result;
+ std::vector<fuchsia::modular::ModuleData> result;
+
result.resize(running_mod_infos_.size());
for (size_t i = 0; i < running_mod_infos_.size(); i++) {
- running_mod_infos_[i].module_data->Clone(&result->at(i));
+ running_mod_infos_[i].module_data->Clone(&result.at(i));
}
callback(std::move(result));
})));
@@ -1509,7 +1507,7 @@
}
void StoryControllerImpl::GetModuleController(
- fidl::VectorPtr<fidl::StringPtr> module_path,
+ std::vector<std::string> module_path,
fidl::InterfaceRequest<fuchsia::modular::ModuleController> request) {
operation_queue_.Add(new SyncCall(
fxl::MakeCopyable([this, module_path = std::move(module_path),
@@ -1589,7 +1587,7 @@
}
bool StoryControllerImpl::IsExternalModule(
- const fidl::VectorPtr<fidl::StringPtr>& module_path) {
+ const std::vector<std::string>& module_path) {
auto* const i = FindRunningModInfo(module_path);
if (!i) {
return false;
@@ -1600,7 +1598,7 @@
}
StoryControllerImpl::RunningModInfo* StoryControllerImpl::FindRunningModInfo(
- const fidl::VectorPtr<fidl::StringPtr>& module_path) {
+ const std::vector<std::string>& module_path) {
for (auto& c : running_mod_infos_) {
if (c.module_data->module_path == module_path) {
return &c;
@@ -1630,7 +1628,7 @@
}
void StoryControllerImpl::RemoveModuleFromStory(
- const fidl::VectorPtr<fidl::StringPtr>& module_path) {
+ const std::vector<std::string>& module_path) {
operation_queue_.Add(
new StopModuleAndStoryIfEmptyCall(this, module_path, [] {}));
}
@@ -1681,7 +1679,7 @@
}
void StoryControllerImpl::CreateEntity(
- fidl::StringPtr type, fuchsia::mem::Buffer data,
+ std::string type, fuchsia::mem::Buffer data,
fidl::InterfaceRequest<fuchsia::modular::Entity> entity_request,
std::function<void(std::string /* entity_reference */)> callback) {
story_provider_impl_->CreateEntity(story_id_, type, std::move(data),
diff --git a/bin/sessionmgr/story_runner/story_controller_impl.h b/bin/sessionmgr/story_runner/story_controller_impl.h
index 6684813..a9b6d23dac 100644
--- a/bin/sessionmgr/story_runner/story_controller_impl.h
+++ b/bin/sessionmgr/story_runner/story_controller_impl.h
@@ -79,13 +79,13 @@
void Sync(const std::function<void()>& done);
// Called by ModuleControllerImpl and ModuleContextImpl.
- void FocusModule(const fidl::VectorPtr<fidl::StringPtr>& module_path);
+ void FocusModule(const std::vector<std::string>& module_path);
// Called by ModuleControllerImpl.
- void DefocusModule(const fidl::VectorPtr<fidl::StringPtr>& module_path);
+ void DefocusModule(const std::vector<std::string>& module_path);
// Called by ModuleControllerImpl.
- void StopModule(const fidl::VectorPtr<fidl::StringPtr>& module_path,
+ void StopModule(const std::vector<std::string>& module_path,
const std::function<void()>& done);
// Called by ModuleControllerImpl.
@@ -106,13 +106,13 @@
// Called by ModuleContextImpl.
fuchsia::modular::LinkPathPtr GetLinkPathForParameterName(
- const fidl::VectorPtr<fidl::StringPtr>& module_path,
- fidl::StringPtr name);
+ const std::vector<std::string>& module_path,
+ std::string name);
// Called by ModuleContextImpl.
void EmbedModule(
- const fidl::VectorPtr<fidl::StringPtr>& parent_module_path,
- fidl::StringPtr module_name, fuchsia::modular::IntentPtr intent,
+ const std::vector<std::string>& parent_module_path,
+ std::string module_name, fuchsia::modular::IntentPtr intent,
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
module_controller_request,
fidl::InterfaceRequest<fuchsia::ui::viewsv1token::ViewOwner>
@@ -122,8 +122,8 @@
// Called by ModuleContextImpl.
void StartModule(
- const fidl::VectorPtr<fidl::StringPtr>& parent_module_path,
- fidl::StringPtr module_name, fuchsia::modular::IntentPtr intent,
+ const std::vector<std::string>& parent_module_path,
+ std::string module_name, fuchsia::modular::IntentPtr intent,
fidl::InterfaceRequest<fuchsia::modular::ModuleController>
module_controller_request,
fuchsia::modular::SurfaceRelationPtr surface_relation,
@@ -132,17 +132,17 @@
// Called by ModuleContextImpl.
void StartContainerInShell(
- const fidl::VectorPtr<fidl::StringPtr>& parent_module_path,
- fidl::StringPtr name,
+ const std::vector<std::string>& parent_module_path,
+ std::string name,
fuchsia::modular::SurfaceRelationPtr parent_relation,
- fidl::VectorPtr<fuchsia::modular::ContainerLayout> layout,
- fidl::VectorPtr<fuchsia::modular::ContainerRelationEntry> relationships,
- fidl::VectorPtr<fuchsia::modular::ContainerNodePtr> nodes);
+ std::vector<fuchsia::modular::ContainerLayout> layout,
+ std::vector<fuchsia::modular::ContainerRelationEntry> relationships,
+ std::vector<fuchsia::modular::ContainerNodePtr> nodes);
// Stops the module at |module_path| in response to a call to
// |ModuleContext.RemoveSelfFromStory|.
void RemoveModuleFromStory(
- const fidl::VectorPtr<fidl::StringPtr>& module_path);
+ const std::vector<std::string>& module_path);
// Called by ModuleContextImpl.
void StartOngoingActivity(
@@ -151,7 +151,7 @@
// Called by ModuleContextImpl.
void CreateEntity(
- fidl::StringPtr type, fuchsia::mem::Buffer data,
+ std::string type, fuchsia::mem::Buffer data,
fidl::InterfaceRequest<fuchsia::modular::Entity> entity_request,
std::function<void(std::string /* entity_reference */)> callback);
@@ -175,7 +175,7 @@
void GetActiveModules(GetActiveModulesCallback callback) override;
void GetModules(GetModulesCallback callback) override;
void GetModuleController(
- fidl::VectorPtr<fidl::StringPtr> module_path,
+ std::vector<std::string> module_path,
fidl::InterfaceRequest<fuchsia::modular::ModuleController> request)
override;
void GetActiveLinks(
@@ -202,7 +202,7 @@
void ProcessPendingViews();
std::set<fuchsia::modular::LinkPath> GetActiveLinksInternal();
- bool IsExternalModule(const fidl::VectorPtr<fidl::StringPtr>& module_path);
+ bool IsExternalModule(const std::vector<std::string>& module_path);
// Handles SessionShell OnModuleFocused event that indicates whether or not a
// surface was focused.
@@ -259,13 +259,13 @@
// serialized module path) until its parent is connected to story shell. Story
// shell cannot display views whose parents are not yet displayed.
struct PendingView {
- fidl::VectorPtr<fidl::StringPtr> module_path;
+ std::vector<std::string> module_path;
fuchsia::modular::ModuleManifestPtr module_manifest;
fuchsia::modular::SurfaceRelationPtr surface_relation;
fuchsia::modular::ModuleSource module_source;
fuchsia::ui::viewsv1token::ViewOwnerPtr view_owner;
};
- std::map<fidl::StringPtr, PendingView> pending_views_;
+ std::map<std::string, PendingView> pending_views_;
// The first ingredient of a story: Modules. For each *running* Module in the
// Story, there is one RunningModInfo.
@@ -295,7 +295,7 @@
// return nullptr if the module at the path is not running, regardless of
// whether a module at that path is known to the story.
RunningModInfo* FindRunningModInfo(
- const fidl::VectorPtr<fidl::StringPtr>& module_path);
+ const std::vector<std::string>& module_path);
// Finds the active RunningModInfo for the story shell anchor of a module
// with the given |running_mod_info|. The anchor is the closest ancestor
diff --git a/bin/sessionmgr/story_runner/story_entity_provider.cc b/bin/sessionmgr/story_runner/story_entity_provider.cc
index aab5e73..18b5d96 100644
--- a/bin/sessionmgr/story_runner/story_entity_provider.cc
+++ b/bin/sessionmgr/story_runner/story_entity_provider.cc
@@ -35,18 +35,18 @@
provider_bindings_.AddBinding(this, std::move(provider_request));
}
-void StoryEntityProvider::GetTypes(fidl::StringPtr cookie,
+void StoryEntityProvider::GetTypes(std::string cookie,
GetTypesCallback callback) {
story_storage_->GetEntityType(cookie)->Then(
[callback = std::move(callback)](StoryStorage::Status status,
std::string type) {
- fidl::VectorPtr<fidl::StringPtr> types;
+ std::vector<std::string> types;
types.push_back(type);
callback(std::move(types));
});
}
-void StoryEntityProvider::GetData(fidl::StringPtr cookie, fidl::StringPtr type,
+void StoryEntityProvider::GetData(std::string cookie, std::string type,
GetDataCallback callback) {
story_storage_->GetEntityData(cookie, type)
->Then([callback = std::move(callback)](StoryStorage::Status status,
@@ -55,8 +55,8 @@
});
}
-void StoryEntityProvider::WriteData(fidl::StringPtr cookie,
- fidl::StringPtr type,
+void StoryEntityProvider::WriteData(std::string cookie,
+ std::string type,
fuchsia::mem::Buffer data,
WriteDataCallback callback) {
story_storage_->SetEntityData(cookie, type, std::move(data))
@@ -79,7 +79,7 @@
}
void StoryEntityProvider::Watch(
- fidl::StringPtr cookie, fidl::StringPtr type,
+ std::string cookie, std::string type,
fidl::InterfaceHandle<fuchsia::modular::EntityWatcher> watcher) {
fuchsia::modular::EntityWatcherPtr entity_watcher = watcher.Bind();
story_storage_->WatchEntity(cookie, type, std::move(entity_watcher));
diff --git a/bin/sessionmgr/story_runner/story_entity_provider.h b/bin/sessionmgr/story_runner/story_entity_provider.h
index 385f1dd..b733141 100644
--- a/bin/sessionmgr/story_runner/story_entity_provider.h
+++ b/bin/sessionmgr/story_runner/story_entity_provider.h
@@ -35,20 +35,20 @@
private:
// |fuchsia::modular::EntityProvider|
- void GetTypes(fidl::StringPtr cookie, GetTypesCallback callback) override;
+ void GetTypes(std::string cookie, GetTypesCallback callback) override;
// |fuchsia::modular::EntityProvider|
- void GetData(fidl::StringPtr cookie, fidl::StringPtr type,
+ void GetData(std::string cookie, std::string type,
GetDataCallback callback) override;
// |fuchsia::modular::EntityProvider|
- void WriteData(fidl::StringPtr cookie, fidl::StringPtr type,
+ void WriteData(std::string cookie, std::string type,
fuchsia::mem::Buffer data,
WriteDataCallback callback) override;
// |fuchsia::modular::EntityProvider|
void Watch(
- fidl::StringPtr cookie, fidl::StringPtr type,
+ std::string cookie, std::string type,
fidl::InterfaceHandle<fuchsia::modular::EntityWatcher> watcher) override;
const std::string story_id_;
diff --git a/bin/sessionmgr/story_runner/story_provider_impl.cc b/bin/sessionmgr/story_runner/story_provider_impl.cc
index 34f09d1..a46b29f 100644
--- a/bin/sessionmgr/story_runner/story_provider_impl.cc
+++ b/bin/sessionmgr/story_runner/story_provider_impl.cc
@@ -475,7 +475,7 @@
}
fuchsia::modular::StoryInfoPtr StoryProviderImpl::GetCachedStoryInfo(
- fidl::StringPtr story_id) {
+ std::string story_id) {
auto it = story_runtime_containers_.find(story_id);
if (it == story_runtime_containers_.end()) {
return nullptr;
@@ -485,7 +485,7 @@
}
// |fuchsia::modular::StoryProvider|
-void StoryProviderImpl::GetStoryInfo(fidl::StringPtr story_id,
+void StoryProviderImpl::GetStoryInfo(std::string story_id,
GetStoryInfoCallback callback) {
auto on_run = Future<>::Create("StoryProviderImpl.GetStoryInfo.on_run");
auto done =
@@ -550,7 +550,7 @@
// |fuchsia::modular::StoryProvider|
void StoryProviderImpl::GetController(
- fidl::StringPtr story_id,
+ std::string story_id,
fidl::InterfaceRequest<fuchsia::modular::StoryController> request) {
operation_queue_.Add(new LoadStoryRuntimeCall(
this, session_storage_, story_id,
@@ -574,13 +574,11 @@
on_run->AsyncMap([this] { return session_storage_->GetAllStoryData(); })
->Map(fxl::MakeCopyable(
[this, watcher_ptr = std::move(watcher_ptr)](
- fidl::VectorPtr<fuchsia::modular::internal::StoryData>
+ std::vector<fuchsia::modular::internal::StoryData>
all_story_data) mutable {
- FXL_DCHECK(all_story_data);
- auto result =
- fidl::VectorPtr<fuchsia::modular::StoryInfo>::New(0);
+ std::vector<fuchsia::modular::StoryInfo> result;
- for (auto& story_data : *all_story_data) {
+ for (auto& story_data : all_story_data) {
if (!story_data.story_options.kind_of_proto_story) {
result.push_back(std::move(story_data.story_info));
}
@@ -601,12 +599,11 @@
auto on_run = Future<>::Create("StoryProviderImpl.PreviousStories.on_run");
auto done =
on_run->AsyncMap([this] { return session_storage_->GetAllStoryData(); })
- ->Map([](fidl::VectorPtr<fuchsia::modular::internal::StoryData>
+ ->Map([](std::vector<fuchsia::modular::internal::StoryData>
all_story_data) {
- FXL_DCHECK(all_story_data);
- auto result = fidl::VectorPtr<fuchsia::modular::StoryInfo>::New(0);
+ std::vector<fuchsia::modular::StoryInfo> result;
- for (auto& story_data : *all_story_data) {
+ for (auto& story_data : all_story_data) {
if (!story_data.story_options.kind_of_proto_story) {
result.push_back(std::move(story_data.story_info));
}
@@ -650,7 +647,7 @@
void StoryProviderImpl::OnFocusChange(fuchsia::modular::FocusInfoPtr info) {
operation_queue_.Add(
new SyncCall(fxl::MakeCopyable([this, info = std::move(info)]() {
- if (info->device_id.get() != device_id_) {
+ if (info->device_id != device_id_) {
return;
}
diff --git a/bin/sessionmgr/story_runner/story_provider_impl.h b/bin/sessionmgr/story_runner/story_provider_impl.h
index 2da631e..e1b2ce4 100644
--- a/bin/sessionmgr/story_runner/story_provider_impl.h
+++ b/bin/sessionmgr/story_runner/story_provider_impl.h
@@ -123,10 +123,10 @@
// Called by StoryControllerImpl.
//
// Returns nullptr if the StoryInfo for |story_id| is not cached.
- fuchsia::modular::StoryInfoPtr GetCachedStoryInfo(fidl::StringPtr story_id);
+ fuchsia::modular::StoryInfoPtr GetCachedStoryInfo(std::string story_id);
// |fuchsia::modular::StoryProvider|.
- void GetStoryInfo(fidl::StringPtr story_id,
+ void GetStoryInfo(std::string story_id,
GetStoryInfoCallback callback) override;
// Called by StoryControllerImpl. Sends request to
@@ -195,7 +195,7 @@
private:
// |fuchsia::modular::StoryProvider|
- void GetController(fidl::StringPtr story_id,
+ void GetController(std::string story_id,
fidl::InterfaceRequest<fuchsia::modular::StoryController>
request) override;
diff --git a/bin/sessionmgr/story_runner/story_shell_context_impl.cc b/bin/sessionmgr/story_runner/story_shell_context_impl.cc
index 5564251..83d5cdc 100644
--- a/bin/sessionmgr/story_runner/story_shell_context_impl.cc
+++ b/bin/sessionmgr/story_runner/story_shell_context_impl.cc
@@ -52,8 +52,8 @@
std::move(request));
}
-void StoryShellContextImpl::RequestView(fidl::StringPtr surface_id) {}
+void StoryShellContextImpl::RequestView(std::string surface_id) {}
-void StoryShellContextImpl::OnSurfaceOffScreen(fidl::StringPtr surface_id) {}
+void StoryShellContextImpl::OnSurfaceOffScreen(std::string surface_id) {}
} // namespace modular
diff --git a/bin/sessionmgr/story_runner/story_shell_context_impl.h b/bin/sessionmgr/story_runner/story_shell_context_impl.h
index 73941ef..7fa4099 100644
--- a/bin/sessionmgr/story_runner/story_shell_context_impl.h
+++ b/bin/sessionmgr/story_runner/story_shell_context_impl.h
@@ -32,8 +32,8 @@
fidl::InterfaceHandle<fuchsia::modular::StoryVisualStateWatcher> watcher)
override;
void GetLink(fidl::InterfaceRequest<fuchsia::modular::Link> request) override;
- void RequestView(fidl::StringPtr surface_id) override;
- void OnSurfaceOffScreen(fidl::StringPtr surface_id) override;
+ void RequestView(std::string surface_id) override;
+ void OnSurfaceOffScreen(std::string surface_id) override;
const fidl::StringPtr story_id_;
// Not owned. The StoryProviderImpl corresponding to this context.
diff --git a/bin/sessionmgr/user_intelligence_provider_impl.cc b/bin/sessionmgr/user_intelligence_provider_impl.cc
index 415ded3..232f2fc 100644
--- a/bin/sessionmgr/user_intelligence_provider_impl.cc
+++ b/bin/sessionmgr/user_intelligence_provider_impl.cc
@@ -106,18 +106,18 @@
void UserIntelligenceProviderImpl::StartAgents(
fidl::InterfaceHandle<fuchsia::modular::ComponentContext>
component_context_handle,
- fidl::VectorPtr<fidl::StringPtr> session_agents,
- fidl::VectorPtr<fidl::StringPtr> startup_agents) {
+ std::vector<std::string> session_agents,
+ std::vector<std::string> startup_agents) {
component_context_.Bind(std::move(component_context_handle));
FXL_LOG(INFO) << "Starting session_agents:";
- for (const auto& agent : *session_agents) {
+ for (const auto& agent : session_agents) {
FXL_LOG(INFO) << " " << agent;
StartSessionAgent(agent);
}
FXL_LOG(INFO) << "Starting startup_agents:";
- for (const auto& agent : *startup_agents) {
+ for (const auto& agent : startup_agents) {
FXL_LOG(INFO) << " " << agent;
StartAgent(agent);
}
@@ -126,7 +126,7 @@
}
void UserIntelligenceProviderImpl::GetServicesForAgent(
- fidl::StringPtr url, GetServicesForAgentCallback callback) {
+ std::string url, GetServicesForAgentCallback callback) {
fuchsia::sys::ServiceList service_list;
agent_namespaces_.emplace_back(service_list.provider.NewRequest());
auto* agent_host = &agent_namespaces_.back();
@@ -232,13 +232,13 @@
});
}
-fidl::VectorPtr<fidl::StringPtr> UserIntelligenceProviderImpl::AddAgentServices(
+std::vector<std::string> UserIntelligenceProviderImpl::AddAgentServices(
const std::string& url, component::ServiceNamespace* agent_host) {
fuchsia::modular::ComponentScope agent_info;
fuchsia::modular::AgentScope agent_scope;
agent_scope.url = url;
agent_info.set_agent_scope(std::move(agent_scope));
- fidl::VectorPtr<fidl::StringPtr> service_names;
+ std::vector<std::string> service_names;
service_names.push_back(fuchsia::modular::ContextWriter::Name_);
agent_host->AddService<fuchsia::modular::ContextWriter>(fxl::MakeCopyable(
diff --git a/bin/sessionmgr/user_intelligence_provider_impl.h b/bin/sessionmgr/user_intelligence_provider_impl.h
index 1f5f7a4..8b31804 100644
--- a/bin/sessionmgr/user_intelligence_provider_impl.h
+++ b/bin/sessionmgr/user_intelligence_provider_impl.h
@@ -56,10 +56,10 @@
void StartAgents(fidl::InterfaceHandle<fuchsia::modular::ComponentContext>
component_context_handle,
- fidl::VectorPtr<fidl::StringPtr> session_agents,
- fidl::VectorPtr<fidl::StringPtr> startup_agents) override;
+ std::vector<std::string> session_agents,
+ std::vector<std::string> startup_agents) override;
- void GetServicesForAgent(fidl::StringPtr url,
+ void GetServicesForAgent(std::string url,
GetServicesForAgentCallback callback) override;
private:
@@ -94,7 +94,7 @@
// A ServiceProviderInitializer that adds standard agent services, including
// attributed context and suggestion service entry points. Returns the names
// of the services added.
- fidl::VectorPtr<fidl::StringPtr> AddAgentServices(
+ std::vector<std::string> AddAgentServices(
const std::string& url, component::ServiceNamespace* agent_host);
// Starts suggestion engine.
diff --git a/bin/suggestion_engine/debug.cc b/bin/suggestion_engine/debug.cc
index 34257ab..98bbafa 100644
--- a/bin/suggestion_engine/debug.cc
+++ b/bin/suggestion_engine/debug.cc
@@ -26,7 +26,7 @@
void makeProposalSummaries(
const RankedSuggestionsList* suggestions,
- fidl::VectorPtr<fuchsia::modular::ProposalSummary>* summaries) {
+ std::vector<fuchsia::modular::ProposalSummary>* summaries) {
for (const auto& suggestion : suggestions->Get()) {
fuchsia::modular::ProposalSummary summary;
makeProposalSummary(suggestion->prototype, &summary);
@@ -37,7 +37,7 @@
void SuggestionDebugImpl::OnAskStart(std::string query,
const RankedSuggestionsList* suggestions) {
for (auto& listener : ask_proposal_listeners_.ptrs()) {
- auto proposals = fidl::VectorPtr<fuchsia::modular::ProposalSummary>::New(0);
+ std::vector<fuchsia::modular::ProposalSummary> proposals;
makeProposalSummaries(suggestions, &proposals);
(*listener)->OnAskStart(query, std::move(proposals));
}
@@ -68,10 +68,10 @@
void SuggestionDebugImpl::OnNextUpdate(
const RankedSuggestionsList* suggestions) {
for (auto& listener : next_proposal_listeners_.ptrs()) {
- auto proposals = fidl::VectorPtr<fuchsia::modular::ProposalSummary>::New(0);
+ std::vector<fuchsia::modular::ProposalSummary> proposals;
makeProposalSummaries(suggestions, &proposals);
(*listener)->OnNextUpdate(std::move(proposals));
- cached_next_proposals_ = std::move(proposals);
+ cached_next_proposals_.reset(std::move(proposals));
}
}
@@ -95,7 +95,7 @@
auto listener_ptr = listener.Bind();
next_proposal_listeners_.AddInterfacePtr(std::move(listener_ptr));
if (cached_next_proposals_) {
- listener_ptr->OnNextUpdate(std::move(cached_next_proposals_));
+ listener_ptr->OnNextUpdate(cached_next_proposals_.take());
}
}
diff --git a/bin/suggestion_engine/next_processor.cc b/bin/suggestion_engine/next_processor.cc
index abad137..7d62689 100644
--- a/bin/suggestion_engine/next_processor.cc
+++ b/bin/suggestion_engine/next_processor.cc
@@ -165,11 +165,9 @@
const size_t max_results) {
const auto& suggestion_vector = suggestions_.Get();
- fidl::VectorPtr<fuchsia::modular::Suggestion> window;
- // Prefer to return an array of size 0 vs. null
- window.resize(0);
+ std::vector<fuchsia::modular::Suggestion> window;
for (size_t i = 0;
- window->size() < max_results && i < suggestion_vector.size(); i++) {
+ window.size() < max_results && i < suggestion_vector.size(); i++) {
if (!suggestion_vector[i]->hidden) {
window.push_back(CreateSuggestion(*suggestion_vector[i]));
}
diff --git a/bin/suggestion_engine/proposal_publisher_impl.cc b/bin/suggestion_engine/proposal_publisher_impl.cc
index c011c6e..da03970 100644
--- a/bin/suggestion_engine/proposal_publisher_impl.cc
+++ b/bin/suggestion_engine/proposal_publisher_impl.cc
@@ -32,7 +32,7 @@
engine_->ProposeNavigation(navigation);
}
-void ProposalPublisherImpl::Remove(fidl::StringPtr proposal_id) {
+void ProposalPublisherImpl::Remove(std::string proposal_id) {
engine_->RemoveNextProposal(component_url_, proposal_id);
}
diff --git a/bin/suggestion_engine/proposal_publisher_impl.h b/bin/suggestion_engine/proposal_publisher_impl.h
index 216f0a6..8bd4cc0 100644
--- a/bin/suggestion_engine/proposal_publisher_impl.h
+++ b/bin/suggestion_engine/proposal_publisher_impl.h
@@ -34,7 +34,7 @@
fidl::InterfaceRequest<fuchsia::modular::ProposalPublisher> request);
void Propose(fuchsia::modular::Proposal proposal) override;
- void Remove(fidl::StringPtr proposal_id) override;
+ void Remove(std::string proposal_id) override;
void ProposeNavigation(
fuchsia::modular::NavigationAction navigation) override;
diff --git a/bin/suggestion_engine/query_processor.cc b/bin/suggestion_engine/query_processor.cc
index 2227afe..d0e72ed 100644
--- a/bin/suggestion_engine/query_processor.cc
+++ b/bin/suggestion_engine/query_processor.cc
@@ -129,8 +129,8 @@
const std::string& handler_url,
fuchsia::modular::QueryResponse response) {
// Ranking currently happens as each set of proposals are added.
- for (size_t i = 0; i < response.proposals->size(); ++i) {
- AddProposal(handler_url, std::move(response.proposals->at(i)));
+ for (size_t i = 0; i < response.proposals.size(); ++i) {
+ AddProposal(handler_url, std::move(response.proposals.at(i)));
}
suggestions_.Refresh(input);
@@ -150,13 +150,13 @@
void QueryProcessor::NotifyOfResults() {
const auto& suggestion_vector = suggestions_.Get();
- fidl::VectorPtr<fuchsia::modular::Suggestion> window;
+ std::vector<fuchsia::modular::Suggestion> window;
for (size_t i = 0;
i < active_query_->max_results() && i < suggestion_vector.size(); i++) {
window.push_back(CreateSuggestion(*suggestion_vector[i]));
}
- if (window) {
+ if (!window.empty()) {
active_query_->listener()->OnQueryResults(std::move(window));
}
}
diff --git a/bin/suggestion_engine/ranking_features/affinity_ranking_feature.cc b/bin/suggestion_engine/ranking_features/affinity_ranking_feature.cc
index 6fa1a5e..4b26092 100644
--- a/bin/suggestion_engine/ranking_features/affinity_ranking_feature.cc
+++ b/bin/suggestion_engine/ranking_features/affinity_ranking_feature.cc
@@ -14,7 +14,7 @@
namespace {
bool MatchesMod(const fuchsia::modular::ModuleAffinity& affinity,
- const fidl::VectorPtr<fidl::StringPtr>& mod_path,
+ const std::vector<std::string>& mod_path,
const std::string& affinity_story) {
// If the stories are not the same return early.
if (affinity.story_name != affinity_story) {
@@ -33,11 +33,11 @@
// meaningful confidence that represents this behavior and supports cases such
// as a/b/c vs a/d. For the case above it could be 0.66 and for the case of
// a/d 0.33.
- for (uint32_t i = 0; i < mod_path->size(); i++) {
- if (i >= affinity.module_name->size()) {
+ for (uint32_t i = 0; i < mod_path.size(); i++) {
+ if (i >= affinity.module_name.size()) {
break;
}
- if (mod_path->at(i) != affinity.module_name->at(i)) {
+ if (mod_path.at(i) != affinity.module_name.at(i)) {
return false;
}
}
@@ -55,12 +55,12 @@
const fuchsia::modular::UserInput& query,
const RankedSuggestion& suggestion) {
const auto& proposal = suggestion.prototype->proposal;
- if (proposal.affinity->empty()) {
+ if (proposal.affinity.empty()) {
return kMaxConfidence;
}
for (const auto& context_value : *ContextValues()) {
const auto& affinity_story_id = context_value.meta.story->id;
- for (const auto& affinity : *proposal.affinity) {
+ for (const auto& affinity : proposal.affinity) {
if (affinity.is_story_affinity() &&
affinity_story_id == affinity.story_affinity().story_name) {
return kMaxConfidence;
diff --git a/bin/suggestion_engine/ranking_features/dead_story_ranking_feature.cc b/bin/suggestion_engine/ranking_features/dead_story_ranking_feature.cc
index 800e49a..fcd99a7 100644
--- a/bin/suggestion_engine/ranking_features/dead_story_ranking_feature.cc
+++ b/bin/suggestion_engine/ranking_features/dead_story_ranking_feature.cc
@@ -18,7 +18,7 @@
const auto& proposal = ranked_suggestion.prototype->proposal;
// Proposal not tied to any story.
- if (proposal.affinity->empty()) {
+ if (proposal.affinity.empty()) {
return kMinConfidence;
}
@@ -26,7 +26,7 @@
// average O(1) lookup.
for (const auto& context_value : *ContextValues()) {
const auto& story_name = context_value.meta.story->id;
- for (const auto& affinity : *proposal.affinity) {
+ for (const auto& affinity : proposal.affinity) {
switch (affinity.Which()) {
case fuchsia::modular::ProposalAffinity::Tag::kModuleAffinity:
if (story_name == affinity.module_affinity().story_name) {
diff --git a/bin/suggestion_engine/ranking_features/mod_pair_ranking_feature.cc b/bin/suggestion_engine/ranking_features/mod_pair_ranking_feature.cc
index c862e5a..7064b61 100644
--- a/bin/suggestion_engine/ranking_features/mod_pair_ranking_feature.cc
+++ b/bin/suggestion_engine/ranking_features/mod_pair_ranking_feature.cc
@@ -50,7 +50,7 @@
const RankedSuggestion& suggestion) {
double prob = 0.0;
- for (auto& command : *suggestion.prototype->proposal.on_selected) {
+ for (auto& command : suggestion.prototype->proposal.on_selected) {
fidl::StringPtr module_url;
switch (command.Which()) {
case fuchsia::modular::StoryCommand::Tag::kAddMod: {
diff --git a/bin/suggestion_engine/ranking_features/ranking_feature.cc b/bin/suggestion_engine/ranking_features/ranking_feature.cc
index 8985bc2..f5a81e2 100644
--- a/bin/suggestion_engine/ranking_features/ranking_feature.cc
+++ b/bin/suggestion_engine/ranking_features/ranking_feature.cc
@@ -34,9 +34,9 @@
}
void RankingFeature::UpdateContext(
- const fidl::VectorPtr<fuchsia::modular::ContextValue>&
+ const std::vector<fuchsia::modular::ContextValue>&
context_update_values) {
- fidl::Clone(context_update_values, &context_values_);
+ context_values_.reset(fidl::Clone(context_update_values));
}
fuchsia::modular::ContextSelectorPtr
diff --git a/bin/suggestion_engine/ranking_features/ranking_feature.h b/bin/suggestion_engine/ranking_features/ranking_feature.h
index 76f3bbf..91074c9 100644
--- a/bin/suggestion_engine/ranking_features/ranking_feature.h
+++ b/bin/suggestion_engine/ranking_features/ranking_feature.h
@@ -31,7 +31,7 @@
fuchsia::modular::ContextSelectorPtr CreateContextSelector();
// Updates the context that the feature needs.
- void UpdateContext(const fidl::VectorPtr<fuchsia::modular::ContextValue>&
+ void UpdateContext(const std::vector<fuchsia::modular::ContextValue>&
context_update_values);
protected:
diff --git a/bin/suggestion_engine/suggestion_engine_impl.cc b/bin/suggestion_engine/suggestion_engine_impl.cc
index f4998aa..e1e98e2 100644
--- a/bin/suggestion_engine/suggestion_engine_impl.cc
+++ b/bin/suggestion_engine/suggestion_engine_impl.cc
@@ -181,7 +181,7 @@
// |fuchsia::modular::SuggestionProvider|
void SuggestionEngineImpl::NotifyInteraction(
- fidl::StringPtr suggestion_uuid,
+ std::string suggestion_uuid,
fuchsia::modular::Interaction interaction) {
// Find the suggestion
bool suggestion_in_ask = false;
@@ -248,7 +248,7 @@
// |fuchsia::modular::SuggestionEngine|
void SuggestionEngineImpl::RegisterProposalPublisher(
- fidl::StringPtr url,
+ std::string url,
fidl::InterfaceRequest<fuchsia::modular::ProposalPublisher> publisher) {
// Check to see if a fuchsia::modular::ProposalPublisher has already been
// created for the component with this url. If not, create one.
@@ -262,7 +262,7 @@
// |fuchsia::modular::SuggestionEngine|
void SuggestionEngineImpl::RegisterQueryHandler(
- fidl::StringPtr url, fidl::InterfaceHandle<fuchsia::modular::QueryHandler>
+ std::string url, fidl::InterfaceHandle<fuchsia::modular::QueryHandler>
query_handler_handle) {
query_processor_.RegisterQueryHandler(url, std::move(query_handler_handle));
}
@@ -335,7 +335,7 @@
void SuggestionEngineImpl::OnContextUpdate(
fuchsia::modular::ContextUpdate update) {
- for (auto& entry : update.values.take()) {
+ for (auto& entry : update.values) {
for (const auto& rf_it : ranking_features) {
if (entry.key == rf_it.first) { // Update key == rf key
rf_it.second->UpdateContext(entry.value);
diff --git a/bin/suggestion_engine/suggestion_engine_impl.h b/bin/suggestion_engine/suggestion_engine_impl.h
index 853b4e7..1ac62e9 100644
--- a/bin/suggestion_engine/suggestion_engine_impl.h
+++ b/bin/suggestion_engine/suggestion_engine_impl.h
@@ -132,18 +132,18 @@
// it came from there.
//
// |fuchsia::modular::SuggestionProvider|
- void NotifyInteraction(fidl::StringPtr suggestion_uuid,
+ void NotifyInteraction(std::string suggestion_uuid,
fuchsia::modular::Interaction interaction) override;
// |fuchsia::modular::SuggestionEngine|
void RegisterProposalPublisher(
- fidl::StringPtr url,
+ std::string url,
fidl::InterfaceRequest<fuchsia::modular::ProposalPublisher> publisher)
override;
// |fuchsia::modular::SuggestionEngine|
void RegisterQueryHandler(
- fidl::StringPtr url, fidl::InterfaceHandle<fuchsia::modular::QueryHandler>
+ std::string url, fidl::InterfaceHandle<fuchsia::modular::QueryHandler>
query_handler_handle) override;
void Terminate(std::function<void()> done) { done(); }
diff --git a/bin/suggestion_engine/suggestion_engine_impl_unittest.cc b/bin/suggestion_engine/suggestion_engine_impl_unittest.cc
index 550d396..e474cab 100644
--- a/bin/suggestion_engine/suggestion_engine_impl_unittest.cc
+++ b/bin/suggestion_engine/suggestion_engine_impl_unittest.cc
@@ -20,20 +20,20 @@
class TestNextListener : public fuchsia::modular::NextListener {
public:
void OnNextResults(
- fidl::VectorPtr<fuchsia::modular::Suggestion> suggestions) override {
+ std::vector<fuchsia::modular::Suggestion> suggestions) override {
last_suggestions_ = std::move(suggestions);
}
- void Reset() { last_suggestions_->clear(); }
+ void Reset() { last_suggestions_.clear(); }
void OnProcessingChange(bool processing) override{};
- fidl::VectorPtr<fuchsia::modular::Suggestion>& last_suggestions() {
+ std::vector<fuchsia::modular::Suggestion>& last_suggestions() {
return last_suggestions_;
}
private:
- fidl::VectorPtr<fuchsia::modular::Suggestion> last_suggestions_;
+ std::vector<fuchsia::modular::Suggestion> last_suggestions_;
};
class TestInterruptionListener : public fuchsia::modular::InterruptionListener {
@@ -246,8 +246,8 @@
// We should see proposal in listener.
auto& results = next_listener_.last_suggestions();
- ASSERT_EQ(1u, results->size());
- EXPECT_EQ("test_proposal", results->at(0).display.headline);
+ ASSERT_EQ(1u, results.size());
+ EXPECT_EQ("test_proposal", results.at(0).display.headline);
}
TEST_F(SuggestionEngineTest, OnlyGetsMaxProposals) {
@@ -262,9 +262,9 @@
// We should see 2 proposals in listener.
auto& results = next_listener_.last_suggestions();
- ASSERT_EQ(2u, results->size());
- EXPECT_EQ("foo", results->at(0).display.headline);
- EXPECT_EQ("bar", results->at(1).display.headline);
+ ASSERT_EQ(2u, results.size());
+ EXPECT_EQ("foo", results.at(0).display.headline);
+ EXPECT_EQ("bar", results.at(1).display.headline);
}
TEST_F(SuggestionEngineTest, AddNextProposalInterruption) {
@@ -282,7 +282,7 @@
// Suggestion shouldn't be in NEXT yet since it's interrupting.
auto& results = next_listener_.last_suggestions();
- EXPECT_TRUE(results->empty());
+ EXPECT_TRUE(results.empty());
}
TEST_F(SuggestionEngineTest, AddNextProposalRichNotAllowed) {
@@ -298,9 +298,9 @@
// Suggestion shouldn't be rich: it has no preloaded story_id.
auto& results = next_listener_.last_suggestions();
- ASSERT_EQ(1u, results->size());
- EXPECT_EQ("foo", results->at(0).display.headline);
- EXPECT_TRUE(results->at(0).preloaded_story_id->empty());
+ ASSERT_EQ(1u, results.size());
+ EXPECT_EQ("foo", results.at(0).display.headline);
+ EXPECT_TRUE(results.at(0).preloaded_story_id->empty());
}
TEST_F(SuggestionEngineTest, AddNextProposalRich) {
@@ -312,13 +312,13 @@
fuchsia::modular::SurfaceArrangement::ONTOP);
proposal_publisher_->Propose(std::move(proposal));
- RunLoopUntil([&] { return next_listener_.last_suggestions()->size() == 1; });
+ RunLoopUntil([&] { return next_listener_.last_suggestions().size() == 1; });
// Suggestion should be rich: it has a preloaded story_id.
auto& results = next_listener_.last_suggestions();
- EXPECT_EQ("foo_rich", results->at(0).display.headline);
- EXPECT_FALSE(results->at(0).preloaded_story_id->empty());
- auto story_name = results->at(0).preloaded_story_id;
+ EXPECT_EQ("foo_rich", results.at(0).display.headline);
+ EXPECT_FALSE(results.at(0).preloaded_story_id->empty());
+ auto story_name = results.at(0).preloaded_story_id;
// The executor should have been called with a command to add a mod and
// created a story.
@@ -329,8 +329,8 @@
ASSERT_TRUE(commands.at(0).is_add_mod());
auto& command = commands.at(0).add_mod();
- ASSERT_EQ(1u, command.mod_name->size());
- EXPECT_EQ("mod_name", command.mod_name->at(0));
+ ASSERT_EQ(1u, command.mod_name.size());
+ EXPECT_EQ("mod_name", command.mod_name.at(0));
EXPECT_EQ("mod_url", command.intent.handler);
EXPECT_EQ(fuchsia::modular::SurfaceArrangement::ONTOP,
command.surface_relation.arrangement);
@@ -361,7 +361,7 @@
proposal_publisher_->Propose(std::move(proposal));
}
- RunLoopUntil([&] { return next_listener_.last_suggestions()->size() == 1; });
+ RunLoopUntil([&] { return next_listener_.last_suggestions().size() == 1; });
// Up to here we expect the same as in the previous test (AddNextProposalRich)
// Submitting a new proposal with the same story_name should result on its
@@ -377,7 +377,7 @@
}
RunLoopUntil([&] { return test_executor_.execute_count() == 1; });
- EXPECT_TRUE(next_listener_.last_suggestions()->empty());
+ EXPECT_TRUE(next_listener_.last_suggestions().empty());
// The executor should have been called with a command to add a mod and
// created a story.
@@ -388,8 +388,8 @@
ASSERT_TRUE(commands.at(0).is_add_mod());
auto& command = commands.at(0).add_mod();
- ASSERT_EQ(1u, command.mod_name->size());
- EXPECT_EQ("mod_name", command.mod_name->at(0));
+ ASSERT_EQ(1u, command.mod_name.size());
+ EXPECT_EQ("mod_name", command.mod_name.at(0));
EXPECT_EQ("mod_url", command.intent.handler);
EXPECT_EQ(fuchsia::modular::SurfaceArrangement::COPRESENT,
command.surface_relation.arrangement);
@@ -417,11 +417,11 @@
fuchsia::modular::SurfaceArrangement::ONTOP);
proposal_publisher_->Propose(std::move(proposal));
- RunLoopUntil([&] { return next_listener_.last_suggestions()->size() == 1; });
+ RunLoopUntil([&] { return next_listener_.last_suggestions().size() == 1; });
// Suggestion should be rich: it has a preloaded story_id.
auto& results = next_listener_.last_suggestions();
- EXPECT_EQ("foo_story", results->at(0).preloaded_story_id);
+ EXPECT_EQ("foo_story", results.at(0).preloaded_story_id);
// The executor should have been called with a command to add a mod and
// created a story.
@@ -451,7 +451,7 @@
RunLoopUntilIdle();
auto& results = next_listener_.last_suggestions();
- EXPECT_TRUE(results->empty());
+ EXPECT_TRUE(results.empty());
}
TEST_F(SuggestionEngineTest, RemoveNextProposalRich) {
@@ -464,12 +464,12 @@
// TODO(miguelfrde): add an operation queue in the suggestion engine and
// remove this wait.
- RunLoopUntil([&] { return next_listener_.last_suggestions()->size() == 1; });
+ RunLoopUntil([&] { return next_listener_.last_suggestions().size() == 1; });
// Remove proposal.
proposal_publisher_->Remove("1");
- RunLoopUntil([&] { return next_listener_.last_suggestions()->empty(); });
+ RunLoopUntil([&] { return next_listener_.last_suggestions().empty(); });
// The story that at some point was created when adding the rich suggestion
// (not tested since other tests already cover it) should have been deleted.
@@ -499,8 +499,8 @@
// Get id of the resulting suggestion.
auto& results = next_listener_.last_suggestions();
- ASSERT_EQ(1u, results->size());
- auto suggestion_id = results->at(0).uuid;
+ ASSERT_EQ(1u, results.size());
+ auto suggestion_id = results.at(0).uuid;
fuchsia::modular::Interaction interaction;
interaction.type = fuchsia::modular::InteractionType::SELECTED;
@@ -520,20 +520,20 @@
EXPECT_TRUE(commands.at(3).is_set_link_value());
auto& add_mod = commands.at(0).add_mod();
- ASSERT_EQ(1u, add_mod.mod_name->size());
- EXPECT_EQ("mod_name", add_mod.mod_name->at(0));
+ ASSERT_EQ(1u, add_mod.mod_name.size());
+ EXPECT_EQ("mod_name", add_mod.mod_name.at(0));
EXPECT_EQ("mod_url", add_mod.intent.handler);
auto& set_focus_state = commands.at(1).set_focus_state();
EXPECT_TRUE(set_focus_state.focused);
auto& focus_mod = commands.at(2).focus_mod();
- ASSERT_EQ(1u, focus_mod.mod_name->size());
- EXPECT_EQ("mod_name", focus_mod.mod_name->at(0));
+ ASSERT_EQ(1u, focus_mod.mod_name.size());
+ EXPECT_EQ("mod_name", focus_mod.mod_name.at(0));
auto& set_link_value = commands.at(3).set_link_value();
- ASSERT_EQ(1u, set_link_value.path.module_path->size());
- EXPECT_EQ("mod_name", set_link_value.path.module_path->at(0));
+ ASSERT_EQ(1u, set_link_value.path.module_path.size());
+ EXPECT_EQ("mod_name", set_link_value.path.module_path.at(0));
EXPECT_EQ("foo_link_name", set_link_value.path.link_name);
std::string link_value;
FXL_CHECK(fsl::StringFromVmo(*set_link_value.value, &link_value));
@@ -552,7 +552,7 @@
// We should have been notified with no suggestions after selecting this
// suggestion.
auto& listener_results = next_listener_.last_suggestions();
- EXPECT_TRUE(listener_results->empty());
+ EXPECT_TRUE(listener_results.empty());
}
TEST_F(SuggestionEngineTest, NotifyInteractionSelectedWithStoryName) {
@@ -568,8 +568,8 @@
// Get id of the resulting suggestion.
auto& results = next_listener_.last_suggestions();
- ASSERT_EQ(1u, results->size());
- auto suggestion_id = results->at(0).uuid;
+ ASSERT_EQ(1u, results.size());
+ auto suggestion_id = results.at(0).uuid;
// Select suggestion.
fuchsia::modular::Interaction interaction;
@@ -587,8 +587,8 @@
ASSERT_EQ(1u, commands.size());
EXPECT_TRUE(commands.at(0).is_focus_mod());
auto& focus_mod = commands.at(0).focus_mod();
- ASSERT_EQ(1u, focus_mod.mod_name->size());
- EXPECT_EQ("mod_name", focus_mod.mod_name->at(0));
+ ASSERT_EQ(1u, focus_mod.mod_name.size());
+ EXPECT_EQ("mod_name", focus_mod.mod_name.at(0));
// Ensure a regular story was created when we executed the proposal.
bool done{};
@@ -603,7 +603,7 @@
// We should have been notified with no suggestions after selecting this
// suggestion.
auto& listener_results = next_listener_.last_suggestions();
- EXPECT_TRUE(listener_results->empty());
+ EXPECT_TRUE(listener_results.empty());
}
TEST_F(SuggestionEngineTest, NotifyInteractionDismissed) {
@@ -618,8 +618,8 @@
// Get id of the resulting suggestion.
auto& results = next_listener_.last_suggestions();
- ASSERT_EQ(1u, results->size());
- auto suggestion_id = results->at(0).uuid;
+ ASSERT_EQ(1u, results.size());
+ auto suggestion_id = results.at(0).uuid;
fuchsia::modular::Interaction interaction;
interaction.type = fuchsia::modular::InteractionType::DISMISSED;
@@ -634,7 +634,7 @@
// We should have been notified with no suggestions after dismissing this
// suggestion.
auto& listener_results = next_listener_.last_suggestions();
- EXPECT_TRUE(listener_results->empty());
+ EXPECT_TRUE(listener_results.empty());
}
TEST_F(SuggestionEngineTest, NotifyInteractionDismissedWithStoryName) {
@@ -650,8 +650,8 @@
// Get id of the resulting suggestion.
auto& results = next_listener_.last_suggestions();
- ASSERT_EQ(1u, results->size());
- auto suggestion_id = results->at(0).uuid;
+ ASSERT_EQ(1u, results.size());
+ auto suggestion_id = results.at(0).uuid;
fuchsia::modular::Interaction interaction;
interaction.type = fuchsia::modular::InteractionType::DISMISSED;
@@ -666,7 +666,7 @@
// We should have been notified with no suggestions after dismissing this
// suggestion.
auto& listener_results = next_listener_.last_suggestions();
- EXPECT_TRUE(listener_results->empty());
+ EXPECT_TRUE(listener_results.empty());
// Ensure no story was created when we executed the proposal.
bool done{};
@@ -686,13 +686,13 @@
AddFocusModuleAction(&proposal, "mod_name");
proposal_publisher_->Propose(std::move(proposal));
- RunLoopUntil([&] { return next_listener_.last_suggestions()->size() == 1; });
+ RunLoopUntil([&] { return next_listener_.last_suggestions().size() == 1; });
// Get id of the resulting suggestion.
auto& results = next_listener_.last_suggestions();
- auto suggestion_id = results->at(0).uuid;
- EXPECT_FALSE(results->at(0).preloaded_story_id->empty());
- auto story_name = results->at(0).preloaded_story_id;
+ auto suggestion_id = results.at(0).uuid;
+ EXPECT_FALSE(results.at(0).preloaded_story_id->empty());
+ auto story_name = results.at(0).preloaded_story_id;
test_executor_.Reset();
@@ -726,15 +726,15 @@
AddFocusModuleAction(&proposal, "mod_name");
proposal_publisher_->Propose(std::move(proposal));
- RunLoopUntil([&] { return next_listener_.last_suggestions()->size() == 1; });
+ RunLoopUntil([&] { return next_listener_.last_suggestions().size() == 1; });
// Get id and story of the resulting suggestion.
auto& results = next_listener_.last_suggestions();
EXPECT_EQ(1, test_executor_.execute_count());
- auto suggestion_id = results->at(0).uuid;
+ auto suggestion_id = results.at(0).uuid;
- EXPECT_FALSE(results->at(0).preloaded_story_id->empty());
- auto story_name = results->at(0).preloaded_story_id;
+ EXPECT_FALSE(results.at(0).preloaded_story_id->empty());
+ auto story_name = results.at(0).preloaded_story_id;
test_executor_.Reset();
@@ -743,7 +743,7 @@
suggestion_engine_impl_->NotifyInteraction(suggestion_id,
std::move(interaction));
- RunLoopUntil([&] { return next_listener_.last_suggestions()->empty(); });
+ RunLoopUntil([&] { return next_listener_.last_suggestions().empty(); });
// The executor shouldn't have been called again.
EXPECT_EQ(0, test_executor_.execute_count());
@@ -769,21 +769,21 @@
// Get id of the resulting suggestion.
auto& suggestion = interruption_listener_.last_suggestion();
- EXPECT_FALSE(suggestion.uuid->empty());
+ EXPECT_FALSE(suggestion.uuid.empty());
auto suggestion_id = suggestion.uuid;
- EXPECT_TRUE(next_listener_.last_suggestions()->empty());
+ EXPECT_TRUE(next_listener_.last_suggestions().empty());
fuchsia::modular::Interaction interaction;
interaction.type = fuchsia::modular::InteractionType::SNOOZED;
suggestion_engine_impl_->NotifyInteraction(suggestion_id,
std::move(interaction));
- RunLoopUntil([&] { return next_listener_.last_suggestions()->size() == 1; });
+ RunLoopUntil([&] { return next_listener_.last_suggestions().size() == 1; });
// The suggestion should still be there after being notified.
auto& listener_results = next_listener_.last_suggestions();
- EXPECT_EQ(suggestion_id, listener_results->at(0).uuid);
+ EXPECT_EQ(suggestion_id, listener_results.at(0).uuid);
}
TEST_F(SuggestionEngineTest, NotifyInteractionExpiredInterruption) {
@@ -797,10 +797,10 @@
// Get id of the resulting suggestion.
auto& suggestion = interruption_listener_.last_suggestion();
- EXPECT_FALSE(suggestion.uuid->empty());
+ EXPECT_FALSE(suggestion.uuid.empty());
auto suggestion_id = suggestion.uuid;
- EXPECT_TRUE(next_listener_.last_suggestions()->empty());
+ EXPECT_TRUE(next_listener_.last_suggestions().empty());
fuchsia::modular::Interaction interaction;
interaction.type = fuchsia::modular::InteractionType::EXPIRED;
@@ -811,8 +811,8 @@
// The suggestion should still be there after being notified.
auto& listener_results = next_listener_.last_suggestions();
- EXPECT_EQ(1u, listener_results->size());
- EXPECT_EQ(suggestion_id, listener_results->at(0).uuid);
+ EXPECT_EQ(1u, listener_results.size());
+ EXPECT_EQ(suggestion_id, listener_results.at(0).uuid);
}
TEST_F(SuggestionEngineTest, NotifyInteractionSelectedInterruption) {
@@ -827,7 +827,7 @@
RunLoopUntilIdle();
auto& suggestion = interruption_listener_.last_suggestion();
- EXPECT_FALSE(suggestion.uuid->empty());
+ EXPECT_FALSE(suggestion.uuid.empty());
auto suggestion_id = suggestion.uuid;
fuchsia::modular::Interaction interaction;
@@ -843,8 +843,8 @@
auto& commands = test_executor_.last_commands();
ASSERT_EQ(1u, commands.size());
auto& focus_mod = commands.at(0).focus_mod();
- ASSERT_EQ(1u, focus_mod.mod_name->size());
- EXPECT_EQ("mod_name", focus_mod.mod_name->at(0));
+ ASSERT_EQ(1u, focus_mod.mod_name.size());
+ EXPECT_EQ("mod_name", focus_mod.mod_name.at(0));
// Ensure a regular story was created when we executed the proposal.
bool done{};
@@ -857,7 +857,7 @@
RunLoopUntil([&] { return done; });
// The suggestion shouldn't be there anymore.
- EXPECT_TRUE(next_listener_.last_suggestions()->empty());
+ EXPECT_TRUE(next_listener_.last_suggestions().empty());
}
TEST_F(SuggestionEngineTest, NotifyInteractionDismissedInterruption) {
@@ -872,7 +872,7 @@
RunLoopUntilIdle();
auto& suggestion = interruption_listener_.last_suggestion();
- EXPECT_FALSE(suggestion.uuid->empty());
+ EXPECT_FALSE(suggestion.uuid.empty());
auto suggestion_id = suggestion.uuid;
fuchsia::modular::Interaction interaction;
@@ -886,7 +886,7 @@
EXPECT_EQ(0, test_executor_.execute_count());
// The suggestion shouldn't be there anymore.
- EXPECT_TRUE(next_listener_.last_suggestions()->empty());
+ EXPECT_TRUE(next_listener_.last_suggestions().empty());
}
TEST_F(SuggestionEngineTest, ProposeNavigation) {
diff --git a/bin/test_driver/test_driver_module.cc b/bin/test_driver/test_driver_module.cc
index b220c45..2d60487 100644
--- a/bin/test_driver/test_driver_module.cc
+++ b/bin/test_driver/test_driver_module.cc
@@ -56,7 +56,7 @@
void SetUp() {
module_host_->module_context()->GetLink(
modular::testing::kTestDriverLinkName, link_.NewRequest());
- link_->Get(sub_module_url_path_.Clone(),
+ link_->Get(fidl::VectorPtr(sub_module_url_path_),
[this](std::unique_ptr<fuchsia::mem::Buffer> link_data) {
std::string sub_module_url;
FXL_CHECK(fsl::StringFromVmo(*link_data, &sub_module_url));
@@ -113,7 +113,7 @@
// is a failure, whereas zero is a success.
void RunTestDriver() {
link_->Get(
- test_driver_url_path_.Clone(),
+ fidl::VectorPtr(test_driver_url_path_),
[this](std::unique_ptr<fuchsia::mem::Buffer> link_data) {
if (link_data == nullptr) {
Signal(modular::testing::kTestShutdown);
@@ -155,8 +155,8 @@
fuchsia::sys::LauncherPtr test_driver_launcher_;
fuchsia::sys::ComponentControllerPtr test_driver_component_controller_;
- fidl::VectorPtr<fidl::StringPtr> sub_module_url_path_;
- fidl::VectorPtr<fidl::StringPtr> test_driver_url_path_;
+ std::vector<std::string> sub_module_url_path_;
+ std::vector<std::string> test_driver_url_path_;
fuchsia::modular::ModuleControllerPtr sub_module_;
diff --git a/examples/simple/simple_impl.cc b/examples/simple/simple_impl.cc
index 7b5e2d8..db8f0c0 100644
--- a/examples/simple/simple_impl.cc
+++ b/examples/simple/simple_impl.cc
@@ -16,7 +16,7 @@
bindings_.AddBinding(this, std::move(request));
}
-void SimpleImpl::SetMessageQueue(fidl::StringPtr queue_token) {
+void SimpleImpl::SetMessageQueue(std::string queue_token) {
token_ = queue_token;
}
diff --git a/examples/simple/simple_impl.h b/examples/simple/simple_impl.h
index 2685f2a..cfa3771 100644
--- a/examples/simple/simple_impl.h
+++ b/examples/simple/simple_impl.h
@@ -27,7 +27,7 @@
private:
// |Simple| interface method.
- void SetMessageQueue(fidl::StringPtr queue_token) override;
+ void SetMessageQueue(std::string queue_token) override;
// The bindings to the Simple service.
fidl::BindingSet<Simple> bindings_;
diff --git a/examples/todo_cpp/todo.cc b/examples/todo_cpp/todo.cc
index 7a04cdf..993ebee 100644
--- a/examples/todo_cpp/todo.cc
+++ b/examples/todo_cpp/todo.cc
@@ -84,8 +84,8 @@
callback(status, {});
return;
}
- for (size_t i = 0; i < new_entries->size(); ++i) {
- entries.push_back(std::move(new_entries->at(i)));
+ for (size_t i = 0; i < new_entries.size(); ++i) {
+ entries.push_back(std::move(new_entries.at(i)));
}
if (status == fuchsia::ledger::Status::OK) {
callback(fuchsia::ledger::Status::OK, std::move(entries));
@@ -166,14 +166,13 @@
});
}
-void TodoApp::GetKeys(std::function<void(fidl::VectorPtr<Key>)> callback) {
+void TodoApp::GetKeys(std::function<void(std::vector<Key>)> callback) {
fuchsia::ledger::PageSnapshotPtr snapshot;
- page_->GetSnapshot(snapshot.NewRequest(), nullptr, nullptr,
+ page_->GetSnapshot(snapshot.NewRequest(), {}, nullptr,
HandleResponse([this] { loop_->Quit(); }, "GetSnapshot"));
fuchsia::ledger::PageSnapshot* snapshot_ptr = snapshot.get();
- snapshot_ptr->GetKeys(
- fidl::VectorPtr<uint8_t>::New(0), nullptr,
+ snapshot_ptr->GetKeys({}, nullptr,
fxl::MakeCopyable([snapshot = std::move(snapshot), callback](
fuchsia::ledger::Status status, auto keys,
auto next_token) { callback(std::move(keys)); }));
@@ -184,17 +183,17 @@
HandleResponse([this] { loop_->Quit(); }, "Put"));
}
-void TodoApp::DeleteOne(fidl::VectorPtr<Key> keys) {
- FXL_DCHECK(keys->size());
- std::uniform_int_distribution<> distribution(0, keys->size() - 1);
- page_->Delete(std::move(keys->at(distribution(rng_))),
+void TodoApp::DeleteOne(std::vector<Key> keys) {
+ FXL_DCHECK(keys.size());
+ std::uniform_int_distribution<> distribution(0, keys.size() - 1);
+ page_->Delete(std::move(keys.at(distribution(rng_))),
HandleResponse([this] { loop_->Quit(); }, "Delete"));
}
void TodoApp::Act() {
- GetKeys([this](fidl::VectorPtr<Key> keys) {
+ GetKeys([this](std::vector<Key> keys) {
size_t target_size = std::round(size_distribution_(rng_));
- if (keys->size() > std::max(static_cast<size_t>(0), target_size)) {
+ if (keys.size() > std::max(static_cast<size_t>(0), target_size)) {
DeleteOne(std::move(keys));
} else {
AddNew();
diff --git a/examples/todo_cpp/todo.h b/examples/todo_cpp/todo.h
index 3cee9f8..2bd129c 100644
--- a/examples/todo_cpp/todo.h
+++ b/examples/todo_cpp/todo.h
@@ -19,7 +19,7 @@
namespace todo {
-using Key = fidl::VectorPtr<uint8_t>;
+using Key = std::vector<uint8_t>;
class TodoApp : public fuchsia::ledger::PageWatcher,
fuchsia::modular::Lifecycle {
@@ -37,11 +37,11 @@
void List(fuchsia::ledger::PageSnapshotPtr snapshot);
- void GetKeys(std::function<void(fidl::VectorPtr<Key>)> callback);
+ void GetKeys(std::function<void(std::vector<Key>)> callback);
void AddNew();
- void DeleteOne(fidl::VectorPtr<Key> keys);
+ void DeleteOne(std::vector<Key> keys);
void Act();
diff --git a/lib/common/story_provider_watcher_base.cc b/lib/common/story_provider_watcher_base.cc
index dd070b0..529192a 100644
--- a/lib/common/story_provider_watcher_base.cc
+++ b/lib/common/story_provider_watcher_base.cc
@@ -25,7 +25,7 @@
void StoryProviderWatcherBase::Reset() { binding_.Unbind(); }
-void StoryProviderWatcherBase::OnDelete(::fidl::StringPtr /*story_id*/) {}
+void StoryProviderWatcherBase::OnDelete(::std::string /*story_id*/) {}
void StoryProviderWatcherBase::OnChange(
fuchsia::modular::StoryInfo /*story_info*/,
diff --git a/lib/common/story_provider_watcher_base.h b/lib/common/story_provider_watcher_base.h
index 131f764..e1edbbb 100644
--- a/lib/common/story_provider_watcher_base.h
+++ b/lib/common/story_provider_watcher_base.h
@@ -36,7 +36,7 @@
private:
// |fuchsia::modular::StoryProviderWatcher|
- void OnDelete(::fidl::StringPtr story_id) override;
+ void OnDelete(::std::string story_id) override;
// |fuchsia::modular::StoryProviderWatcher|
void OnChange(
diff --git a/lib/convert/convert.cc b/lib/convert/convert.cc
index c768d89..9d97a49 100644
--- a/lib/convert/convert.cc
+++ b/lib/convert/convert.cc
@@ -14,9 +14,9 @@
const char kHexDigits[] = "0123456789ABCDEF";
}
-fidl::VectorPtr<uint8_t> ExtendedStringView::ToArray() {
- fidl::VectorPtr<uint8_t> result = fidl::VectorPtr<uint8_t>::New(size());
- memcpy(result->data(), data(), size());
+std::vector<uint8_t> ExtendedStringView::ToArray() {
+ std::vector<uint8_t> result(size());
+ memcpy(result.data(), data(), size());
return result;
}
@@ -37,7 +37,7 @@
return result;
}
-fidl::VectorPtr<uint8_t> ToArray(ExtendedStringView value) {
+std::vector<uint8_t> ToArray(ExtendedStringView value) {
return value.ToArray();
}
diff --git a/lib/convert/convert.h b/lib/convert/convert.h
index ceedb29..946528d 100644
--- a/lib/convert/convert.h
+++ b/lib/convert/convert.h
@@ -64,7 +64,7 @@
return leveldb::Slice(data(), size());
}
- fidl::VectorPtr<uint8_t> ToArray();
+ std::vector<uint8_t> ToArray();
flatbuffers::Offset<flatbuffers::Vector<uint8_t>> ToFlatBufferVector(
flatbuffers::FlatBufferBuilder* builder);
@@ -80,8 +80,8 @@
// Returns the representation of the given value in LevelDB.
inline leveldb::Slice ToSlice(ExtendedStringView value) { return value; }
-// Returns the fidl::VectorPtr representation of the given value.
-fidl::VectorPtr<uint8_t> ToArray(ExtendedStringView value);
+// Returns the std::vector representation of the given value.
+std::vector<uint8_t> ToArray(ExtendedStringView value);
// Returns the fidl::Array representation of the given value.
template <size_t N>
diff --git a/lib/convert/convert_unittest.cc b/lib/convert/convert_unittest.cc
index 00084d1..d0e8fa0 100644
--- a/lib/convert/convert_unittest.cc
+++ b/lib/convert/convert_unittest.cc
@@ -10,8 +10,8 @@
namespace convert {
namespace {
-fidl::VectorPtr<uint8_t> CreateArray(const char* data, size_t size) {
- fidl::VectorPtr<uint8_t> result;
+std::vector<uint8_t> CreateArray(const char* data, size_t size) {
+ std::vector<uint8_t> result;
for (size_t i = 0; i < size; ++i) {
result.push_back(data[i]);
}
@@ -23,21 +23,21 @@
leveldb::Slice slice = ToSlice(str);
EXPECT_EQ(str, std::string(slice.data(), slice.size()));
- fidl::VectorPtr<uint8_t> array = CreateArray(str.data(), str.size());
+ std::vector<uint8_t> array = CreateArray(str.data(), str.size());
slice = ToSlice(str);
EXPECT_EQ(str, std::string(slice.data(), slice.size()));
}
TEST(Convert, ToArray) {
std::string str = "Hello";
- fidl::VectorPtr<uint8_t> array = ToArray(str);
+ std::vector<uint8_t> array = ToArray(str);
EXPECT_EQ(str,
- std::string(reinterpret_cast<char*>(array->data()), array->size()));
+ std::string(reinterpret_cast<char*>(array.data()), array.size()));
leveldb::Slice slice(str.data(), str.size());
array = ToArray(slice);
EXPECT_EQ(str,
- std::string(reinterpret_cast<char*>(array->data()), array->size()));
+ std::string(reinterpret_cast<char*>(array.data()), array.size()));
}
TEST(Convert, ToString) {
@@ -46,7 +46,7 @@
std::string result = ToString(slice);
EXPECT_EQ(str, result);
- fidl::VectorPtr<uint8_t> array = ToArray(str);
+ std::vector<uint8_t> array = ToArray(str);
result = ToString(array);
EXPECT_EQ(str, result);
}
@@ -57,7 +57,7 @@
ExtendedStringView result = slice;
EXPECT_EQ(str, result.ToString());
- fidl::VectorPtr<uint8_t> array = ToArray(str);
+ std::vector<uint8_t> array = ToArray(str);
result = array;
EXPECT_EQ(str, result.ToString());
}
diff --git a/lib/environment_host/maxwell_service_provider_bridge.h b/lib/environment_host/maxwell_service_provider_bridge.h
index c743f4f..6b095a9 100644
--- a/lib/environment_host/maxwell_service_provider_bridge.h
+++ b/lib/environment_host/maxwell_service_provider_bridge.h
@@ -19,7 +19,7 @@
MaxwellServiceProviderBridge(fuchsia::sys::Environment* parent_env);
zx::channel OpenAsDirectory();
- const fidl::VectorPtr<fidl::StringPtr>& service_names() {
+ const std::vector<std::string>& service_names() {
return service_names_;
}
@@ -38,7 +38,7 @@
private:
fs::SynchronousVfs vfs_;
fbl::RefPtr<fs::PseudoDir> services_dir_;
- fidl::VectorPtr<fidl::StringPtr> service_names_;
+ std::vector<std::string> service_names_;
};
} // namespace maxwell
diff --git a/lib/fidl/app_client.cc b/lib/fidl/app_client.cc
index ff9a976..bd0c122 100644
--- a/lib/fidl/app_client.cc
+++ b/lib/fidl/app_client.cc
@@ -23,11 +23,10 @@
fuchsia::sys::LaunchInfo launch_info;
launch_info.directory_request = services_.NewRequest();
launch_info.url = config.url;
- fidl::VectorPtr<fidl::StringPtr> args;
+ std::vector<std::string> args;
for (const auto& arg : *config.args) {
- args.push_back(arg);
+ launch_info.arguments.push_back(arg);
}
- launch_info.arguments = std::move(args);
if (!data_origin.empty()) {
if (!files::CreateDirectory(data_origin)) {
@@ -46,7 +45,7 @@
launch_info.flat_namespace->directories.push_back(
fsl::CloneChannelFromFileDescriptor(dir.get()));
- if (!launch_info.flat_namespace->directories->at(0)) {
+ if (!launch_info.flat_namespace->directories.at(0)) {
FXL_LOG(ERROR) << "Unable create a handle from " << data_origin;
return;
}
diff --git a/lib/fidl/app_client_unittest.cc b/lib/fidl/app_client_unittest.cc
index 7951bb9..b79ef95 100644
--- a/lib/fidl/app_client_unittest.cc
+++ b/lib/fidl/app_client_unittest.cc
@@ -129,7 +129,7 @@
fidl::InterfaceRequest<fuchsia::sys::ComponentController> ctrl) {
EXPECT_EQ(kTestUrl, launch_info.url);
auto additional_services = std::move(launch_info.additional_services);
- EXPECT_EQ(kServiceName, additional_services->names->at(0));
+ EXPECT_EQ(kServiceName, additional_services->names.at(0));
callback_called = true;
});
diff --git a/lib/fidl/array_to_string.h b/lib/fidl/array_to_string.h
index fa8467a..d87d094 100644
--- a/lib/fidl/array_to_string.h
+++ b/lib/fidl/array_to_string.h
@@ -21,6 +21,10 @@
return std::string(reinterpret_cast<const char*>(data->data()), data->size());
}
+inline std::string to_string(const std::vector<uint8_t>& data) {
+ return std::string(reinterpret_cast<const char*>(data.data()), data.size());
+}
+
inline std::string to_hex_string(const uint8_t* data, size_t size) {
constexpr char kHexadecimalCharacters[] = "0123456789abcdef";
std::string ret;
diff --git a/lib/fidl/json_xdr_unittest.cc b/lib/fidl/json_xdr_unittest.cc
index ac06f8a..9576ddc 100644
--- a/lib/fidl/json_xdr_unittest.cc
+++ b/lib/fidl/json_xdr_unittest.cc
@@ -479,38 +479,38 @@
EXPECT_EQ(t1, t0) << json;
- EXPECT_EQ(1u, t1.string->size());
- EXPECT_EQ(1u, t1.bool_->size());
- EXPECT_EQ(1u, t1.int8->size());
- EXPECT_EQ(1u, t1.int16->size());
- EXPECT_EQ(1u, t1.int32->size());
- EXPECT_EQ(1u, t1.int64->size());
- EXPECT_EQ(1u, t1.uint8->size());
- EXPECT_EQ(1u, t1.uint16->size());
- EXPECT_EQ(1u, t1.uint32->size());
- EXPECT_EQ(1u, t1.uint64->size());
- EXPECT_EQ(1u, t1.float32->size());
- EXPECT_EQ(1u, t1.float64->size());
- EXPECT_EQ(1u, t1.struct_->size());
- EXPECT_EQ(1u, t1.enum_->size());
- EXPECT_EQ(1u, t1.union_->size());
+ EXPECT_EQ(1u, t1.string.size());
+ EXPECT_EQ(1u, t1.bool_.size());
+ EXPECT_EQ(1u, t1.int8.size());
+ EXPECT_EQ(1u, t1.int16.size());
+ EXPECT_EQ(1u, t1.int32.size());
+ EXPECT_EQ(1u, t1.int64.size());
+ EXPECT_EQ(1u, t1.uint8.size());
+ EXPECT_EQ(1u, t1.uint16.size());
+ EXPECT_EQ(1u, t1.uint32.size());
+ EXPECT_EQ(1u, t1.uint64.size());
+ EXPECT_EQ(1u, t1.float32.size());
+ EXPECT_EQ(1u, t1.float64.size());
+ EXPECT_EQ(1u, t1.struct_.size());
+ EXPECT_EQ(1u, t1.enum_.size());
+ EXPECT_EQ(1u, t1.union_.size());
- EXPECT_EQ("1", t1.string->at(0));
- EXPECT_TRUE(t1.bool_->at(0));
- EXPECT_EQ(2, t1.int8->at(0));
- EXPECT_EQ(3, t1.int16->at(0));
- EXPECT_EQ(4, t1.int32->at(0));
- EXPECT_EQ(5, t1.int64->at(0));
- EXPECT_EQ(6u, t1.uint8->at(0));
- EXPECT_EQ(7u, t1.uint16->at(0));
- EXPECT_EQ(8u, t1.uint32->at(0));
- EXPECT_EQ(9u, t1.uint64->at(0));
- EXPECT_EQ(10.0f, t1.float32->at(0));
- EXPECT_EQ(11.0, t1.float64->at(0));
- EXPECT_EQ(12, t1.struct_->at(0).item);
- EXPECT_EQ(json_xdr_unittest::Enum::ONE, t1.enum_->at(0));
- EXPECT_TRUE(t1.union_->at(0).is_int32());
- EXPECT_EQ(13, t1.union_->at(0).int32());
+ EXPECT_EQ("1", t1.string.at(0));
+ EXPECT_TRUE(t1.bool_.at(0));
+ EXPECT_EQ(2, t1.int8.at(0));
+ EXPECT_EQ(3, t1.int16.at(0));
+ EXPECT_EQ(4, t1.int32.at(0));
+ EXPECT_EQ(5, t1.int64.at(0));
+ EXPECT_EQ(6u, t1.uint8.at(0));
+ EXPECT_EQ(7u, t1.uint16.at(0));
+ EXPECT_EQ(8u, t1.uint32.at(0));
+ EXPECT_EQ(9u, t1.uint64.at(0));
+ EXPECT_EQ(10.0f, t1.float32.at(0));
+ EXPECT_EQ(11.0, t1.float64.at(0));
+ EXPECT_EQ(12, t1.struct_.at(0).item);
+ EXPECT_EQ(json_xdr_unittest::Enum::ONE, t1.enum_.at(0));
+ EXPECT_TRUE(t1.union_.at(0).is_int32());
+ EXPECT_EQ(13, t1.union_.at(0).int32());
}
constexpr XdrFilterType<json_xdr_unittest::RequiredRepeatedOptionalData>
@@ -541,23 +541,23 @@
EXPECT_EQ(t1, t0) << json;
// See comment in FidlRequired.
- EXPECT_EQ(1u, t1.string->size());
- EXPECT_EQ(1u, t1.struct_->size());
- EXPECT_EQ(1u, t1.union_->size());
+ EXPECT_EQ(1u, t1.string.size());
+ EXPECT_EQ(1u, t1.struct_.size());
+ EXPECT_EQ(1u, t1.union_.size());
- EXPECT_FALSE(t1.string->at(0).is_null());
- EXPECT_EQ("1", t1.string->at(0));
+ EXPECT_FALSE(t1.string.at(0).is_null());
+ EXPECT_EQ("1", t1.string.at(0));
- EXPECT_FALSE(nullptr == t1.struct_->at(0));
- EXPECT_EQ(12, t1.struct_->at(0)->item);
+ EXPECT_FALSE(nullptr == t1.struct_.at(0));
+ EXPECT_EQ(12, t1.struct_.at(0)->item);
- EXPECT_FALSE(nullptr == t1.union_->at(0));
- EXPECT_TRUE(t1.union_->at(0)->is_int32());
- EXPECT_EQ(13, t1.union_->at(0)->int32());
+ EXPECT_FALSE(nullptr == t1.union_.at(0));
+ EXPECT_TRUE(t1.union_.at(0)->is_int32());
+ EXPECT_EQ(13, t1.union_.at(0)->int32());
- t1.string->at(0).reset();
- t1.struct_->at(0).reset();
- t1.union_->at(0).reset();
+ t1.string.at(0).reset();
+ t1.struct_.at(0).reset();
+ t1.union_.at(0).reset();
XdrWrite(&json, &t1, XdrRequiredRepeatedOptionalData);
@@ -567,13 +567,13 @@
EXPECT_EQ(t2, t1) << json;
// See comment in FidlRequired.
- EXPECT_EQ(1u, t2.string->size());
- EXPECT_EQ(1u, t2.struct_->size());
- EXPECT_EQ(1u, t2.union_->size());
+ EXPECT_EQ(1u, t2.string.size());
+ EXPECT_EQ(1u, t2.struct_.size());
+ EXPECT_EQ(1u, t2.union_.size());
- EXPECT_TRUE(t2.string->at(0).is_null());
- EXPECT_TRUE(nullptr == t2.struct_->at(0));
- EXPECT_TRUE(nullptr == t2.union_->at(0));
+ EXPECT_TRUE(t2.string.at(0).is_null());
+ EXPECT_TRUE(nullptr == t2.struct_.at(0));
+ EXPECT_TRUE(nullptr == t2.union_.at(0));
}
constexpr XdrFilterType<json_xdr_unittest::OptionalRepeatedRequiredData>
@@ -818,21 +818,23 @@
json_xdr_unittest::ArrayData t0;
- t0.string.at(0) = "1";
- t0.bool_.at(0) = true;
- t0.int8.at(0) = 2;
- t0.int16.at(0) = 3;
- t0.int32.at(0) = 4;
- t0.int64.at(0) = 5;
- t0.uint8.at(0) = 6;
- t0.uint16.at(0) = 7;
- t0.uint32.at(0) = 8;
- t0.uint64.at(0) = 9;
- t0.float32.at(0) = 10;
- t0.float64.at(0) = 11;
- t0.struct_.at(0).item = 12;
- t0.enum_.at(0) = json_xdr_unittest::Enum::ONE;
- t0.union_.at(0).set_int32(13);
+ for (size_t i=0; i<t0.string.size(); i++) {
+ t0.string.at(i) = "1";
+ t0.bool_.at(i) = true;
+ t0.int8.at(i) = 2;
+ t0.int16.at(i) = 3;
+ t0.int32.at(i) = 4;
+ t0.int64.at(i) = 5;
+ t0.uint8.at(i) = 6;
+ t0.uint16.at(i) = 7;
+ t0.uint32.at(i) = 8;
+ t0.uint64.at(i) = 9;
+ t0.float32.at(i) = 10;
+ t0.float64.at(i) = 11;
+ t0.struct_.at(i).item = 12;
+ t0.enum_.at(i) = json_xdr_unittest::Enum::ONE;
+ t0.union_.at(i).set_int32(13);
+ }
XdrWrite(&json, &t0, XdrArrayData);
diff --git a/lib/firebase_auth/testing/fake_token_manager.cc b/lib/firebase_auth/testing/fake_token_manager.cc
index 8f855fa..19666b9 100644
--- a/lib/firebase_auth/testing/fake_token_manager.cc
+++ b/lib/firebase_auth/testing/fake_token_manager.cc
@@ -18,7 +18,7 @@
void FakeTokenManager::Authorize(
AppConfig app_config,
fidl::InterfaceHandle<AuthenticationUIContext> auth_ui_context,
- fidl::VectorPtr<fidl::StringPtr> /*app_scopes*/,
+ std::vector<std::string> /*app_scopes*/,
fidl::StringPtr /*user_profile_id*/, fidl::StringPtr /*auth_code*/,
AuthorizeCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED() << "FakeTokenManager::Authorize not implemented";
@@ -26,25 +26,25 @@
}
void FakeTokenManager::GetAccessToken(
- AppConfig app_config, fidl::StringPtr /*user_profile_id*/,
- fidl::VectorPtr<fidl::StringPtr> /*app_scopes*/,
+ AppConfig app_config, std::string /*user_profile_id*/,
+ std::vector<std::string> /*app_scopes*/,
GetAccessTokenCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED() << "FakeTokenManager::GetAccessToken not implemented";
callback(fuchsia::auth::Status::INTERNAL_ERROR, nullptr);
}
void FakeTokenManager::GetIdToken(AppConfig app_config,
- fidl::StringPtr /*user_profile_id*/,
+ std::string /*user_profile_id*/,
fidl::StringPtr /*audience*/,
GetIdTokenCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED() << "FakeTokenManager::GetIdToken not implemented";
- callback(fuchsia::auth::Status::INTERNAL_ERROR, nullptr);
+ callback(fuchsia::auth::Status::INTERNAL_ERROR, {});
}
void FakeTokenManager::GetFirebaseToken(AppConfig /*app_config*/,
- fidl::StringPtr /*user_profile_id*/,
- fidl::StringPtr /*audience*/,
- fidl::StringPtr /*firebase_api_key*/,
+ std::string /*user_profile_id*/,
+ std::string /*audience*/,
+ std::string /*firebase_api_key*/,
GetFirebaseTokenCallback callback) {
if (firebase_local_id_.empty()) {
callback(fuchsia::auth::Status::OK, nullptr);
@@ -58,7 +58,7 @@
}
void FakeTokenManager::DeleteAllTokens(AppConfig /*app_config*/,
- fidl::StringPtr /*user_profile_id*/,
+ std::string /*user_profile_id*/,
DeleteAllTokensCallback callback) {
FXL_NOTIMPLEMENTED() << "FakeTokenManager::DeleteAllTokens not implemented";
callback(fuchsia::auth::Status::INTERNAL_ERROR);
@@ -67,7 +67,7 @@
void FakeTokenManager::ListProfileIds(AppConfig app_config,
ListProfileIdsCallback callback) {
FXL_NOTIMPLEMENTED() << "FakeTokenManager::ListProifleIds not implemented";
- callback(fuchsia::auth::Status::INTERNAL_ERROR, nullptr);
+ callback(fuchsia::auth::Status::INTERNAL_ERROR, {});
}
} // namespace firebase_auth
diff --git a/lib/firebase_auth/testing/fake_token_manager.h b/lib/firebase_auth/testing/fake_token_manager.h
index 3d2f17e..01394a0 100644
--- a/lib/firebase_auth/testing/fake_token_manager.h
+++ b/lib/firebase_auth/testing/fake_token_manager.h
@@ -33,24 +33,24 @@
// fuchsia::auth::TokenManager:
void Authorize(AppConfig app_config,
fidl::InterfaceHandle<AuthenticationUIContext> auth_ui_context,
- fidl::VectorPtr<fidl::StringPtr> app_scopes,
+ std::vector<std::string> app_scopes,
fidl::StringPtr user_profile_id, fidl::StringPtr auth_code,
AuthorizeCallback callback) override;
- void GetAccessToken(AppConfig app_config, fidl::StringPtr user_profile_id,
- fidl::VectorPtr<fidl::StringPtr> app_scopes,
+ void GetAccessToken(AppConfig app_config, std::string user_profile_id,
+ std::vector<std::string> app_scopes,
GetAccessTokenCallback callback) override;
- void GetIdToken(AppConfig app_config, fidl::StringPtr user_profile_id,
+ void GetIdToken(AppConfig app_config, std::string user_profile_id,
fidl::StringPtr audience,
GetIdTokenCallback callback) override;
- void GetFirebaseToken(AppConfig app_config, fidl::StringPtr user_profile_id,
- fidl::StringPtr audience,
- fidl::StringPtr firebase_api_key,
+ void GetFirebaseToken(AppConfig app_config, std::string user_profile_id,
+ std::string audience,
+ std::string firebase_api_key,
GetFirebaseTokenCallback callback) override;
- void DeleteAllTokens(AppConfig app_config, fidl::StringPtr user_profile_id,
+ void DeleteAllTokens(AppConfig app_config, std::string user_profile_id,
DeleteAllTokensCallback callback) override;
void ListProfileIds(AppConfig app_config,
diff --git a/lib/firebase_auth/testing/service_account_token_manager.cc b/lib/firebase_auth/testing/service_account_token_manager.cc
index 74acb6f..425c6af 100644
--- a/lib/firebase_auth/testing/service_account_token_manager.cc
+++ b/lib/firebase_auth/testing/service_account_token_manager.cc
@@ -38,7 +38,7 @@
void ServiceAccountTokenManager::Authorize(
AppConfig app_config,
fidl::InterfaceHandle<AuthenticationUIContext> auth_ui_context,
- fidl::VectorPtr<fidl::StringPtr> /*app_scopes*/,
+ std::vector<std::string> /*app_scopes*/,
fidl::StringPtr /*user_profile_id*/, fidl::StringPtr /*auth_code*/,
AuthorizeCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED();
@@ -46,23 +46,23 @@
}
void ServiceAccountTokenManager::GetAccessToken(
- AppConfig app_config, fidl::StringPtr /*user_profile_id*/,
- fidl::VectorPtr<fidl::StringPtr> /*app_scopes*/,
+ AppConfig app_config, std::string /*user_profile_id*/,
+ std::vector<std::string> /*app_scopes*/,
GetAccessTokenCallback callback) {
FXL_NOTIMPLEMENTED();
callback(fuchsia::auth::Status::INTERNAL_ERROR /*Not implemented*/, nullptr);
}
void ServiceAccountTokenManager::GetIdToken(
- AppConfig app_config, fidl::StringPtr /*user_profile_id*/,
+ AppConfig app_config, std::string /*user_profile_id*/,
fidl::StringPtr /*audience*/, GetIdTokenCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED();
callback(fuchsia::auth::Status::INTERNAL_ERROR /*Not implemented*/, nullptr);
}
void ServiceAccountTokenManager::GetFirebaseToken(
- AppConfig /*app_config*/, fidl::StringPtr /*user_profile_id*/,
- fidl::StringPtr /*audience*/, fidl::StringPtr firebase_api_key,
+ AppConfig /*app_config*/, std::string /*user_profile_id*/,
+ std::string /*audience*/, std::string firebase_api_key,
GetFirebaseTokenCallback callback) {
service_account_token_minter_.GetFirebaseToken(
std::move(firebase_api_key),
@@ -85,7 +85,7 @@
}
void ServiceAccountTokenManager::DeleteAllTokens(
- AppConfig app_config, fidl::StringPtr /*user_profile_id*/,
+ AppConfig app_config, std::string /*user_profile_id*/,
DeleteAllTokensCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED();
callback(fuchsia::auth::Status::INTERNAL_ERROR /*Not implemented*/);
@@ -94,7 +94,7 @@
void ServiceAccountTokenManager::ListProfileIds(
AppConfig app_config, ListProfileIdsCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED();
- callback(fuchsia::auth::Status::INTERNAL_ERROR /*Not implemented*/, nullptr);
+ callback(fuchsia::auth::Status::INTERNAL_ERROR /*Not implemented*/, {});
}
} // namespace service_account
diff --git a/lib/firebase_auth/testing/service_account_token_manager.h b/lib/firebase_auth/testing/service_account_token_manager.h
index efaa54a..1d7fcfc 100644
--- a/lib/firebase_auth/testing/service_account_token_manager.h
+++ b/lib/firebase_auth/testing/service_account_token_manager.h
@@ -38,24 +38,24 @@
// fuchsia::auth::TokenManager:
void Authorize(AppConfig app_config,
fidl::InterfaceHandle<AuthenticationUIContext> auth_ui_context,
- fidl::VectorPtr<fidl::StringPtr> app_scopes,
+ std::vector<std::string> app_scopes,
fidl::StringPtr user_profile_id, fidl::StringPtr auth_code,
AuthorizeCallback callback) override;
- void GetAccessToken(AppConfig app_config, fidl::StringPtr user_profile_id,
- fidl::VectorPtr<fidl::StringPtr> app_scopes,
+ void GetAccessToken(AppConfig app_config, std::string user_profile_id,
+ std::vector<std::string> app_scopes,
GetAccessTokenCallback callback) override;
- void GetIdToken(AppConfig app_config, fidl::StringPtr user_profile_id,
+ void GetIdToken(AppConfig app_config, std::string user_profile_id,
fidl::StringPtr audience,
GetIdTokenCallback callback) override;
- void GetFirebaseToken(AppConfig app_config, fidl::StringPtr user_profile_id,
- fidl::StringPtr audience,
- fidl::StringPtr firebase_api_key,
+ void GetFirebaseToken(AppConfig app_config, std::string user_profile_id,
+ std::string audience,
+ std::string firebase_api_key,
GetFirebaseTokenCallback callback) override;
- void DeleteAllTokens(AppConfig app_config, fidl::StringPtr user_profile_id,
+ void DeleteAllTokens(AppConfig app_config, std::string user_profile_id,
DeleteAllTokensCallback callback) override;
void ListProfileIds(AppConfig app_config,
diff --git a/lib/firebase_auth/testing/test_token_manager.cc b/lib/firebase_auth/testing/test_token_manager.cc
index 17308f0..dfbc4e4 100644
--- a/lib/firebase_auth/testing/test_token_manager.cc
+++ b/lib/firebase_auth/testing/test_token_manager.cc
@@ -21,30 +21,30 @@
void TestTokenManager::Authorize(
AppConfig app_config,
fidl::InterfaceHandle<AuthenticationUIContext> auth_ui_context,
- fidl::VectorPtr<fidl::StringPtr> /*app_scopes*/,
+ std::vector<std::string> /*app_scopes*/,
fidl::StringPtr /*user_profile_id*/, fidl::StringPtr /*auth_code*/,
AuthorizeCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED();
}
void TestTokenManager::GetAccessToken(
- AppConfig app_config, fidl::StringPtr /*user_profile_id*/,
- fidl::VectorPtr<fidl::StringPtr> /*app_scopes*/,
+ AppConfig app_config, std::string /*user_profile_id*/,
+ std::vector<std::string> /*app_scopes*/,
GetAccessTokenCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED();
}
void TestTokenManager::GetIdToken(AppConfig app_config,
- fidl::StringPtr /*user_profile_id*/,
+ std::string /*user_profile_id*/,
fidl::StringPtr /*audience*/,
GetIdTokenCallback callback /*callback*/) {
FXL_NOTIMPLEMENTED();
}
void TestTokenManager::GetFirebaseToken(AppConfig /*app_config*/,
- fidl::StringPtr /*user_profile_id*/,
- fidl::StringPtr /*audience*/,
- fidl::StringPtr /*firebase_api_key*/,
+ std::string /*user_profile_id*/,
+ std::string /*audience*/,
+ std::string /*firebase_api_key*/,
GetFirebaseTokenCallback callback) {
fuchsia::auth::FirebaseTokenPtr token_to_return_copy;
fidl::Clone(token_to_return_, &token_to_return_copy);
@@ -59,7 +59,7 @@
}
void TestTokenManager::DeleteAllTokens(AppConfig /*app_config*/,
- fidl::StringPtr /*user_profile_id*/,
+ std::string /*user_profile_id*/,
DeleteAllTokensCallback callback) {
FXL_NOTIMPLEMENTED();
}
diff --git a/lib/firebase_auth/testing/test_token_manager.h b/lib/firebase_auth/testing/test_token_manager.h
index f58da31..da9b975 100644
--- a/lib/firebase_auth/testing/test_token_manager.h
+++ b/lib/firebase_auth/testing/test_token_manager.h
@@ -26,24 +26,24 @@
// fuchsia::auth::TokenManager:
void Authorize(AppConfig app_config,
fidl::InterfaceHandle<AuthenticationUIContext> auth_ui_context,
- fidl::VectorPtr<fidl::StringPtr> app_scopes,
+ std::vector<std::string> app_scopes,
fidl::StringPtr user_profile_id, fidl::StringPtr auth_code,
AuthorizeCallback callback) override;
- void GetAccessToken(AppConfig app_config, fidl::StringPtr user_profile_id,
- fidl::VectorPtr<fidl::StringPtr> app_scopes,
+ void GetAccessToken(AppConfig app_config, std::string user_profile_id,
+ std::vector<std::string> app_scopes,
GetAccessTokenCallback callback) override;
- void GetIdToken(AppConfig app_config, fidl::StringPtr user_profile_id,
+ void GetIdToken(AppConfig app_config, std::string user_profile_id,
fidl::StringPtr audience,
GetIdTokenCallback callback) override;
- void GetFirebaseToken(AppConfig app_config, fidl::StringPtr user_profile_id,
- fidl::StringPtr audience,
- fidl::StringPtr firebase_api_key,
+ void GetFirebaseToken(AppConfig app_config, std::string user_profile_id,
+ std::string audience,
+ std::string firebase_api_key,
GetFirebaseTokenCallback callback) override;
- void DeleteAllTokens(AppConfig app_config, fidl::StringPtr user_profile_id,
+ void DeleteAllTokens(AppConfig app_config, std::string user_profile_id,
DeleteAllTokensCallback callback) override;
void ListProfileIds(AppConfig app_config,
diff --git a/lib/ledger_client/ledger_client.cc b/lib/ledger_client/ledger_client.cc
index 782b1ea..1e902d7 100644
--- a/lib/ledger_client/ledger_client.cc
+++ b/lib/ledger_client/ledger_client.cc
@@ -27,7 +27,7 @@
PageClient::Conflict ToConflict(const fuchsia::ledger::DiffEntry* entry) {
PageClient::Conflict conflict;
- conflict.key = entry->key.Clone();
+ conflict.key = entry->key;
if (entry->left) {
conflict.has_left = true;
std::string value;
@@ -61,9 +61,9 @@
fit::closure callback) {
auto cont = [result_provider, conflicts, callback = std::move(callback)](
fuchsia::ledger::IterationStatus status,
- fidl::VectorPtr<fuchsia::ledger::DiffEntry> change_delta,
+ std::vector<fuchsia::ledger::DiffEntry> change_delta,
LedgerToken token) mutable {
- for (auto& diff_entry : *change_delta) {
+ for (auto& diff_entry : change_delta) {
(*conflicts)[to_string(diff_entry.key)] = ToConflict(&diff_entry);
}
@@ -157,7 +157,7 @@
for (auto& pair : conflicts_) {
const PageClient::Conflict& conflict = pair.second;
- fidl::VectorPtr<fuchsia::ledger::MergedValue> merge_changes;
+ std::vector<fuchsia::ledger::MergedValue> merge_changes;
if (conflict.has_left && conflict.has_right) {
for (PageClient* const page_client : page_clients) {
@@ -166,7 +166,7 @@
if (pair.second.resolution != PageClient::LEFT) {
fuchsia::ledger::MergedValue merged_value;
- merged_value.key = conflict.key.Clone();
+ merged_value.key = conflict.key;
if (pair.second.resolution == PageClient::RIGHT) {
merged_value.source = fuchsia::ledger::ValueSource::RIGHT;
} else {
@@ -198,7 +198,7 @@
}
}
- if (!merge_changes->empty()) {
+ if (!merge_changes.empty()) {
result_provider_->MergeNew(std::move(merge_changes));
}
}
diff --git a/lib/ledger_client/operations.h b/lib/ledger_client/operations.h
index 2caae06..2af0227 100644
--- a/lib/ledger_client/operations.h
+++ b/lib/ledger_client/operations.h
@@ -188,7 +188,7 @@
FXL_DISALLOW_COPY_AND_ASSIGN(ReadDataCall);
};
-template <typename Data, typename DataArray = fidl::VectorPtr<Data>,
+template <typename Data, typename DataArray = std::vector<Data>,
typename DataFilter = XdrFilterList<Data>>
class ReadAllDataCall : public PageOperation<DataArray> {
public:
diff --git a/lib/ledger_client/page_client.cc b/lib/ledger_client/page_client.cc
index d91f5c5..e75ae85 100644
--- a/lib/ledger_client/page_client.cc
+++ b/lib/ledger_client/page_client.cc
@@ -58,15 +58,12 @@
void PageClient::OnChange(fuchsia::ledger::PageChange page,
fuchsia::ledger::ResultState result_state,
OnChangeCallback callback) {
- // According to their fidl spec, neither page nor page->changed_entries
- // should be null.
- FXL_DCHECK(page.changed_entries);
- for (auto& entry : *page.changed_entries) {
+ for (auto& entry : page.changed_entries) {
// Remove key prefix maybe?
OnPageChange(to_string(entry.key), std::move(entry.value));
}
- for (auto& key : *page.deleted_keys) {
+ for (auto& key : page.deleted_keys) {
OnPageDelete(to_string(key));
}
@@ -102,7 +99,7 @@
std::unique_ptr<fuchsia::ledger::Token> next_token,
std::function<void(fuchsia::ledger::Status)> done) {
snapshot->GetEntries(
- fidl::VectorPtr<uint8_t>::New(0) /* key_start */, std::move(next_token),
+ std::vector<uint8_t>{} /* key_start */, std::move(next_token),
fxl::MakeCopyable([snapshot, entries, done = std::move(done)](
fuchsia::ledger::Status status, auto new_entries,
auto next_token) mutable {
@@ -112,8 +109,8 @@
return;
}
- for (size_t i = 0; i < new_entries->size(); ++i) {
- entries->push_back(std::move(new_entries->at(i)));
+ for (size_t i = 0; i < new_entries.size(); ++i) {
+ entries->push_back(std::move(new_entries.at(i)));
}
if (status == fuchsia::ledger::Status::OK) {
diff --git a/lib/ledger_client/page_client.h b/lib/ledger_client/page_client.h
index 05ea448..81785aa 100644
--- a/lib/ledger_client/page_client.h
+++ b/lib/ledger_client/page_client.h
@@ -81,7 +81,7 @@
// The argument to OnPageConflict(). It's mutated in place so it's easier to
// extend without having to alter clients.
struct Conflict {
- fidl::VectorPtr<uint8_t> key;
+ std::vector<uint8_t> key;
bool has_left{};
std::string left;
diff --git a/lib/ledger_client/promise.h b/lib/ledger_client/promise.h
index 23f3fa9..6cf14d6 100644
--- a/lib/ledger_client/promise.h
+++ b/lib/ledger_client/promise.h
@@ -134,7 +134,7 @@
if (value) {
// Convert the result to a unique_ptr instead of a VectorPtr.
auto ret =
- std::make_unique<std::vector<uint8_t>>(value->value.take());
+ std::make_unique<std::vector<uint8_t>>(value->value);
completer.complete_ok(std::move(ret));
} else {
completer.complete_ok(nullptr);
diff --git a/lib/module_manifest/module_facet_reader_impl_unittest.cc b/lib/module_manifest/module_facet_reader_impl_unittest.cc
index eba0d1b..840bcd5 100644
--- a/lib/module_manifest/module_facet_reader_impl_unittest.cc
+++ b/lib/module_manifest/module_facet_reader_impl_unittest.cc
@@ -93,10 +93,10 @@
private:
// |fuchsia::sys::Loader|
- void LoadUrl(fidl::StringPtr url, LoadUrlCallback cb) {
- if (load_info_.find(url.get()) != load_info_.end()) {
- auto retval = std::move(load_info_[url.get()]);
- load_info_.erase(url.get());
+ void LoadUrl(std::string url, LoadUrlCallback cb) {
+ if (load_info_.find(url) != load_info_.end()) {
+ auto retval = std::move(load_info_[url]);
+ load_info_.erase(url);
cb(std::move(retval));
} else {
diff --git a/lib/module_manifest/module_manifest_xdr_unittest.cc b/lib/module_manifest/module_manifest_xdr_unittest.cc
index 4815a28..3566c76 100644
--- a/lib/module_manifest/module_manifest_xdr_unittest.cc
+++ b/lib/module_manifest/module_manifest_xdr_unittest.cc
@@ -14,9 +14,9 @@
EXPECT_EQ("suggestion_headline", m.suggestion_headline);
EXPECT_EQ(1u, m.intent_filters->size());
- EXPECT_EQ(1u, m.intent_filters->at(0).parameter_constraints->size());
- EXPECT_EQ("name", m.intent_filters->at(0).parameter_constraints->at(0).name);
- EXPECT_EQ("type", m.intent_filters->at(0).parameter_constraints->at(0).type);
+ EXPECT_EQ(1u, m.intent_filters->at(0).parameter_constraints.size());
+ EXPECT_EQ("name", m.intent_filters->at(0).parameter_constraints.at(0).name);
+ EXPECT_EQ("type", m.intent_filters->at(0).parameter_constraints.at(0).type);
}
// Tests version 4 of the manifest
diff --git a/lib/module_manifest_source/module_package_source.cc b/lib/module_manifest_source/module_package_source.cc
index 591abe2..d848c64 100644
--- a/lib/module_manifest_source/module_package_source.cc
+++ b/lib/module_manifest_source/module_package_source.cc
@@ -45,15 +45,15 @@
ModulePackageSource::~ModulePackageSource() {}
-void ModulePackageSource::IndexManifest(fidl::StringPtr package_name,
- fidl::StringPtr module_manifest_path) {
+void ModulePackageSource::IndexManifest(std::string package_name,
+ std::string module_manifest_path) {
FXL_DCHECK(dispatcher_);
FXL_DCHECK(new_entry_fn_);
std::string data;
- if (!files::ReadFileToString(module_manifest_path.get(), &data)) {
+ if (!files::ReadFileToString(module_manifest_path, &data)) {
FXL_LOG(ERROR) << "Couldn't read module manifest from: "
- << module_manifest_path.get();
+ << module_manifest_path;
return;
}
diff --git a/lib/module_manifest_source/module_package_source.h b/lib/module_manifest_source/module_package_source.h
index e1d8e22..5e1f6a5 100644
--- a/lib/module_manifest_source/module_package_source.h
+++ b/lib/module_manifest_source/module_package_source.h
@@ -34,8 +34,8 @@
private:
// |ModulePackageIndexer|
- void IndexManifest(fidl::StringPtr package_name,
- fidl::StringPtr module_manifest_path) override;
+ void IndexManifest(std::string package_name,
+ std::string module_manifest_path) override;
const std::string dir_;
NewEntryFn new_entry_fn_;
diff --git a/lib/rapidjson/rapidjson.h b/lib/rapidjson/rapidjson.h
index 3f7ad3d..dd4e9e6 100644
--- a/lib/rapidjson/rapidjson.h
+++ b/lib/rapidjson/rapidjson.h
@@ -68,7 +68,7 @@
const Doc& doc, const Collection& path) {
rapidjson::GenericPointer<typename Doc::ValueType> pointer;
for (const auto& it : path) {
- pointer = pointer.Append(it.get(), nullptr);
+ pointer = pointer.Append(it, nullptr);
}
return pointer;
}
diff --git a/lib/testing/component_context_fake.cc b/lib/testing/component_context_fake.cc
index 17d0911..ed15150 100644
--- a/lib/testing/component_context_fake.cc
+++ b/lib/testing/component_context_fake.cc
@@ -23,7 +23,7 @@
}
void ComponentContextFake::ConnectToAgent(
- fidl::StringPtr url,
+ std::string url,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider>
incoming_services_request,
fidl::InterfaceRequest<fuchsia::modular::AgentController>
@@ -32,17 +32,17 @@
}
void ComponentContextFake::ObtainMessageQueue(
- fidl::StringPtr name,
+ std::string name,
fidl::InterfaceRequest<fuchsia::modular::MessageQueue> request) {
FXL_NOTIMPLEMENTED();
}
-void ComponentContextFake::DeleteMessageQueue(fidl::StringPtr name) {
+void ComponentContextFake::DeleteMessageQueue(std::string name) {
FXL_NOTIMPLEMENTED();
}
void ComponentContextFake::GetMessageSender(
- fidl::StringPtr queue_token,
+ std::string queue_token,
fidl::InterfaceRequest<fuchsia::modular::MessageSender> request) {
FXL_NOTIMPLEMENTED();
}
@@ -53,7 +53,7 @@
}
void ComponentContextFake::CreateEntityWithData(
- fidl::VectorPtr<fuchsia::modular::TypeToDataEntry> type_to_data,
+ std::vector<fuchsia::modular::TypeToDataEntry> type_to_data,
CreateEntityWithDataCallback result) {
FXL_NOTIMPLEMENTED();
}
diff --git a/lib/testing/component_context_fake.h b/lib/testing/component_context_fake.h
index db1e9e0..6cad271 100644
--- a/lib/testing/component_context_fake.h
+++ b/lib/testing/component_context_fake.h
@@ -44,7 +44,7 @@
fidl::InterfaceRequest<fuchsia::ledger::Ledger> request) override;
// |fuchsia::modular::ComponentContext|
- void ConnectToAgent(fidl::StringPtr url,
+ void ConnectToAgent(std::string url,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider>
incoming_services_request,
fidl::InterfaceRequest<fuchsia::modular::AgentController>
@@ -52,15 +52,15 @@
// |fuchsia::modular::ComponentContext|
void ObtainMessageQueue(
- fidl::StringPtr name,
+ std::string name,
fidl::InterfaceRequest<fuchsia::modular::MessageQueue> request) override;
// |fuchsia::modular::ComponentContext|
- void DeleteMessageQueue(fidl::StringPtr name) override;
+ void DeleteMessageQueue(std::string name) override;
// |fuchsia::modular::ComponentContext|
void GetMessageSender(
- fidl::StringPtr queue_token,
+ std::string queue_token,
fidl::InterfaceRequest<fuchsia::modular::MessageSender> request) override;
// |fuchsia::modular::ComponentContext|
@@ -70,7 +70,7 @@
// |fuchsia::modular::ComponentContext|
void CreateEntityWithData(
- fidl::VectorPtr<fuchsia::modular::TypeToDataEntry> type_to_data,
+ std::vector<fuchsia::modular::TypeToDataEntry> type_to_data,
CreateEntityWithDataCallback result) override;
// |fuchsia::modular::ComponentContext|
diff --git a/lib/testing/entity_resolver_fake.cc b/lib/testing/entity_resolver_fake.cc
index ae46372..a8bc2af 100644
--- a/lib/testing/entity_resolver_fake.cc
+++ b/lib/testing/entity_resolver_fake.cc
@@ -20,7 +20,7 @@
private:
// |fuchsia::modular::Entity|
void GetTypes(GetTypesCallback callback) override {
- fidl::VectorPtr<fidl::StringPtr> types;
+ std::vector<std::string> types;
for (const auto& entry : types_and_data_) {
types.push_back(entry.first);
}
@@ -28,7 +28,7 @@
}
// |fuchsia::modular::Entity|
- void GetData(fidl::StringPtr type, GetDataCallback callback) override {
+ void GetData(std::string type, GetDataCallback callback) override {
auto it = types_and_data_.find(type);
if (it == types_and_data_.end()) {
callback(nullptr);
@@ -43,7 +43,7 @@
}
// |fuchsia::modular::Entity|
- void WriteData(fidl::StringPtr type, fuchsia::mem::Buffer data,
+ void WriteData(std::string type, fuchsia::mem::Buffer data,
WriteDataCallback callback) override {
// TODO(rosswang)
callback(fuchsia::modular::EntityWriteStatus::READ_ONLY);
@@ -57,7 +57,7 @@
// |fuchsia::modular::Entity|
void Watch(
- fidl::StringPtr type,
+ std::string type,
fidl::InterfaceHandle<fuchsia::modular::EntityWatcher> watcher) override {
// TODO(MI4-1301)
FXL_NOTIMPLEMENTED();
@@ -89,7 +89,7 @@
}
void EntityResolverFake::ResolveEntity(
- fidl::StringPtr entity_reference,
+ std::string entity_reference,
fidl::InterfaceRequest<fuchsia::modular::Entity> entity_request) {
auto it = entities_.find(entity_reference);
if (it == entities_.end()) {
diff --git a/lib/testing/entity_resolver_fake.h b/lib/testing/entity_resolver_fake.h
index 8ac6482..82e353c 100644
--- a/lib/testing/entity_resolver_fake.h
+++ b/lib/testing/entity_resolver_fake.h
@@ -34,7 +34,7 @@
class EntityImpl;
void ResolveEntity(
- fidl::StringPtr entity_reference,
+ std::string entity_reference,
fidl::InterfaceRequest<fuchsia::modular::Entity> entity_request) override;
int next_entity_id_{0};
diff --git a/lib/testing/module_resolver_fake.cc b/lib/testing/module_resolver_fake.cc
index d935cc9..12125f4 100644
--- a/lib/testing/module_resolver_fake.cc
+++ b/lib/testing/module_resolver_fake.cc
@@ -24,7 +24,7 @@
callback(std::move(find_modules_response_));
}
-void ModuleResolverFake::GetModuleManifest(fidl::StringPtr module_id,
+void ModuleResolverFake::GetModuleManifest(std::string module_id,
GetModuleManifestCallback callback) {
if (get_module_manifest_validate_fn_) {
get_module_manifest_validate_fn_(module_id);
diff --git a/lib/testing/module_resolver_fake.h b/lib/testing/module_resolver_fake.h
index 21191d0..73b967e 100644
--- a/lib/testing/module_resolver_fake.h
+++ b/lib/testing/module_resolver_fake.h
@@ -20,7 +20,7 @@
FindModulesCallback callback) override;
// |ModuleResolver|
- void GetModuleManifest(fidl::StringPtr module_id,
+ void GetModuleManifest(std::string module_id,
GetModuleManifestCallback callback) override;
// |ModuleResolver|
diff --git a/lib/testing/story_controller_mock.h b/lib/testing/story_controller_mock.h
index 2bd5669..0230aa8 100644
--- a/lib/testing/story_controller_mock.h
+++ b/lib/testing/story_controller_mock.h
@@ -66,7 +66,7 @@
// |fuchsia::modular::StoryController|
void GetModuleController(
- fidl::VectorPtr<fidl::StringPtr> module_path,
+ std::vector<std::string> module_path,
fidl::InterfaceRequest<fuchsia::modular::ModuleController> request)
override {
FXL_NOTIMPLEMENTED();
diff --git a/lib/testing/story_provider_mock.h b/lib/testing/story_provider_mock.h
index a49da74..b799712 100644
--- a/lib/testing/story_provider_mock.h
+++ b/lib/testing/story_provider_mock.h
@@ -48,8 +48,7 @@
void GetStories(
fidl::InterfaceHandle<fuchsia::modular::StoryProviderWatcher> watcher,
GetStoriesCallback callback) override {
- fidl::VectorPtr<fuchsia::modular::StoryInfo> stories;
- stories.resize(0);
+ std::vector<fuchsia::modular::StoryInfo> stories;
callback(std::move(stories));
}
@@ -67,13 +66,13 @@
}
// |fuchsia::modular::StoryProvider|
- void GetStoryInfo(fidl::StringPtr story_id,
+ void GetStoryInfo(std::string story_id,
GetStoryInfoCallback callback) override {
callback(nullptr);
}
// |fuchsia::modular::StoryProvider|
- void GetController(fidl::StringPtr story_id,
+ void GetController(std::string story_id,
fidl::InterfaceRequest<fuchsia::modular::StoryController>
story) override {
binding_set_.AddBinding(&controller_mock_, std::move(story));
@@ -81,7 +80,7 @@
// |fuchsia::modular::StoryProvider|
void PreviousStories(PreviousStoriesCallback callback) override {
- callback(fidl::VectorPtr<fuchsia::modular::StoryInfo>::New(0));
+ callback(std::vector<fuchsia::modular::StoryInfo>());
}
std::string last_created_story_;
diff --git a/public/lib/agent/cpp/agent_impl.cc b/public/lib/agent/cpp/agent_impl.cc
index 4afb9c3..5fbd0e1 100644
--- a/public/lib/agent/cpp/agent_impl.cc
+++ b/public/lib/agent/cpp/agent_impl.cc
@@ -30,13 +30,13 @@
// |fuchsia::modular::Agent|
void AgentImpl::Connect(
- fidl::StringPtr requestor_url,
+ std::string requestor_url,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider> services_request) {
delegate_->Connect(std::move(services_request));
}
// |fuchsia::modular::Agent|
-void AgentImpl::RunTask(fidl::StringPtr task_id, RunTaskCallback callback) {
+void AgentImpl::RunTask(std::string task_id, RunTaskCallback callback) {
delegate_->RunTask(task_id, callback);
}
diff --git a/public/lib/agent/cpp/agent_impl.h b/public/lib/agent/cpp/agent_impl.h
index 0315a8d..93bc403 100644
--- a/public/lib/agent/cpp/agent_impl.h
+++ b/public/lib/agent/cpp/agent_impl.h
@@ -36,11 +36,11 @@
private:
// |fuchsia::modular::Agent|
- void Connect(fidl::StringPtr requestor_url,
+ void Connect(std::string requestor_url,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider>
services_request) override;
// |fuchsia::modular::Agent|
- void RunTask(fidl::StringPtr task_id, RunTaskCallback callback) override;
+ void RunTask(std::string task_id, RunTaskCallback callback) override;
Delegate* const delegate_;
fidl::Binding<fuchsia::modular::Agent> binding_;
diff --git a/public/lib/context/cpp/context_helper.cc b/public/lib/context/cpp/context_helper.cc
index a47b864..ae71e81 100644
--- a/public/lib/context/cpp/context_helper.cc
+++ b/public/lib/context/cpp/context_helper.cc
@@ -6,9 +6,9 @@
namespace modular {
-std::optional<fidl::VectorPtr<fuchsia::modular::ContextValue>> TakeContextValue(
+std::optional<std::vector<fuchsia::modular::ContextValue>> TakeContextValue(
fuchsia::modular::ContextUpdate* const update, const std::string& key) {
- for (auto& it : update->values.take()) {
+ for (auto& it : update->values) {
if (it.key == key) {
return std::move(it.value);
}
@@ -27,7 +27,7 @@
bool HasSelectorKey(fuchsia::modular::ContextQuery* const query,
const std::string& key) {
- for (auto& it : *query->selector) {
+ for (auto& it : query->selector) {
if (it.key == key) {
return true;
}
diff --git a/public/lib/context/cpp/context_helper.h b/public/lib/context/cpp/context_helper.h
index 3c5e769..ba1600c 100644
--- a/public/lib/context/cpp/context_helper.h
+++ b/public/lib/context/cpp/context_helper.h
@@ -14,7 +14,7 @@
// Takes a single value specified by |key| from |update|, and sets
// |update.values| to null."
-std::optional<fidl::VectorPtr<fuchsia::modular::ContextValue>> TakeContextValue(
+std::optional<std::vector<fuchsia::modular::ContextValue>> TakeContextValue(
fuchsia::modular::ContextUpdate* update, const std::string& key);
void AddToContextQuery(fuchsia::modular::ContextQuery* query,
diff --git a/public/lib/context/cpp/context_metadata_builder.cc b/public/lib/context/cpp/context_metadata_builder.cc
index bc13e78..8b56273 100644
--- a/public/lib/context/cpp/context_metadata_builder.cc
+++ b/public/lib/context/cpp/context_metadata_builder.cc
@@ -34,8 +34,8 @@
return *this;
}
ContextMetadataBuilder& ContextMetadataBuilder::SetModulePath(
- const fidl::VectorPtr<fidl::StringPtr>& path) {
- fidl::Clone(path, &ModuleMetadata()->path);
+ const std::vector<std::string>& path) {
+ ModuleMetadata()->path.reset(path);
return *this;
}
@@ -59,14 +59,14 @@
return *this;
}
ContextMetadataBuilder& ContextMetadataBuilder::SetEntityTypes(
- const fidl::VectorPtr<fidl::StringPtr>& types) {
- fidl::Clone(types, &EntityMetadata()->type);
+ const std::vector<std::string>& types) {
+ EntityMetadata()->type.reset(types);
return *this;
}
ContextMetadataBuilder& ContextMetadataBuilder::SetLinkPath(
- const fidl::VectorPtr<fidl::StringPtr>& module_path,
- const fidl::StringPtr& name) {
- fidl::Clone(module_path, &LinkMetadata()->module_path);
+ const std::vector<std::string>& module_path,
+ const std::string& name) {
+ LinkMetadata()->module_path.reset(module_path);
LinkMetadata()->name = name;
return *this;
}
diff --git a/public/lib/context/cpp/context_metadata_builder.h b/public/lib/context/cpp/context_metadata_builder.h
index 882d367..ebb3263 100644
--- a/public/lib/context/cpp/context_metadata_builder.h
+++ b/public/lib/context/cpp/context_metadata_builder.h
@@ -20,17 +20,17 @@
ContextMetadataBuilder& SetModuleUrl(const fidl::StringPtr& url);
ContextMetadataBuilder& SetModulePath(
- const fidl::VectorPtr<fidl::StringPtr>& path);
+ const std::vector<std::string>& path);
ContextMetadataBuilder& SetModuleFocused(bool focused);
ContextMetadataBuilder& SetEntityTopic(const fidl::StringPtr& topic);
ContextMetadataBuilder& AddEntityType(const fidl::StringPtr& type);
ContextMetadataBuilder& SetEntityTypes(
- const fidl::VectorPtr<fidl::StringPtr>& types);
+ const std::vector<std::string>& types);
ContextMetadataBuilder& SetLinkPath(
- const fidl::VectorPtr<fidl::StringPtr>& module_path,
- const fidl::StringPtr& name);
+ const std::vector<std::string>& module_path,
+ const std::string& name);
// Build() or BuildPtr() can be called only once, as they move |m_|.
fuchsia::modular::ContextMetadata Build();
diff --git a/public/lib/context/cpp/formatting.cc b/public/lib/context/cpp/formatting.cc
index 9ed5c42..0633903 100644
--- a/public/lib/context/cpp/formatting.cc
+++ b/public/lib/context/cpp/formatting.cc
@@ -62,10 +62,10 @@
std::ostream& operator<<(std::ostream& os, const ContextUpdate& update) {
os << "{" << std::endl;
- for (auto it = update.values->begin(); it != update.values->end(); ++it) {
+ for (auto it = update.values.begin(); it != update.values.end(); ++it) {
os << " " << (*it).key << ":" << std::endl;
int i = 0;
- for (const auto& v : *(*it).value) {
+ for (const auto& v : (*it).value) {
os << " [" << i++ << "]: " << v;
}
}
@@ -75,7 +75,7 @@
std::ostream& operator<<(std::ostream& os, const ContextQuery& query) {
os << "{" << std::endl;
- for (auto it = query.selector->begin(); it != query.selector->end(); ++it) {
+ for (auto it = query.selector.begin(); it != query.selector.end(); ++it) {
os << " " << (*it).key << ": " << (*it).value;
}
os << "}";
diff --git a/public/lib/module_resolver/cpp/formatting.cc b/public/lib/module_resolver/cpp/formatting.cc
index 3be3bac..87e1184 100644
--- a/public/lib/module_resolver/cpp/formatting.cc
+++ b/public/lib/module_resolver/cpp/formatting.cc
@@ -28,7 +28,7 @@
} else if (parameter_data.is_entity_reference()) {
os << "[ref: " << parameter_data.entity_reference() << "]";
} else if (parameter_data.is_entity_type()) {
- for (const auto& type : *parameter_data.entity_type()) {
+ for (const auto& type : parameter_data.entity_type()) {
os << type << ", ";
}
}
diff --git a/tests/benchmarks/story/modular_benchmark_story_session_shell.cc b/tests/benchmarks/story/modular_benchmark_story_session_shell.cc
index 5b4db09..1e249a0 100644
--- a/tests/benchmarks/story/modular_benchmark_story_session_shell.cc
+++ b/tests/benchmarks/story/modular_benchmark_story_session_shell.cc
@@ -89,7 +89,7 @@
void OnModuleAdded(fuchsia::modular::ModuleData module_data) override {}
// |fuchsia::modular::StoryWatcher|
- void OnModuleFocused(fidl::VectorPtr<fidl::StringPtr> module_path) override {}
+ void OnModuleFocused(std::vector<std::string> module_path) override {}
fidl::Binding<fuchsia::modular::StoryWatcher> binding_;
@@ -185,7 +185,7 @@
std::string story_name = std::string(kStoryNamePrefix) + std::to_string(story_count_);
puppet_master_->ControlStory(story_name, story_puppet_master_.NewRequest());
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
fuchsia::modular::AddMod add_mod;
add_mod.mod_name.push_back("root");
add_mod.intent.handler = settings_.module_url;
@@ -219,7 +219,7 @@
FXL_LOG(INFO) << "Link()";
fuchsia::modular::LinkPath link_path = fuchsia::modular::LinkPath();
- fidl::VectorPtr<fidl::StringPtr> root_module_path;
+ std::vector<std::string> root_module_path;
root_module_path.push_back(modular::kRootModuleName);
link_path.module_path = std::move(root_module_path);
link_path.link_name = nullptr;
diff --git a/tests/common/common_null_module.cmx b/tests/common/common_null_module.cmx
index c89d06b..0a98241 100644
--- a/tests/common/common_null_module.cmx
+++ b/tests/common/common_null_module.cmx
@@ -13,6 +13,7 @@
"facets": {
"fuchsia.module": {
"@version": 2,
+ "binary": "bin/app",
"composition_pattern": "ticker",
"intent_filters": [
{
diff --git a/tests/component_context/component_context_test_one_agent.cc b/tests/component_context/component_context_test_one_agent.cc
index 950160b..e9dcc4b 100644
--- a/tests/component_context/component_context_test_one_agent.cc
+++ b/tests/component_context/component_context_test_one_agent.cc
@@ -68,12 +68,12 @@
private:
// |Agent1Interface|
- void SendToMessageQueue(fidl::StringPtr message_queue_token,
- fidl::StringPtr message_to_send) override {
+ void SendToMessageQueue(std::string message_queue_token,
+ std::string message_to_send) override {
modular::MessageSenderClient message_sender;
component_context_->GetMessageSender(message_queue_token,
message_sender.NewRequest());
- message_sender.Send(message_to_send.get());
+ message_sender.Send(message_to_send);
}
fuchsia::modular::ComponentContextPtr component_context_;
diff --git a/tests/embed_shell/embed_shell_test_story_shell.cc b/tests/embed_shell/embed_shell_test_story_shell.cc
index c1e87b0..3e6cd4f 100644
--- a/tests/embed_shell/embed_shell_test_story_shell.cc
+++ b/tests/embed_shell/embed_shell_test_story_shell.cc
@@ -59,25 +59,25 @@
}
// |fuchsia::modular::StoryShell|
- void FocusSurface(fidl::StringPtr /*surface_id*/) override {}
+ void FocusSurface(std::string /*surface_id*/) override {}
// |fuchsia::modular::StoryShell|
- void DefocusSurface(fidl::StringPtr /*surface_id*/,
+ void DefocusSurface(std::string /*surface_id*/,
DefocusSurfaceCallback callback) override {
callback();
}
// |fuchsia::modular::StoryShell|
void AddContainer(
- fidl::StringPtr /*container_name*/, fidl::StringPtr /*parent_id*/,
+ std::string /*container_name*/, fidl::StringPtr /*parent_id*/,
fuchsia::modular::SurfaceRelation /*relation*/,
- fidl::VectorPtr<fuchsia::modular::ContainerLayout> /*layout*/,
- fidl::VectorPtr<
+ std::vector<fuchsia::modular::ContainerLayout> /*layout*/,
+ std::vector<
fuchsia::modular::ContainerRelationEntry> /* relationships */,
- fidl::VectorPtr<fuchsia::modular::ContainerView> /* views */) override {}
+ std::vector<fuchsia::modular::ContainerView> /* views */) override {}
// |fuchsia::modular::StoryShell|
- void RemoveSurface(fidl::StringPtr /*surface_id*/) override {}
+ void RemoveSurface(std::string /*surface_id*/) override {}
// |fuchsia::modular::StoryShell|
void ReconnectView(fuchsia::modular::ViewConnection view_connection) override {}
diff --git a/tests/intents/intent_test_parent_module.cc b/tests/intents/intent_test_parent_module.cc
index da74b29..05a2acd 100644
--- a/tests/intents/intent_test_parent_module.cc
+++ b/tests/intents/intent_test_parent_module.cc
@@ -147,7 +147,7 @@
// the handler will be given the link name in its own namespace, in this
// case first_parameter_name.
path.link_name = "does_not_matter_either";
- fidl::VectorPtr<fidl::StringPtr> module_path;
+ std::vector<std::string> module_path;
module_path.push_back("nor_does_this_matter");
path.module_path = std::move(module_path);
intent_parameter2.data.set_link_path(std::move(path));
diff --git a/tests/last_focus_time/last_focus_time_test_session_shell.cc b/tests/last_focus_time/last_focus_time_test_session_shell.cc
index 4de1a82..849df8e 100644
--- a/tests/last_focus_time/last_focus_time_test_session_shell.cc
+++ b/tests/last_focus_time/last_focus_time_test_session_shell.cc
@@ -115,7 +115,7 @@
// |fuchsia::modular::StoryWatcher|
void OnModuleFocused(
- fidl::VectorPtr<fidl::StringPtr> /*module_path*/) override {}
+ std::vector<std::string> /*module_path*/) override {}
fidl::Binding<fuchsia::modular::StoryWatcher> binding_;
std::function<void()> continue_;
@@ -178,8 +178,8 @@
add_mod.intent.handler = kCommonNullModule;
add_mod.intent.action = kCommonNullAction;
- auto commands = fidl::VectorPtr<fuchsia::modular::StoryCommand>::New(1);
- commands->at(0).set_add_mod(std::move(add_mod));
+ std::vector<fuchsia::modular::StoryCommand> commands(1);
+ commands.at(0).set_add_mod(std::move(add_mod));
story_puppet_master_->Enqueue(std::move(commands));
story_puppet_master_->Execute(
diff --git a/tests/link_context_entities/link_context_entities_test_module.cc b/tests/link_context_entities/link_context_entities_test_module.cc
index 845c138..3189dc4 100644
--- a/tests/link_context_entities/link_context_entities_test_module.cc
+++ b/tests/link_context_entities/link_context_entities_test_module.cc
@@ -49,7 +49,7 @@
private:
void SetLink(fuchsia::modular::Link* link,
- fidl::VectorPtr<fidl::StringPtr> path,
+ fidl::VectorPtr<std::string> path,
const std::string& value) {
fsl::SizedVmo vmo;
FXL_CHECK(fsl::VmoFromString(value, &vmo));
diff --git a/tests/link_context_entities/link_context_entities_test_session_shell.cc b/tests/link_context_entities/link_context_entities_test_session_shell.cc
index 195bad0..bd9223e 100644
--- a/tests/link_context_entities/link_context_entities_test_session_shell.cc
+++ b/tests/link_context_entities/link_context_entities_test_session_shell.cc
@@ -69,7 +69,7 @@
void OnContextUpdate(fuchsia::modular::ContextUpdate update) override {
FXL_LOG(INFO) << "ContextListenerImpl::OnUpdate()";
if (auto values = modular::TakeContextValue(&update, "all")) {
- for (const auto& value : **values) {
+ for (const auto& value : *values) {
FXL_LOG(INFO) << "ContextListenerImpl::OnUpdate() " << value;
handler_(value);
}
@@ -111,7 +111,7 @@
void CreateStory() {
puppet_master_->ControlStory(kStoryName, story_puppet_master_.NewRequest());
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
fuchsia::modular::AddMod add_mod;
add_mod.mod_name.push_back("root");
add_mod.intent.handler = kModuleUrl;
diff --git a/tests/link_data/link_data_test_module1.cc b/tests/link_data/link_data_test_module1.cc
index 707f12a..e75362c 100644
--- a/tests/link_data/link_data_test_module1.cc
+++ b/tests/link_data/link_data_test_module1.cc
@@ -78,7 +78,7 @@
modular::ModuleHost* const module_host_;
fuchsia::modular::LinkPtr link_;
- fidl::VectorPtr<fidl::StringPtr> path_;
+ fidl::VectorPtr<std::string> path_;
FXL_DISALLOW_COPY_AND_ASSIGN(TestModule);
};
diff --git a/tests/link_data/link_data_test_session_shell.cc b/tests/link_data/link_data_test_session_shell.cc
index 22c1917..addf960 100644
--- a/tests/link_data/link_data_test_session_shell.cc
+++ b/tests/link_data/link_data_test_session_shell.cc
@@ -52,7 +52,7 @@
TestPoint story1_create_{"Story1 Create"};
void TestStory1() {
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
fuchsia::modular::AddMod add_mod;
add_mod.mod_name.push_back(kModule0Name);
add_mod.intent.action = kModule0Action;
@@ -95,7 +95,7 @@
TestPoint story1_get_module0_link_{"Story1 Get Module0 link"};
void TestStory1_GetModule0Link() {
- fidl::VectorPtr<fidl::StringPtr> module_path;
+ fidl::VectorPtr<std::string> module_path;
module_path.push_back(kModule0Name);
fuchsia::modular::LinkPath link_path = fuchsia::modular::LinkPath();
link_path.module_path = std::move(module_path);
@@ -177,11 +177,11 @@
void TestStory1_GetActiveModules() {
story_controller_->GetActiveModules(
- [this](fidl::VectorPtr<fuchsia::modular::ModuleData> modules) {
- if (modules->size() == 0) {
+ [this](std::vector<fuchsia::modular::ModuleData> modules) {
+ if (modules.size() == 0) {
story1_get_active_modules_.Pass();
} else {
- FXL_LOG(ERROR) << "ACTIVE MODULES " << modules->size()
+ FXL_LOG(ERROR) << "ACTIVE MODULES " << modules.size()
<< " EXPECTED " << 0;
}
TestStory1_GetActiveLinks();
@@ -192,11 +192,11 @@
void TestStory1_GetActiveLinks() {
story_controller_->GetActiveLinks(
- nullptr, [this](fidl::VectorPtr<fuchsia::modular::LinkPath> links) {
- if (links->size() == 0) {
+ nullptr, [this](std::vector<fuchsia::modular::LinkPath> links) {
+ if (links.size() == 0) {
story1_get_active_links_.Pass();
} else {
- FXL_LOG(ERROR) << "ACTIVE LINKS " << links->size() << " EXPECTED "
+ FXL_LOG(ERROR) << "ACTIVE LINKS " << links.size() << " EXPECTED "
<< 0;
}
TestStory2_Run();
diff --git a/tests/maxwell_integration/context_engine_test.cc b/tests/maxwell_integration/context_engine_test.cc
index 5859b88..37da031 100644
--- a/tests/maxwell_integration/context_engine_test.cc
+++ b/tests/maxwell_integration/context_engine_test.cc
@@ -126,7 +126,7 @@
auto maybe_results =
modular::TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_results.has_value());
- auto results = maybe_results.value().take();
+ auto results = std::move(maybe_results.value());
ASSERT_EQ(3u, results.size());
EXPECT_EQ(std::set<std::string>({"topic", "frob", "borf"}),
GetTopicSet(results));
@@ -141,7 +141,7 @@
ASSERT_TRUE(listener.last_update);
maybe_results = modular::TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_results.has_value());
- results = maybe_results.value().take();
+ results = std::move(maybe_results.value());
ASSERT_EQ(1u, results.size());
EXPECT_EQ("frob", results[0].meta.entity->topic);
@@ -169,7 +169,7 @@
WaitUntilIdle();
maybe_results = modular::TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_results.has_value());
- results = maybe_results.value().take();
+ results = std::move(maybe_results.value());
ASSERT_EQ(2u, results.size());
fuchsia::modular::ContextValue entity_result, story_result;
@@ -193,7 +193,7 @@
ASSERT_TRUE(listener.last_update);
maybe_results = modular::TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_results.has_value());
- results = maybe_results.value().take();
+ results = std::move(maybe_results.value());
ASSERT_EQ(1u, results.size());
EXPECT_EQ("frob", results[0].meta.entity->topic);
}
@@ -226,7 +226,7 @@
auto maybe_result =
modular::TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_result.has_value());
- auto result = maybe_result.value().take();
+ auto result = std::move(maybe_result.value());
ASSERT_EQ(1u, result.size());
EXPECT_EQ(value1, result[0].content);
@@ -244,7 +244,7 @@
maybe_result = modular::TakeContextValue(listener.last_update.get(), "a");
ASSERT_TRUE(maybe_result.has_value());
- result = maybe_result.value().take();
+ result = std::move(maybe_result.value());
ASSERT_EQ(1u, result.size());
EXPECT_EQ(value2, result[0].content);
}
@@ -331,7 +331,7 @@
auto maybe_results = modular::TakeContextValue(&update, "a");
ASSERT_TRUE(maybe_results.has_value());
- auto results = maybe_results.value().take();
+ auto results = std::move(maybe_results.value());
ASSERT_EQ(2u, results.size());
EXPECT_EQ(std::set<std::string>({"topic", "frob"}), GetTopicSet(results));
});
diff --git a/tests/maxwell_integration/suggestion_engine_test.cc b/tests/maxwell_integration/suggestion_engine_test.cc
index 355feff..278742c 100644
--- a/tests/maxwell_integration/suggestion_engine_test.cc
+++ b/tests/maxwell_integration/suggestion_engine_test.cc
@@ -38,7 +38,7 @@
fuchsia::modular::Proposal CreateProposal(
const std::string& id, const std::string& headline,
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands,
+ std::vector<fuchsia::modular::StoryCommand> commands,
fuchsia::modular::AnnoyanceType annoyance) {
fuchsia::modular::Proposal p;
p.id = id;
@@ -65,16 +65,14 @@
virtual ~Proposinator() = default;
void Propose(const std::string& id,
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands =
- fidl::VectorPtr<fuchsia::modular::StoryCommand>::New(0)) {
+ std::vector<fuchsia::modular::StoryCommand> commands ={}) {
Propose(id, id, fuchsia::modular::AnnoyanceType::NONE, std::move(commands));
}
void Propose(const std::string& id, const std::string& headline,
fuchsia::modular::AnnoyanceType annoyance =
fuchsia::modular::AnnoyanceType::NONE,
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands =
- fidl::VectorPtr<fuchsia::modular::StoryCommand>::New(0)) {
+ std::vector<fuchsia::modular::StoryCommand> commands = {}) {
Propose(CreateProposal(id, headline, std::move(commands), annoyance));
}
@@ -128,7 +126,7 @@
fidl::StringPtr query() const { return query_ ? query_->text : nullptr; }
void ProposeForAsk(const std::string& id) {
- auto commands = fidl::VectorPtr<fuchsia::modular::StoryCommand>::New(0);
+ std::vector<fuchsia::modular::StoryCommand> commands;
ProposeForAsk(id, id, fuchsia::modular::AnnoyanceType::NONE,
std::move(commands));
}
@@ -137,8 +135,7 @@
const std::string& id, const std::string& headline,
fuchsia::modular::AnnoyanceType annoyance =
fuchsia::modular::AnnoyanceType::NONE,
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands =
- fidl::VectorPtr<fuchsia::modular::StoryCommand>::New(0)) {
+ std::vector<fuchsia::modular::StoryCommand> commands ={}) {
query_proposals_.push_back(
CreateProposal(id, headline, std::move(commands), annoyance));
}
@@ -147,7 +144,7 @@
async::Loop* const loop_;
fidl::Binding<fuchsia::modular::QueryHandler> ask_binding_;
fuchsia::modular::UserInputPtr query_;
- fidl::VectorPtr<fuchsia::modular::Proposal> query_proposals_;
+ std::vector<fuchsia::modular::Proposal> query_proposals_;
OnQueryCallback query_callback_;
bool waiting_for_query_ = false;
};
@@ -179,10 +176,10 @@
FXL_LOG(INFO) << "Expect an update key for every query key.";
}
auto& r = maybe_result.value();
- if (r->empty()) {
+ if (r.empty()) {
return;
}
- int n = std::stoi(r->at(0).content);
+ int n = std::stoi(r.at(0).content);
for (int i = n_; i < n; i++) {
Propose(std::to_string(i));
@@ -308,7 +305,7 @@
}
// |fuchsia::modular::ProposalListener|
- void OnProposalAccepted(fidl::StringPtr proposal_id,
+ void OnProposalAccepted(std::string proposal_id,
fidl::StringPtr story_id) override {
accepted_proposal_id_ = proposal_id;
if (!story_id->empty()) {
@@ -885,7 +882,7 @@
fuchsia::modular::StoryCommand command;
command.set_add_mod(std::move(add_mod));
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(std::move(command));
p.Propose("1", std::move(commands));
WaitUntilIdle();
@@ -915,7 +912,7 @@
fuchsia::modular::StoryCommand command;
command.set_add_mod(std::move(add_mod));
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(std::move(command));
p.Propose("1", std::move(commands));
WaitUntilIdle();
diff --git a/tests/maxwell_integration/test_suggestion_listener.cc b/tests/maxwell_integration/test_suggestion_listener.cc
index 9278262..e07350f 100644
--- a/tests/maxwell_integration/test_suggestion_listener.cc
+++ b/tests/maxwell_integration/test_suggestion_listener.cc
@@ -14,9 +14,9 @@
namespace modular {
template <typename T>
-std::ostream& operator<<(std::ostream& os, const fidl::VectorPtr<T>& value) {
+std::ostream& operator<<(std::ostream& os, const std::vector<T>& value) {
os << "[ ";
- for (const T& element : *value) {
+ for (const T& element : value) {
os << element << " ";
}
return os << "]";
@@ -42,25 +42,25 @@
}
void TestSuggestionListener::OnNextResults(
- fidl::VectorPtr<fuchsia::modular::Suggestion> suggestions) {
+ std::vector<fuchsia::modular::Suggestion> suggestions) {
FXL_LOG(INFO) << "OnNextResults(" << suggestions << ")";
OnAnyResults(suggestions);
}
void TestSuggestionListener::OnQueryResults(
- fidl::VectorPtr<fuchsia::modular::Suggestion> suggestions) {
+ std::vector<fuchsia::modular::Suggestion> suggestions) {
FXL_LOG(INFO) << "OnQueryResults(" << suggestions << ")";
OnAnyResults(suggestions);
}
void TestSuggestionListener::OnAnyResults(
- fidl::VectorPtr<fuchsia::modular::Suggestion>& suggestions) {
+ std::vector<fuchsia::modular::Suggestion>& suggestions) {
ClearSuggestions();
auto insert_head = ordered_suggestions_.begin();
- for (auto& suggestion : *suggestions) {
+ for (auto& suggestion : suggestions) {
insert_head = std::upper_bound(insert_head, ordered_suggestions_.end(),
&suggestion, suggestion_less);
suggestions_by_id_[suggestion.uuid] = fuchsia::modular::Suggestion();
diff --git a/tests/maxwell_integration/test_suggestion_listener.h b/tests/maxwell_integration/test_suggestion_listener.h
index cd07f26..326b781 100644
--- a/tests/maxwell_integration/test_suggestion_listener.h
+++ b/tests/maxwell_integration/test_suggestion_listener.h
@@ -23,14 +23,14 @@
// |fuchsia::modular::NextListener|
void OnNextResults(
- fidl::VectorPtr<fuchsia::modular::Suggestion> suggestions) override;
+ std::vector<fuchsia::modular::Suggestion> suggestions) override;
// |fuchsia::modular::NextListener|
void OnProcessingChange(bool processing) override;
// |fuchsia::modular::QueryListener|
void OnQueryResults(
- fidl::VectorPtr<fuchsia::modular::Suggestion> suggestions) override;
+ std::vector<fuchsia::modular::Suggestion> suggestions) override;
// |fuchsia::modular::QueryListener|
void OnQueryComplete() override;
@@ -68,7 +68,7 @@
}
private:
- void OnAnyResults(fidl::VectorPtr<fuchsia::modular::Suggestion>& suggestions);
+ void OnAnyResults(std::vector<fuchsia::modular::Suggestion>& suggestions);
std::map<std::string, fuchsia::modular::Suggestion> suggestions_by_id_;
std::vector<fuchsia::modular::Suggestion*> ordered_suggestions_;
@@ -84,10 +84,10 @@
protected:
void UpdateProposals(
- fidl::VectorPtr<fuchsia::modular::ProposalSummary> proposals) {
+ std::vector<fuchsia::modular::ProposalSummary> proposals) {
proposals_.clear();
- for (size_t i = 0; i < proposals->size(); ++i) {
- proposals_.push_back(std::move(proposals->at(i)));
+ for (size_t i = 0; i < proposals.size(); ++i) {
+ proposals_.push_back(std::move(proposals.at(i)));
}
}
std::vector<fuchsia::modular::ProposalSummary> proposals_;
@@ -97,7 +97,7 @@
public TestProposalListener {
public:
void OnNextUpdate(
- fidl::VectorPtr<fuchsia::modular::ProposalSummary> proposals) override {
+ std::vector<fuchsia::modular::ProposalSummary> proposals) override {
FXL_LOG(INFO) << "In OnNextUpdate debug";
UpdateProposals(std::move(proposals));
}
@@ -107,10 +107,10 @@
public TestProposalListener {
public:
void OnAskStart(
- fidl::StringPtr query,
- fidl::VectorPtr<fuchsia::modular::ProposalSummary> proposals) override {
+ std::string query,
+ std::vector<fuchsia::modular::ProposalSummary> proposals) override {
UpdateProposals(std::move(proposals));
- query_ = query.get();
+ query_ = query;
}
void OnProposalSelected(
fuchsia::modular::ProposalSummaryPtr selectedProposal) override {
diff --git a/tests/module_context/module_context_test_module.cc b/tests/module_context/module_context_test_module.cc
index 0529269..bc88447 100644
--- a/tests/module_context/module_context_test_module.cc
+++ b/tests/module_context/module_context_test_module.cc
@@ -37,7 +37,7 @@
initialized_.Pass();
module_host->module_context()->GetLink(kLinkName, link_.NewRequest());
- fidl::VectorPtr<fidl::StringPtr> name;
+ fidl::VectorPtr<std::string> name;
name.push_back(kLinkKey);
link_->Get(name.Clone(), [this, module_context](
std::unique_ptr<fuchsia::mem::Buffer> value) {
diff --git a/tests/module_context/module_context_test_session_shell.cc b/tests/module_context/module_context_test_session_shell.cc
index 8f3ec25..54395b2 100644
--- a/tests/module_context/module_context_test_session_shell.cc
+++ b/tests/module_context/module_context_test_session_shell.cc
@@ -36,8 +36,8 @@
StoryActivityWatcherImpl()
: binding_(this),
on_notify_(
- [](fidl::StringPtr,
- fidl::VectorPtr<fuchsia::modular::OngoingActivityType>) {}) {}
+ [](std::string,
+ std::vector<fuchsia::modular::OngoingActivityType>) {}) {}
~StoryActivityWatcherImpl() override = default;
void Watch(fuchsia::modular::StoryProvider* const story_provider) {
@@ -45,8 +45,8 @@
}
void OnNotify(std::function<
- void(fidl::StringPtr,
- fidl::VectorPtr<fuchsia::modular::OngoingActivityType>)>
+ void(std::string,
+ std::vector<fuchsia::modular::OngoingActivityType>)>
on_notify) {
on_notify_ = std::move(on_notify);
}
@@ -54,15 +54,15 @@
private:
// |fuchsia::modular::StoryActivityWatcher|
void OnStoryActivityChange(
- fidl::StringPtr story_id,
- fidl::VectorPtr<fuchsia::modular::OngoingActivityType> activities)
+ std::string story_id,
+ std::vector<fuchsia::modular::OngoingActivityType> activities)
override {
on_notify_(std::move(story_id), std::move(activities));
}
fidl::Binding<fuchsia::modular::StoryActivityWatcher> binding_;
- std::function<void(fidl::StringPtr,
- fidl::VectorPtr<fuchsia::modular::OngoingActivityType>)>
+ std::function<void(std::string,
+ std::vector<fuchsia::modular::OngoingActivityType>)>
on_notify_;
FXL_DISALLOW_COPY_AND_ASSIGN(StoryActivityWatcherImpl);
@@ -84,7 +84,7 @@
private:
TestPoint story_create_{"Created story."};
void CreateStory() {
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
{
fuchsia::modular::AddMod add_mod;
add_mod.mod_name.push_back(kFirstModuleName);
@@ -149,9 +149,9 @@
story_activity_watcher_.Watch(story_provider());
story_activity_watcher_.OnNotify(
[this](
- fidl::StringPtr story_id,
- fidl::VectorPtr<fuchsia::modular::OngoingActivityType> activities) {
- if (story_id == kStoryName && activities->empty()) {
+ std::string story_id,
+ std::vector<fuchsia::modular::OngoingActivityType> activities) {
+ if (story_id == kStoryName && activities.empty()) {
on_watch_ongoing_activities_dispatched.Pass();
}
PerformFirstModuleStartActivity();
@@ -166,10 +166,10 @@
Signal(kFirstModuleCallStartActivity);
story_activity_watcher_.OnNotify(
[this](
- fidl::StringPtr story_id,
- fidl::VectorPtr<fuchsia::modular::OngoingActivityType> activities) {
- if (story_id == kStoryName && activities->size() == 1 &&
- activities.get()[0] ==
+ std::string story_id,
+ std::vector<fuchsia::modular::OngoingActivityType> activities) {
+ if (story_id == kStoryName && activities.size() == 1 &&
+ activities[0] ==
fuchsia::modular::OngoingActivityType::VIDEO) {
on_start_ongoing_activity_dispatched.Pass();
}
@@ -185,12 +185,12 @@
Signal(kSecondModuleCallStartActivity);
story_activity_watcher_.OnNotify(
[this](
- fidl::StringPtr story_id,
- fidl::VectorPtr<fuchsia::modular::OngoingActivityType> activities) {
- if (story_id == kStoryName && activities->size() == 2 &&
- activities.get()[0] ==
+ std::string story_id,
+ std::vector<fuchsia::modular::OngoingActivityType> activities) {
+ if (story_id == kStoryName && activities.size() == 2 &&
+ activities[0] ==
fuchsia::modular::OngoingActivityType::VIDEO &&
- activities.get()[1] ==
+ activities[1] ==
fuchsia::modular::OngoingActivityType::VIDEO) {
on_start_all_ongoing_activities_dispatched.Pass();
}
@@ -206,10 +206,10 @@
Signal(kSecondModuleCallStopActivity);
story_activity_watcher_.OnNotify(
[this](
- fidl::StringPtr story_id,
- fidl::VectorPtr<fuchsia::modular::OngoingActivityType> activities) {
- if (story_id == kStoryName && activities->size() == 1 &&
- activities.get()[0] ==
+ std::string story_id,
+ std::vector<fuchsia::modular::OngoingActivityType> activities) {
+ if (story_id == kStoryName && activities.size() == 1 &&
+ activities[0] ==
fuchsia::modular::OngoingActivityType::VIDEO) {
on_stop_remaining_ongoing_activities_dispatched.Pass();
}
@@ -226,7 +226,7 @@
fuchsia::modular::RemoveMod remove_mod;
remove_mod.mod_name.push_back("entity_module");
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
fuchsia::modular::StoryCommand command;
command.set_remove_mod(std::move(remove_mod));
commands.push_back(std::move(command));
@@ -255,8 +255,8 @@
// Verify that the second module is still active, but the first one is
// not.
story_controller_->GetActiveModules(
- [this](fidl::VectorPtr<fuchsia::modular::ModuleData> module_data) {
- if (module_data->size() == 1) {
+ [this](std::vector<fuchsia::modular::ModuleData> module_data) {
+ if (module_data.size() == 1) {
second_module_active_.Pass();
}
VerifyStoryStillRunning();
@@ -265,9 +265,9 @@
story_activity_watcher_.OnNotify(
[this](
- fidl::StringPtr story_id,
- fidl::VectorPtr<fuchsia::modular::OngoingActivityType> activities) {
- if (story_id == kStoryName && activities->empty()) {
+ std::string story_id,
+ std::vector<fuchsia::modular::OngoingActivityType> activities) {
+ if (story_id == kStoryName && activities.empty()) {
on_done_ongoing_activities_stopped.Pass();
}
});
@@ -296,8 +296,8 @@
Await(kSecondModuleTerminated, [this] {
// Verify that the second module is still active.
story_controller_->GetActiveModules(
- [this](fidl::VectorPtr<fuchsia::modular::ModuleData> module_data) {
- if (module_data->empty()) {
+ [this](std::vector<fuchsia::modular::ModuleData> module_data) {
+ if (module_data.empty()) {
no_module_active_.Pass();
}
IsStoryRunning([this](bool is_running) {
diff --git a/tests/session_shell/session_shell_test_session_shell.cc b/tests/session_shell/session_shell_test_session_shell.cc
index 4857cca..21613c2 100644
--- a/tests/session_shell/session_shell_test_session_shell.cc
+++ b/tests/session_shell/session_shell_test_session_shell.cc
@@ -63,7 +63,7 @@
int on_delete_called_{};
// |fuchsia::modular::StoryProviderWatcher|
- void OnDelete(fidl::StringPtr story_id) override {
+ void OnDelete(std::string story_id) override {
FXL_LOG(INFO) << "StoryProviderStateWatcherImpl::OnDelete() " << story_id;
if (++on_delete_called_ == 1) {
@@ -230,7 +230,7 @@
void TestStoryProvider_GetStories() {
story_provider()->GetStories(
- nullptr, [this](fidl::VectorPtr<fuchsia::modular::StoryInfo> stories) {
+ nullptr, [this](std::vector<fuchsia::modular::StoryInfo> stories) {
previous_stories_.Pass();
TestStoryProvider_GetStoryInfo(std::move(stories));
});
@@ -239,12 +239,12 @@
TestPoint get_story_info_{"StoryProvider.GetStoryInfo()"};
void TestStoryProvider_GetStoryInfo(
- fidl::VectorPtr<fuchsia::modular::StoryInfo> stories) {
- if (stories->empty()) {
+ std::vector<fuchsia::modular::StoryInfo> stories) {
+ if (stories.empty()) {
get_story_info_.Pass();
} else {
- FXL_LOG(ERROR) << "StoryProvider.GetStoryInfo() " << stories->size();
- for (const auto& item : stories.get()) {
+ FXL_LOG(ERROR) << "StoryProvider.GetStoryInfo() " << stories.size();
+ for (const auto& item : stories) {
FXL_LOG(INFO) << item.id;
}
}
@@ -276,7 +276,7 @@
fuchsia::modular::StoryCommand command;
command.set_add_mod(std::move(add_mod));
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(std::move(command));
story_puppet_master_->Enqueue(std::move(commands));
@@ -338,7 +338,7 @@
fuchsia::modular::StoryCommand command;
command.set_add_mod(std::move(add_mod));
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(std::move(command));
story_puppet_master_->Enqueue(std::move(commands));
@@ -365,8 +365,8 @@
void TestStory2_GetModules() {
story_controller_->GetModules(
- [this](fidl::VectorPtr<fuchsia::modular::ModuleData> modules) {
- if (modules->size() == 1) {
+ [this](std::vector<fuchsia::modular::ModuleData> modules) {
+ if (modules.size() == 1) {
story2_get_modules_.Pass();
}
@@ -463,15 +463,15 @@
void TestStory3_GetStories() {
story_provider()->GetStories(
- nullptr, [this](fidl::VectorPtr<fuchsia::modular::StoryInfo> stories) {
+ nullptr, [this](std::vector<fuchsia::modular::StoryInfo> stories) {
// Since this is a kind-of-proto story, it shouldn't appear in
// GetStories calls. Note that we still expect 1 story to be here
// since Story1 wasn't deleted.
- if (stories->size() == 1 && stories->at(0).id != story_info_.id) {
+ if (stories.size() == 1 && stories.at(0).id != story_info_.id) {
story3_previous_stories_.Pass();
} else {
- FXL_LOG(ERROR) << "StoryProvider.GetStories() " << stories->size();
- for (const auto& item : stories.get()) {
+ FXL_LOG(ERROR) << "StoryProvider.GetStories() " << stories.size();
+ for (const auto& item : stories) {
FXL_LOG(INFO) << item.id;
}
}
@@ -547,7 +547,7 @@
fuchsia::modular::StoryCommand command;
command.set_add_mod(std::move(add_mod));
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(std::move(command));
story_puppet_master_->Enqueue(std::move(commands));
@@ -644,7 +644,7 @@
fuchsia::modular::StoryCommand command;
command.set_add_mod(std::move(add_mod));
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(std::move(command));
story_puppet_master_->Enqueue(std::move(commands));
@@ -745,7 +745,7 @@
fuchsia::modular::StoryCommand command;
command.set_add_mod(std::move(add_mod));
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
commands.push_back(std::move(command));
story_puppet_master_->Enqueue(std::move(commands));
diff --git a/tests/story_shell/story_shell_test_session_shell.cc b/tests/story_shell/story_shell_test_session_shell.cc
index 0baa65c..5395d03 100644
--- a/tests/story_shell/story_shell_test_session_shell.cc
+++ b/tests/story_shell/story_shell_test_session_shell.cc
@@ -72,7 +72,7 @@
bool story2_presentation_request_received_{};
// |fuchsia::modular::SessionShellPresentationProvider|
- void GetPresentation(fidl::StringPtr story_id,
+ void GetPresentation(std::string story_id,
fidl::InterfaceRequest<fuchsia::ui::policy::Presentation>
request) override {
if (story_id == kStoryName1 && !story1_presentation_request_received_) {
@@ -90,7 +90,7 @@
// |fuchsia::modular::SessionShellPresentationProvider|
void WatchVisualState(
- fidl::StringPtr story_id,
+ std::string story_id,
fidl::InterfaceHandle<fuchsia::modular::StoryVisualStateWatcher> watcher)
override {}
@@ -109,7 +109,7 @@
TestPoint story1_create_{"Story1 Create"};
void Story1_Create() {
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
auto addMod = [&commands](fidl::StringPtr name,
std::vector<fidl::StringPtr> parent) {
fuchsia::modular::AddMod add_mod;
@@ -194,7 +194,7 @@
TestPoint story2_create_{"Story2 Create"};
void Story2_Create() {
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
auto addMod = [&commands](fidl::StringPtr name,
std::vector<fidl::StringPtr> parent) {
fuchsia::modular::AddMod add_mod;
diff --git a/tests/story_shell/story_shell_test_story_shell.cc b/tests/story_shell/story_shell_test_story_shell.cc
index f4c6c6e..5480949 100644
--- a/tests/story_shell/story_shell_test_story_shell.cc
+++ b/tests/story_shell/story_shell_test_story_shell.cc
@@ -47,7 +47,7 @@
story_shell_context_.Bind(std::move(story_shell_context));
story_shell_context_->GetPresentation(presentation_.NewRequest());
story_shell_context_->GetLink(story_shell_link_.NewRequest());
- fidl::VectorPtr<fidl::StringPtr> link_path;
+ fidl::VectorPtr<std::string> link_path;
link_path.push_back("path");
story_shell_link_->Get(
@@ -61,7 +61,7 @@
document.SetObject();
document.AddMember("label", "value", document.GetAllocator());
fsl::SizedVmo vmo;
- fidl::VectorPtr<fidl::StringPtr> path_to_write;
+ fidl::VectorPtr<std::string> path_to_write;
path_to_write.push_back("path");
fsl::VmoFromString(modular::JsonValueToString(document), &vmo);
fuchsia::mem::Buffer buffer = std::move(vmo).ToTransport();
@@ -110,25 +110,25 @@
}
// |fuchsia::modular::StoryShell|
- void FocusSurface(fidl::StringPtr /*surface_id*/) override {}
+ void FocusSurface(std::string /*surface_id*/) override {}
// |fuchsia::modular::StoryShell|
- void DefocusSurface(fidl::StringPtr /*surface_id*/,
+ void DefocusSurface(std::string /*surface_id*/,
DefocusSurfaceCallback callback) override {
callback();
}
// |fuchsia::modular::StoryShell|
void AddContainer(
- fidl::StringPtr /*container_name*/, fidl::StringPtr /*parent_id*/,
+ std::string /*container_name*/, fidl::StringPtr /*parent_id*/,
fuchsia::modular::SurfaceRelation /*relation*/,
- fidl::VectorPtr<fuchsia::modular::ContainerLayout> /*layout*/,
- fidl::VectorPtr<
+ std::vector<fuchsia::modular::ContainerLayout> /*layout*/,
+ std::vector<
fuchsia::modular::ContainerRelationEntry> /* relationships */,
- fidl::VectorPtr<fuchsia::modular::ContainerView> /* views */) override {}
+ std::vector<fuchsia::modular::ContainerView> /* views */) override {}
// |fuchsia::modular::StoryShell|
- void RemoveSurface(fidl::StringPtr /*surface_id*/) override {}
+ void RemoveSurface(std::string /*surface_id*/) override {}
// |fuchsia::modular::StoryShell|
void ReconnectView(fuchsia::modular::ViewConnection view_connection) override {}
diff --git a/tests/suggestion/suggestion_test_module.cc b/tests/suggestion/suggestion_test_module.cc
index dc9291d..0d7b027 100644
--- a/tests/suggestion/suggestion_test_module.cc
+++ b/tests/suggestion/suggestion_test_module.cc
@@ -94,7 +94,7 @@
}
// |fuchsia::modular::ProposalListener|
- void OnProposalAccepted(fidl::StringPtr proposal_id,
+ void OnProposalAccepted(std::string proposal_id,
fidl::StringPtr story_id) override {
Signal("proposal_was_accepted");
}
diff --git a/tests/suggestion/suggestion_test_session_shell.cc b/tests/suggestion/suggestion_test_session_shell.cc
index f6488bf..1f1ec76 100644
--- a/tests/suggestion/suggestion_test_session_shell.cc
+++ b/tests/suggestion/suggestion_test_session_shell.cc
@@ -49,7 +49,7 @@
private:
void CreateStory() {
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
fuchsia::modular::AddMod add_mod;
add_mod.mod_name.push_back("root");
add_mod.intent.action = kSuggestionTestAction;
@@ -86,8 +86,8 @@
// |fuchsia::modular::NextListener|
void OnNextResults(
- fidl::VectorPtr<fuchsia::modular::Suggestion> suggestions) override {
- for (auto& suggestion : *suggestions) {
+ std::vector<fuchsia::modular::Suggestion> suggestions) override {
+ for (auto& suggestion : suggestions) {
auto& display = suggestion.display;
if (display.headline == "foo" && display.subheadline == "bar" &&
display.details == "baz") {
diff --git a/tests/trigger/trigger_test_agent.cc b/tests/trigger/trigger_test_agent.cc
index a7a955b..2ac9cb3 100644
--- a/tests/trigger/trigger_test_agent.cc
+++ b/tests/trigger/trigger_test_agent.cc
@@ -73,7 +73,7 @@
}
// |TriggerTestService|
- void ObserveMessageQueueDeletion(fidl::StringPtr queue_token) override {
+ void ObserveMessageQueueDeletion(std::string queue_token) override {
fuchsia::modular::TaskInfo task_info;
task_info.task_id = queue_token;
task_info.trigger_condition.set_queue_deleted(queue_token);
diff --git a/tests/trigger/trigger_test_session_shell.cc b/tests/trigger/trigger_test_session_shell.cc
index 00bfa99..9aa7b2c 100644
--- a/tests/trigger/trigger_test_session_shell.cc
+++ b/tests/trigger/trigger_test_session_shell.cc
@@ -45,7 +45,7 @@
TestPoint story_create_{"Created story."};
void CreateStory() {
- fidl::VectorPtr<fuchsia::modular::StoryCommand> commands;
+ std::vector<fuchsia::modular::StoryCommand> commands;
fuchsia::modular::AddMod add_mod;
add_mod.mod_name.push_back("root");