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

Side by Side Diff: third_party/WebKit/Source/core/animation/UnderlyingValueOwner.cpp

Issue 2384263003: Reflow comments in core/animation and subdirs (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/animation/UnderlyingValueOwner.h" 5 #include "core/animation/UnderlyingValueOwner.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 10 matching lines...) Expand all
21 void UnderlyingValueOwner::set(std::nullptr_t) { 21 void UnderlyingValueOwner::set(std::nullptr_t) {
22 m_type = nullptr; 22 m_type = nullptr;
23 m_valueOwner.clear(); 23 m_valueOwner.clear();
24 m_value = nullptr; 24 m_value = nullptr;
25 } 25 }
26 26
27 void UnderlyingValueOwner::set(const InterpolationType& type, 27 void UnderlyingValueOwner::set(const InterpolationType& type,
28 const InterpolationValue& value) { 28 const InterpolationValue& value) {
29 DCHECK(value); 29 DCHECK(value);
30 m_type = &type; 30 m_type = &type;
31 // By clearing m_valueOwner we will perform a copy before attempting to mutate m_value, 31 // By clearing m_valueOwner we will perform a copy before attempting to mutate
32 // thus upholding the const contract for this instance of interpolationValue. 32 // m_value, thus upholding the const contract for this instance of
33 // interpolationValue.
33 m_valueOwner.clear(); 34 m_valueOwner.clear();
34 m_value = &value; 35 m_value = &value;
35 } 36 }
36 37
37 void UnderlyingValueOwner::set(const InterpolationType& type, 38 void UnderlyingValueOwner::set(const InterpolationType& type,
38 InterpolationValue&& value) { 39 InterpolationValue&& value) {
39 DCHECK(value); 40 DCHECK(value);
40 m_type = &type; 41 m_type = &type;
41 m_valueOwner = std::move(value); 42 m_valueOwner = std::move(value);
42 m_value = &m_valueOwner; 43 m_value = &m_valueOwner;
(...skipping 16 matching lines...) Expand all
59 InterpolationValue& UnderlyingValueOwner::mutableValue() { 60 InterpolationValue& UnderlyingValueOwner::mutableValue() {
60 DCHECK(m_type && m_value); 61 DCHECK(m_type && m_value);
61 if (!m_valueOwner) { 62 if (!m_valueOwner) {
62 m_valueOwner = m_value->clone(); 63 m_valueOwner = m_value->clone();
63 m_value = &m_valueOwner; 64 m_value = &m_valueOwner;
64 } 65 }
65 return m_valueOwner; 66 return m_valueOwner;
66 } 67 }
67 68
68 } // namespace blink 69 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698