Chromium Code Reviews

Side by Side Diff: Source/bindings/v8/custom/V8NodeIteratorCustom.cpp

Issue 26792002: Reland: Reland: Implement new Blink IDL attribute [SetReference] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...)
31 #include "config.h" 31 #include "config.h"
32 #include "V8NodeIterator.h" 32 #include "V8NodeIterator.h"
33 33
34 #include "V8NodeFilter.h" 34 #include "V8NodeFilter.h"
35 #include "bindings/v8/V8Binding.h" 35 #include "bindings/v8/V8Binding.h"
36 #include "bindings/v8/V8HiddenPropertyName.h" 36 #include "bindings/v8/V8HiddenPropertyName.h"
37 #include "core/dom/Node.h" 37 #include "core/dom/Node.h"
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 v8::Handle<v8::Object> wrap(NodeIterator* nodeIterator, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 41 void* V8NodeIterator::resolveWrapperReachability(void* object, const v8::Persist ent<v8::Object>& wrapper, v8::Isolate* isolate)
42 { 42 {
43 ASSERT(nodeIterator); 43 NodeIterator* impl = fromInternalPointer(object);
44 ASSERT(!DOMDataStore::containsWrapper<V8NodeIterator>(nodeIterator, isolate) ); 44
45 NodeFilter* filter = impl->filter();
46 if (filter) {
47 toV8(filter, v8::Local<v8::Object>::New(isolate, wrapper), isolate);
48 isolate->SetReference(wrapper, *reinterpret_cast<v8::Persistent<v8::Valu e>*>(filter->unsafePersistent().persistent()));
haraken 2013/10/10 06:08:32 *reinterpret_cast<v8::Persistent<v8::Value>*>(filt
49 }
45 50
46 v8::Handle<v8::Object> wrapper = V8NodeIterator::createWrapper(nodeIterator, creationContext, isolate); 51 return object;
47
48 if (nodeIterator->filter())
49 V8HiddenPropertyName::setNamedHiddenReference(wrapper, "filter", toV8(no deIterator->filter(), creationContext, isolate));
50
51 return wrapper;
52 } 52 }
53 53
54 } // namespace WebCore 54 } // namespace WebCore
OLDNEW

Powered by Google App Engine