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

Unified Diff: src/api.cc

Issue 10837358: Throw a more descriptive exception when blocking 'eval' via CSP. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add SetErrorMessageForCodeGenerationFromStrings API function. Created 8 years, 3 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 | « include/v8.h ('k') | src/contexts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 65b544c7919eae9cb63119d7c0131b9be357ac73..ec16556ceb654e30c146cd4e3de445841bbb3901 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -4577,6 +4577,22 @@ bool Context::IsCodeGenerationFromStringsAllowed() {
}
+void Context::SetErrorMessageForCodeGenerationFromStrings(
+ Handle<String> error) {
+ i::Isolate* isolate = i::Isolate::Current();
+ if (IsDeadCheck(isolate,
+ "v8::Context::SetErrorMessageForCodeGenerationFromStrings()")) {
+ return;
+ }
+ ENTER_V8(isolate);
+ i::Object** ctx = reinterpret_cast<i::Object**>(this);
+ i::Handle<i::Context> context =
+ i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx));
+ i::Handle<i::Object> error_handle = Utils::OpenHandle(*error);
+ context->set_error_message_for_code_gen_from_strings(*error_handle);
+}
+
+
void V8::SetWrapperClassId(i::Object** global_handle, uint16_t class_id) {
i::GlobalHandles::SetWrapperClassId(global_handle, class_id);
}
« no previous file with comments | « include/v8.h ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698