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 |