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

Side by Side Diff: chrome/common/extensions/api/storage/storage_schema_manifest_handler.h

Issue 47513018: Make the internal storage of policy::Schemas ref counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-policy-schema-4-new-generate
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_ 6 #define CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "chrome/common/extensions/manifest_handler.h" 9 #include "chrome/common/extensions/manifest_handler.h"
10 10
11 namespace policy { 11 namespace policy {
12 class SchemaOwner; 12 class Schema;
13 } 13 }
14 14
15 namespace extensions { 15 namespace extensions {
16 16
17 // Handles the "storage.managed_schema" manifest key. 17 // Handles the "storage.managed_schema" manifest key.
18 class StorageSchemaManifestHandler : public ManifestHandler { 18 class StorageSchemaManifestHandler : public ManifestHandler {
19 public: 19 public:
20 StorageSchemaManifestHandler(); 20 StorageSchemaManifestHandler();
21 virtual ~StorageSchemaManifestHandler(); 21 virtual ~StorageSchemaManifestHandler();
22 22
23 // Returns the managed storage schema defined for |extension|. 23 // Returns the managed storage schema defined for |extension|.
24 // If the schema is invalid then NULL is returned, and the failure reason 24 // If the schema is invalid then the failure reason is stored in |error|.
dconnelly 2013/10/29 16:43:58 mention what is returned if it's invalid
Joao da Silva 2013/10/29 20:38:42 Done.
25 // is stored in |error|.
26 // This function does file I/O and must be called on a thread that allows I/O. 25 // This function does file I/O and must be called on a thread that allows I/O.
27 static scoped_ptr<policy::SchemaOwner> GetSchema(const Extension* extension, 26 static policy::Schema GetSchema(const Extension* extension,
28 std::string* error); 27 std::string* error);
29 28
30 private: 29 private:
31 // ManifestHandler implementation: 30 // ManifestHandler implementation:
32 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; 31 virtual bool Parse(Extension* extension, string16* error) OVERRIDE;
33 virtual bool Validate(const Extension* extension, 32 virtual bool Validate(const Extension* extension,
34 std::string* error, 33 std::string* error,
35 std::vector<InstallWarning>* warnings) const OVERRIDE; 34 std::vector<InstallWarning>* warnings) const OVERRIDE;
36 virtual const std::vector<std::string> Keys() const OVERRIDE; 35 virtual const std::vector<std::string> Keys() const OVERRIDE;
37 36
38 DISALLOW_COPY_AND_ASSIGN(StorageSchemaManifestHandler); 37 DISALLOW_COPY_AND_ASSIGN(StorageSchemaManifestHandler);
39 }; 38 };
40 39
41 } // namespace extensions 40 } // namespace extensions
42 41
43 #endif // CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_ H_ 42 #endif // CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698