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

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

Issue 142193004: Create & use microtask work queue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ws Created 6 years, 10 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 Subtree = 1 << 3, 64 Subtree = 1 << 3,
65 AttributeFilter = 1 << 4 65 AttributeFilter = 1 << 4
66 }; 66 };
67 67
68 enum DeliveryFlags { 68 enum DeliveryFlags {
69 AttributeOldValue = 1 << 5, 69 AttributeOldValue = 1 << 5,
70 CharacterDataOldValue = 1 << 6, 70 CharacterDataOldValue = 1 << 6,
71 }; 71 };
72 72
73 static PassRefPtr<MutationObserver> create(PassOwnPtr<MutationCallback>); 73 static PassRefPtr<MutationObserver> create(PassOwnPtr<MutationCallback>);
74 static void deliverAllMutations(); 74 static void deliverMutations();
75 75
76 ~MutationObserver(); 76 ~MutationObserver();
77 77
78 void observe(Node*, const Dictionary&, ExceptionState&); 78 void observe(Node*, const Dictionary&, ExceptionState&);
79 Vector<RefPtr<MutationRecord> > takeRecords(); 79 Vector<RefPtr<MutationRecord> > takeRecords();
80 void disconnect(); 80 void disconnect();
81 void observationStarted(MutationObserverRegistration*); 81 void observationStarted(MutationObserverRegistration*);
82 void observationEnded(MutationObserverRegistration*); 82 void observationEnded(MutationObserverRegistration*);
83 void enqueueMutationRecord(PassRefPtr<MutationRecord>); 83 void enqueueMutationRecord(PassRefPtr<MutationRecord>);
84 void setHasTransientRegistration(); 84 void setHasTransientRegistration();
85 bool canDeliver(); 85 bool canDeliver();
86 86
87 HashSet<Node*> getObservedNodes() const; 87 HashSet<Node*> getObservedNodes() const;
88 88
89 private: 89 private:
90 struct ObserverLessThan; 90 struct ObserverLessThan;
91 91
92 explicit MutationObserver(PassOwnPtr<MutationCallback>); 92 explicit MutationObserver(PassOwnPtr<MutationCallback>);
93 void deliver(); 93 void deliver();
94 94
95 OwnPtr<MutationCallback> m_callback; 95 OwnPtr<MutationCallback> m_callback;
96 Vector<RefPtr<MutationRecord> > m_records; 96 Vector<RefPtr<MutationRecord> > m_records;
97 HashSet<MutationObserverRegistration*> m_registrations; 97 HashSet<MutationObserverRegistration*> m_registrations;
98 unsigned m_priority; 98 unsigned m_priority;
99 }; 99 };
100 100
101 } 101 }
102 102
103 #endif // MutationObserver_h 103 #endif // MutationObserver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698