Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 EXTENSIONS_RENDERER_RENDERER_EXTENSION_REGISTRY_H_ | 5 #ifndef EXTENSIONS_RENDERER_RENDERER_EXTENSION_REGISTRY_H_ |
| 6 #define EXTENSIONS_RENDERER_RENDERER_EXTENSION_REGISTRY_H_ | 6 #define EXTENSIONS_RENDERER_RENDERER_EXTENSION_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 | 25 |
| 26 // Returns the ExtensionSet that underlies this RenderExtensionRegistry. | 26 // Returns the ExtensionSet that underlies this RenderExtensionRegistry. |
| 27 // | 27 // |
| 28 // This is not thread-safe and must only be called on the RenderThread, but | 28 // This is not thread-safe and must only be called on the RenderThread, but |
| 29 // even so, it's not thread safe because other threads may decide to | 29 // even so, it's not thread safe because other threads may decide to |
| 30 // modify this. Don't persist a reference to this. | 30 // modify this. Don't persist a reference to this. |
| 31 // | 31 // |
| 32 // TODO(annekao): remove or make thread-safe and callback-based. | 32 // TODO(annekao): remove or make thread-safe and callback-based. |
| 33 const ExtensionSet* GetMainThreadExtensionSet() const; | 33 const ExtensionSet* GetMainThreadExtensionSet() const; |
| 34 | 34 |
| 35 // This method is used to let RendererExtensionRegistry know which webview | |
| 36 // partition ID this render process is associated with, if any. This ID is | |
| 37 // used to find the correct entry in extension manifests for webview | |
| 38 // accessible resources. | |
| 39 void SetWebviewPartitionID(const std::string& partition_id); | |
|
not at google - send to devlin
2015/08/27 20:01:25
This class is a set of extensions. Knowledge about
paulmeyer
2015/08/31 15:32:55
Okay, I will instead store the partition ID right
| |
| 40 | |
| 41 std::string webview_partition_id() const { return webview_partition_id_; } | |
| 42 | |
| 35 size_t size() const; | 43 size_t size() const; |
| 36 bool is_empty() const; | 44 bool is_empty() const; |
| 37 | 45 |
| 38 // Forwards to the ExtensionSet methods by the same name. | 46 // Forwards to the ExtensionSet methods by the same name. |
| 39 bool Contains(const std::string& id) const; | 47 bool Contains(const std::string& id) const; |
| 40 bool Insert(const scoped_refptr<const Extension>& extension); | 48 bool Insert(const scoped_refptr<const Extension>& extension); |
| 41 bool Remove(const std::string& id); | 49 bool Remove(const std::string& id); |
| 42 std::string GetExtensionOrAppIDByURL(const GURL& url) const; | 50 std::string GetExtensionOrAppIDByURL(const GURL& url) const; |
| 43 const Extension* GetExtensionOrAppByURL(const GURL& url) const; | 51 const Extension* GetExtensionOrAppByURL(const GURL& url) const; |
| 44 const Extension* GetHostedAppByURL(const GURL& url) const; | 52 const Extension* GetHostedAppByURL(const GURL& url) const; |
| 45 const Extension* GetByID(const std::string& id) const; | 53 const Extension* GetByID(const std::string& id) const; |
| 46 ExtensionIdSet GetIDs() const; | 54 ExtensionIdSet GetIDs() const; |
| 47 bool ExtensionBindingsAllowed(const GURL& url) const; | 55 bool ExtensionBindingsAllowed(const GURL& url) const; |
| 48 | 56 |
| 49 private: | 57 private: |
| 50 ExtensionSet extensions_; | 58 ExtensionSet extensions_; |
| 51 | 59 |
| 52 mutable base::Lock lock_; | 60 mutable base::Lock lock_; |
| 53 | 61 |
| 62 std::string webview_partition_id_; | |
| 63 | |
| 54 DISALLOW_COPY_AND_ASSIGN(RendererExtensionRegistry); | 64 DISALLOW_COPY_AND_ASSIGN(RendererExtensionRegistry); |
| 55 }; | 65 }; |
| 56 | 66 |
| 57 } // namespace extensions | 67 } // namespace extensions |
| 58 | 68 |
| 59 #endif // EXTENSIONS_RENDERER_RENDERER_EXTENSION_REGISTRY_H_ | 69 #endif // EXTENSIONS_RENDERER_RENDERER_EXTENSION_REGISTRY_H_ |
| OLD | NEW |