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

Unified Diff: chrome/renderer/extensions/object_backed_native_handler.h

Issue 12693008: Prevent ObjectBackedNativeHandler from calling itself once invalid. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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
Index: chrome/renderer/extensions/object_backed_native_handler.h
diff --git a/chrome/renderer/extensions/object_backed_native_handler.h b/chrome/renderer/extensions/object_backed_native_handler.h
index 16ebe55e545bbb3e88c318395e84a1d854786143..5e9a3dd4eb8d8d73829136e6a89e80df0ed13a79 100644
--- a/chrome/renderer/extensions/object_backed_native_handler.h
+++ b/chrome/renderer/extensions/object_backed_native_handler.h
@@ -40,18 +40,20 @@ class ObjectBackedNativeHandler : public NativeHandler {
const HandlerFunction& handler_function);
void RouteStaticFunction(const std::string& name,
- const HandlerFunc handler_func);
+ const HandlerFunc& handler_func);
v8::Handle<v8::Context> v8_context() { return v8_context_.get(); }
virtual void Invalidate() OVERRIDE;
private:
-
static v8::Handle<v8::Value> Router(const v8::Arguments& args);
- struct RouterData;
- std::vector<linked_ptr<RouterData> > router_data_;
+ // Hold onto persistent handles for the router data we've created. Each is
+ // an object that contains an "is valid" flag along with a pointer to the
+ // method to call, if it's valid.
+ typedef std::vector<v8::Persistent<v8::Object> > RouterData;
+ RouterData router_data_;
// TODO(kalman): Just pass around a ChromeV8Context. It already has a
// persistent handle to this context.

Powered by Google App Engine
This is Rietveld 408576698