| OLD | NEW |
| 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 5606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5617 | 5617 |
| 5618 styleEngine().platformColorsChanged(); | 5618 styleEngine().platformColorsChanged(); |
| 5619 } | 5619 } |
| 5620 | 5620 |
| 5621 void Document::clearWeakMembers(Visitor* visitor) | 5621 void Document::clearWeakMembers(Visitor* visitor) |
| 5622 { | 5622 { |
| 5623 if (m_axObjectCache) | 5623 if (m_axObjectCache) |
| 5624 m_axObjectCache->clearWeakMembers(visitor); | 5624 m_axObjectCache->clearWeakMembers(visitor); |
| 5625 } | 5625 } |
| 5626 | 5626 |
| 5627 v8::Handle<v8::Object> Document::wrap(v8::Handle<v8::Object> creationContext, v8
::Isolate* isolate) | 5627 v8::Local<v8::Object> Document::wrap(v8::Local<v8::Object> creationContext, v8::
Isolate* isolate) |
| 5628 { | 5628 { |
| 5629 // It's possible that no one except for the new wrapper owns this object at | 5629 // It's possible that no one except for the new wrapper owns this object at |
| 5630 // this moment, so we have to prevent GC to collect this object until the | 5630 // this moment, so we have to prevent GC to collect this object until the |
| 5631 // object gets associated with the wrapper. | 5631 // object gets associated with the wrapper. |
| 5632 RefPtrWillBeRawPtr<Document> protect(this); | 5632 RefPtrWillBeRawPtr<Document> protect(this); |
| 5633 | 5633 |
| 5634 ASSERT(!DOMDataStore::containsWrapper(this, isolate)); | 5634 ASSERT(!DOMDataStore::containsWrapper(this, isolate)); |
| 5635 | 5635 |
| 5636 const WrapperTypeInfo* wrapperType = wrapperTypeInfo(); | 5636 const WrapperTypeInfo* wrapperType = wrapperTypeInfo(); |
| 5637 | 5637 |
| 5638 if (frame() && frame()->script().initializeMainWorld()) { | 5638 if (frame() && frame()->script().initializeMainWorld()) { |
| 5639 // initializeMainWorld may have created a wrapper for the object, retry
from the start. | 5639 // initializeMainWorld may have created a wrapper for the object, retry
from the start. |
| 5640 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapper(this, isolate)
; | 5640 v8::Local<v8::Object> wrapper = DOMDataStore::getWrapper(this, isolate); |
| 5641 if (!wrapper.IsEmpty()) | 5641 if (!wrapper.IsEmpty()) |
| 5642 return wrapper; | 5642 return wrapper; |
| 5643 } | 5643 } |
| 5644 | 5644 |
| 5645 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(isolate, creati
onContext, wrapperType, this); | 5645 v8::Local<v8::Object> wrapper = V8DOMWrapper::createWrapper(isolate, creatio
nContext, wrapperType, this); |
| 5646 if (UNLIKELY(wrapper.IsEmpty())) | 5646 if (UNLIKELY(wrapper.IsEmpty())) |
| 5647 return wrapper; | 5647 return wrapper; |
| 5648 | 5648 |
| 5649 wrapperType->installConditionallyEnabledProperties(wrapper, isolate); | 5649 wrapperType->installConditionallyEnabledProperties(wrapper, isolate); |
| 5650 return associateWithWrapper(isolate, wrapperType, wrapper); | 5650 return associateWithWrapper(isolate, wrapperType, wrapper); |
| 5651 } | 5651 } |
| 5652 | 5652 |
| 5653 v8::Handle<v8::Object> Document::associateWithWrapper(v8::Isolate* isolate, cons
t WrapperTypeInfo* wrapperType, v8::Handle<v8::Object> wrapper) | 5653 v8::Local<v8::Object> Document::associateWithWrapper(v8::Isolate* isolate, const
WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper) |
| 5654 { | 5654 { |
| 5655 V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType, wrapper
); | 5655 V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType, wrapper
); |
| 5656 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate); | 5656 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate); |
| 5657 if (world.isMainWorld() && frame()) | 5657 if (world.isMainWorld() && frame()) |
| 5658 frame()->script().windowProxy(world)->updateDocumentWrapper(wrapper); | 5658 frame()->script().windowProxy(world)->updateDocumentWrapper(wrapper); |
| 5659 return wrapper; | 5659 return wrapper; |
| 5660 } | 5660 } |
| 5661 | 5661 |
| 5662 bool Document::isPrivilegedContext(String& errorMessage, const PrivilegeContextC
heck privilegeContextCheck) | 5662 bool Document::isPrivilegedContext(String& errorMessage, const PrivilegeContextC
heck privilegeContextCheck) |
| 5663 { | 5663 { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5757 #ifndef NDEBUG | 5757 #ifndef NDEBUG |
| 5758 using namespace blink; | 5758 using namespace blink; |
| 5759 void showLiveDocumentInstances() | 5759 void showLiveDocumentInstances() |
| 5760 { | 5760 { |
| 5761 WeakDocumentSet& set = liveDocumentSet(); | 5761 WeakDocumentSet& set = liveDocumentSet(); |
| 5762 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5762 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 5763 for (Document* document : set) | 5763 for (Document* document : set) |
| 5764 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5764 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
| 5765 } | 5765 } |
| 5766 #endif | 5766 #endif |
| OLD | NEW |