Index: chrome/browser/extensions/extension_function.h |
diff --git a/chrome/browser/extensions/extension_function.h b/chrome/browser/extensions/extension_function.h |
index 0698d3bcbc609a373848990bed87a7901045514d..dd4aac52243c2e481bf35cb1d787cc4311affa74 100644 |
--- a/chrome/browser/extensions/extension_function.h |
+++ b/chrome/browser/extensions/extension_function.h |
@@ -44,12 +44,16 @@ namespace extensions { |
class WindowController; |
} |
+#ifdef NDEBUG |
not at google - send to devlin
2012/07/25 07:03:46
Pretty please I want to make this change. It's rea
|
#define EXTENSION_FUNCTION_VALIDATE(test) do { \ |
if (!(test)) { \ |
bad_message_ = true; \ |
return false; \ |
} \ |
} while (0) |
+#else // NDEBUG |
+#define EXTENSION_FUNCTION_VALIDATE(test) CHECK(test) |
+#endif // NDEBUG |
#define EXTENSION_FUNCTION_ERROR(error) do { \ |
error_ = error; \ |
@@ -79,6 +83,15 @@ class ExtensionFunction |
virtual UIThreadExtensionFunction* AsUIThreadExtensionFunction(); |
virtual IOThreadExtensionFunction* AsIOThreadExtensionFunction(); |
+ // Returns true if the function permission to run. |
+ // |
+ // The default implementation is to check the Extension's permissions against |
+ // what this function requires to run, but some APIs may require finer |
+ // grained control, such as tabs.executeScript being allowed for active tabs. |
+ // |
+ // This will be run after the function has been set up but before Run(). |
+ virtual bool HasPermission(); |
+ |
// Execute the API. Clients should initialize the ExtensionFunction using |
// SetArgs(), set_request_id(), and the other setters before calling this |
// method. Derived classes should be ready to return GetResultList() and |