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

Unified Diff: Source/bindings/core/dart/shared_lib/DartNativeExtensionsPosix.cpp

Issue 1532413002: Added Dartium changes onto 45.0.2454.104 (Closed) Base URL: http://src.chromium.org/blink/branches/chromium/2454
Patch Set: Created 5 years 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/bindings/core/dart/shared_lib/DartNativeExtensionsPosix.cpp
diff --git a/Source/core/svg/SVGPointTearOff.cpp b/Source/bindings/core/dart/shared_lib/DartNativeExtensionsPosix.cpp
similarity index 54%
copy from Source/core/svg/SVGPointTearOff.cpp
copy to Source/bindings/core/dart/shared_lib/DartNativeExtensionsPosix.cpp
index 706d26dab6c52256d253def792931381f8ebb77b..9cc1e4c28385daa2e054da55f7215c901f2f109f 100644
--- a/Source/core/svg/SVGPointTearOff.cpp
+++ b/Source/bindings/core/dart/shared_lib/DartNativeExtensionsPosix.cpp
@@ -29,47 +29,52 @@
*/
#include "config.h"
+#include "bindings/core/dart/shared_lib/DartNativeExtensions.h"
-#include "core/svg/SVGPointTearOff.h"
+#if defined(ENABLE_DART_NATIVE_EXTENSIONS)
+#if OS(POSIX)
+#include "wtf/text/StringUTF8Adaptor.h"
+#include <dlfcn.h>
+#include <string>
-#include "bindings/core/v8/ExceptionState.h"
-#include "core/dom/ExceptionCode.h"
-#include "core/svg/SVGElement.h"
-#include "core/svg/SVGMatrixTearOff.h"
namespace blink {
-SVGPointTearOff::SVGPointTearOff(PassRefPtrWillBeRawPtr<SVGPoint> target, SVGElement* contextElement, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName)
- : SVGPropertyTearOff<SVGPoint>(target, contextElement, propertyIsAnimVal, attributeName)
+Dart_Handle DartNativeExtensions::loadExtensionLibrary(const String& libraryPath, const String& libraryName, void** libraryHandle)
{
-}
-
-void SVGPointTearOff::setX(float f, ExceptionState& exceptionState)
-{
- if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
- return;
+ String libraryFile = libraryPath;
+#if OS(MACOSX)
+ libraryFile.append("lib");
+ libraryFile.append(libraryName);
+ libraryFile.append(".dylib");
+#else
+ libraryFile.append("lib");
+ libraryFile.append(libraryName);
+ libraryFile.append(".so");
+#endif
+ StringUTF8Adaptor utf8LibraryFile(libraryFile);
+ std::string utf8LibraryFileStr(utf8LibraryFile.data(), utf8LibraryFile.length());
+ *libraryHandle = dlopen(utf8LibraryFileStr.c_str(), RTLD_LAZY);
+ if (!*libraryHandle) {
+ return Dart_NewApiError(dlerror());
}
-
- target()->setX(f);
- commitChange();
+ return Dart_Null();
}
-void SVGPointTearOff::setY(float f, ExceptionState& exceptionState)
+Dart_Handle DartNativeExtensions::resolveSymbol(void* libHandle, const String& symbolName, void** symbol)
{
- if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
- return;
+ StringUTF8Adaptor utf8Symbol(symbolName);
+ std::string utf8SymbolStr(utf8Symbol.data(), utf8Symbol.length());
+ dlerror();
+ *symbol = dlsym(libHandle, utf8SymbolStr.c_str());
+ const char* error = dlerror();
+ if (error) {
+ return Dart_NewApiError(error);
}
-
- target()->setY(f);
- commitChange();
+ return Dart_Null();
}
-PassRefPtrWillBeRawPtr<SVGPointTearOff> SVGPointTearOff::matrixTransform(PassRefPtrWillBeRawPtr<SVGMatrixTearOff> matrix)
-{
- FloatPoint point = target()->matrixTransform(matrix->value());
- return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnimVal);
}
-}
+#endif // OS(POSIX)
+#endif // defined(ENABLE_DART_NATIVE_EXTENSIONS)

Powered by Google App Engine
This is Rietveld 408576698