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

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: sync 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
« no previous file with comments | « Source/core/dom/Microtask.cpp ('k') | Source/core/dom/MutationObserver.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) 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 resumeSuspendedObservers();
75 static void deliverMutations();
75 76
76 ~MutationObserver(); 77 ~MutationObserver();
77 78
78 void observe(Node*, const Dictionary&, ExceptionState&); 79 void observe(Node*, const Dictionary&, ExceptionState&);
79 Vector<RefPtr<MutationRecord> > takeRecords(); 80 Vector<RefPtr<MutationRecord> > takeRecords();
80 void disconnect(); 81 void disconnect();
81 void observationStarted(MutationObserverRegistration*); 82 void observationStarted(MutationObserverRegistration*);
82 void observationEnded(MutationObserverRegistration*); 83 void observationEnded(MutationObserverRegistration*);
83 void enqueueMutationRecord(PassRefPtr<MutationRecord>); 84 void enqueueMutationRecord(PassRefPtr<MutationRecord>);
84 void setHasTransientRegistration(); 85 void setHasTransientRegistration();
85 bool canDeliver(); 86 bool canDeliver();
86 87
87 HashSet<Node*> getObservedNodes() const; 88 HashSet<Node*> getObservedNodes() const;
88 89
89 private: 90 private:
90 struct ObserverLessThan; 91 struct ObserverLessThan;
91 92
92 explicit MutationObserver(PassOwnPtr<MutationCallback>); 93 explicit MutationObserver(PassOwnPtr<MutationCallback>);
93 void deliver(); 94 void deliver();
94 95
95 OwnPtr<MutationCallback> m_callback; 96 OwnPtr<MutationCallback> m_callback;
96 Vector<RefPtr<MutationRecord> > m_records; 97 Vector<RefPtr<MutationRecord> > m_records;
97 HashSet<MutationObserverRegistration*> m_registrations; 98 HashSet<MutationObserverRegistration*> m_registrations;
98 unsigned m_priority; 99 unsigned m_priority;
99 }; 100 };
100 101
101 } 102 }
102 103
103 #endif // MutationObserver_h 104 #endif // MutationObserver_h
OLDNEW
« no previous file with comments | « Source/core/dom/Microtask.cpp ('k') | Source/core/dom/MutationObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698