Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: webkit/port/bindings/v8/v8_proxy.cpp

Issue 27224: Part of unforking Location. We make a bunch of Location related... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/port/bindings/v8/v8_custom.cpp ('k') | webkit/webkit.xcodeproj/project.pbxproj » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/bindings/v8/v8_proxy.cpp
===================================================================
--- webkit/port/bindings/v8/v8_proxy.cpp (revision 10557)
+++ webkit/port/bindings/v8/v8_proxy.cpp (working copy)
@@ -1760,6 +1760,33 @@
break;
}
case V8ClassIndex::LOCATION: {
+ // For security reasons, these functions are on the instance
+ // instead of on the prototype object to insure that they cannot
+ // be overwritten.
+ v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+ instance->SetAccessor(
+ v8::String::New("reload"),
+ V8Custom::v8LocationReloadAccessorGetter,
+ 0,
+ v8::Handle<v8::Value>(),
+ v8::ALL_CAN_READ,
+ static_cast<v8::PropertyAttribute>(v8::DontDelete|v8::ReadOnly));
+
+ instance->SetAccessor(
+ v8::String::New("replace"),
+ V8Custom::v8LocationReplaceAccessorGetter,
+ 0,
+ v8::Handle<v8::Value>(),
+ v8::ALL_CAN_READ,
+ static_cast<v8::PropertyAttribute>(v8::DontDelete|v8::ReadOnly));
+
+ instance->SetAccessor(
+ v8::String::New("assign"),
+ V8Custom::v8LocationAssignAccessorGetter,
+ 0,
+ v8::Handle<v8::Value>(),
+ v8::ALL_CAN_READ,
+ static_cast<v8::PropertyAttribute>(v8::DontDelete|v8::ReadOnly));
break;
}
case V8ClassIndex::HISTORY: {
« no previous file with comments | « webkit/port/bindings/v8/v8_custom.cpp ('k') | webkit/webkit.xcodeproj/project.pbxproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698