diff options
Diffstat (limited to 'WebCore/bindings/v8/custom/V8LocationCustom.cpp')
-rw-r--r-- | WebCore/bindings/v8/custom/V8LocationCustom.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/WebCore/bindings/v8/custom/V8LocationCustom.cpp b/WebCore/bindings/v8/custom/V8LocationCustom.cpp index c5f3b1d..3f3ff6b 100644 --- a/WebCore/bindings/v8/custom/V8LocationCustom.cpp +++ b/WebCore/bindings/v8/custom/V8LocationCustom.cpp @@ -62,7 +62,7 @@ ACCESSOR_SETTER(LocationHash) { INC_STATS("DOM.Location.hash._set"); v8::Handle<v8::Object> holder = info.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); String hash = toWebCoreString(value); Frame* frame = imp->frame(); @@ -70,13 +70,13 @@ ACCESSOR_SETTER(LocationHash) return; KURL url = frame->loader()->url(); - String oldRef = url.ref(); + String oldRef = url.fragmentIdentifier(); if (hash.startsWith("#")) hash = hash.substring(1); if (oldRef == hash || (oldRef.isNull() && hash.isEmpty())) return; - url.setRef(hash); + url.setFragmentIdentifier(hash); navigateIfAllowed(frame, url, false, false); } @@ -85,7 +85,7 @@ ACCESSOR_SETTER(LocationHost) { INC_STATS("DOM.Location.host._set"); v8::Handle<v8::Object> holder = info.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); String host = toWebCoreString(value); Frame* frame = imp->frame(); @@ -105,7 +105,7 @@ ACCESSOR_SETTER(LocationHostname) { INC_STATS("DOM.Location.hostname._set"); v8::Handle<v8::Object> holder = info.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); String hostname = toWebCoreString(value); Frame* frame = imp->frame(); @@ -122,7 +122,7 @@ ACCESSOR_SETTER(LocationHref) { INC_STATS("DOM.Location.href._set"); v8::Handle<v8::Object> holder = info.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); Frame* frame = imp->frame(); if (!frame) @@ -142,7 +142,7 @@ ACCESSOR_SETTER(LocationPathname) { INC_STATS("DOM.Location.pathname._set"); v8::Handle<v8::Object> holder = info.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); String pathname = toWebCoreString(value); Frame* frame = imp->frame(); @@ -159,7 +159,7 @@ ACCESSOR_SETTER(LocationPort) { INC_STATS("DOM.Location.port._set"); v8::Handle<v8::Object> holder = info.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); String port = toWebCoreString(value); Frame* frame = imp->frame(); @@ -176,7 +176,7 @@ ACCESSOR_SETTER(LocationProtocol) { INC_STATS("DOM.Location.protocol._set"); v8::Handle<v8::Object> holder = info.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); String protocol = toWebCoreString(value); Frame* frame = imp->frame(); @@ -193,7 +193,7 @@ ACCESSOR_SETTER(LocationSearch) { INC_STATS("DOM.Location.search._set"); v8::Handle<v8::Object> holder = info.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); String query = toWebCoreString(value); Frame* frame = imp->frame(); @@ -210,14 +210,14 @@ ACCESSOR_GETTER(LocationReload) { INC_STATS("DOM.Location.reload._get"); static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(v8LocationReloadCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8Location::GetRawTemplate()))); - v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::LOCATION, info.This()); + v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8ClassIndex::LOCATION, info.This()); if (holder.IsEmpty()) { // can only reach here by 'object.__proto__.func', and it should passed // domain security check already return privateTemplate->GetFunction(); } - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); - if (!V8Proxy::CanAccessFrame(imp->frame(), false)) { + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + if (!V8Proxy::canAccessFrame(imp->frame(), false)) { static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(v8LocationReloadCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8Location::GetRawTemplate()))); return sharedTemplate->GetFunction(); } else @@ -228,14 +228,14 @@ ACCESSOR_GETTER(LocationReplace) { INC_STATS("DOM.Location.replace._get"); static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(v8LocationReplaceCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8Location::GetRawTemplate()))); - v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::LOCATION, info.This()); + v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8ClassIndex::LOCATION, info.This()); if (holder.IsEmpty()) { // can only reach here by 'object.__proto__.func', and it should passed // domain security check already return privateTemplate->GetFunction(); } - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); - if (!V8Proxy::CanAccessFrame(imp->frame(), false)) { + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + if (!V8Proxy::canAccessFrame(imp->frame(), false)) { static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(v8LocationReplaceCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8Location::GetRawTemplate()))); return sharedTemplate->GetFunction(); } else @@ -247,14 +247,14 @@ ACCESSOR_GETTER(LocationAssign) INC_STATS("DOM.Location.assign._get"); static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(v8LocationAssignCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8Location::GetRawTemplate()))); - v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::LOCATION, info.This()); + v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8ClassIndex::LOCATION, info.This()); if (holder.IsEmpty()) { // can only reach here by 'object.__proto__.func', and it should passed // domain security check already return privateTemplate->GetFunction(); } - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); - if (!V8Proxy::CanAccessFrame(imp->frame(), false)) { + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + if (!V8Proxy::canAccessFrame(imp->frame(), false)) { static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(v8LocationAssignCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8Location::GetRawTemplate()))); return sharedTemplate->GetFunction(); } else @@ -266,8 +266,8 @@ CALLBACK_FUNC_DECL(LocationReload) // FIXME: we ignore the "forceget" parameter. INC_STATS("DOM.Location.reload"); - v8::Handle<v8::Value> holder = args.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + v8::Handle<v8::Object> holder = args.Holder(); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); Frame* frame = imp->frame(); if (!frame || !ScriptController::isSafeScript(frame)) @@ -281,8 +281,8 @@ CALLBACK_FUNC_DECL(LocationReload) CALLBACK_FUNC_DECL(LocationReplace) { INC_STATS("DOM.Location.replace"); - v8::Handle<v8::Value> holder = args.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + v8::Handle<v8::Object> holder = args.Holder(); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); Frame* frame = imp->frame(); if (!frame) @@ -302,8 +302,8 @@ CALLBACK_FUNC_DECL(LocationReplace) CALLBACK_FUNC_DECL(LocationAssign) { INC_STATS("DOM.Location.assign"); - v8::Handle<v8::Value> holder = args.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + v8::Handle<v8::Object> holder = args.Holder(); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); Frame* frame = imp->frame(); if (!frame) @@ -333,9 +333,9 @@ CALLBACK_FUNC_DECL(LocationValueOf) CALLBACK_FUNC_DECL(LocationToString) { INC_STATS("DOM.Location.toString"); - v8::Handle<v8::Value> holder = args.Holder(); - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, holder); - if (!V8Proxy::CanAccessFrame(imp->frame(), true)) + v8::Handle<v8::Object> holder = args.Holder(); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, holder); + if (!V8Proxy::canAccessFrame(imp->frame(), true)) return v8::Undefined(); String result = imp->href(); return v8String(result); @@ -345,16 +345,16 @@ INDEXED_ACCESS_CHECK(Location) { ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::LOCATION); // Only allow same origin access - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, host); - return V8Proxy::CanAccessFrame(imp->frame(), false); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, host); + return V8Proxy::canAccessFrame(imp->frame(), false); } NAMED_ACCESS_CHECK(Location) { ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::LOCATION); // Only allow same origin access - Location* imp = V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, host); - return V8Proxy::CanAccessFrame(imp->frame(), false); + Location* imp = V8DOMWrapper::convertToNativeObject<Location>(V8ClassIndex::LOCATION, host); + return V8Proxy::canAccessFrame(imp->frame(), false); } } // namespace WebCore |