Chromium Code Reviews| Index: chrome/common/extensions/manifest_handlers/externally_connectable.h |
| diff --git a/chrome/common/extensions/manifest_handlers/externally_connectable.h b/chrome/common/extensions/manifest_handlers/externally_connectable.h |
| index 7a8ff61830d6f67e8e21203239b84ea428e8a88b..799c7f723475c077793bad38f119bda81cb8b33d 100644 |
| --- a/chrome/common/extensions/manifest_handlers/externally_connectable.h |
| +++ b/chrome/common/extensions/manifest_handlers/externally_connectable.h |
| @@ -62,18 +62,25 @@ struct ExternallyConnectableInfo : public Extension::ManifestData { |
| // The URL patterns that are allowed to connect/sendMessage. |
| const URLPatternSet matches; |
|
Jeffrey Yasskin
2013/06/08 02:27:47
"url_matches"?
not at google - send to devlin
2013/06/08 02:36:50
we use matches elsewhere to mean URLs (notably con
|
| - // The extension IDs that are allowed to connect/sendMessage. |
| + // The extension IDs that are allowed to connect/sendMessage. Sorted. |
| const std::vector<std::string> ids; |
| // True if any extension is allowed to connect. This would have corresponded |
| // to an ID of "*" in |ids|. |
| const bool matches_all_ids; |
| - private: |
| + // Returns true if |ids| contains |id| or if |matches_all_ids| is true. |
| + // |
| + // More convenient for callers than checking each individually, and it makes |
| + // use of the sortedness of |ids|. |
| + bool MatchesIdOrAllIds(const std::string& id); |
|
Jeffrey Yasskin
2013/06/08 02:27:47
I might just call this "MatchesId" since if it mat
not at google - send to devlin
2013/06/08 02:36:50
now you've inspired me to not use the term "matche
|
| + |
| + // Public only for testing. Use FromValue in production. |
| ExternallyConnectableInfo(const URLPatternSet& matches, |
| const std::vector<std::string>& ids, |
| bool matches_all_ids); |
| + private: |
| DISALLOW_COPY_AND_ASSIGN(ExternallyConnectableInfo); |
| }; |