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

Unified Diff: Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp

Issue 288323004: HTML Imports: Get rid of needsProcessOrStop() from dom/custom/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
Index: Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp
diff --git a/Source/modules/mediastream/NavigatorUserMediaError.cpp b/Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp
similarity index 70%
copy from Source/modules/mediastream/NavigatorUserMediaError.cpp
copy to Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp
index 6c27428ef64e0be3653413dba2dba2378b9f5c75..5aae3a6a09e10e28b5a883560d82a1b1ff02d94c 100644
--- a/Source/modules/mediastream/NavigatorUserMediaError.cpp
+++ b/Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,24 +29,27 @@
*/
#include "config.h"
-#include "modules/mediastream/NavigatorUserMediaError.h"
+#include "core/dom/custom/CustomElementAsyncImportMicrotaskQueue.h"
+
+#include "core/dom/custom/CustomElementMicrotaskImportStep.h"
namespace WebCore {
-PassRefPtrWillBeRawPtr<NavigatorUserMediaError> NavigatorUserMediaError::create(Name name, const String& message, const String& constraintName)
+void CustomElementAsyncImportMicrotaskQueue::enqueue(PassOwnPtr<CustomElementMicrotaskImportStep> step)
{
- String nameString;
- switch (name) {
- case NamePermissionDenied:
- nameString = "PermissionDeniedError";
- break;
-
- case NameConstraintNotSatisfied:
- nameString = "ConstraintNotSatisfiedError";
- break;
+ m_queue.append(step);
+}
+
+void CustomElementAsyncImportMicrotaskQueue::doDispatch()
+{
+ WillBeHeapVector<OwnPtr<CustomElementMicrotaskStep> > remaining;
+
+ for (unsigned i = 0; i < m_queue.size(); ++i) {
+ if (CustomElementMicrotaskStep::Processing == m_queue[i]->process())
+ remaining.append(m_queue[i].release());
}
- return adoptRefWillBeNoop(new NavigatorUserMediaError(nameString, message, constraintName));
+ m_queue.swap(remaining);
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698