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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsTest.cpp

Issue 2730183003: bindings: Add C++ versions of WebIDL types and generalize NativeValueTraits. (Closed)
Patch Set: Move specialization for SerializedScriptValue to the appropriate header Created 3 years, 9 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
(Empty)
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "bindings/core/v8/NativeValueTraits.h"
6
7 #include <type_traits>
8 #include "bindings/core/v8/IDLTypesBase.h"
9
10 // No gtest tests; only static_assert checks.
11
12 namespace blink {
13
14 template <>
15 struct NativeValueTraits<bool> : public NativeValueTraitsBase<bool> {};
16
17 static_assert(std::is_same<NativeValueTraits<bool>::ImplType, bool>::value,
18 "NativeValueTraitsBase works with non IDLBase-derived types");
19
20 struct MyIDLType final : public IDLBaseHelper<char> {};
21 template <>
22 struct NativeValueTraits<MyIDLType> : public NativeValueTraitsBase<MyIDLType> {
23 };
24
25 static_assert(std::is_same<NativeValueTraits<MyIDLType>::ImplType, char>::value,
26 "NativeValueTraitsBase works with IDLBase-derived types");
27
28 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698