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

Unified Diff: Source/bindings/v8/custom/V8SVGNumberCustom.cpp

Issue 19154006: Get rid of special casing for SVGNumber in the bindings generator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update core.gypi Created 7 years, 5 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
« no previous file with comments | « Source/bindings/scripts/deprecated_code_generator_v8.pm ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8SVGNumberCustom.cpp
diff --git a/Source/modules/filesystem/FileWriterBase.cpp b/Source/bindings/v8/custom/V8SVGNumberCustom.cpp
similarity index 65%
copy from Source/modules/filesystem/FileWriterBase.cpp
copy to Source/bindings/v8/custom/V8SVGNumberCustom.cpp
index 27fb688f7fcc91088d8ed86dfce5c331bb57ed11..3f48fbdd5e59c86d5395024bb84480936c9c7e12 100644
--- a/Source/modules/filesystem/FileWriterBase.cpp
+++ b/Source/bindings/v8/custom/V8SVGNumberCustom.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -30,42 +30,28 @@
#include "config.h"
-#include "modules/filesystem/FileWriterBase.h"
-
-#include "core/dom/ExceptionCode.h"
-#include "core/dom/ProgressEvent.h"
-#include "core/fileapi/Blob.h"
-#include "core/fileapi/FileError.h"
-#include "modules/filesystem/AsyncFileWriter.h"
+#include "V8SVGNumber.h"
namespace WebCore {
-FileWriterBase::~FileWriterBase()
-{
-}
-
-void FileWriterBase::initialize(PassOwnPtr<AsyncFileWriter> writer, long long length)
-{
- ASSERT(!m_writer);
- ASSERT(length >= 0);
- m_writer = writer;
- m_length = length;
-}
-
-FileWriterBase::FileWriterBase()
- : m_position(0)
+void V8SVGNumber::valueAttrGetterCustom(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
haraken 2013/07/15 10:59:15 I guess this getter doesn't need to be custom. You
do-not-use 2013/07/15 11:11:14 This does not work. SVGNumber is a typedef to floa
{
+ SVGPropertyTearOff<SVGNumber>* wrapper = V8SVGNumber::toNative(info.Holder());
+ SVGNumber& impl = wrapper->propertyReference();
+ v8SetReturnValue(info, impl);
}
-void FileWriterBase::seekInternal(long long position)
+void V8SVGNumber::valueAttrSetterCustom(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
- if (position > m_length)
- position = m_length;
- else if (position < 0)
- position = m_length + position;
- if (position < 0)
- position = 0;
- m_position = position;
+ SVGPropertyTearOff<SVGNumber>* wrapper = V8SVGNumber::toNative(info.Holder());
+ if (wrapper->isReadOnly()) {
+ setDOMException(NoModificationAllowedError, info.GetIsolate());
+ return;
+ }
+ SVGNumber& impl = wrapper->propertyReference();
+ V8TRYCATCH_VOID(SVGNumber, v, static_cast<float>(value->NumberValue()));
+ impl = v;
+ wrapper->commitChange();
haraken 2013/07/15 10:59:15 Would it be possible to get rid of the custom sett
}
} // namespace WebCore
« no previous file with comments | « Source/bindings/scripts/deprecated_code_generator_v8.pm ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698