| Index: Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp
|
| diff --git a/Source/modules/mediastream/NavigatorUserMediaError.cpp b/Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp
|
| similarity index 71%
|
| copy from Source/modules/mediastream/NavigatorUserMediaError.cpp
|
| copy to Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp
|
| index 27e81533bba910ef8412cfbc3ccabefba6bc978d..5d492ceb3f97c78cbddd7fbe2edc1e6cbea77280 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 {
|
|
|
| -PassRefPtr<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()
|
| +{
|
| + Vector<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 adoptRef(new NavigatorUserMediaError(nameString, message, constraintName));
|
| + m_queue.swap(remaining);
|
| }
|
|
|
| } // namespace WebCore
|
|
|