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

Unified Diff: extensions/renderer/object_backed_native_handler.h

Issue 1074273002: Move the event attach/detach logic on unload from event.js to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: being process of relanding - more test assertions Created 5 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 | « extensions/renderer/native_handler.cc ('k') | extensions/renderer/object_backed_native_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/object_backed_native_handler.h
diff --git a/extensions/renderer/object_backed_native_handler.h b/extensions/renderer/object_backed_native_handler.h
index 7fe4b1fe305e9d230f4527ad671bf5a38169e7fa..843e13bf466ceaa867730b0b942e33509b0e5219 100644
--- a/extensions/renderer/object_backed_native_handler.h
+++ b/extensions/renderer/object_backed_native_handler.h
@@ -38,6 +38,10 @@ class ObjectBackedNativeHandler : public NativeHandler {
// Installs a new 'route' from |name| to |handler_function|. This means that
// NewInstance()s of this ObjectBackedNativeHandler will have a property
// |name| which will be handled by |handler_function|.
+ //
+ // Routed functions are destroyed along with the destruction of this class,
+ // and are never called back into, therefore it's safe for |handler_function|
+ // to bind to base::Unretained.
void RouteFunction(const std::string& name,
const HandlerFunction& handler_function);
« no previous file with comments | « extensions/renderer/native_handler.cc ('k') | extensions/renderer/object_backed_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698