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

Side by Side Diff: Source/bindings/v8/V8HiddenValue.cpp

Issue 351423002: Moved files under Source/bindings/v8 to Source/bindings/core/v8. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/V8HiddenValue.h ('k') | Source/bindings/v8/V8Initializer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 #include "config.h"
6 #include "bindings/v8/V8HiddenValue.h"
7
8 #include "bindings/v8/ScriptWrappable.h"
9 #include "bindings/v8/V8Binding.h"
10
11 namespace WebCore {
12
13 #define V8_DEFINE_METHOD(name) \
14 v8::Handle<v8::String> V8HiddenValue::name(v8::Isolate* isolate) \
15 { \
16 V8HiddenValue* hiddenValue = V8PerIsolateData::from(isolate)->hiddenValue(); \
17 if (hiddenValue->m_##name.isEmpty()) { \
18 hiddenValue->m_##name.set(isolate, v8AtomicString(isolate, #name)); \
19 } \
20 return hiddenValue->m_##name.newLocal(isolate); \
21 }
22
23 V8_HIDDEN_VALUES(V8_DEFINE_METHOD);
24
25 v8::Local<v8::Value> V8HiddenValue::getHiddenValue(v8::Isolate* isolate, v8::Han dle<v8::Object> object, v8::Handle<v8::String> key)
26 {
27 return object->GetHiddenValue(key);
28 }
29
30 bool V8HiddenValue::setHiddenValue(v8::Isolate* isolate, v8::Handle<v8::Object> object, v8::Handle<v8::String> key, v8::Handle<v8::Value> value)
31 {
32 return object->SetHiddenValue(key, value);
33 }
34
35 bool V8HiddenValue::deleteHiddenValue(v8::Isolate* isolate, v8::Handle<v8::Objec t> object, v8::Handle<v8::String> key)
36 {
37 return object->DeleteHiddenValue(key);
38 }
39
40 v8::Local<v8::Value> V8HiddenValue::getHiddenValueFromMainWorldWrapper(v8::Isola te* isolate, ScriptWrappable* wrappable, v8::Handle<v8::String> key)
41 {
42 v8::Local<v8::Object> wrapper = wrappable->newLocalWrapper(isolate);
43 return wrapper.IsEmpty() ? v8::Local<v8::Value>() : getHiddenValue(isolate, wrapper, key);
44 }
45
46 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8HiddenValue.h ('k') | Source/bindings/v8/V8Initializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698