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

Unified Diff: services/ui/public/cpp/window.cc

Issue 2511883006: Mojo C++ bindings: switch services/ui/public/interfaces mojom target to use STL types. (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/ui/public/cpp/window.cc
diff --git a/services/ui/public/cpp/window.cc b/services/ui/public/cpp/window.cc
index e5c5dc64539605918735ae8c7531994b64ae2304..7befa36301d31b53309870276a40c4560338554d 100644
--- a/services/ui/public/cpp/window.cc
+++ b/services/ui/public/cpp/window.cc
@@ -609,11 +609,12 @@ void Window::SetSharedPropertyInternal(const std::string& name,
return;
if (client_) {
- mojo::Array<uint8_t> transport_value(nullptr);
+ base::Optional<std::vector<uint8_t>> transport_value;
if (value) {
- transport_value.resize(value->size());
+ transport_value.emplace(value->size());
if (value->size())
- memcpy(&transport_value.front(), &(value->front()), value->size());
+ memcpy(&transport_value.value().front(), &(value->front()),
+ value->size());
}
// TODO: add test coverage of this (450303).
client_->SetProperty(this, name, std::move(transport_value));
« no previous file with comments | « services/ui/public/cpp/tests/window_tree_client_unittest.cc ('k') | services/ui/public/cpp/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698