From: Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics Date: Wed, 18 Nov 2020 11:21:12 +0000 (+0100) Subject: Merge branch 'tizen_4.0' into tizen_5.0 X-Git-Tag: submit/tizen/20201209.085808~6^2^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F247926%2F2;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git Merge branch 'tizen_4.0' into tizen_5.0 Change-Id: I660b3b2b74fb33acbb89b9d06b7a230abee28315 --- c1aa41d6754569b6fbe29e2bcdecadc87bc1f27d diff --cc packaging/webapi-plugins.spec index 5d426b62,f3248b79..9da348d6 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@@ -8,7 -8,7 +8,7 @@@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins - Version: 2.51 -Version: 2.45 ++Version: 2.52 Release: 0 License: Apache-2.0 and BSD-3-Clause and MIT Group: Development/Libraries diff --cc src/filesystem/filesystem_instance.cc index 1e93b7f1,0d5ded40..94aa5c7e --- a/src/filesystem/filesystem_instance.cc +++ b/src/filesystem/filesystem_instance.cc @@@ -748,11 -409,13 +748,13 @@@ void FilesystemInstance::FileWriteStrin if (encoding == "iso-8859-1") { std::vector data; latin1::from_utf8(str, data); - write_file(data.data(), data.size(), location, offset, rewrite); + write_file(data.data(), data.size(), location, offset, mode); + ReportSuccess(picojson::value{(double)data.size()}, out); } else { // default: UTF-8 const std::uint8_t* buf = (const std::uint8_t*)str.c_str(); std::size_t len = str.length(); - write_file(buf, len, location, offset, rewrite); + write_file(buf, len, location, offset, mode); + ReportSuccess(picojson::value{(double)str.size()}, out); } } catch (std::runtime_error& e) { LoggerE("Cannot write to file %s, cause: %s", location.c_str(), e.what()); diff --cc src/filesystem/js/file_stream.js index 61add68f,8e72b0bf..88679850 --- a/src/filesystem/js/file_stream.js +++ b/src/filesystem/js/file_stream.js @@@ -265,9 -284,10 +265,10 @@@ function write() throw new WebAPIException(WebAPIException.IO_ERR, 'Could not write'); } can_change_size = true; - this.position = this.position + args.stringData.length; + var written_bytes = native_.getResultObject(result); + this.position = this.position + written_bytes; can_change_size = false; - this._rewrite = false; + this._truncate = false; } FileStream.prototype.write = function() {