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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2209593002: Stop returning an empty handle from createWrapper() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 5832 matching lines...) Expand 10 before | Expand all | Expand 10 after
5843 const WrapperTypeInfo* wrapperType = wrapperTypeInfo(); 5843 const WrapperTypeInfo* wrapperType = wrapperTypeInfo();
5844 5844
5845 if (frame() && frame()->script().initializeMainWorld()) { 5845 if (frame() && frame()->script().initializeMainWorld()) {
5846 // initializeMainWorld may have created a wrapper for the object, retry from the start. 5846 // initializeMainWorld may have created a wrapper for the object, retry from the start.
5847 v8::Local<v8::Object> wrapper = DOMDataStore::getWrapper(this, isolate); 5847 v8::Local<v8::Object> wrapper = DOMDataStore::getWrapper(this, isolate);
5848 if (!wrapper.IsEmpty()) 5848 if (!wrapper.IsEmpty())
5849 return wrapper; 5849 return wrapper;
5850 } 5850 }
5851 5851
5852 v8::Local<v8::Object> wrapper = V8DOMWrapper::createWrapper(isolate, creatio nContext, wrapperType); 5852 v8::Local<v8::Object> wrapper = V8DOMWrapper::createWrapper(isolate, creatio nContext, wrapperType);
5853 if (UNLIKELY(wrapper.IsEmpty())) 5853 DCHECK(!wrapper.IsEmpty());
5854 return wrapper;
5855
5856 wrapperType->installConditionallyEnabledProperties(wrapper, isolate); 5854 wrapperType->installConditionallyEnabledProperties(wrapper, isolate);
5857 return associateWithWrapper(isolate, wrapperType, wrapper); 5855 return associateWithWrapper(isolate, wrapperType, wrapper);
5858 } 5856 }
5859 5857
5860 v8::Local<v8::Object> Document::associateWithWrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper) 5858 v8::Local<v8::Object> Document::associateWithWrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper)
5861 { 5859 {
5862 wrapper = V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperTyp e, wrapper); 5860 wrapper = V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperTyp e, wrapper);
5863 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate); 5861 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate);
5864 if (world.isMainWorld() && frame()) 5862 if (world.isMainWorld() && frame())
5865 frame()->script().windowProxy(world)->updateDocumentWrapper(wrapper); 5863 frame()->script().windowProxy(world)->updateDocumentWrapper(wrapper);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
6034 } 6032 }
6035 6033
6036 void showLiveDocumentInstances() 6034 void showLiveDocumentInstances()
6037 { 6035 {
6038 WeakDocumentSet& set = liveDocumentSet(); 6036 WeakDocumentSet& set = liveDocumentSet();
6039 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6037 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6040 for (Document* document : set) 6038 for (Document* document : set)
6041 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6039 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6042 } 6040 }
6043 #endif 6041 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp ('k') | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698