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

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

Issue 2607063002: Remove mojo::Array. (Closed)
Patch Set: Created 3 years, 11 months 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/in_flight_change.cc
diff --git a/services/ui/public/cpp/in_flight_change.cc b/services/ui/public/cpp/in_flight_change.cc
index 1eef7487789daaa3a4d6d5dbef03158140e05de4..383d70d6ab84d31fe1c978b89be74a692675ab4d 100644
--- a/services/ui/public/cpp/in_flight_change.cc
+++ b/services/ui/public/cpp/in_flight_change.cc
@@ -138,10 +138,10 @@ void InFlightFocusChange::Revert() {
InFlightPropertyChange::InFlightPropertyChange(
Window* window,
const std::string& property_name,
- const mojo::Array<uint8_t>& revert_value)
+ const base::Optional<std::vector<uint8_t>>& revert_value)
: InFlightChange(window, ChangeType::PROPERTY),
property_name_(property_name),
- revert_value_(revert_value.Clone()) {}
+ revert_value_(revert_value) {}
InFlightPropertyChange::~InFlightPropertyChange() {}
@@ -152,12 +152,12 @@ bool InFlightPropertyChange::Matches(const InFlightChange& change) const {
void InFlightPropertyChange::SetRevertValueFrom(const InFlightChange& change) {
revert_value_ =
- static_cast<const InFlightPropertyChange&>(change).revert_value_.Clone();
+ static_cast<const InFlightPropertyChange&>(change).revert_value_;
}
void InFlightPropertyChange::Revert() {
- WindowPrivate(window())
- .LocalSetSharedProperty(property_name_, std::move(revert_value_));
+ WindowPrivate(window()).LocalSetSharedProperty(
+ property_name_, revert_value_ ? &*revert_value_ : nullptr);
yzshen1 2017/01/06 19:38:38 nit: it seems easier to read: &revert_value_.value
Sam McNally 2017/01/09 23:15:15 Done.
}
// InFlightPredefinedCursorChange ---------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698