Chromium Code Reviews| Index: extensions/common/extension_consumer.h |
| diff --git a/extensions/common/extension_consumer.h b/extensions/common/extension_consumer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2e06cbb5aadf585d55e024a1b44a839dea70e30e |
| --- /dev/null |
| +++ b/extensions/common/extension_consumer.h |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2015 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_EXTENSION_CONSUMER_H_ |
| +#define EXTENSIONS_COMMON_EXTENSION_CONSUMER_H_ |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "extensions/common/extension.h" |
| +#include "extensions/common/host_id.h" |
| + |
| +namespace extensions { |
| + |
| +// A wrapper class which holds an extension and implements the Host interface. |
| +class ExtensionConsumer : public Host { |
|
Devlin
2015/02/04 17:01:14
Does this class (and Host itself) have to be in co
Xi Han
2015/02/05 16:06:20
At least now I think both of them should be in com
Devlin
2015/02/06 00:28:40
Where are they used by UserScriptLoader, etc? I o
Devlin
2015/02/06 18:48:36
Didn't get an answer to this one.
Xi Han
2015/02/06 19:45:33
Sorry for missing this comment. Yes, it seems this
|
| + public: |
| + ExtensionConsumer(Extension* extension, const HostID& host_id); |
|
Devlin
2015/02/04 17:01:14
If this is going to store it as a scoped_refptr, i
Xi Han
2015/02/05 16:06:20
Done.
|
| + ~ExtensionConsumer() override; |
| + |
| + const Extension* extension() const { return extension_.get(); } |
| + |
| + private: |
| + scoped_refptr<Extension> extension_; |
|
Devlin
2015/02/04 17:01:14
Extensions should be const.
Xi Han
2015/02/05 16:06:20
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(ExtensionConsumer); |
| +}; |
| + |
| +} // namespace extesions |
| + |
| +#endif // EXTENSIONS_COMMON_EXTENSION_CONSUMER_H_ |