| Index: chrome/browser/extensions/api/declarative/declarative_api.h
|
| diff --git a/chrome/browser/extensions/api/declarative/declarative_api.h b/chrome/browser/extensions/api/declarative/declarative_api.h
|
| index 640094651ea8e2b5ecc9e820891eeee8dc235f17..824e3eb53a97219087b11572e7f7de943df459ac 100644
|
| --- a/chrome/browser/extensions/api/declarative/declarative_api.h
|
| +++ b/chrome/browser/extensions/api/declarative/declarative_api.h
|
| @@ -9,22 +9,42 @@
|
| #include "chrome/browser/extensions/extension_function.h"
|
|
|
| namespace extensions {
|
| +class RulesRegistry;
|
| +}
|
|
|
| -class AddRulesFunction : public SyncExtensionFunction {
|
| +namespace extensions {
|
| +
|
| +class RulesFunction : public AsyncExtensionFunction {
|
| + public:
|
| + RulesFunction();
|
| + virtual bool RunImpl();
|
| +
|
| + // Concrete implementation of the RulesFunction that is being called
|
| + // on the thread on which the respective RulesRegistry lives.
|
| + virtual void RunImplOnCorrectThread() = 0;
|
| +
|
| + protected:
|
| + RulesRegistry* rules_registry_;
|
| +
|
| + private:
|
| + void SendResponseOnUIThread();
|
| +};
|
| +
|
| +class AddRulesFunction : public RulesFunction {
|
| public:
|
| - virtual bool RunImpl() OVERRIDE;
|
| + virtual void RunImplOnCorrectThread() OVERRIDE;
|
| DECLARE_EXTENSION_FUNCTION_NAME("experimental.declarative.addRules");
|
| };
|
|
|
| -class RemoveRulesFunction : public SyncExtensionFunction {
|
| +class RemoveRulesFunction : public RulesFunction {
|
| public:
|
| - virtual bool RunImpl() OVERRIDE;
|
| + virtual void RunImplOnCorrectThread() OVERRIDE;
|
| DECLARE_EXTENSION_FUNCTION_NAME("experimental.declarative.removeRules");
|
| };
|
|
|
| -class GetRulesFunction : public SyncExtensionFunction {
|
| +class GetRulesFunction : public RulesFunction {
|
| public:
|
| - virtual bool RunImpl() OVERRIDE;
|
| + virtual void RunImplOnCorrectThread() OVERRIDE;
|
| DECLARE_EXTENSION_FUNCTION_NAME("experimental.declarative.getRules");
|
| };
|
|
|
|
|