Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1497)

Unified Diff: extensions/common/manifest_handlers/webview_info.cc

Issue 1312653003: Fix for WebView accessible resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small fix. Rebased. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/manifest_handlers/webview_info.h ('k') | extensions/renderer/dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/manifest_handlers/webview_info.cc
diff --git a/extensions/common/manifest_handlers/webview_info.cc b/extensions/common/manifest_handlers/webview_info.cc
index 50400023bd82021b7edb639a1fc2406c06861e3d..3359c8009773408139ef5d4ce27b89c75b7da3b4 100644
--- a/extensions/common/manifest_handlers/webview_info.cc
+++ b/extensions/common/manifest_handlers/webview_info.cc
@@ -58,18 +58,20 @@ WebviewInfo::WebviewInfo(const std::string& extension_id)
WebviewInfo::~WebviewInfo() {
}
+// static
bool WebviewInfo::IsResourceWebviewAccessible(
const Extension* extension,
const std::string& partition_id,
- const std::string& relative_path) const {
- if (!extension || extension->id() != extension_id_)
+ const std::string& relative_path) {
+ if (!extension)
return false;
- DCHECK_EQ(this,
- extension->GetManifestData(keys::kWebviewAccessibleResources));
+ const WebviewInfo* webview_info = static_cast<const WebviewInfo*>(
+ extension->GetManifestData(keys::kWebviewAccessibleResources));
+ if (!webview_info)
+ return false;
- for (size_t i = 0; i < partition_items_.size(); ++i) {
- const PartitionItem* const item = partition_items_[i];
+ for (const PartitionItem* item : webview_info->partition_items_) {
if (item->Matches(partition_id) &&
extension->ResourceMatches(item->accessible_resources(),
relative_path)) {
« no previous file with comments | « extensions/common/manifest_handlers/webview_info.h ('k') | extensions/renderer/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698