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

Unified Diff: chrome/renderer/native_handler.cc

Issue 10208001: Make functions being routed by NativeHandlers throw an exception if there is no ModuleSystem in the… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed error message Created 8 years, 8 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 | « chrome/renderer/module_system.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/native_handler.cc
diff --git a/chrome/renderer/native_handler.cc b/chrome/renderer/native_handler.cc
index a09486b604a1704f38ec8f096cb38754ecda6ced..91c0ff582b9227fea69559b2619dcb89a5dd8131 100644
--- a/chrome/renderer/native_handler.cc
+++ b/chrome/renderer/native_handler.cc
@@ -6,6 +6,7 @@
#include "base/memory/linked_ptr.h"
#include "base/logging.h"
+#include "chrome/renderer/module_system.h"
#include "v8/include/v8.h"
NativeHandler::NativeHandler()
@@ -25,6 +26,9 @@ v8::Handle<v8::Object> NativeHandler::NewInstance() {
v8::Handle<v8::Value> NativeHandler::Router(const v8::Arguments& args) {
HandlerFunction* handler_function = static_cast<HandlerFunction*>(
args.Data().As<v8::External>()->Value());
+ if (!ModuleSystem::IsPresentInCurrentContext())
+ return v8::ThrowException(v8::Exception::Error(
+ v8::String::New("ModuleSystem has been deleted")));
not at google - send to devlin 2012/04/24 05:15:29 nit: braces around multi-line-single-statement if
koz (OOO until 15th September) 2012/04/24 05:35:20 Done.
return handler_function->Run(args);
}
« no previous file with comments | « chrome/renderer/module_system.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698