| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bindings/core/v8/V8ObjectBuilder.h" | 5 #include "bindings/core/v8/V8ObjectBuilder.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8Binding.h" | 7 #include "bindings/core/v8/V8BindingForCore.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 V8ObjectBuilder::V8ObjectBuilder(ScriptState* script_state) | 11 V8ObjectBuilder::V8ObjectBuilder(ScriptState* script_state) |
| 12 : script_state_(script_state), | 12 : script_state_(script_state), |
| 13 object_(v8::Object::New(script_state->GetIsolate())) {} | 13 object_(v8::Object::New(script_state->GetIsolate())) {} |
| 14 | 14 |
| 15 V8ObjectBuilder& V8ObjectBuilder::Add(const StringView& name, | 15 V8ObjectBuilder& V8ObjectBuilder::Add(const StringView& name, |
| 16 const V8ObjectBuilder& value) { | 16 const V8ObjectBuilder& value) { |
| 17 AddInternal(name, value.V8Value()); | 17 AddInternal(name, value.V8Value()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if (value.IsEmpty() || | 63 if (value.IsEmpty() || |
| 64 object_ | 64 object_ |
| 65 ->CreateDataProperty(script_state_->GetContext(), | 65 ->CreateDataProperty(script_state_->GetContext(), |
| 66 V8String(script_state_->GetIsolate(), name), | 66 V8String(script_state_->GetIsolate(), name), |
| 67 value) | 67 value) |
| 68 .IsNothing()) | 68 .IsNothing()) |
| 69 object_.Clear(); | 69 object_.Clear(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace blink | 72 } // namespace blink |
| OLD | NEW |