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

Side by Side Diff: Source/core/dom/Document.h

Issue 262093006: Oilpan: Make the Node hierarchy RefCountedGarbageCollected instead of TreeShared. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. Created 6 years, 7 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 | Annotate | Revision Log
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, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 Document& topDocument() const; 828 Document& topDocument() const;
829 WeakPtr<Document> contextDocument(); 829 WeakPtr<Document> contextDocument();
830 830
831 ScriptRunner* scriptRunner() { return m_scriptRunner.get(); } 831 ScriptRunner* scriptRunner() { return m_scriptRunner.get(); }
832 832
833 HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEm pty() ? m_currentScriptStack.last().get() : 0; } 833 HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEm pty() ? m_currentScriptStack.last().get() : 0; }
834 void pushCurrentScript(PassRefPtr<HTMLScriptElement>); 834 void pushCurrentScript(PassRefPtr<HTMLScriptElement>);
835 void popCurrentScript(); 835 void popCurrentScript();
836 836
837 void applyXSLTransform(ProcessingInstruction* pi); 837 void applyXSLTransform(ProcessingInstruction* pi);
838 PassRefPtr<Document> transformSourceDocument() { return m_transformSourceDoc ument; } 838 PassRefPtrWillBeRawPtr<Document> transformSourceDocument() { return m_transf ormSourceDocument; }
839 void setTransformSourceDocument(Document* doc) { m_transformSourceDocument = doc; } 839 void setTransformSourceDocument(Document* doc) { m_transformSourceDocument = doc; }
840 840
841 void setTransformSource(PassOwnPtr<TransformSource>); 841 void setTransformSource(PassOwnPtr<TransformSource>);
842 TransformSource* transformSource() const { return m_transformSource.get(); } 842 TransformSource* transformSource() const { return m_transformSource.get(); }
843 843
844 void incDOMTreeVersion() { ASSERT(m_lifecycle.stateAllowsTreeMutations()); m _domTreeVersion = ++s_globalTreeVersion; } 844 void incDOMTreeVersion() { ASSERT(m_lifecycle.stateAllowsTreeMutations()); m _domTreeVersion = ++s_globalTreeVersion; }
845 uint64_t domTreeVersion() const { return m_domTreeVersion; } 845 uint64_t domTreeVersion() const { return m_domTreeVersion; }
846 846
847 enum PendingSheetLayout { NoLayoutWithPendingSheets, DidLayoutWithPendingShe ets, IgnoreLayoutWithPendingSheets }; 847 enum PendingSheetLayout { NoLayoutWithPendingSheets, DidLayoutWithPendingShe ets, IgnoreLayoutWithPendingSheets };
848 848
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 // Return a Locale for the default locale if the argument is null or empty. 1020 // Return a Locale for the default locale if the argument is null or empty.
1021 Locale& getCachedLocale(const AtomicString& locale = nullAtom); 1021 Locale& getCachedLocale(const AtomicString& locale = nullAtom);
1022 1022
1023 AnimationClock& animationClock() { return *m_animationClock; } 1023 AnimationClock& animationClock() { return *m_animationClock; }
1024 DocumentTimeline& timeline() const { return *m_timeline; } 1024 DocumentTimeline& timeline() const { return *m_timeline; }
1025 DocumentTimeline& transitionTimeline() const { return *m_transitionTimeline; } 1025 DocumentTimeline& transitionTimeline() const { return *m_transitionTimeline; }
1026 CompositorPendingAnimations& compositorPendingAnimations() { return m_compos itorPendingAnimations; } 1026 CompositorPendingAnimations& compositorPendingAnimations() { return m_compos itorPendingAnimations; }
1027 1027
1028 void addToTopLayer(Element*, const Element* before = 0); 1028 void addToTopLayer(Element*, const Element* before = 0);
1029 void removeFromTopLayer(Element*); 1029 void removeFromTopLayer(Element*);
1030 const Vector<RefPtr<Element> >& topLayerElements() const { return m_topLayer Elements; } 1030 const WillBeHeapVector<RefPtrWillBeMember<Element> >& topLayerElements() con st { return m_topLayerElements; }
1031 HTMLDialogElement* activeModalDialog() const; 1031 HTMLDialogElement* activeModalDialog() const;
1032 1032
1033 // A non-null m_templateDocumentHost implies that |this| was created by ensu reTemplateDocument(). 1033 // A non-null m_templateDocumentHost implies that |this| was created by ensu reTemplateDocument().
1034 bool isTemplateDocument() const { return !!m_templateDocumentHost; } 1034 bool isTemplateDocument() const { return !!m_templateDocumentHost; }
1035 Document& ensureTemplateDocument(); 1035 Document& ensureTemplateDocument();
1036 Document* templateDocumentHost() { return m_templateDocumentHost; } 1036 Document* templateDocumentHost() { return m_templateDocumentHost; }
1037 1037
1038 void didAssociateFormControl(Element*); 1038 void didAssociateFormControl(Element*);
1039 1039
1040 void addConsoleMessageWithRequestIdentifier(MessageSource, MessageLevel, con st String& message, unsigned long requestIdentifier); 1040 void addConsoleMessageWithRequestIdentifier(MessageSource, MessageLevel, con st String& message, unsigned long requestIdentifier);
1041 1041
1042 virtual DOMWindow* executingWindow() OVERRIDE FINAL; 1042 virtual DOMWindow* executingWindow() OVERRIDE FINAL;
1043 LocalFrame* executingFrame(); 1043 LocalFrame* executingFrame();
1044 1044
1045 DocumentLifecycleNotifier& lifecycleNotifier(); 1045 DocumentLifecycleNotifier& lifecycleNotifier();
1046 DocumentLifecycle& lifecycle() { return m_lifecycle; } 1046 DocumentLifecycle& lifecycle() { return m_lifecycle; }
1047 bool isActive() const { return m_lifecycle.isActive(); } 1047 bool isActive() const { return m_lifecycle.isActive(); }
1048 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St opped; } 1048 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St opped; }
1049 bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::D isposed; }
1049 1050
1050 enum HttpRefreshType { 1051 enum HttpRefreshType {
1051 HttpRefreshFromHeader, 1052 HttpRefreshFromHeader,
1052 HttpRefreshFromMetaTag 1053 HttpRefreshFromMetaTag
1053 }; 1054 };
1054 void maybeHandleHttpRefresh(const String&, HttpRefreshType); 1055 void maybeHandleHttpRefresh(const String&, HttpRefreshType);
1055 1056
1056 void updateSecurityOrigin(PassRefPtr<SecurityOrigin>); 1057 void updateSecurityOrigin(PassRefPtr<SecurityOrigin>);
1057 PassOwnPtr<LifecycleNotifier<Document> > createLifecycleNotifier(); 1058 PassOwnPtr<LifecycleNotifier<Document> > createLifecycleNotifier();
1058 1059
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 KURL m_baseURL; // Node.baseURI: The URL to use when resolving relative URLs . 1203 KURL m_baseURL; // Node.baseURI: The URL to use when resolving relative URLs .
1203 KURL m_baseURLOverride; // An alternative base URL that takes precedence ove r m_baseURL (but not m_baseElementURL). 1204 KURL m_baseURLOverride; // An alternative base URL that takes precedence ove r m_baseURL (but not m_baseElementURL).
1204 KURL m_baseElementURL; // The URL set by the <base> element. 1205 KURL m_baseElementURL; // The URL set by the <base> element.
1205 KURL m_cookieURL; // The URL to use for cookie access. 1206 KURL m_cookieURL; // The URL to use for cookie access.
1206 1207
1207 AtomicString m_baseTarget; 1208 AtomicString m_baseTarget;
1208 1209
1209 // Mime-type of the document in case it was cloned or created by XHR. 1210 // Mime-type of the document in case it was cloned or created by XHR.
1210 AtomicString m_mimeType; 1211 AtomicString m_mimeType;
1211 1212
1212 RefPtr<DocumentType> m_docType; 1213 RefPtrWillBeMember<DocumentType> m_docType;
1213 OwnPtr<DOMImplementation> m_implementation; 1214 OwnPtr<DOMImplementation> m_implementation;
1214 1215
1215 RefPtrWillBePersistent<CSSStyleSheet> m_elemSheet; 1216 RefPtrWillBeMember<CSSStyleSheet> m_elemSheet;
1216 1217
1217 bool m_printing; 1218 bool m_printing;
1218 bool m_paginatedForScreen; 1219 bool m_paginatedForScreen;
1219 1220
1220 CompatibilityMode m_compatibilityMode; 1221 CompatibilityMode m_compatibilityMode;
1221 bool m_compatibilityModeLocked; // This is cheaper than making setCompatibil ityMode virtual. 1222 bool m_compatibilityModeLocked; // This is cheaper than making setCompatibil ityMode virtual.
1222 1223
1223 bool m_hasAutofocused; 1224 bool m_hasAutofocused;
1224 Timer<Document> m_clearFocusedElementTimer; 1225 Timer<Document> m_clearFocusedElementTimer;
1225 RefPtr<Element> m_autofocusElement; 1226 RefPtrWillBeMember<Element> m_autofocusElement;
1226 RefPtr<Element> m_focusedElement; 1227 RefPtrWillBeMember<Element> m_focusedElement;
1227 RefPtr<Node> m_hoverNode; 1228 RefPtrWillBeMember<Node> m_hoverNode;
1228 RefPtr<Element> m_activeHoverElement; 1229 RefPtrWillBeMember<Element> m_activeHoverElement;
1229 RefPtr<Element> m_documentElement; 1230 RefPtrWillBeMember<Element> m_documentElement;
1230 UserActionElementSet m_userActionElements; 1231 UserActionElementSet m_userActionElements;
1231 1232
1232 uint64_t m_domTreeVersion; 1233 uint64_t m_domTreeVersion;
1233 static uint64_t s_globalTreeVersion; 1234 static uint64_t s_globalTreeVersion;
1234 1235
1235 HashSet<NodeIterator*> m_nodeIterators; 1236 HashSet<NodeIterator*> m_nodeIterators;
1236 HashSet<Range*> m_ranges; 1237 HashSet<Range*> m_ranges;
1237 1238
1238 unsigned short m_listenerTypes; 1239 unsigned short m_listenerTypes;
1239 1240
1240 MutationObserverOptions m_mutationObserverTypes; 1241 MutationObserverOptions m_mutationObserverTypes;
1241 1242
1242 OwnPtrWillBePersistent<StyleEngine> m_styleEngine; 1243 OwnPtrWillBeMember<StyleEngine> m_styleEngine;
1243 RefPtrWillBeMember<StyleSheetList> m_styleSheetList; 1244 RefPtrWillBeMember<StyleSheetList> m_styleSheetList;
1244 1245
1245 OwnPtr<FormController> m_formController; 1246 OwnPtr<FormController> m_formController;
1246 1247
1247 TextLinkColors m_textLinkColors; 1248 TextLinkColors m_textLinkColors;
1248 const OwnPtr<VisitedLinkState> m_visitedLinkState; 1249 const OwnPtr<VisitedLinkState> m_visitedLinkState;
1249 1250
1250 bool m_visuallyOrdered; 1251 bool m_visuallyOrdered;
1251 ReadyState m_readyState; 1252 ReadyState m_readyState;
1252 bool m_isParsing; 1253 bool m_isParsing;
1253 1254
1254 bool m_gotoAnchorNeededAfterStylesheetsLoad; 1255 bool m_gotoAnchorNeededAfterStylesheetsLoad;
1255 bool m_isDNSPrefetchEnabled; 1256 bool m_isDNSPrefetchEnabled;
1256 bool m_haveExplicitlyDisabledDNSPrefetch; 1257 bool m_haveExplicitlyDisabledDNSPrefetch;
1257 bool m_containsValidityStyleRules; 1258 bool m_containsValidityStyleRules;
1258 bool m_updateFocusAppearanceRestoresSelection; 1259 bool m_updateFocusAppearanceRestoresSelection;
1259 bool m_containsPlugins; 1260 bool m_containsPlugins;
1260 1261
1261 // http://www.whatwg.org/specs/web-apps/current-work/#ignore-destructive-wri tes-counter 1262 // http://www.whatwg.org/specs/web-apps/current-work/#ignore-destructive-wri tes-counter
1262 unsigned m_ignoreDestructiveWriteCount; 1263 unsigned m_ignoreDestructiveWriteCount;
1263 1264
1264 String m_title; 1265 String m_title;
1265 String m_rawTitle; 1266 String m_rawTitle;
1266 bool m_titleSetExplicitly; 1267 bool m_titleSetExplicitly;
1267 RefPtr<Element> m_titleElement; 1268 RefPtrWillBeMember<Element> m_titleElement;
1268 1269
1269 OwnPtr<AXObjectCache> m_axObjectCache; 1270 OwnPtr<AXObjectCache> m_axObjectCache;
1270 OwnPtr<DocumentMarkerController> m_markers; 1271 OwnPtr<DocumentMarkerController> m_markers;
1271 1272
1272 Timer<Document> m_updateFocusAppearanceTimer; 1273 Timer<Document> m_updateFocusAppearanceTimer;
1273 1274
1274 Element* m_cssTarget; 1275 Element* m_cssTarget;
1275 1276
1276 LoadEventProgress m_loadEventProgress; 1277 LoadEventProgress m_loadEventProgress;
1277 1278
1278 double m_startTime; 1279 double m_startTime;
1279 1280
1280 OwnPtr<ScriptRunner> m_scriptRunner; 1281 OwnPtr<ScriptRunner> m_scriptRunner;
1281 1282
1282 Vector<RefPtr<HTMLScriptElement> > m_currentScriptStack; 1283 WillBeHeapVector<RefPtrWillBeMember<HTMLScriptElement> > m_currentScriptStac k;
1283 1284
1284 OwnPtr<TransformSource> m_transformSource; 1285 OwnPtr<TransformSource> m_transformSource;
1285 RefPtr<Document> m_transformSourceDocument; 1286 RefPtrWillBeMember<Document> m_transformSourceDocument;
1286 1287
1287 String m_xmlEncoding; 1288 String m_xmlEncoding;
1288 String m_xmlVersion; 1289 String m_xmlVersion;
1289 unsigned m_xmlStandalone : 2; 1290 unsigned m_xmlStandalone : 2;
1290 unsigned m_hasXMLDeclaration : 1; 1291 unsigned m_hasXMLDeclaration : 1;
1291 1292
1292 AtomicString m_contentLanguage; 1293 AtomicString m_contentLanguage;
1293 1294
1294 DocumentEncodingData m_encodingData; 1295 DocumentEncodingData m_encodingData;
1295 1296
1296 InheritedBool m_designMode; 1297 InheritedBool m_designMode;
1297 1298
1298 HashSet<LiveNodeListBase*> m_listsInvalidatedAtDocument; 1299 HashSet<LiveNodeListBase*> m_listsInvalidatedAtDocument;
1299 unsigned m_nodeListCounts[numNodeListInvalidationTypes]; 1300 unsigned m_nodeListCounts[numNodeListInvalidationTypes];
1300 1301
1301 OwnPtr<SVGDocumentExtensions> m_svgExtensions; 1302 OwnPtr<SVGDocumentExtensions> m_svgExtensions;
1302 1303
1303 Vector<AnnotatedRegionValue> m_annotatedRegions; 1304 Vector<AnnotatedRegionValue> m_annotatedRegions;
1304 bool m_hasAnnotatedRegions; 1305 bool m_hasAnnotatedRegions;
1305 bool m_annotatedRegionsDirty; 1306 bool m_annotatedRegionsDirty;
1306 1307
1307 HashMap<String, RefPtr<HTMLCanvasElement> > m_cssCanvasElements; 1308 WillBeHeapHashMap<String, RefPtrWillBeMember<HTMLCanvasElement> > m_cssCanva sElements;
1308 1309
1309 OwnPtr<SelectorQueryCache> m_selectorQueryCache; 1310 OwnPtr<SelectorQueryCache> m_selectorQueryCache;
1310 1311
1311 bool m_useSecureKeyboardEntryWhenActive; 1312 bool m_useSecureKeyboardEntryWhenActive;
1312 1313
1313 DocumentClassFlags m_documentClasses; 1314 DocumentClassFlags m_documentClasses;
1314 1315
1315 bool m_isViewSource; 1316 bool m_isViewSource;
1316 bool m_sawElementsInKnownNamespaces; 1317 bool m_sawElementsInKnownNamespaces;
1317 bool m_isSrcdocDocument; 1318 bool m_isSrcdocDocument;
1318 bool m_isMobileDocument; 1319 bool m_isMobileDocument;
1319 1320
1320 RenderView* m_renderView; 1321 RenderView* m_renderView;
1321 1322
1322 WeakPtrFactory<Document> m_weakFactory; 1323 WeakPtrFactory<Document> m_weakFactory;
1323 WeakPtr<Document> m_contextDocument; 1324 WeakPtr<Document> m_contextDocument;
1324 1325
1325 bool m_hasFullscreenElementStack; // For early return in FullscreenElementSt ack::fromIfExists() 1326 bool m_hasFullscreenElementStack; // For early return in FullscreenElementSt ack::fromIfExists()
1326 1327
1327 Vector<RefPtr<Element> > m_topLayerElements; 1328 WillBeHeapVector<RefPtrWillBeMember<Element> > m_topLayerElements;
1328 1329
1329 int m_loadEventDelayCount; 1330 int m_loadEventDelayCount;
1330 Timer<Document> m_loadEventDelayTimer; 1331 Timer<Document> m_loadEventDelayTimer;
1331 Timer<Document> m_pluginLoadingTimer; 1332 Timer<Document> m_pluginLoadingTimer;
1332 1333
1333 ViewportDescription m_viewportDescription; 1334 ViewportDescription m_viewportDescription;
1334 ViewportDescription m_legacyViewportDescription; 1335 ViewportDescription m_legacyViewportDescription;
1335 Length m_viewportDefaultMinWidth; 1336 Length m_viewportDefaultMinWidth;
1336 1337
1337 bool m_didSetReferrerPolicy; 1338 bool m_didSetReferrerPolicy;
(...skipping 25 matching lines...) Expand all
1363 #endif 1364 #endif
1364 1365
1365 typedef HashMap<AtomicString, OwnPtr<Locale> > LocaleIdentifierToLocaleMap; 1366 typedef HashMap<AtomicString, OwnPtr<Locale> > LocaleIdentifierToLocaleMap;
1366 LocaleIdentifierToLocaleMap m_localeCache; 1367 LocaleIdentifierToLocaleMap m_localeCache;
1367 1368
1368 OwnPtr<AnimationClock> m_animationClock; 1369 OwnPtr<AnimationClock> m_animationClock;
1369 RefPtr<DocumentTimeline> m_timeline; 1370 RefPtr<DocumentTimeline> m_timeline;
1370 RefPtr<DocumentTimeline> m_transitionTimeline; 1371 RefPtr<DocumentTimeline> m_transitionTimeline;
1371 CompositorPendingAnimations m_compositorPendingAnimations; 1372 CompositorPendingAnimations m_compositorPendingAnimations;
1372 1373
1373 RefPtr<Document> m_templateDocument; 1374 RefPtrWillBeMember<Document> m_templateDocument;
1374 Document* m_templateDocumentHost; // Manually managed weakref (backpointer f rom m_templateDocument). 1375 RawPtrWillBeMember<Document> m_templateDocumentHost; // Manually managed wea kref (backpointer from m_templateDocument).
1375 1376
1376 Timer<Document> m_didAssociateFormControlsTimer; 1377 Timer<Document> m_didAssociateFormControlsTimer;
1377 HashSet<RefPtr<Element> > m_associatedFormControls; 1378 WillBeHeapHashSet<RefPtrWillBeMember<Element> > m_associatedFormControls;
1378 1379
1379 HashSet<SVGUseElement*> m_useElementsNeedingUpdate; 1380 HashSet<SVGUseElement*> m_useElementsNeedingUpdate;
1380 HashSet<Element*> m_layerUpdateElements; 1381 HashSet<Element*> m_layerUpdateElements;
1381 1382
1382 bool m_hasViewportUnits; 1383 bool m_hasViewportUnits;
1383 1384
1384 typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<DocumentVisibilityObserver> > DocumentVisibilityObserverSet; 1385 typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<DocumentVisibilityObserver> > DocumentVisibilityObserverSet;
1385 DocumentVisibilityObserverSet m_visibilityObservers; 1386 DocumentVisibilityObserverSet m_visibilityObservers;
1386 1387
1387 int m_styleRecalcElementCounter; 1388 int m_styleRecalcElementCounter;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 inline bool Node::isDocumentNode() const 1442 inline bool Node::isDocumentNode() const
1442 { 1443 {
1443 return this == document(); 1444 return this == document();
1444 } 1445 }
1445 1446
1446 Node* eventTargetNodeForDocument(Document*); 1447 Node* eventTargetNodeForDocument(Document*);
1447 1448
1448 } // namespace WebCore 1449 } // namespace WebCore
1449 1450
1450 #endif // Document_h 1451 #endif // Document_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698