1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "extensions/common/extension.h"
7 #include "base/base64.h"
8 #include "base/basictypes.h"
9 #include "base/command_line.h"
10 #include "base/files/file_path.h"
11 #include "base/i18n/rtl.h"
12 #include "base/logging.h"
13 #include "base/memory/singleton.h"
14 #include "base/stl_util.h"
15 #include "base/strings/string16.h"
16 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/string_piece.h"
18 #include "base/strings/string_util.h"
19 #include "base/strings/stringprintf.h"
20 #include "base/strings/utf_string_conversions.h"
21 #include "base/values.h"
22 #include "base/version.h"
23 #include "components/crx_file/id_util.h"
24 #include "content/public/common/url_constants.h"
25 #include "extensions/common/constants.h"
26 #include "extensions/common/error_utils.h"
27 #include "extensions/common/feature_switch.h"
28 #include "extensions/common/manifest.h"
29 #include "extensions/common/manifest_constants.h"
30 #include "extensions/common/manifest_handler.h"
31 #include "extensions/common/manifest_handlers/permissions_parser.h"
32 #include "extensions/common/permissions/permission_set.h"
33 #include "extensions/common/permissions/permissions_data.h"
34 #include "extensions/common/permissions/permissions_info.h"
35 #include "extensions/common/switches.h"
36 #include "extensions/common/url_pattern.h"
37 #include "net/base/filename_util.h"
38 #include "url/url_util.h"
40 namespace extensions
{
42 namespace keys
= manifest_keys
;
43 namespace values
= manifest_values
;
44 namespace errors
= manifest_errors
;
48 const int kModernManifestVersion
= 2;
49 const int kPEMOutputColumns
= 64;
52 const char kKeyBeginHeaderMarker
[] = "-----BEGIN";
53 const char kKeyBeginFooterMarker
[] = "-----END";
54 const char kKeyInfoEndMarker
[] = "KEY-----";
55 const char kPublic
[] = "PUBLIC";
56 const char kPrivate
[] = "PRIVATE";
58 bool ContainsReservedCharacters(const base::FilePath
& path
) {
59 // We should disallow backslash '\\' as file path separator even on Windows,
60 // because the backslash is not regarded as file path separator on Linux/Mac.
61 // Extensions are cross-platform.
62 // Since FilePath uses backslash '\\' as file path separator on Windows, so we
63 // need to check manually.
64 if (path
.value().find('\\') != path
.value().npos
)
66 return !net::IsSafePortableRelativePath(path
);
71 const int Extension::kInitFromValueFlagBits
= 13;
73 const char Extension::kMimeType
[] = "application/x-chrome-extension";
75 const int Extension::kValidWebExtentSchemes
=
76 URLPattern::SCHEME_HTTP
| URLPattern::SCHEME_HTTPS
;
78 const int Extension::kValidHostPermissionSchemes
= URLPattern::SCHEME_CHROMEUI
|
79 URLPattern::SCHEME_HTTP
|
80 URLPattern::SCHEME_HTTPS
|
81 URLPattern::SCHEME_FILE
|
82 URLPattern::SCHEME_FTP
;
89 scoped_refptr
<Extension
> Extension::Create(const base::FilePath
& path
,
90 Manifest::Location location
,
91 const base::DictionaryValue
& value
,
93 std::string
* utf8_error
) {
94 return Extension::Create(path
,
98 std::string(), // ID is ignored if empty.
102 // TODO(sungguk): Continue removing std::string errors and replacing
103 // with base::string16. See http://crbug.com/71980.
104 scoped_refptr
<Extension
> Extension::Create(const base::FilePath
& path
,
105 Manifest::Location location
,
106 const base::DictionaryValue
& value
,
108 const std::string
& explicit_id
,
109 std::string
* utf8_error
) {
111 base::string16 error
;
112 scoped_ptr
<extensions::Manifest
> manifest(
113 new extensions::Manifest(
114 location
, scoped_ptr
<base::DictionaryValue
>(value
.DeepCopy())));
116 if (!InitExtensionID(manifest
.get(), path
, explicit_id
, flags
, &error
)) {
117 *utf8_error
= base::UTF16ToUTF8(error
);
121 std::vector
<InstallWarning
> install_warnings
;
122 if (!manifest
->ValidateManifest(utf8_error
, &install_warnings
)) {
126 scoped_refptr
<Extension
> extension
= new Extension(path
, manifest
.Pass());
127 extension
->install_warnings_
.swap(install_warnings
);
129 if (!extension
->InitFromValue(flags
, &error
)) {
130 *utf8_error
= base::UTF16ToUTF8(error
);
137 Manifest::Type
Extension::GetType() const {
138 return converted_from_user_script() ?
139 Manifest::TYPE_USER_SCRIPT
: manifest_
->type();
143 GURL
Extension::GetResourceURL(const GURL
& extension_url
,
144 const std::string
& relative_path
) {
145 DCHECK(extension_url
.SchemeIs(extensions::kExtensionScheme
));
146 DCHECK_EQ("/", extension_url
.path());
148 std::string path
= relative_path
;
150 // If the relative path starts with "/", it is "absolute" relative to the
151 // extension base directory, but extension_url is already specified to refer
152 // to that base directory, so strip the leading "/" if present.
153 if (relative_path
.size() > 0 && relative_path
[0] == '/')
154 path
= relative_path
.substr(1);
156 GURL ret_val
= GURL(extension_url
.spec() + path
);
157 DCHECK(StartsWithASCII(ret_val
.spec(), extension_url
.spec(), false));
162 bool Extension::ResourceMatches(const URLPatternSet
& pattern_set
,
163 const std::string
& resource
) const {
164 return pattern_set
.MatchesURL(extension_url_
.Resolve(resource
));
167 ExtensionResource
Extension::GetResource(
168 const std::string
& relative_path
) const {
169 std::string new_path
= relative_path
;
170 // We have some legacy data where resources have leading slashes.
171 // See: http://crbug.com/121164
172 if (!new_path
.empty() && new_path
.at(0) == '/')
173 new_path
.erase(0, 1);
174 base::FilePath relative_file_path
= base::FilePath::FromUTF8Unsafe(new_path
);
175 if (ContainsReservedCharacters(relative_file_path
))
176 return ExtensionResource();
177 ExtensionResource
r(id(), path(), relative_file_path
);
178 if ((creation_flags() & Extension::FOLLOW_SYMLINKS_ANYWHERE
)) {
179 r
.set_follow_symlinks_anywhere();
184 ExtensionResource
Extension::GetResource(
185 const base::FilePath
& relative_file_path
) const {
186 if (ContainsReservedCharacters(relative_file_path
))
187 return ExtensionResource();
188 ExtensionResource
r(id(), path(), relative_file_path
);
189 if ((creation_flags() & Extension::FOLLOW_SYMLINKS_ANYWHERE
)) {
190 r
.set_follow_symlinks_anywhere();
195 // TODO(rafaelw): Move ParsePEMKeyBytes, ProducePEM & FormatPEMForOutput to a
196 // util class in base:
197 // http://code.google.com/p/chromium/issues/detail?id=13572
199 bool Extension::ParsePEMKeyBytes(const std::string
& input
,
200 std::string
* output
) {
204 if (input
.length() == 0)
207 std::string working
= input
;
208 if (StartsWithASCII(working
, kKeyBeginHeaderMarker
, true)) {
209 working
= base::CollapseWhitespaceASCII(working
, true);
210 size_t header_pos
= working
.find(kKeyInfoEndMarker
,
211 sizeof(kKeyBeginHeaderMarker
) - 1);
212 if (header_pos
== std::string::npos
)
214 size_t start_pos
= header_pos
+ sizeof(kKeyInfoEndMarker
) - 1;
215 size_t end_pos
= working
.rfind(kKeyBeginFooterMarker
);
216 if (end_pos
== std::string::npos
)
218 if (start_pos
>= end_pos
)
221 working
= working
.substr(start_pos
, end_pos
- start_pos
);
222 if (working
.length() == 0)
226 return base::Base64Decode(working
, output
);
230 bool Extension::ProducePEM(const std::string
& input
, std::string
* output
) {
234 base::Base64Encode(input
, output
);
239 bool Extension::FormatPEMForFileOutput(const std::string
& input
,
243 if (input
.length() == 0)
246 output
->append(kKeyBeginHeaderMarker
);
248 output
->append(is_public
? kPublic
: kPrivate
);
250 output
->append(kKeyInfoEndMarker
);
251 output
->append("\n");
252 for (size_t i
= 0; i
< input
.length(); ) {
253 int slice
= std::min
<int>(input
.length() - i
, kPEMOutputColumns
);
254 output
->append(input
.substr(i
, slice
));
255 output
->append("\n");
258 output
->append(kKeyBeginFooterMarker
);
260 output
->append(is_public
? kPublic
: kPrivate
);
262 output
->append(kKeyInfoEndMarker
);
263 output
->append("\n");
269 GURL
Extension::GetBaseURLFromExtensionId(const std::string
& extension_id
) {
270 return GURL(std::string(extensions::kExtensionScheme
) +
271 url::kStandardSchemeSeparator
+ extension_id
+ "/");
274 bool Extension::ShowConfigureContextMenus() const {
275 // Normally we don't show a context menu for component actions, but when
276 // re-design is enabled we show them in the toolbar (if they have an action),
277 // and it is weird to have a random button that has no context menu when the
279 if (location() == Manifest::COMPONENT
||
280 location() == Manifest::EXTERNAL_COMPONENT
)
281 return FeatureSwitch::extension_action_redesign()->IsEnabled();
286 bool Extension::OverlapsWithOrigin(const GURL
& origin
) const {
290 if (web_extent().is_empty())
293 // Note: patterns and extents ignore port numbers.
294 URLPattern
origin_only_pattern(kValidWebExtentSchemes
);
295 if (!origin_only_pattern
.SetScheme(origin
.scheme()))
297 origin_only_pattern
.SetHost(origin
.host());
298 origin_only_pattern
.SetPath("/*");
300 URLPatternSet origin_only_pattern_list
;
301 origin_only_pattern_list
.AddPattern(origin_only_pattern
);
303 return web_extent().OverlapsWith(origin_only_pattern_list
);
306 bool Extension::RequiresSortOrdinal() const {
307 return is_app() && (display_in_launcher_
|| display_in_new_tab_page_
);
310 bool Extension::ShouldDisplayInAppLauncher() const {
311 // Only apps should be displayed in the launcher.
312 return is_app() && display_in_launcher_
;
315 bool Extension::ShouldDisplayInNewTabPage() const {
316 // Only apps should be displayed on the NTP.
317 return is_app() && display_in_new_tab_page_
;
320 bool Extension::ShouldDisplayInExtensionSettings() const {
321 // Don't show for themes since the settings UI isn't really useful for them.
325 // Don't show component extensions and invisible apps.
326 if (ShouldNotBeVisible())
329 // Always show unpacked extensions and apps.
330 if (Manifest::IsUnpackedLocation(location()))
333 // Unless they are unpacked, never show hosted apps. Note: We intentionally
334 // show packaged apps and platform apps because there are some pieces of
335 // functionality that are only available in chrome://extensions/ but which
336 // are needed for packaged and platform apps. For example, inspecting
337 // background pages. See http://crbug.com/116134.
344 bool Extension::ShouldNotBeVisible() const {
345 // Don't show component extensions because they are only extensions as an
346 // implementation detail of Chrome.
347 if (extensions::Manifest::IsComponentLocation(location()) &&
348 !base::CommandLine::ForCurrentProcess()->HasSwitch(
349 switches::kShowComponentExtensionOptions
)) {
353 // Always show unpacked extensions and apps.
354 if (Manifest::IsUnpackedLocation(location()))
357 // Don't show apps that aren't visible in either launcher or ntp.
358 if (is_app() && !ShouldDisplayInAppLauncher() && !ShouldDisplayInNewTabPage())
364 Extension::ManifestData
* Extension::GetManifestData(const std::string
& key
)
366 DCHECK(finished_parsing_manifest_
|| thread_checker_
.CalledOnValidThread());
367 ManifestDataMap::const_iterator iter
= manifest_data_
.find(key
);
368 if (iter
!= manifest_data_
.end())
369 return iter
->second
.get();
373 void Extension::SetManifestData(const std::string
& key
,
374 Extension::ManifestData
* data
) {
375 DCHECK(!finished_parsing_manifest_
&& thread_checker_
.CalledOnValidThread());
376 manifest_data_
[key
] = linked_ptr
<ManifestData
>(data
);
379 Manifest::Location
Extension::location() const {
380 return manifest_
->location();
383 const std::string
& Extension::id() const {
384 return manifest_
->extension_id();
387 const std::string
Extension::VersionString() const {
388 return version()->GetString();
391 const std::string
Extension::GetVersionForDisplay() const {
392 if (version_name_
.size() > 0)
393 return version_name_
;
394 return VersionString();
397 void Extension::AddInstallWarning(const InstallWarning
& new_warning
) {
398 install_warnings_
.push_back(new_warning
);
401 void Extension::AddInstallWarnings(
402 const std::vector
<InstallWarning
>& new_warnings
) {
403 install_warnings_
.insert(install_warnings_
.end(),
404 new_warnings
.begin(), new_warnings
.end());
407 bool Extension::is_app() const {
408 return manifest()->is_app();
411 bool Extension::is_platform_app() const {
412 return manifest()->is_platform_app();
415 bool Extension::is_hosted_app() const {
416 return manifest()->is_hosted_app();
419 bool Extension::is_legacy_packaged_app() const {
420 return manifest()->is_legacy_packaged_app();
423 bool Extension::is_extension() const {
424 return manifest()->is_extension();
427 bool Extension::is_shared_module() const {
428 return manifest()->is_shared_module();
431 bool Extension::is_theme() const {
432 return manifest()->is_theme();
435 bool Extension::can_be_incognito_enabled() const {
436 // Only component platform apps are supported in incognito.
437 return !is_platform_app() || location() == Manifest::COMPONENT
;
440 void Extension::AddWebExtentPattern(const URLPattern
& pattern
) {
441 // Bookmark apps are permissionless.
445 extent_
.AddPattern(pattern
);
449 bool Extension::InitExtensionID(extensions::Manifest
* manifest
,
450 const base::FilePath
& path
,
451 const std::string
& explicit_id
,
453 base::string16
* error
) {
454 if (!explicit_id
.empty()) {
455 manifest
->set_extension_id(explicit_id
);
459 if (manifest
->HasKey(keys::kPublicKey
)) {
460 std::string public_key
;
461 std::string public_key_bytes
;
462 if (!manifest
->GetString(keys::kPublicKey
, &public_key
) ||
463 !ParsePEMKeyBytes(public_key
, &public_key_bytes
)) {
464 *error
= base::ASCIIToUTF16(errors::kInvalidKey
);
467 std::string extension_id
= crx_file::id_util::GenerateId(public_key_bytes
);
468 manifest
->set_extension_id(extension_id
);
472 if (creation_flags
& REQUIRE_KEY
) {
473 *error
= base::ASCIIToUTF16(errors::kInvalidKey
);
476 // If there is a path, we generate the ID from it. This is useful for
477 // development mode, because it keeps the ID stable across restarts and
478 // reloading the extension.
479 std::string extension_id
= crx_file::id_util::GenerateIdForPath(path
);
480 if (extension_id
.empty()) {
481 NOTREACHED() << "Could not create ID from path.";
484 manifest
->set_extension_id(extension_id
);
489 Extension::Extension(const base::FilePath
& path
,
490 scoped_ptr
<extensions::Manifest
> manifest
)
491 : manifest_version_(0),
492 converted_from_user_script_(false),
493 manifest_(manifest
.release()),
494 finished_parsing_manifest_(false),
495 display_in_launcher_(true),
496 display_in_new_tab_page_(true),
497 wants_file_access_(false),
499 DCHECK(path
.empty() || path
.IsAbsolute());
500 path_
= crx_file::id_util::MaybeNormalizePath(path
);
503 Extension::~Extension() {
506 bool Extension::InitFromValue(int flags
, base::string16
* error
) {
509 creation_flags_
= flags
;
511 // Important to load manifest version first because many other features
512 // depend on its value.
513 if (!LoadManifestVersion(error
))
516 if (!LoadRequiredFeatures(error
))
519 // We don't need to validate because InitExtensionID already did that.
520 manifest_
->GetString(keys::kPublicKey
, &public_key_
);
522 extension_url_
= Extension::GetBaseURLFromExtensionId(id());
524 // Load App settings. LoadExtent at least has to be done before
525 // ParsePermissions(), because the valid permissions depend on what type of
527 if (is_app() && !LoadAppFeatures(error
))
530 permissions_parser_
.reset(new PermissionsParser());
531 if (!permissions_parser_
->Parse(this, error
))
534 if (manifest_
->HasKey(keys::kConvertedFromUserScript
)) {
535 manifest_
->GetBoolean(keys::kConvertedFromUserScript
,
536 &converted_from_user_script_
);
539 if (!LoadSharedFeatures(error
))
542 permissions_parser_
->Finalize(this);
543 permissions_parser_
.reset();
545 finished_parsing_manifest_
= true;
547 permissions_data_
.reset(new PermissionsData(this));
552 bool Extension::LoadRequiredFeatures(base::string16
* error
) {
553 if (!LoadName(error
) ||
559 bool Extension::LoadName(base::string16
* error
) {
560 base::string16 localized_name
;
561 if (!manifest_
->GetString(keys::kName
, &localized_name
)) {
562 *error
= base::ASCIIToUTF16(errors::kInvalidName
);
565 non_localized_name_
= base::UTF16ToUTF8(localized_name
);
566 base::i18n::AdjustStringForLocaleDirection(&localized_name
);
567 name_
= base::UTF16ToUTF8(localized_name
);
571 bool Extension::LoadVersion(base::string16
* error
) {
572 std::string version_str
;
573 if (!manifest_
->GetString(keys::kVersion
, &version_str
)) {
574 *error
= base::ASCIIToUTF16(errors::kInvalidVersion
);
577 version_
.reset(new Version(version_str
));
578 if (!version_
->IsValid() || version_
->components().size() > 4) {
579 *error
= base::ASCIIToUTF16(errors::kInvalidVersion
);
582 if (manifest_
->HasKey(keys::kVersionName
)) {
583 if (!manifest_
->GetString(keys::kVersionName
, &version_name_
)) {
584 *error
= base::ASCIIToUTF16(errors::kInvalidVersionName
);
591 bool Extension::LoadAppFeatures(base::string16
* error
) {
592 if (!LoadExtent(keys::kWebURLs
, &extent_
,
593 errors::kInvalidWebURLs
, errors::kInvalidWebURL
, error
)) {
596 if (manifest_
->HasKey(keys::kDisplayInLauncher
) &&
597 !manifest_
->GetBoolean(keys::kDisplayInLauncher
, &display_in_launcher_
)) {
598 *error
= base::ASCIIToUTF16(errors::kInvalidDisplayInLauncher
);
601 if (manifest_
->HasKey(keys::kDisplayInNewTabPage
)) {
602 if (!manifest_
->GetBoolean(keys::kDisplayInNewTabPage
,
603 &display_in_new_tab_page_
)) {
604 *error
= base::ASCIIToUTF16(errors::kInvalidDisplayInNewTabPage
);
608 // Inherit default from display_in_launcher property.
609 display_in_new_tab_page_
= display_in_launcher_
;
614 bool Extension::LoadExtent(const char* key
,
615 URLPatternSet
* extent
,
616 const char* list_error
,
617 const char* value_error
,
618 base::string16
* error
) {
619 const base::Value
* temp_pattern_value
= NULL
;
620 if (!manifest_
->Get(key
, &temp_pattern_value
))
623 const base::ListValue
* pattern_list
= NULL
;
624 if (!temp_pattern_value
->GetAsList(&pattern_list
)) {
625 *error
= base::ASCIIToUTF16(list_error
);
629 for (size_t i
= 0; i
< pattern_list
->GetSize(); ++i
) {
630 std::string pattern_string
;
631 if (!pattern_list
->GetString(i
, &pattern_string
)) {
632 *error
= ErrorUtils::FormatErrorMessageUTF16(value_error
,
633 base::UintToString(i
),
634 errors::kExpectString
);
638 URLPattern
pattern(kValidWebExtentSchemes
);
639 URLPattern::ParseResult parse_result
= pattern
.Parse(pattern_string
);
640 if (parse_result
== URLPattern::PARSE_ERROR_EMPTY_PATH
) {
641 pattern_string
+= "/";
642 parse_result
= pattern
.Parse(pattern_string
);
645 if (parse_result
!= URLPattern::PARSE_SUCCESS
) {
646 *error
= ErrorUtils::FormatErrorMessageUTF16(
648 base::UintToString(i
),
649 URLPattern::GetParseResultString(parse_result
));
653 // Do not allow authors to claim "<all_urls>".
654 if (pattern
.match_all_urls()) {
655 *error
= ErrorUtils::FormatErrorMessageUTF16(
657 base::UintToString(i
),
658 errors::kCannotClaimAllURLsInExtent
);
662 // Do not allow authors to claim "*" for host.
663 if (pattern
.host().empty()) {
664 *error
= ErrorUtils::FormatErrorMessageUTF16(
666 base::UintToString(i
),
667 errors::kCannotClaimAllHostsInExtent
);
671 // We do not allow authors to put wildcards in their paths. Instead, we
672 // imply one at the end.
673 if (pattern
.path().find('*') != std::string::npos
) {
674 *error
= ErrorUtils::FormatErrorMessageUTF16(
676 base::UintToString(i
),
677 errors::kNoWildCardsInPaths
);
680 pattern
.SetPath(pattern
.path() + '*');
682 extent
->AddPattern(pattern
);
688 bool Extension::LoadSharedFeatures(base::string16
* error
) {
689 if (!LoadDescription(error
) ||
690 !ManifestHandler::ParseExtension(this, error
) ||
691 !LoadShortName(error
))
697 bool Extension::LoadDescription(base::string16
* error
) {
698 if (manifest_
->HasKey(keys::kDescription
) &&
699 !manifest_
->GetString(keys::kDescription
, &description_
)) {
700 *error
= base::ASCIIToUTF16(errors::kInvalidDescription
);
706 bool Extension::LoadManifestVersion(base::string16
* error
) {
707 // Get the original value out of the dictionary so that we can validate it
709 if (manifest_
->value()->HasKey(keys::kManifestVersion
)) {
710 int manifest_version
= 1;
711 if (!manifest_
->GetInteger(keys::kManifestVersion
, &manifest_version
) ||
712 manifest_version
< 1) {
713 *error
= base::ASCIIToUTF16(errors::kInvalidManifestVersion
);
718 manifest_version_
= manifest_
->GetManifestVersion();
719 if (manifest_version_
< kModernManifestVersion
&&
720 ((creation_flags_
& REQUIRE_MODERN_MANIFEST_VERSION
&&
721 !base::CommandLine::ForCurrentProcess()->HasSwitch(
722 switches::kAllowLegacyExtensionManifests
)) ||
723 GetType() == Manifest::TYPE_PLATFORM_APP
)) {
724 *error
= ErrorUtils::FormatErrorMessageUTF16(
725 errors::kInvalidManifestVersionOld
,
726 base::IntToString(kModernManifestVersion
),
727 is_platform_app() ? "apps" : "extensions");
734 bool Extension::LoadShortName(base::string16
* error
) {
735 if (manifest_
->HasKey(keys::kShortName
)) {
736 base::string16 localized_short_name
;
737 if (!manifest_
->GetString(keys::kShortName
, &localized_short_name
) ||
738 localized_short_name
.empty()) {
739 *error
= base::ASCIIToUTF16(errors::kInvalidShortName
);
743 base::i18n::AdjustStringForLocaleDirection(&localized_short_name
);
744 short_name_
= base::UTF16ToUTF8(localized_short_name
);
751 ExtensionInfo::ExtensionInfo(const base::DictionaryValue
* manifest
,
752 const std::string
& id
,
753 const base::FilePath
& path
,
754 Manifest::Location location
)
756 extension_path(path
),
757 extension_location(location
) {
759 extension_manifest
.reset(manifest
->DeepCopy());
762 ExtensionInfo::~ExtensionInfo() {}
764 InstalledExtensionInfo::InstalledExtensionInfo(
765 const Extension
* extension
,
768 const std::string
& old_name
)
769 : extension(extension
),
770 is_update(is_update
),
771 from_ephemeral(from_ephemeral
),
772 old_name(old_name
) {}
774 UnloadedExtensionInfo::UnloadedExtensionInfo(
775 const Extension
* extension
,
776 UnloadedExtensionInfo::Reason reason
)
778 extension(extension
) {}
780 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
781 const Extension
* extension
,
782 const PermissionSet
* permissions
,
785 extension(extension
),
786 permissions(permissions
) {}
788 } // namespace extensions