Chromium Code Reviews| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 | 115 |
| 116 // MinorGC does not collect objects because it may be expensive to | 116 // MinorGC does not collect objects because it may be expensive to |
| 117 // update references during minorGC | 117 // update references during minorGC |
| 118 if (classId == WrapperTypeInfo::ObjectClassId) { | 118 if (classId == WrapperTypeInfo::ObjectClassId) { |
| 119 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); | 119 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); |
| 120 return; | 120 return; |
| 121 } | 121 } |
| 122 | 122 |
| 123 v8::Local<v8::Object> wrapper = v8::Local<v8::Object>::New(m_isolate, v8 ::Persistent<v8::Object>::Cast(*value)); | 123 v8::Local<v8::Object> wrapper = v8::Local<v8::Object>::New(m_isolate, v8 ::Persistent<v8::Object>::Cast(*value)); |
| 124 ASSERT(V8DOMWrapper::hasInternalFieldsSet(wrapper)); | 124 ASSERT(V8DOMWrapper::hasInternalFieldsSet(wrapper)); |
| 125 const WrapperTypeInfo* type = toWrapperTypeInfo(wrapper); | |
|
sof
2016/02/25 13:08:13
You still need this, I think, but need to add mark
haraken
2016/02/25 13:58:37
Ah, nice catch. HTMLMediaElement needs to be marke
| |
| 126 if (type != npObjectTypeInfo() && toScriptWrappable(wrapper)->hasPending Activity()) | |
| 127 return; | |
| 128 | |
| 129 if (classId == WrapperTypeInfo::NodeClassId) { | 125 if (classId == WrapperTypeInfo::NodeClassId) { |
| 130 ASSERT(V8Node::hasInstance(wrapper, m_isolate)); | 126 ASSERT(V8Node::hasInstance(wrapper, m_isolate)); |
| 131 Node* node = V8Node::toImpl(wrapper); | 127 Node* node = V8Node::toImpl(wrapper); |
| 132 if (node->hasEventListeners()) { | 128 if (node->hasEventListeners()) { |
| 133 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); | 129 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); |
| 134 return; | 130 return; |
| 135 } | 131 } |
| 136 // FIXME: Remove the special handling for image elements. | 132 // FIXME: Remove the special handling for image elements. |
| 137 // The same special handling is in V8GCController::opaqueRootForGC() . | 133 // The same special handling is in V8GCController::opaqueRootForGC() . |
| 138 // Maybe should image elements be active DOM nodes? | 134 // Maybe should image elements be active DOM nodes? |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 485 | 481 |
| 486 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scanPendingActivityHis togram, new CustomCountHistogram("Blink.ScanPendingActivityDuration", 1, 1000, 5 0)); | 482 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scanPendingActivityHis togram, new CustomCountHistogram("Blink.ScanPendingActivityDuration", 1, 1000, 5 0)); |
| 487 double startTime = WTF::currentTimeMS(); | 483 double startTime = WTF::currentTimeMS(); |
| 488 PendingActivityVisitor visitor(executionContext); | 484 PendingActivityVisitor visitor(executionContext); |
| 489 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); | 485 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); |
| 490 scanPendingActivityHistogram.count(static_cast<int>(WTF::currentTimeMS() - s tartTime)); | 486 scanPendingActivityHistogram.count(static_cast<int>(WTF::currentTimeMS() - s tartTime)); |
| 491 return visitor.pendingActivityFound(); | 487 return visitor.pendingActivityFound(); |
| 492 } | 488 } |
| 493 | 489 |
| 494 } // namespace blink | 490 } // namespace blink |
| OLD | NEW |