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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/modules/BooleanOrString.cpp

Issue 2897603003: Get and return String by const-ref if used as rvalue (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/modules/BooleanOrString.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This file has been auto-generated by code_generator_v8.py. 5 // This file has been auto-generated by code_generator_v8.py.
6 // DO NOT MODIFY! 6 // DO NOT MODIFY!
7 7
8 // This file has been generated from the Jinja2 template in 8 // This file has been generated from the Jinja2 template in
9 // third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl 9 // third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl
10 10
(...skipping 18 matching lines...) Expand all
29 m_boolean = value; 29 m_boolean = value;
30 m_type = SpecificTypeBoolean; 30 m_type = SpecificTypeBoolean;
31 } 31 }
32 32
33 BooleanOrString BooleanOrString::fromBoolean(bool value) { 33 BooleanOrString BooleanOrString::fromBoolean(bool value) {
34 BooleanOrString container; 34 BooleanOrString container;
35 container.setBoolean(value); 35 container.setBoolean(value);
36 return container; 36 return container;
37 } 37 }
38 38
39 String BooleanOrString::getAsString() const { 39 const String& BooleanOrString::getAsString() const {
40 DCHECK(isString()); 40 DCHECK(isString());
41 return m_string; 41 return m_string;
42 } 42 }
43 43
44 void BooleanOrString::setString(String value) { 44 void BooleanOrString::setString(const String& value) {
45 DCHECK(isNull()); 45 DCHECK(isNull());
46 m_string = value; 46 m_string = value;
47 m_type = SpecificTypeString; 47 m_type = SpecificTypeString;
48 } 48 }
49 49
50 BooleanOrString BooleanOrString::fromString(String value) { 50 BooleanOrString BooleanOrString::fromString(const String& value) {
51 BooleanOrString container; 51 BooleanOrString container;
52 container.setString(value); 52 container.setString(value);
53 return container; 53 return container;
54 } 54 }
55 55
56 BooleanOrString::BooleanOrString(const BooleanOrString&) = default; 56 BooleanOrString::BooleanOrString(const BooleanOrString&) = default;
57 BooleanOrString::~BooleanOrString() = default; 57 BooleanOrString::~BooleanOrString() = default;
58 BooleanOrString& BooleanOrString::operator=(const BooleanOrString&) = default; 58 BooleanOrString& BooleanOrString::operator=(const BooleanOrString&) = default;
59 59
60 DEFINE_TRACE(BooleanOrString) { 60 DEFINE_TRACE(BooleanOrString) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return v8::Local<v8::Value>(); 95 return v8::Local<v8::Value>();
96 } 96 }
97 97
98 BooleanOrString NativeValueTraits<BooleanOrString>::NativeValue(v8::Isolate* iso late, v8::Local<v8::Value> value, ExceptionState& exceptionState) { 98 BooleanOrString NativeValueTraits<BooleanOrString>::NativeValue(v8::Isolate* iso late, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
99 BooleanOrString impl; 99 BooleanOrString impl;
100 V8BooleanOrString::toImpl(isolate, value, impl, UnionTypeConversionMode::kNotN ullable, exceptionState); 100 V8BooleanOrString::toImpl(isolate, value, impl, UnionTypeConversionMode::kNotN ullable, exceptionState);
101 return impl; 101 return impl;
102 } 102 }
103 103
104 } // namespace blink 104 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/modules/BooleanOrString.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698