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

Unified Diff: extensions/common/api/declarative_net_request/rules_manifest_info.h

Issue 2881453002: DNR Prototype: With flatbuffers
Patch Set: -- Created 3 years, 6 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: extensions/common/api/declarative_net_request/rules_manifest_info.h
diff --git a/extensions/common/api/declarative_net_request/rules_manifest_info.h b/extensions/common/api/declarative_net_request/rules_manifest_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..a49fe7272ddd3f061a65ef49f5f354bce11a05ef
--- /dev/null
+++ b/extensions/common/api/declarative_net_request/rules_manifest_info.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_RULES_MANIFEST_INFO_H_
+#define EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_RULES_MANIFEST_INFO_H_
+
+#include "base/macros.h"
+#include "extensions/common/extension.h"
+#include "extensions/common/manifest_handler.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace extensions {
+namespace declarative_net_request {
+
+struct RulesManifestData : Extension::ManifestData {
+ explicit RulesManifestData(base::FilePath path);
+ ~RulesManifestData() override;
+ static const base::FilePath* GetJSONRulesetPath(const Extension* extension);
+
+ base::FilePath json_ruleset_path;
+ DISALLOW_COPY_AND_ASSIGN(RulesManifestData);
+};
+
+// Parses the kDeclarativeNetRequestRulesetLocation manifest key.
+class RulesManifestHandler : public ManifestHandler {
+ public:
+ RulesManifestHandler();
+ ~RulesManifestHandler() override;
+
+ private:
+ bool Parse(Extension* extension, base::string16* error) override;
+ bool Validate(const Extension* extension,
+ std::string* error,
+ std::vector<InstallWarning>* warnings) const override;
+ const std::vector<std::string> Keys() const override;
+
+ DISALLOW_COPY_AND_ASSIGN(RulesManifestHandler);
+};
+
+} // namespace declarative_net_request
+} // namespace extensions
+
+#endif // EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_RULES_MANIFEST_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698