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

Unified Diff: chrome/renderer/native_handler.cc

Issue 9835039: Make app_custom_bindings.js lazily evaluated so it doesn't execute on every page load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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/native_handler.h ('k') | chrome/renderer/resources/extensions/app_custom_bindings.js » ('j') | 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 afa21ff65822d4ae6ecd3a6cf1f6dcf14b5b5274..a09486b604a1704f38ec8f096cb38754ecda6ced 100644
--- a/chrome/renderer/native_handler.cc
+++ b/chrome/renderer/native_handler.cc
@@ -9,10 +9,13 @@
#include "v8/include/v8.h"
NativeHandler::NativeHandler()
- : object_template_(v8::ObjectTemplate::New()) {
+ : object_template_(
+ v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New())) {
}
-NativeHandler::~NativeHandler() {}
+NativeHandler::~NativeHandler() {
+ object_template_.Dispose();
+}
v8::Handle<v8::Object> NativeHandler::NewInstance() {
return object_template_->NewInstance();
« no previous file with comments | « chrome/renderer/native_handler.h ('k') | chrome/renderer/resources/extensions/app_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698