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

Side by Side Diff: Source/bindings/core/v8/Dictionary.h

Issue 555133003: Use ExceptionState to throw exceptions when converting arrays (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 3 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 bool getKey(const String& key, v8::Local<v8::Value>&) const; 137 bool getKey(const String& key, v8::Local<v8::Value>&) const;
138 138
139 private: 139 private:
140 v8::Handle<v8::Value> m_options; 140 v8::Handle<v8::Value> m_options;
141 v8::Isolate* m_isolate; 141 v8::Isolate* m_isolate;
142 }; 142 };
143 143
144 template<> 144 template<>
145 struct NativeValueTraits<Dictionary> { 145 struct NativeValueTraits<Dictionary> {
146 static inline Dictionary nativeValue(const v8::Handle<v8::Value>& value, v8: :Isolate* isolate) 146 static inline Dictionary nativeValue(const v8::Handle<v8::Value>& value, v8: :Isolate* isolate, ExceptionState&)
147 { 147 {
148 return Dictionary(value, isolate); 148 return Dictionary(value, isolate);
149 } 149 }
150 }; 150 };
151 151
152 // DictionaryHelper is a collection of static methods for getting or 152 // DictionaryHelper is a collection of static methods for getting or
153 // converting a value from Dictionary. 153 // converting a value from Dictionary.
154 struct DictionaryHelper { 154 struct DictionaryHelper {
155 template <typename T> 155 template <typename T>
156 static bool get(const Dictionary&, const String& key, T& value); 156 static bool get(const Dictionary&, const String& key, T& value);
(...skipping 13 matching lines...) Expand all
170 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, T& value); 170 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, T& value);
171 template <typename T> 171 template <typename T>
172 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, Nullable<T>& value); 172 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, Nullable<T>& value);
173 template <template <typename> class PointerType, typename T> 173 template <template <typename> class PointerType, typename T>
174 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, PointerType<T>& value); 174 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, PointerType<T>& value);
175 }; 175 };
176 176
177 } 177 }
178 178
179 #endif // Dictionary_h 179 #endif // Dictionary_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt ('k') | Source/bindings/core/v8/DictionaryHelperForCore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698