[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
eric at webkit.org
eric at webkit.org
Thu Oct 29 20:49:19 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 679ba1b1131ae6f849690ab8ef5977e6e8f7e383
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 21 00:08:52 2009 +0000
2009-10-20 James Robinson <jamesr at chromium.org>
Reviewed by Adam Barth.
Fixes RefPtr initialization in the V8 implementation of WebCore::ScriptString to use the ::create() idiom and
use adoptRef() properly. I failed to read the RefPtr docs the first time through :(
No new tests, error was caught by valgrind on the Chromium builders.
* bindings/v8/ScriptString.h:
(WebCore::ScriptString::ScriptString):
(WebCore::ScriptString::operator=):
* bindings/v8/ScriptStringImpl.h:
(WebCore::ScriptStringImpl::create):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1a53430..3704b41 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-20 James Robinson <jamesr at chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Fixes RefPtr initialization in the V8 implementation of WebCore::ScriptString to use the ::create() idiom and
+ use adoptRef() properly. I failed to read the RefPtr docs the first time through :(
+
+ No new tests, error was caught by valgrind on the Chromium builders.
+
+ * bindings/v8/ScriptString.h:
+ (WebCore::ScriptString::ScriptString):
+ (WebCore::ScriptString::operator=):
+ * bindings/v8/ScriptStringImpl.h:
+ (WebCore::ScriptStringImpl::create):
+
2009-10-20 Mikhail Naganov <mnaganov at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/bindings/v8/ScriptString.h b/WebCore/bindings/v8/ScriptString.h
index b017a0c..414818a 100644
--- a/WebCore/bindings/v8/ScriptString.h
+++ b/WebCore/bindings/v8/ScriptString.h
@@ -40,8 +40,8 @@ namespace WebCore {
class ScriptString {
public:
ScriptString() : m_impl(0) {}
- ScriptString(const String& s) : m_impl(new ScriptStringImpl(s)) {}
- ScriptString(const char* s) : m_impl(new ScriptStringImpl(s)) {}
+ ScriptString(const String& s) : m_impl(ScriptStringImpl::create(s)) {}
+ ScriptString(const char* s) : m_impl(ScriptStringImpl::create(s)) {}
operator String() const { return m_impl->toString(); }
@@ -50,7 +50,7 @@ public:
ScriptString& operator=(const char* s)
{
- m_impl = new ScriptStringImpl(s);
+ m_impl = ScriptStringImpl::create(s);
return *this;
}
diff --git a/WebCore/bindings/v8/ScriptStringImpl.h b/WebCore/bindings/v8/ScriptStringImpl.h
index 5faf0ba..8a47b4f 100644
--- a/WebCore/bindings/v8/ScriptStringImpl.h
+++ b/WebCore/bindings/v8/ScriptStringImpl.h
@@ -46,9 +46,15 @@ namespace WebCore {
// This implementation optimizes for the common case where the responseText is built up with many calls to operator+= before the actual text is queried.
class ScriptStringImpl : public RefCounted<ScriptStringImpl> {
public:
- ScriptStringImpl() {}
- ScriptStringImpl(const String& s);
- ScriptStringImpl(const char* s);
+ static PassRefPtr<ScriptStringImpl> create(const String& s)
+ {
+ return adoptRef(new ScriptStringImpl(s));
+ }
+
+ static PassRefPtr<ScriptStringImpl> create(const char* s)
+ {
+ return adoptRef(new ScriptStringImpl(s));
+ }
String toString() const;
@@ -60,6 +66,9 @@ public:
v8::Handle<v8::String> v8StringHandle() { return m_handle.get(); }
private:
+ ScriptStringImpl(const String& s);
+ ScriptStringImpl(const char* s);
+
OwnHandle<v8::String> m_handle;
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list