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

Unified Diff: chrome/browser/extensions/api/declarative/declarative_api.h

Issue 9422003: Migrate Declarative API bindings to new JSON objects generated by JSON compiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pacify clang Created 8 years, 10 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/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..bc4ec779f77474abbac039873eb73bf6499211c0 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 "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() OVERRIDE;
+
+ // 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 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");
};

Powered by Google App Engine
This is Rietveld 408576698