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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8StringResource.h

Issue 2709983004: WIP bindings: Add support for the record<K,V> WebIDL type. (Closed)
Patch Set: Rebased patch using NativeValueTraits for IDL types 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
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 template <V8StringResourceMode Mode = DefaultMode> 171 template <V8StringResourceMode Mode = DefaultMode>
172 class V8StringResource { 172 class V8StringResource {
173 STACK_ALLOCATED(); 173 STACK_ALLOCATED();
174 174
175 public: 175 public:
176 V8StringResource() : m_mode(Externalize) {} 176 V8StringResource() : m_mode(Externalize) {}
177 177
178 V8StringResource(v8::Local<v8::Value> object) 178 V8StringResource(v8::Local<v8::Value> object)
179 : m_v8Object(object), m_mode(Externalize) {} 179 : m_v8Object(object), m_mode(Externalize) {}
180 180
181 V8StringResource(v8::Local<v8::String> object)
182 : m_v8Object(object), m_mode(Externalize) {}
183
181 V8StringResource(const String& string) 184 V8StringResource(const String& string)
182 : m_mode(Externalize), m_string(string) {} 185 : m_mode(Externalize), m_string(string) {}
183 186
184 void operator=(v8::Local<v8::Value> object) { m_v8Object = object; } 187 void operator=(v8::Local<v8::Value> object) { m_v8Object = object; }
185 188
186 void operator=(const String& string) { setString(string); } 189 void operator=(const String& string) { setString(string); }
187 190
188 void operator=(std::nullptr_t) { setString(String()); } 191 void operator=(std::nullptr_t) { setString(String()); }
189 192
190 bool prepare() { // DEPRECATED 193 bool prepare() { // DEPRECATED
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 304
302 template <> 305 template <>
303 inline String 306 inline String
304 V8StringResource<TreatNullAndUndefinedAsNullString>::fallbackString() const { 307 V8StringResource<TreatNullAndUndefinedAsNullString>::fallbackString() const {
305 return String(); 308 return String();
306 } 309 }
307 310
308 } // namespace blink 311 } // namespace blink
309 312
310 #endif // V8StringResource_h 313 #endif // V8StringResource_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698