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

Unified Diff: Source/core/dom/Microtask.cpp

Issue 14660019: Run Mutation Observer and Custom Element callbacks consistently at microtask checkpoint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Microtask.h ('k') | Source/core/html/parser/HTMLScriptRunner.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Microtask.cpp
diff --git a/Source/modules/mediastream/RTCSessionDescriptionCallback.h b/Source/core/dom/Microtask.cpp
similarity index 72%
copy from Source/modules/mediastream/RTCSessionDescriptionCallback.h
copy to Source/core/dom/Microtask.cpp
index 678daa7b0d0de42a2dc4f0b115412f71b1755d6b..cb0b12b618b570e67dee34c4aeb1aea6560b940f 100644
--- a/Source/modules/mediastream/RTCSessionDescriptionCallback.h
+++ b/Source/core/dom/Microtask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,21 +28,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef RTCSessionDescriptionCallback_h
-#define RTCSessionDescriptionCallback_h
+#include "config.h"
+#include "core/dom/Microtask.h"
-#include "wtf/RefCounted.h"
+#include "core/dom/CustomElementCallbackDispatcher.h"
+#include "core/dom/MutationObserver.h"
+#include "wtf/Vector.h"
namespace WebCore {
-class RTCSessionDescription;
+void Microtask::performCheckpoint()
+{
+ static bool performingCheckpoint = false;
+ if (performingCheckpoint)
+ return;
+ performingCheckpoint = true;
-class RTCSessionDescriptionCallback : public RefCounted<RTCSessionDescriptionCallback> {
-public:
- virtual ~RTCSessionDescriptionCallback() { }
- virtual bool handleEvent(RTCSessionDescription*) = 0;
-};
+ bool anyWorkDone;
+ do {
+ MutationObserver::deliverAllMutations();
+ anyWorkDone = CustomElementCallbackDispatcher::instance().dispatch();
+ } while (anyWorkDone);
-} // namespace WebCore
+ performingCheckpoint = false;
+}
-#endif // RTCSessionDescriptionCallback_h
+} // namespace WebCore
« no previous file with comments | « Source/core/dom/Microtask.h ('k') | Source/core/html/parser/HTMLScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698