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

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

Issue 1119683003: Implement requestIdleCallback API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add LayoutTest and fix minor spec violation Created 5 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 | 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 class HTMLCollection; 115 class HTMLCollection;
116 class HTMLDialogElement; 116 class HTMLDialogElement;
117 class HTMLElement; 117 class HTMLElement;
118 class HTMLFrameOwnerElement; 118 class HTMLFrameOwnerElement;
119 class HTMLHeadElement; 119 class HTMLHeadElement;
120 class HTMLImportLoader; 120 class HTMLImportLoader;
121 class HTMLImportsController; 121 class HTMLImportsController;
122 class HTMLLinkElement; 122 class HTMLLinkElement;
123 class HTMLScriptElement; 123 class HTMLScriptElement;
124 class HitTestRequest; 124 class HitTestRequest;
125 class IdleRequestCallback;
125 class LayoutPoint; 126 class LayoutPoint;
126 class LiveNodeListBase; 127 class LiveNodeListBase;
127 class Locale; 128 class Locale;
128 class LocalFrame; 129 class LocalFrame;
129 class Location; 130 class Location;
130 class MainThreadTaskRunner; 131 class MainThreadTaskRunner;
131 class MediaQueryListListener; 132 class MediaQueryListListener;
132 class MediaQueryMatcher; 133 class MediaQueryMatcher;
133 class NodeFilter; 134 class NodeFilter;
134 class NodeIterator; 135 class NodeIterator;
135 class NthIndexCache; 136 class NthIndexCache;
136 class Page; 137 class Page;
137 class PlatformMouseEvent; 138 class PlatformMouseEvent;
138 class ProcessingInstruction; 139 class ProcessingInstruction;
139 class QualifiedName; 140 class QualifiedName;
140 class Range; 141 class Range;
141 class LayoutView; 142 class LayoutView;
142 class ResourceFetcher; 143 class ResourceFetcher;
143 class SVGDocumentExtensions; 144 class SVGDocumentExtensions;
144 class SVGUseElement; 145 class SVGUseElement;
145 class ScriptRunner; 146 class ScriptRunner;
146 class ScriptableDocumentParser; 147 class ScriptableDocumentParser;
147 class ScriptedAnimationController; 148 class ScriptedAnimationController;
149 class ScriptedIdleTaskController;
148 class SecurityOrigin; 150 class SecurityOrigin;
149 class SegmentedString; 151 class SegmentedString;
150 class SelectorQueryCache; 152 class SelectorQueryCache;
151 class SerializedScriptValue; 153 class SerializedScriptValue;
152 class Settings; 154 class Settings;
153 class StyleEngine; 155 class StyleEngine;
154 class StyleResolver; 156 class StyleResolver;
155 class StyleSheet; 157 class StyleSheet;
156 class StyleSheetList; 158 class StyleSheetList;
157 class Text; 159 class Text;
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 921
920 PassRefPtrWillBeRawPtr<Touch> createTouch(DOMWindow*, EventTarget*, int iden tifier, double pageX, double pageY, double screenX, double screenY, double radiu sX, double radiusY, float rotationAngle, float force) const; 922 PassRefPtrWillBeRawPtr<Touch> createTouch(DOMWindow*, EventTarget*, int iden tifier, double pageX, double pageY, double screenX, double screenY, double radiu sX, double radiusY, float rotationAngle, float force) const;
921 PassRefPtrWillBeRawPtr<TouchList> createTouchList(WillBeHeapVector<RefPtrWil lBeMember<Touch>>&) const; 923 PassRefPtrWillBeRawPtr<TouchList> createTouchList(WillBeHeapVector<RefPtrWil lBeMember<Touch>>&) const;
922 924
923 const DocumentTiming& timing() const { return m_documentTiming; } 925 const DocumentTiming& timing() const { return m_documentTiming; }
924 926
925 int requestAnimationFrame(FrameRequestCallback*); 927 int requestAnimationFrame(FrameRequestCallback*);
926 void cancelAnimationFrame(int id); 928 void cancelAnimationFrame(int id);
927 void serviceScriptedAnimations(double monotonicAnimationStartTime); 929 void serviceScriptedAnimations(double monotonicAnimationStartTime);
928 930
931 int requestIdleCallback(IdleRequestCallback*, double timeout);
Sami 2015/08/10 09:47:46 nit: timeoutMs/Millis/Milliseconds? (here and else
rmcilroy 2015/08/11 16:30:51 Done.
932 void cancelIdleCallback(int id);
933
929 EventTarget* errorEventTarget() final; 934 EventTarget* errorEventTarget() final;
930 void logExceptionToConsole(const String& errorMessage, int scriptId, const S tring& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<Scrip tCallStack>) final; 935 void logExceptionToConsole(const String& errorMessage, int scriptId, const S tring& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<Scrip tCallStack>) final;
931 936
937
jochen (gone - plz use gerrit) 2015/07/31 09:19:19 nit. remove
rmcilroy 2015/08/11 16:30:51 Done.
932 void initDNSPrefetch(); 938 void initDNSPrefetch();
933 939
934 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } 940 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; }
935 941
936 TextAutosizer* textAutosizer(); 942 TextAutosizer* textAutosizer();
937 943
938 PassRefPtrWillBeRawPtr<Element> createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState&); 944 PassRefPtrWillBeRawPtr<Element> createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState&);
939 PassRefPtrWillBeRawPtr<Element> createElementNS(const AtomicString& namespac eURI, const AtomicString& qualifiedName, const AtomicString& typeExtension, Exce ptionState&); 945 PassRefPtrWillBeRawPtr<Element> createElementNS(const AtomicString& namespac eURI, const AtomicString& qualifiedName, const AtomicString& typeExtension, Exce ptionState&);
940 ScriptValue registerElement(ScriptState*, const AtomicString& name, const El ementRegistrationOptions&, ExceptionState&, CustomElement::NameSet validNames = CustomElement::StandardNames); 946 ScriptValue registerElement(ScriptState*, const AtomicString& name, const El ementRegistrationOptions&, ExceptionState&, CustomElement::NameSet validNames = CustomElement::StandardNames);
941 CustomElementRegistrationContext* registrationContext() { return m_registrat ionContext.get(); } 947 CustomElementRegistrationContext* registrationContext() { return m_registrat ionContext.get(); }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 1066
1061 private: 1067 private:
1062 friend class IgnoreDestructiveWriteCountIncrementer; 1068 friend class IgnoreDestructiveWriteCountIncrementer;
1063 friend class NthIndexCache; 1069 friend class NthIndexCache;
1064 1070
1065 bool isDocumentFragment() const = delete; // This will catch anyone doing an unnecessary check. 1071 bool isDocumentFragment() const = delete; // This will catch anyone doing an unnecessary check.
1066 bool isDocumentNode() const = delete; // This will catch anyone doing an unn ecessary check. 1072 bool isDocumentNode() const = delete; // This will catch anyone doing an unn ecessary check.
1067 bool isElementNode() const = delete; // This will catch anyone doing an unne cessary check. 1073 bool isElementNode() const = delete; // This will catch anyone doing an unne cessary check.
1068 1074
1069 ScriptedAnimationController& ensureScriptedAnimationController(); 1075 ScriptedAnimationController& ensureScriptedAnimationController();
1076 ScriptedIdleTaskController& ensureScriptedIdleTaskController();
1070 SecurityContext& securityContext() final { return *this; } 1077 SecurityContext& securityContext() final { return *this; }
1071 EventQueue* eventQueue() const final; 1078 EventQueue* eventQueue() const final;
1072 1079
1073 // FIXME: Rename the StyleRecalc state to LayoutTreeUpdate. 1080 // FIXME: Rename the StyleRecalc state to LayoutTreeUpdate.
1074 bool hasPendingStyleRecalc() const { return m_lifecycle.state() == DocumentL ifecycle::VisualUpdatePending; } 1081 bool hasPendingStyleRecalc() const { return m_lifecycle.state() == DocumentL ifecycle::VisualUpdatePending; }
1075 1082
1076 bool shouldScheduleLayoutTreeUpdate() const; 1083 bool shouldScheduleLayoutTreeUpdate() const;
1077 void scheduleLayoutTreeUpdate(); 1084 void scheduleLayoutTreeUpdate();
1078 1085
1079 bool needsFullLayoutTreeUpdate() const; 1086 bool needsFullLayoutTreeUpdate() const;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 Length m_viewportDefaultMinWidth; 1341 Length m_viewportDefaultMinWidth;
1335 1342
1336 ReferrerPolicy m_referrerPolicy; 1343 ReferrerPolicy m_referrerPolicy;
1337 1344
1338 DocumentTiming m_documentTiming; 1345 DocumentTiming m_documentTiming;
1339 RefPtrWillBeMember<MediaQueryMatcher> m_mediaQueryMatcher; 1346 RefPtrWillBeMember<MediaQueryMatcher> m_mediaQueryMatcher;
1340 bool m_writeRecursionIsTooDeep; 1347 bool m_writeRecursionIsTooDeep;
1341 unsigned m_writeRecursionDepth; 1348 unsigned m_writeRecursionDepth;
1342 1349
1343 RefPtrWillBeMember<ScriptedAnimationController> m_scriptedAnimationControlle r; 1350 RefPtrWillBeMember<ScriptedAnimationController> m_scriptedAnimationControlle r;
1351 RefPtrWillBeMember<ScriptedIdleTaskController> m_scriptedIdleTaskController;
1344 OwnPtr<MainThreadTaskRunner> m_taskRunner; 1352 OwnPtr<MainThreadTaskRunner> m_taskRunner;
1345 OwnPtrWillBeMember<TextAutosizer> m_textAutosizer; 1353 OwnPtrWillBeMember<TextAutosizer> m_textAutosizer;
1346 1354
1347 RefPtrWillBeMember<CustomElementRegistrationContext> m_registrationContext; 1355 RefPtrWillBeMember<CustomElementRegistrationContext> m_registrationContext;
1348 RefPtrWillBeMember<CustomElementMicrotaskRunQueue> m_customElementMicrotaskR unQueue; 1356 RefPtrWillBeMember<CustomElementMicrotaskRunQueue> m_customElementMicrotaskR unQueue;
1349 1357
1350 void elementDataCacheClearTimerFired(Timer<Document>*); 1358 void elementDataCacheClearTimerFired(Timer<Document>*);
1351 Timer<Document> m_elementDataCacheClearTimer; 1359 Timer<Document> m_elementDataCacheClearTimer;
1352 1360
1353 OwnPtrWillBeMember<ElementDataCache> m_elementDataCache; 1361 OwnPtrWillBeMember<ElementDataCache> m_elementDataCache;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); 1437 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true);
1430 1438
1431 } // namespace blink 1439 } // namespace blink
1432 1440
1433 #ifndef NDEBUG 1441 #ifndef NDEBUG
1434 // Outside the WebCore namespace for ease of invocation from gdb. 1442 // Outside the WebCore namespace for ease of invocation from gdb.
1435 CORE_EXPORT void showLiveDocumentInstances(); 1443 CORE_EXPORT void showLiveDocumentInstances();
1436 #endif 1444 #endif
1437 1445
1438 #endif // Document_h 1446 #endif // Document_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698