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

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

Issue 559553002: Merge ExecutionContextClient and ExecutionContext (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@tmp1
Patch Set: Rebased Created 6 years, 3 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
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 protected: 207 protected:
208 virtual void trace(Visitor*); 208 virtual void trace(Visitor*);
209 209
210 private: 210 private:
211 void registerObserver(Document&); 211 void registerObserver(Document&);
212 void unregisterObserver(); 212 void unregisterObserver();
213 213
214 RawPtrWillBeMember<Document> m_document; 214 RawPtrWillBeMember<Document> m_document;
215 }; 215 };
216 216
217 class Document : public ContainerNode, public TreeScope, public SecurityContext, public ExecutionContext, public ExecutionContextClient 217 class Document : public ContainerNode, public TreeScope, public SecurityContext, public ExecutionContext
218 , public DocumentSupplementable, public LifecycleContext<Document> { 218 , public DocumentSupplementable, public LifecycleContext<Document> {
219 DEFINE_WRAPPERTYPEINFO(); 219 DEFINE_WRAPPERTYPEINFO();
220 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Document); 220 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Document);
221 public: 221 public:
222 static PassRefPtrWillBeRawPtr<Document> create(const DocumentInit& initializ er = DocumentInit()) 222 static PassRefPtrWillBeRawPtr<Document> create(const DocumentInit& initializ er = DocumentInit())
223 { 223 {
224 return adoptRefWillBeNoop(new Document(initializer)); 224 return adoptRefWillBeNoop(new Document(initializer));
225 } 225 }
226 virtual ~Document(); 226 virtual ~Document();
227 227
228 MediaQueryMatcher& mediaQueryMatcher(); 228 MediaQueryMatcher& mediaQueryMatcher();
229 229
230 void mediaQueryAffectingValueChanged(); 230 void mediaQueryAffectingValueChanged();
231 231
232 #if !ENABLE(OILPAN) 232 #if !ENABLE(OILPAN)
233 using ContainerNode::ref; 233 using ContainerNode::ref;
234 using ContainerNode::deref; 234 using ContainerNode::deref;
235 #endif 235 #endif
236 using SecurityContext::securityOrigin; 236 using SecurityContext::securityOrigin;
237 using SecurityContext::contentSecurityPolicy; 237 using SecurityContext::contentSecurityPolicy;
238 using ExecutionContextClient::addConsoleMessage;
239 using TreeScope::getElementById; 238 using TreeScope::getElementById;
240 239
241 virtual bool canContainRangeEndPoint() const OVERRIDE { return true; } 240 virtual bool canContainRangeEndPoint() const OVERRIDE { return true; }
242 241
243 SelectorQueryCache& selectorQueryCache(); 242 SelectorQueryCache& selectorQueryCache();
244 243
245 // Focus Management. 244 // Focus Management.
246 Element* activeElement() const; 245 Element* activeElement() const;
247 bool hasFocus() const; 246 bool hasFocus() const;
248 247
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 const WillBeHeapVector<RefPtrWillBeMember<Element> >& topLayerElements() con st { return m_topLayerElements; } 996 const WillBeHeapVector<RefPtrWillBeMember<Element> >& topLayerElements() con st { return m_topLayerElements; }
998 HTMLDialogElement* activeModalDialog() const; 997 HTMLDialogElement* activeModalDialog() const;
999 998
1000 // A non-null m_templateDocumentHost implies that |this| was created by ensu reTemplateDocument(). 999 // A non-null m_templateDocumentHost implies that |this| was created by ensu reTemplateDocument().
1001 bool isTemplateDocument() const { return !!m_templateDocumentHost; } 1000 bool isTemplateDocument() const { return !!m_templateDocumentHost; }
1002 Document& ensureTemplateDocument(); 1001 Document& ensureTemplateDocument();
1003 Document* templateDocumentHost() { return m_templateDocumentHost; } 1002 Document* templateDocumentHost() { return m_templateDocumentHost; }
1004 1003
1005 void didAssociateFormControl(Element*); 1004 void didAssociateFormControl(Element*);
1006 1005
1007 virtual void addMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) OVERRIDE FIN AL; 1006 virtual void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) OVERR IDE FINAL;
1008 1007
1009 virtual LocalDOMWindow* executingWindow() OVERRIDE FINAL; 1008 virtual LocalDOMWindow* executingWindow() OVERRIDE FINAL;
1010 LocalFrame* executingFrame(); 1009 LocalFrame* executingFrame();
1011 1010
1012 DocumentLifecycleNotifier& lifecycleNotifier(); 1011 DocumentLifecycleNotifier& lifecycleNotifier();
1013 DocumentLifecycle& lifecycle() { return m_lifecycle; } 1012 DocumentLifecycle& lifecycle() { return m_lifecycle; }
1014 bool isActive() const { return m_lifecycle.isActive(); } 1013 bool isActive() const { return m_lifecycle.isActive(); }
1015 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St opped; } 1014 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St opped; }
1016 bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::D isposed; } 1015 bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::D isposed; }
1017 1016
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 1385
1387 inline void Document::scheduleRenderTreeUpdateIfNeeded() 1386 inline void Document::scheduleRenderTreeUpdateIfNeeded()
1388 { 1387 {
1389 // Inline early out to avoid the function calls below. 1388 // Inline early out to avoid the function calls below.
1390 if (hasPendingStyleRecalc()) 1389 if (hasPendingStyleRecalc())
1391 return; 1390 return;
1392 if (shouldScheduleRenderTreeUpdate() && needsRenderTreeUpdate()) 1391 if (shouldScheduleRenderTreeUpdate() && needsRenderTreeUpdate())
1393 scheduleRenderTreeUpdate(); 1392 scheduleRenderTreeUpdate();
1394 } 1393 }
1395 1394
1396 DEFINE_TYPE_CASTS(Document, ExecutionContextClient, client, client->isDocument() , client.isDocument());
1397 DEFINE_TYPE_CASTS(Document, ExecutionContext, context, context->isDocument(), co ntext.isDocument()); 1395 DEFINE_TYPE_CASTS(Document, ExecutionContext, context, context->isDocument(), co ntext.isDocument());
1398 DEFINE_NODE_TYPE_CASTS(Document, isDocumentNode()); 1396 DEFINE_NODE_TYPE_CASTS(Document, isDocumentNode());
1399 1397
1400 #define DEFINE_DOCUMENT_TYPE_CASTS(thisType) \ 1398 #define DEFINE_DOCUMENT_TYPE_CASTS(thisType) \
1401 DEFINE_TYPE_CASTS(thisType, Document, document, document->is##thisType(), do cument.is##thisType()) 1399 DEFINE_TYPE_CASTS(thisType, Document, document, document->is##thisType(), do cument.is##thisType())
1402 1400
1403 // This is needed to avoid ambiguous overloads with the Node and TreeScope versi ons. 1401 // This is needed to avoid ambiguous overloads with the Node and TreeScope versi ons.
1404 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Document) 1402 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Document)
1405 1403
1406 // Put these methods here, because they require the Document definition, but we really want to inline them. 1404 // Put these methods here, because they require the Document definition, but we really want to inline them.
1407 1405
1408 inline bool Node::isDocumentNode() const 1406 inline bool Node::isDocumentNode() const
1409 { 1407 {
1410 return this == document(); 1408 return this == document();
1411 } 1409 }
1412 1410
1413 Node* eventTargetNodeForDocument(Document*); 1411 Node* eventTargetNodeForDocument(Document*);
1414 1412
1415 } // namespace blink 1413 } // namespace blink
1416 1414
1417 #ifndef NDEBUG 1415 #ifndef NDEBUG
1418 // Outside the WebCore namespace for ease of invocation from gdb. 1416 // Outside the WebCore namespace for ease of invocation from gdb.
1419 void showLiveDocumentInstances(); 1417 void showLiveDocumentInstances();
1420 #endif 1418 #endif
1421 1419
1422 #endif // Document_h 1420 #endif // Document_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698