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

Unified Diff: third_party/WebKit/Source/core/style/DataPersistent.h

Issue 2923333002: Generate StyleRareNonInheritedData in ComputedStyleBase. (Closed)
Patch Set: Rebase Created 3 years, 6 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: third_party/WebKit/Source/core/style/DataPersistent.h
diff --git a/third_party/WebKit/Source/core/style/DataPersistent.h b/third_party/WebKit/Source/core/style/DataPersistent.h
index ba18789be6a04f8e81c69e41885bbf242d622922..5b5feae7bca364f3314aea4075aac9ee516147e3 100644
--- a/third_party/WebKit/Source/core/style/DataPersistent.h
+++ b/third_party/WebKit/Source/core/style/DataPersistent.h
@@ -46,6 +46,11 @@ class DataPersistent {
const_cast<DataPersistent&>(other).own_copy_ = false;
}
+ DataPersistent(DataPersistent&& other)
+ : data_(std::move(other.data_)), own_copy_(other.own_copy_) {
+ other.own_copy_ = false;
+ }
+
const T* Get() const { return data_ ? data_->Get() : nullptr; }
const T& operator*() const { return data_ ? *Get() : nullptr; }
@@ -78,6 +83,12 @@ class DataPersistent {
}
void operator=(std::nullptr_t) { data_.clear(); }
+ DataPersistent& operator=(DataPersistent&& other) {
+ data_ = std::move(other.data_);
+ own_copy_ = other.own_copy_;
+ other.own_copy_ = false;
+ return *this;
+ }
private:
// Reduce size of DataPersistent<> by delaying creation of Persistent<>.

Powered by Google App Engine
This is Rietveld 408576698