OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "bindings/core/v8/ExceptionMessages.h" | 34 #include "bindings/core/v8/ExceptionMessages.h" |
35 #include "bindings/core/v8/ExceptionState.h" | 35 #include "bindings/core/v8/ExceptionState.h" |
36 #include "bindings/core/v8/V8Binding.h" | 36 #include "bindings/core/v8/V8Binding.h" |
37 #include "bindings/core/v8/V8DOMWrapper.h" | 37 #include "bindings/core/v8/V8DOMWrapper.h" |
38 #include "bindings/core/v8/V8GCController.h" | 38 #include "bindings/core/v8/V8GCController.h" |
39 #include "bindings/core/v8/V8MutationCallback.h" | 39 #include "bindings/core/v8/V8MutationCallback.h" |
40 #include "core/dom/MutationObserver.h" | 40 #include "core/dom/MutationObserver.h" |
41 #include "core/dom/Node.h" | 41 #include "core/dom/Node.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace blink { |
44 | 44 |
45 void V8MutationObserver::constructorCustom(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 45 void V8MutationObserver::constructorCustom(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
46 { | 46 { |
47 ExceptionState exceptionState(ExceptionState::ConstructionContext, "Mutation
Observer", info.Holder(), info.GetIsolate()); | 47 ExceptionState exceptionState(ExceptionState::ConstructionContext, "Mutation
Observer", info.Holder(), info.GetIsolate()); |
48 if (info.Length() < 1) { | 48 if (info.Length() < 1) { |
49 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 49 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
50 exceptionState.throwIfNeeded(); | 50 exceptionState.throwIfNeeded(); |
51 return; | 51 return; |
52 } | 52 } |
53 | 53 |
(...skipping 16 matching lines...) Expand all Loading... |
70 void V8MutationObserver::visitDOMWrapper(void* object, const v8::Persistent<v8::
Object>& wrapper, v8::Isolate* isolate) | 70 void V8MutationObserver::visitDOMWrapper(void* object, const v8::Persistent<v8::
Object>& wrapper, v8::Isolate* isolate) |
71 { | 71 { |
72 MutationObserver* observer = static_cast<MutationObserver*>(object); | 72 MutationObserver* observer = static_cast<MutationObserver*>(object); |
73 WillBeHeapHashSet<RawPtrWillBeMember<Node> > observedNodes = observer->getOb
servedNodes(); | 73 WillBeHeapHashSet<RawPtrWillBeMember<Node> > observedNodes = observer->getOb
servedNodes(); |
74 for (WillBeHeapHashSet<RawPtrWillBeMember<Node> >::iterator it = observedNod
es.begin(); it != observedNodes.end(); ++it) { | 74 for (WillBeHeapHashSet<RawPtrWillBeMember<Node> >::iterator it = observedNod
es.begin(); it != observedNodes.end(); ++it) { |
75 v8::UniqueId id(reinterpret_cast<intptr_t>(V8GCController::opaqueRootFor
GC(*it, isolate))); | 75 v8::UniqueId id(reinterpret_cast<intptr_t>(V8GCController::opaqueRootFor
GC(*it, isolate))); |
76 isolate->SetReferenceFromGroup(id, wrapper); | 76 isolate->SetReferenceFromGroup(id, wrapper); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 } // namespace WebCore | 80 } // namespace blink |
OLD | NEW |