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

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

Issue 40433002: Make wrapperTypeInfo static member const in bindings classes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 2 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
« no previous file with comments | « Source/bindings/v8/V8DOMWrapper.cpp ('k') | Source/bindings/v8/V8Initializer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // during the GC prologue. 121 // during the GC prologue.
122 ASSERT((*reinterpret_cast<v8::Handle<v8::Value>*>(value))->IsObject()); 122 ASSERT((*reinterpret_cast<v8::Handle<v8::Value>*>(value))->IsObject());
123 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Object >*>(value); 123 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Object >*>(value);
124 ASSERT(V8DOMWrapper::maybeDOMWrapper(*wrapper)); 124 ASSERT(V8DOMWrapper::maybeDOMWrapper(*wrapper));
125 ASSERT(V8Node::HasInstanceInAnyWorld(*wrapper, m_isolate)); 125 ASSERT(V8Node::HasInstanceInAnyWorld(*wrapper, m_isolate));
126 Node* node = V8Node::toNative(*wrapper); 126 Node* node = V8Node::toNative(*wrapper);
127 // A minor DOM GC can handle only node wrappers in the main world. 127 // A minor DOM GC can handle only node wrappers in the main world.
128 // Note that node->wrapper().IsEmpty() returns true for nodes that 128 // Note that node->wrapper().IsEmpty() returns true for nodes that
129 // do not have wrappers in the main world. 129 // do not have wrappers in the main world.
130 if (node->containsWrapper()) { 130 if (node->containsWrapper()) {
131 WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper); 131 const WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper);
132 ActiveDOMObject* activeDOMObject = type->toActiveDOMObject(*wrapper) ; 132 ActiveDOMObject* activeDOMObject = type->toActiveDOMObject(*wrapper) ;
133 if (activeDOMObject && activeDOMObject->hasPendingActivity()) 133 if (activeDOMObject && activeDOMObject->hasPendingActivity())
134 return; 134 return;
135 m_nodesInNewSpace.append(node); 135 m_nodesInNewSpace.append(node);
136 node->setV8CollectableDuringMinorGC(true); 136 node->setV8CollectableDuringMinorGC(true);
137 } 137 }
138 } 138 }
139 139
140 void notifyFinished() 140 void notifyFinished()
141 { 141 {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 if (classId != v8DOMNodeClassId && classId != v8DOMObjectClassId) 238 if (classId != v8DOMNodeClassId && classId != v8DOMObjectClassId)
239 return; 239 return;
240 240
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 const WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper);
249 void* object = toNative(*wrapper); 249 void* object = toNative(*wrapper);
250 250
251 if (V8MessagePort::wrapperTypeInfo.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::wrapperTypeInfo.equals(type)) { 258 } else if (V8MutationObserver::wrapperTypeInfo.equals(type)) {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8DOMWrapper.cpp ('k') | Source/bindings/v8/V8Initializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698