| 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..72fe02c696f1298d3df07be6a2b2a35e30b3612e 100644
|
| --- a/chrome/browser/extensions/api/declarative/declarative_api.h
|
| +++ b/chrome/browser/extensions/api/declarative/declarative_api.h
|
| @@ -6,25 +6,46 @@
|
| #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_DECLARATIVE_API_H__
|
| #pragma once
|
|
|
| +#include "base/compiler_specific.h"
|
| +#include "base/memory/ref_counted.h"
|
| +#include "chrome/browser/extensions/api/declarative/rules_registry.h"
|
| #include "chrome/browser/extensions/extension_function.h"
|
|
|
| namespace extensions {
|
|
|
| -class AddRulesFunction : public SyncExtensionFunction {
|
| +class RulesFunction : public AsyncExtensionFunction {
|
| public:
|
| + RulesFunction();
|
| + virtual ~RulesFunction();
|
| virtual bool RunImpl() OVERRIDE;
|
| +
|
| + // Concrete implementation of the RulesFunction that is being called
|
| + // on the thread on which the respective RulesRegistry lives.
|
| + // Returns false in case of errors.
|
| + virtual bool RunImplOnCorrectThread() = 0;
|
| +
|
| + protected:
|
| + scoped_refptr<RulesRegistry> rules_registry_;
|
| +
|
| + private:
|
| + void SendResponseOnUIThread();
|
| +};
|
| +
|
| +class AddRulesFunction : public RulesFunction {
|
| + public:
|
| + virtual bool RunImplOnCorrectThread() OVERRIDE;
|
| DECLARE_EXTENSION_FUNCTION_NAME("experimental.declarative.addRules");
|
| };
|
|
|
| -class RemoveRulesFunction : public SyncExtensionFunction {
|
| +class RemoveRulesFunction : public RulesFunction {
|
| public:
|
| - virtual bool RunImpl() OVERRIDE;
|
| + virtual bool RunImplOnCorrectThread() OVERRIDE;
|
| DECLARE_EXTENSION_FUNCTION_NAME("experimental.declarative.removeRules");
|
| };
|
|
|
| -class GetRulesFunction : public SyncExtensionFunction {
|
| +class GetRulesFunction : public RulesFunction {
|
| public:
|
| - virtual bool RunImpl() OVERRIDE;
|
| + virtual bool RunImplOnCorrectThread() OVERRIDE;
|
| DECLARE_EXTENSION_FUNCTION_NAME("experimental.declarative.getRules");
|
| };
|
|
|
|
|