OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "bindings/core/v8/StringResource.h" | 5 #include "platform/bindings/StringResource.h" |
6 | 6 |
7 #include "bindings/core/v8/V8Binding.h" | 7 #include "platform/bindings/V8Binding.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 template <class StringClass> | 11 template <class StringClass> |
12 struct StringTraits { | 12 struct StringTraits { |
13 static const StringClass& FromStringResource(StringResourceBase*); | 13 static const StringClass& FromStringResource(StringResourceBase*); |
14 template <typename V8StringTrait> | 14 template <typename V8StringTrait> |
15 static StringClass FromV8String(v8::Local<v8::String>, int); | 15 static StringClass FromV8String(v8::Local<v8::String>, int); |
16 }; | 16 }; |
17 | 17 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 String Int32ToWebCoreString(int value) { | 158 String Int32ToWebCoreString(int value) { |
159 // If we are on the main thread (this should always true for non-workers), | 159 // If we are on the main thread (this should always true for non-workers), |
160 // call the faster one. | 160 // call the faster one. |
161 if (IsMainThread()) | 161 if (IsMainThread()) |
162 return Int32ToWebCoreStringFast(value); | 162 return Int32ToWebCoreStringFast(value); |
163 return String::Number(value); | 163 return String::Number(value); |
164 } | 164 } |
165 | 165 |
166 } // namespace blink | 166 } // namespace blink |
OLD | NEW |