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

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

Issue 1029093003: [WIP] IDL: Add limited serializer support and use for RTCIceCandidate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use V8ObjectBuilder in modules/crypto 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
OLDNEW
(Empty)
1 // Copyright 2015 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 #ifndef V8ObjectBuilder_h
6 #define V8ObjectBuilder_h
7
8 #include "wtf/text/WTFString.h"
9 #include <v8.h>
10
11 namespace blink {
12
13 class ScriptValue;
14
15 class V8ObjectBuilder {
16 public:
17 V8ObjectBuilder(v8::Isolate*);
18
19 ScriptValue scriptValue() const;
20 v8::Local<v8::Object> v8Value() const { return m_object; }
21
22 void add(String name, const ScriptValue&);
bashi 2015/03/24 00:49:05 nit: How about making add methods return *this? Th
Jens Widell 2015/03/24 07:10:03 Yeah, might as well do this, if we drop the curren
23 void addNull(String name);
24 void addBoolean(String name, bool value);
25 void addNumber(String name, double value);
26 void addString(String name, String value);
27
28 V8ObjectBuilder addObject(String name);
29
30 private:
31 void add(String name, v8::Local<v8::Value>);
32
33 v8::Isolate* m_isolate;
34 v8::Local<v8::Object> m_object;
35 };
36
37 } // namespace blink
38
39 #endif // V8ObjectBuilder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698