Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp |
| index ad0f11b1d9bf46d062554580886b5ca12c7cc158..cbd5aa209d3e5cf01ea410bf386202cc6f359e92 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp |
| @@ -458,7 +458,9 @@ void V8GCController::collectAllGarbageForTesting(v8::Isolate* isolate) { |
| class DOMWrapperTracer : public v8::PersistentHandleVisitor { |
| public: |
| - explicit DOMWrapperTracer(Visitor* visitor) : m_visitor(visitor) {} |
| + explicit DOMWrapperTracer(Visitor* visitor) : m_visitor(visitor) { |
| + DCHECK(m_visitor); |
| + } |
| void VisitPersistentHandle(v8::Persistent<v8::Value>* value, |
| uint16_t classId) override { |
| @@ -469,8 +471,10 @@ class DOMWrapperTracer : public v8::PersistentHandleVisitor { |
| const v8::Persistent<v8::Object>& wrapper = |
| v8::Persistent<v8::Object>::Cast(*value); |
| - if (m_visitor) |
| - toWrapperTypeInfo(wrapper)->trace(m_visitor, toScriptWrappable(wrapper)); |
| + // |scriptWrappable| can be null if |wrapper| is a global proxy object, |
| + // which points to nothing while a navigation. |
|
haraken
2017/02/09 12:46:40
Move this comment to toScriptWrappable.
Yuki
2017/02/10 07:47:21
Done.
|
| + if (ScriptWrappable* scriptWrappable = toScriptWrappable(wrapper)) |
| + toWrapperTypeInfo(wrapper)->trace(m_visitor, scriptWrappable); |
| } |
| private: |