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

Unified Diff: Source/WebCore/bindings/dart/DartUtilities.h

Issue 9188009: Things to unfork. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 years, 11 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/WebCore/bindings/dart/DartUtilities.h
diff --git a/Source/WebCore/bindings/dart/DartUtilities.h b/Source/WebCore/bindings/dart/DartUtilities.h
deleted file mode 100644
index 1328c49e33da85f0480d214980e2e9b385e6f5c8..0000000000000000000000000000000000000000
--- a/Source/WebCore/bindings/dart/DartUtilities.h
+++ /dev/null
@@ -1,154 +0,0 @@
-// 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
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// 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.
-
-#ifndef DartUtilities_h
-#define DartUtilities_h
-
-#include "MessagePort.h"
-
-#include <dart_api.h>
-#include <wtf/HashMap.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class EventListener;
-class EventTarget;
-class Frame;
-class ScriptArguments;
-class ScriptCallStack;
-class ScriptExecutionContext;
-class SerializedScriptValue;
-
-typedef HashMap<void*, Dart_Handle> DartDOMMap;
-
-class DartUtilities {
-public:
- enum ConversionFlag {
- ConvertNone = 0,
- ConvertNullToEmptyString = 1
- };
-
- static const char* domLibraryName;
-
- static PassRefPtr<StringImpl> toStringImpl(Dart_Handle, ConversionFlag flag, Dart_Handle& exception);
- // FIXME: we should get rid of this one in favour of toStringImpl.
- static String dartStringToString(Dart_Handle object)
- {
- Dart_Handle exception = 0;
- RefPtr<StringImpl> impl = toStringImpl(object, ConvertNone, exception);
- ASSERT(!exception);
- return String(impl.release());
- }
- static Dart_Handle stringToDartString(const String&);
- static Dart_Handle stringToDartString(const AtomicString&);
-
- static int64_t toInteger(Dart_Handle object, Dart_Handle& exception);
- static int64_t toInteger(Dart_Handle object);
- static double toDouble(Dart_Handle object, Dart_Handle& exception);
- static double toDouble(Dart_Handle object);
- static bool toBool(Dart_Handle object, Dart_Handle& exception);
- static bool toBool(Dart_Handle object);
- static PassRefPtr<EventListener> toEventListener(Dart_Handle object, Dart_Handle& exception);
- static PassRefPtr<EventTarget> toEventTarget(Dart_Handle object, Dart_Handle& exception);
- static void toMessagePortArray(Dart_Handle object, MessagePortArray&, Dart_Handle& exception);
-
- static PassRefPtr<SerializedScriptValue> toSerializedScriptValue(Dart_Handle object, Dart_Handle& exception);
- static Dart_Handle fromSerializedScriptValue(SerializedScriptValue*);
-
- static void registerIsolateContext(Dart_Isolate, ScriptExecutionContext*);
- static ScriptExecutionContext* isolateContext(Dart_Isolate);
- static void unregisterIsolateContext(Dart_Isolate);
- static bool isFullDomIsolate(Dart_Isolate);
-
- static DOMWindow* domWindowForIsolate(Dart_Isolate);
- static DOMWindow* domWindowForCurrentIsolate();
-
- static Dart_Handle domLibraryForCurrentIsolate();
- static Dart_Handle pageLibraryForCurrentIsolate();
-
- static DartDOMMap* domMapForIsolate(Dart_Isolate);
- static DartDOMMap* domMapForCurrentIsolate();
-
- static int* recursionForIsolate(Dart_Isolate);
- static int* recursionForCurrentIsolate();
-
- static ScriptExecutionContext* scriptExecutionContext();
-
- static bool processingUserGesture();
-
- static PassRefPtr<ScriptArguments> createScriptArguments(Dart_Handle argument, Dart_Handle& exception);
- static PassRefPtr<ScriptCallStack> createScriptCallStack();
-
- static const uint8_t* fullSnapshot();
-
- static void reportProblem(ScriptExecutionContext*, Dart_Handle);
-
- static Dart_Handle invalidNumberOfArgumentsException()
- {
- return Dart_NewString("Invalid number of arguments");
- }
-
- static Dart_Handle conditionalFunctionalityException()
- {
- return Dart_NewString("Ooops, this functionality is not enabled in this browser");
- }
-
- static Dart_Handle notImplementedException()
- {
- Dart_Handle library = Dart_LookupLibrary(Dart_NewString(domLibraryName));
- ASSERT(!Dart_IsError(library));
- Dart_Handle result = Dart_InvokeStatic(library, Dart_NewString("Utils"), Dart_NewString("makeNotImplementedException"), 0, 0);
- ASSERT(!Dart_IsError(result));
- return result;
- }
-
- static Dart_Handle domDisabledException()
- {
- return Dart_NewString("DOM access is not enabled in this isolate");
- }
-
- static Dart_Handle internalErrorException(const char* msg)
- {
- // FIXME: wrap into proper type.
- return Dart_NewString(msg);
- }
-};
-
-class DartApiScope {
-public:
- DartApiScope() { Dart_EnterScope(); }
- ~DartApiScope() { Dart_ExitScope(); }
-};
-
-#define DART_UNIMPLEMENTED() Dart_ThrowException(DartUtilities::notImplementedException());
-
-} // namespace WebCore
-
-#endif // DartUtilities_h
« no previous file with comments | « Source/WebCore/bindings/dart/DartScheduledAction.cpp ('k') | Source/WebCore/bindings/dart/DartUtilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698