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 #include "chrome/common/pepper_permission_util.h" | 5 #include "chrome/common/pepper_permission_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/sha1.h" | 10 #include "base/sha1.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 typedef std::vector<SharedModuleInfo::ImportInfo> ImportInfoVector; | 56 typedef std::vector<SharedModuleInfo::ImportInfo> ImportInfoVector; |
57 const ImportInfoVector& imports = SharedModuleInfo::GetImports(extension); | 57 const ImportInfoVector& imports = SharedModuleInfo::GetImports(extension); |
58 for (ImportInfoVector::const_iterator it = imports.begin(); | 58 for (ImportInfoVector::const_iterator it = imports.begin(); |
59 it != imports.end(); | 59 it != imports.end(); |
60 ++it) { | 60 ++it) { |
61 const Extension* imported_extension = | 61 const Extension* imported_extension = |
62 extension_set->GetByID(it->extension_id); | 62 extension_set->GetByID(it->extension_id); |
63 if (imported_extension && | 63 if (imported_extension && |
64 SharedModuleInfo::IsSharedModule(imported_extension) && | 64 SharedModuleInfo::IsSharedModule(imported_extension) && |
65 // We check the whitelist explicitly even though the extension should | |
66 // never have been allowed to be installed in the first place if this | |
67 // fails. See SharedModuleService::CheckImports for details. | |
68 SharedModuleInfo::IsExportAllowedByWhitelist(imported_extension, | |
69 host) && | |
70 HostIsInSet(it->extension_id, whitelist)) { | 65 HostIsInSet(it->extension_id, whitelist)) { |
71 return true; | 66 return true; |
72 } | 67 } |
73 } | 68 } |
74 | 69 |
75 return false; | 70 return false; |
76 } | 71 } |
77 | 72 |
78 bool IsHostAllowedByCommandLine(const GURL& url, | 73 bool IsHostAllowedByCommandLine(const GURL& url, |
79 const extensions::ExtensionSet* extension_set, | 74 const extensions::ExtensionSet* extension_set, |
(...skipping 22 matching lines...) Expand all Loading... |
102 base::StringTokenizer t(allowed_list, ","); | 97 base::StringTokenizer t(allowed_list, ","); |
103 while (t.GetNext()) { | 98 while (t.GetNext()) { |
104 if (t.token() == host) | 99 if (t.token() == host) |
105 return true; | 100 return true; |
106 } | 101 } |
107 | 102 |
108 return false; | 103 return false; |
109 } | 104 } |
110 | 105 |
111 } // namespace chrome | 106 } // namespace chrome |
OLD | NEW |