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

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

Issue 178473026: Have MutationObserverRegistration deal with references instead of pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 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 | « no previous file | Source/core/dom/MutationObserverRegistration.h » ('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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (!((options & CharacterData) || !(options & CharacterDataOldValue))) { 130 if (!((options & CharacterData) || !(options & CharacterDataOldValue))) {
131 exceptionState.throwTypeError("The options object may only set 'characte rDataOldValue' to true when 'characterData' is true or not present."); 131 exceptionState.throwTypeError("The options object may only set 'characte rDataOldValue' to true when 'characterData' is true or not present.");
132 return; 132 return;
133 } 133 }
134 134
135 if (!(options & (Attributes | CharacterData | ChildList))) { 135 if (!(options & (Attributes | CharacterData | ChildList))) {
136 exceptionState.throwTypeError("The options object must set at least one of 'attributes', 'characterData', or 'childList' to true."); 136 exceptionState.throwTypeError("The options object must set at least one of 'attributes', 'characterData', or 'childList' to true.");
137 return; 137 return;
138 } 138 }
139 139
140 node->registerMutationObserver(this, options, attributeFilter); 140 node->registerMutationObserver(*this, options, attributeFilter);
141 } 141 }
142 142
143 Vector<RefPtr<MutationRecord> > MutationObserver::takeRecords() 143 Vector<RefPtr<MutationRecord> > MutationObserver::takeRecords()
144 { 144 {
145 Vector<RefPtr<MutationRecord> > records; 145 Vector<RefPtr<MutationRecord> > records;
146 records.swap(m_records); 146 records.swap(m_records);
147 InspectorInstrumentation::didClearAllMutationRecords(m_callback->executionCo ntext(), this); 147 InspectorInstrumentation::didClearAllMutationRecords(m_callback->executionCo ntext(), this);
148 return records; 148 return records;
149 } 149 }
150 150
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 std::sort(observers.begin(), observers.end(), ObserverLessThan()); 268 std::sort(observers.begin(), observers.end(), ObserverLessThan());
269 for (size_t i = 0; i < observers.size(); ++i) { 269 for (size_t i = 0; i < observers.size(); ++i) {
270 if (observers[i]->canDeliver()) 270 if (observers[i]->canDeliver())
271 observers[i]->deliver(); 271 observers[i]->deliver();
272 else 272 else
273 suspendedMutationObservers().add(observers[i]); 273 suspendedMutationObservers().add(observers[i]);
274 } 274 }
275 } 275 }
276 276
277 } // namespace WebCore 277 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/MutationObserverRegistration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698