| OLD | NEW |
| 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_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Creates a new SchemaRegistryService for |context|, which must be managed | 39 // Creates a new SchemaRegistryService for |context|, which must be managed |
| 40 // by the caller. Subsequent calls to GetForContext() will return the instance | 40 // by the caller. Subsequent calls to GetForContext() will return the instance |
| 41 // created, as long as it lives. | 41 // created, as long as it lives. |
| 42 static scoped_ptr<SchemaRegistryService> CreateForContext( | 42 static scoped_ptr<SchemaRegistryService> CreateForContext( |
| 43 content::BrowserContext* context, | 43 content::BrowserContext* context, |
| 44 const Schema& chrome_schema, | 44 const Schema& chrome_schema, |
| 45 CombinedSchemaRegistry* global_registry); | 45 CombinedSchemaRegistry* global_registry); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 friend struct DefaultSingletonTraits<SchemaRegistryServiceFactory>; | 48 friend struct base::DefaultSingletonTraits<SchemaRegistryServiceFactory>; |
| 49 | 49 |
| 50 SchemaRegistryServiceFactory(); | 50 SchemaRegistryServiceFactory(); |
| 51 ~SchemaRegistryServiceFactory() override; | 51 ~SchemaRegistryServiceFactory() override; |
| 52 | 52 |
| 53 SchemaRegistryService* GetForContextInternal( | 53 SchemaRegistryService* GetForContextInternal( |
| 54 content::BrowserContext* context); | 54 content::BrowserContext* context); |
| 55 | 55 |
| 56 scoped_ptr<SchemaRegistryService> CreateForContextInternal( | 56 scoped_ptr<SchemaRegistryService> CreateForContextInternal( |
| 57 content::BrowserContext* context, | 57 content::BrowserContext* context, |
| 58 const Schema& chrome_schema, | 58 const Schema& chrome_schema, |
| 59 CombinedSchemaRegistry* global_registry); | 59 CombinedSchemaRegistry* global_registry); |
| 60 | 60 |
| 61 // BrowserContextKeyedBaseFactory: | 61 // BrowserContextKeyedBaseFactory: |
| 62 void BrowserContextShutdown(content::BrowserContext* context) override; | 62 void BrowserContextShutdown(content::BrowserContext* context) override; |
| 63 void BrowserContextDestroyed(content::BrowserContext* context) override; | 63 void BrowserContextDestroyed(content::BrowserContext* context) override; |
| 64 void SetEmptyTestingFactory(content::BrowserContext* context) override; | 64 void SetEmptyTestingFactory(content::BrowserContext* context) override; |
| 65 bool HasTestingFactory(content::BrowserContext* context) override; | 65 bool HasTestingFactory(content::BrowserContext* context) override; |
| 66 void CreateServiceNow(content::BrowserContext* context) override; | 66 void CreateServiceNow(content::BrowserContext* context) override; |
| 67 | 67 |
| 68 typedef std::map<content::BrowserContext*, SchemaRegistryService*> | 68 typedef std::map<content::BrowserContext*, SchemaRegistryService*> |
| 69 RegistryMap; | 69 RegistryMap; |
| 70 RegistryMap registries_; | 70 RegistryMap registries_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(SchemaRegistryServiceFactory); | 72 DISALLOW_COPY_AND_ASSIGN(SchemaRegistryServiceFactory); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace policy | 75 } // namespace policy |
| 76 | 76 |
| 77 #endif // CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_FACTORY_H_ | 77 #endif // CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_FACTORY_H_ |
| OLD | NEW |