| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Object
>*>(value); | 241 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Object
>*>(value); |
| 242 | 242 |
| 243 ASSERT(V8DOMWrapper::maybeDOMWrapper(*wrapper)); | 243 ASSERT(V8DOMWrapper::maybeDOMWrapper(*wrapper)); |
| 244 | 244 |
| 245 if (value->IsIndependent()) | 245 if (value->IsIndependent()) |
| 246 return; | 246 return; |
| 247 | 247 |
| 248 WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper); | 248 WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper); |
| 249 void* object = toNative(*wrapper); | 249 void* object = toNative(*wrapper); |
| 250 | 250 |
| 251 if (V8MessagePort::info.equals(type)) { | 251 if (V8MessagePort::wrapperTypeInfo.equals(type)) { |
| 252 // Mark each port as in-use if it's entangled. For simplicity's sake
, | 252 // Mark each port as in-use if it's entangled. For simplicity's sake
, |
| 253 // we assume all ports are remotely entangled, since the Chromium po
rt | 253 // we assume all ports are remotely entangled, since the Chromium po
rt |
| 254 // implementation can't tell the difference. | 254 // implementation can't tell the difference. |
| 255 MessagePort* port = static_cast<MessagePort*>(object); | 255 MessagePort* port = static_cast<MessagePort*>(object); |
| 256 if (port->isEntangled() || port->hasPendingActivity()) | 256 if (port->isEntangled() || port->hasPendingActivity()) |
| 257 m_isolate->SetObjectGroupId(*value, liveRootId()); | 257 m_isolate->SetObjectGroupId(*value, liveRootId()); |
| 258 } else if (V8MutationObserver::info.equals(type)) { | 258 } else if (V8MutationObserver::wrapperTypeInfo.equals(type)) { |
| 259 // FIXME: Allow opaqueRootForGC to operate on multiple roots and mov
e this logic into V8MutationObserverCustom. | 259 // FIXME: Allow opaqueRootForGC to operate on multiple roots and mov
e this logic into V8MutationObserverCustom. |
| 260 MutationObserver* observer = static_cast<MutationObserver*>(object); | 260 MutationObserver* observer = static_cast<MutationObserver*>(object); |
| 261 HashSet<Node*> observedNodes = observer->getObservedNodes(); | 261 HashSet<Node*> observedNodes = observer->getObservedNodes(); |
| 262 for (HashSet<Node*>::iterator it = observedNodes.begin(); it != obse
rvedNodes.end(); ++it) { | 262 for (HashSet<Node*>::iterator it = observedNodes.begin(); it != obse
rvedNodes.end(); ++it) { |
| 263 v8::UniqueId id(reinterpret_cast<intptr_t>(V8GCController::opaqu
eRootForGC(*it, m_isolate))); | 263 v8::UniqueId id(reinterpret_cast<intptr_t>(V8GCController::opaqu
eRootForGC(*it, m_isolate))); |
| 264 m_isolate->SetReferenceFromGroup(id, *value); | 264 m_isolate->SetReferenceFromGroup(id, *value); |
| 265 } | 265 } |
| 266 } else { | 266 } else { |
| 267 ActiveDOMObject* activeDOMObject = type->toActiveDOMObject(*wrapper)
; | 267 ActiveDOMObject* activeDOMObject = type->toActiveDOMObject(*wrapper)
; |
| 268 if (activeDOMObject && activeDOMObject->hasPendingActivity()) | 268 if (activeDOMObject && activeDOMObject->hasPendingActivity()) |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 { | 414 { |
| 415 v8::HandleScope handleScope(isolate); | 415 v8::HandleScope handleScope(isolate); |
| 416 v8::Local<v8::Context> context = v8::Context::New(isolate); | 416 v8::Local<v8::Context> context = v8::Context::New(isolate); |
| 417 if (context.IsEmpty()) | 417 if (context.IsEmpty()) |
| 418 return; | 418 return; |
| 419 v8::Context::Scope contextScope(context); | 419 v8::Context::Scope contextScope(context); |
| 420 V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolat
e), isolate); | 420 V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolat
e), isolate); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } // namespace WebCore | 423 } // namespace WebCore |
| OLD | NEW |