summaryrefslogtreecommitdiffstats
path: root/webkit/port
diff options
context:
space:
mode:
authoriposva@chromium.org <iposva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-17 23:33:29 +0000
committeriposva@chromium.org <iposva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-17 23:33:29 +0000
commitcf6fd5b507b76c0787206a1642c66c61b2e58bec (patch)
tree83de2f942d460513481f64c121eec9701960d5dc /webkit/port
parent4e5c1084d36e100572b2bcee0c10caf35e0f2367 (diff)
downloadchromium_src-cf6fd5b507b76c0787206a1642c66c61b2e58bec.zip
chromium_src-cf6fd5b507b76c0787206a1642c66c61b2e58bec.tar.gz
chromium_src-cf6fd5b507b76c0787206a1642c66c61b2e58bec.tar.bz2
Backout r9871 because it in mysterious ways causes a international page cycler
regression. TBR=darin Review URL: http://codereview.chromium.org/20436 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9919 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r--webkit/port/bindings/v8/v8_binding.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/webkit/port/bindings/v8/v8_binding.h b/webkit/port/bindings/v8/v8_binding.h
index 553364c..5f83e51 100644
--- a/webkit/port/bindings/v8/v8_binding.h
+++ b/webkit/port/bindings/v8/v8_binding.h
@@ -48,8 +48,9 @@ class WebCoreStringResource: public v8::String::ExternalStringResource {
// Convert a v8::String to a WebCore::String. If the V8 string is not already
// an external string then it is transformed into an external string at this
// point to avoid repeated conversions.
-inline String ToWebCoreString(v8::Handle<v8::Value> obj,
- bool atomic = false) {
+inline String ToWebCoreString(v8::Handle<v8::Value> obj) {
+ bool morph = false;
+ bool atomic = false;
v8::TryCatch block;
v8::Local<v8::String> v8_str = obj->ToString();
if (v8_str.IsEmpty())
@@ -78,10 +79,12 @@ inline String ToWebCoreString(v8::Handle<v8::Value> obj,
} else {
result = StringImpl::adopt(buf);
}
- WebCoreStringResource* resource = new WebCoreStringResource(result);
- if (!v8_str->MakeExternal(resource)) {
- // In case of a failure delete the external resource as it was not used.
- delete resource;
+ if (morph) {
+ WebCoreStringResource* resource = new WebCoreStringResource(result);
+ if (!v8_str->MakeExternal(resource)) {
+ // In case of a failure delete the external resource as it was not used.
+ delete resource;
+ }
}
return result;
}