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

Unified Diff: extensions/renderer/v8_helpers.h

Issue 1433293004: [Extensions] Don't allow gin::Define to be overridden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « extensions/renderer/module_system.cc ('k') | gin/converter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/v8_helpers.h
diff --git a/extensions/renderer/v8_helpers.h b/extensions/renderer/v8_helpers.h
index 2bfeee8a6f3d73909da77a66b5aca5389e48adc2..1a092aac85eece509f5fff4b91f7fe15dfcc44f1 100644
--- a/extensions/renderer/v8_helpers.h
+++ b/extensions/renderer/v8_helpers.h
@@ -56,12 +56,13 @@ inline bool IsEmptyOrUndefied(v8::Local<v8::Value> value) {
return value.IsEmpty() || value->IsUndefined();
}
-// SetProperty() family wraps V8::Object::Set(). Returns true on success.
+// SetProperty() family wraps V8::Object::DefineOwnProperty().
+// Returns true on success.
inline bool SetProperty(v8::Local<v8::Context> context,
v8::Local<v8::Object> object,
- v8::Local<v8::Value> key,
+ v8::Local<v8::String> key,
v8::Local<v8::Value> value) {
- return IsTrue(object->Set(context, key, value));
+ return IsTrue(object->DefineOwnProperty(context, key, value));
}
inline bool SetProperty(v8::Local<v8::Context> context,
« no previous file with comments | « extensions/renderer/module_system.cc ('k') | gin/converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698