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

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

Powered by Google App Engine
This is Rietveld 408576698