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

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

Issue 1031783003: Add V8ObjectBuilder helper and use in modules/crypto/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use "const String&" Created 5 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
« no previous file with comments | « no previous file | Source/bindings/core/v8/Dictionary.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // because they hold a V8 value without putting it on persistent handles. 47 // because they hold a V8 value without putting it on persistent handles.
48 class CORE_EXPORT Dictionary { 48 class CORE_EXPORT Dictionary {
49 ALLOW_ONLY_INLINE_ALLOCATION(); 49 ALLOW_ONLY_INLINE_ALLOCATION();
50 public: 50 public:
51 Dictionary(); 51 Dictionary();
52 Dictionary(const v8::Handle<v8::Value>& options, v8::Isolate*, ExceptionStat e&); 52 Dictionary(const v8::Handle<v8::Value>& options, v8::Isolate*, ExceptionStat e&);
53 ~Dictionary(); 53 ~Dictionary();
54 54
55 Dictionary& operator=(const Dictionary&); 55 Dictionary& operator=(const Dictionary&);
56 56
57 // This is different from the default constructor:
58 // * isObject() is true when using createEmpty().
59 // * isUndefinedOrNull() is true when using default constructor.
60 static Dictionary createEmpty(v8::Isolate*);
61
62 bool isObject() const; 57 bool isObject() const;
63 bool isUndefinedOrNull() const; 58 bool isUndefinedOrNull() const;
64 59
65 bool get(const String&, Dictionary&) const; 60 bool get(const String&, Dictionary&) const;
66 bool get(const String&, v8::Local<v8::Value>&) const; 61 bool get(const String&, v8::Local<v8::Value>&) const;
67 62
68 // Sets properties using default attributes.
69 bool set(const String&, const v8::Handle<v8::Value>&);
70 bool set(const String&, const String&);
71 bool set(const String&, unsigned);
72 bool set(const String&, const Dictionary&);
73
74 v8::Handle<v8::Value> v8Value() const { return m_options; } 63 v8::Handle<v8::Value> v8Value() const { return m_options; }
75 64
76 class CORE_EXPORT ConversionContext { 65 class CORE_EXPORT ConversionContext {
77 public: 66 public:
78 explicit ConversionContext(ExceptionState& exceptionState) 67 explicit ConversionContext(ExceptionState& exceptionState)
79 : m_exceptionState(exceptionState) 68 : m_exceptionState(exceptionState)
80 , m_dirty(true) 69 , m_dirty(true)
81 { 70 {
82 resetPerPropertyContext(); 71 resetPerPropertyContext();
83 } 72 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, T& value); 156 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, T& value);
168 template <typename T> 157 template <typename T>
169 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, Nullable<T>& value); 158 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, Nullable<T>& value);
170 template <template <typename> class PointerType, typename T> 159 template <template <typename> class PointerType, typename T>
171 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, PointerType<T>& value); 160 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const String& key, PointerType<T>& value);
172 }; 161 };
173 162
174 } 163 }
175 164
176 #endif // Dictionary_h 165 #endif // Dictionary_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/Dictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698