| Index: sky/engine/bindings-dart/core/dart/custom/DartMutationObserverCustom.cpp
|
| diff --git a/LICENSE b/sky/engine/bindings-dart/core/dart/custom/DartMutationObserverCustom.cpp
|
| similarity index 58%
|
| copy from LICENSE
|
| copy to sky/engine/bindings-dart/core/dart/custom/DartMutationObserverCustom.cpp
|
| index 972bb2edb099e58b6a1939fa57f8e74391159c0c..818772009d293300f67765a98e925c670251061c 100644
|
| --- a/LICENSE
|
| +++ b/sky/engine/bindings-dart/core/dart/custom/DartMutationObserverCustom.cpp
|
| @@ -1,4 +1,5 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright 2011, Google Inc.
|
| +// All rights reserved.
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| @@ -25,3 +26,44 @@
|
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| +
|
| +#include "config.h"
|
| +
|
| +#include "bindings/core/dart/DartMutationObserver.h"
|
| +
|
| +#include "bindings/core/dart/DartMutationCallback.h"
|
| +
|
| +namespace blink {
|
| +
|
| +namespace DartMutationObserverInternal {
|
| +
|
| +void constructorCallback(Dart_NativeArguments args)
|
| +{
|
| + Dart_Handle exception = 0;
|
| + {
|
| + Dart_Handle dartCallback = Dart_GetNativeArgument(args, 0);
|
| + if (!Dart_IsClosure(dartCallback)) {
|
| + DartExceptionState es;
|
| + es.throwDOMException(TypeMismatchError);
|
| + exception = es.toDart(args);
|
| + goto fail;
|
| + }
|
| +
|
| + OwnPtr<MutationCallback> callback = DartMutationCallback::create(dartCallback, DartUtilities::scriptExecutionContext(), exception);
|
| + if (exception)
|
| + goto fail;
|
| +
|
| + RefPtr<MutationObserver> observer = MutationObserver::create(callback.release());
|
| +
|
| + DartDOMWrapper::returnToDart<DartMutationObserver>(args, observer.get());
|
| + return;
|
| + }
|
| +
|
| +fail:
|
| + Dart_ThrowException(exception);
|
| + ASSERT_NOT_REACHED();
|
| +}
|
| +
|
| +}
|
| +
|
| +}
|
|
|