Chromium Code Reviews| 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 |