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

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

Issue 400043002: Add a way to schedule generic per-frame events through Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | 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, 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 3856 matching lines...) Expand 10 before | Expand all | Expand 10 after
3867 if (!m_domWindow) 3867 if (!m_domWindow)
3868 return 0; 3868 return 0;
3869 return m_domWindow->eventQueue(); 3869 return m_domWindow->eventQueue();
3870 } 3870 }
3871 3871
3872 void Document::enqueueAnimationFrameEvent(PassRefPtrWillBeRawPtr<Event> event) 3872 void Document::enqueueAnimationFrameEvent(PassRefPtrWillBeRawPtr<Event> event)
3873 { 3873 {
3874 ensureScriptedAnimationController().enqueueEvent(event); 3874 ensureScriptedAnimationController().enqueueEvent(event);
3875 } 3875 }
3876 3876
3877 void Document::enqueueUniqueAnimationFrameEvent(PassRefPtrWillBeRawPtr<Event> ev ent)
3878 {
3879 ensureScriptedAnimationController().enqueuePerFrameEvent(event);
3880 }
3881
3877 void Document::enqueueScrollEventForNode(Node* target) 3882 void Document::enqueueScrollEventForNode(Node* target)
3878 { 3883 {
3879 // Per the W3C CSSOM View Module only scroll events fired at the document sh ould bubble. 3884 // Per the W3C CSSOM View Module only scroll events fired at the document sh ould bubble.
3880 RefPtrWillBeRawPtr<Event> scrollEvent = target->isDocumentNode() ? Event::cr eateBubble(EventTypeNames::scroll) : Event::create(EventTypeNames::scroll); 3885 RefPtrWillBeRawPtr<Event> scrollEvent = target->isDocumentNode() ? Event::cr eateBubble(EventTypeNames::scroll) : Event::create(EventTypeNames::scroll);
3881 scrollEvent->setTarget(target); 3886 scrollEvent->setTarget(target);
3882 ensureScriptedAnimationController().enqueuePerFrameEvent(scrollEvent.release ()); 3887 ensureScriptedAnimationController().enqueuePerFrameEvent(scrollEvent.release ());
3883 } 3888 }
3884 3889
3885 void Document::enqueueResizeEvent() 3890 void Document::enqueueResizeEvent()
3886 { 3891 {
3887 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::resize); 3892 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::resize);
3888 event->setTarget(domWindow()); 3893 event->setTarget(domWindow());
3889 ensureScriptedAnimationController().enqueuePerFrameEvent(event.release()); 3894 ensureScriptedAnimationController().enqueuePerFrameEvent(event.release());
3890 } 3895 }
3891 3896
3892 void Document::enqueueMediaQueryChangeListeners(WillBeHeapVector<RefPtrWillBeMem ber<MediaQueryListListener> >& listeners) 3897 void Document::enqueueMediaQueryChangeListeners(WillBeHeapVector<RefPtrWillBeMem ber<MediaQueryListListener> >& listeners)
3893 { 3898 {
3894 ensureScriptedAnimationController().enqueueMediaQueryChangeListeners(listene rs); 3899 ensureScriptedAnimationController().enqueueMediaQueryChangeListeners(listene rs);
3895 } 3900 }
3896 3901
3897
3898 Document::EventFactorySet& Document::eventFactories() 3902 Document::EventFactorySet& Document::eventFactories()
3899 { 3903 {
3900 DEFINE_STATIC_LOCAL(EventFactorySet, s_eventFactory, ()); 3904 DEFINE_STATIC_LOCAL(EventFactorySet, s_eventFactory, ());
3901 return s_eventFactory; 3905 return s_eventFactory;
3902 } 3906 }
3903 3907
3904 void Document::registerEventFactory(PassOwnPtr<EventFactoryBase> eventFactory) 3908 void Document::registerEventFactory(PassOwnPtr<EventFactoryBase> eventFactory)
3905 { 3909 {
3906 ASSERT(!eventFactories().contains(eventFactory.get())); 3910 ASSERT(!eventFactories().contains(eventFactory.get()));
3907 eventFactories().add(eventFactory); 3911 eventFactories().add(eventFactory);
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
5853 using namespace WebCore; 5857 using namespace WebCore;
5854 void showLiveDocumentInstances() 5858 void showLiveDocumentInstances()
5855 { 5859 {
5856 WeakDocumentSet& set = liveDocumentSet(); 5860 WeakDocumentSet& set = liveDocumentSet();
5857 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5861 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5858 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 5862 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
5859 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 5863 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
5860 } 5864 }
5861 } 5865 }
5862 #endif 5866 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698