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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Issue 2617733004: binding: Changes the association among global-proxy/global/window-instance. (Closed)
Patch Set: Fixed Document.defaultView Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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:

Powered by Google App Engine
This is Rietveld 408576698