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

Unified Diff: extensions/browser/renderer_startup_helper.cc

Issue 2499493004: Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: Add URLPattern effective TLD whitelisting, Switched IPC to UpdatePermissions, Removed shared memor… Created 3 years, 11 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
Index: extensions/browser/renderer_startup_helper.cc
diff --git a/extensions/browser/renderer_startup_helper.cc b/extensions/browser/renderer_startup_helper.cc
index c200c27a2dd843ec4e6fa83d24ef74f875f9c21a..48d6fe957562dbcb6d2ea1505a09ab01281d199c 100644
--- a/extensions/browser/renderer_startup_helper.cc
+++ b/extensions/browser/renderer_startup_helper.cc
@@ -18,6 +18,8 @@
#include "extensions/common/extensions_client.h"
#include "extensions/common/features/feature_channel.h"
#include "extensions/common/features/feature_session_type.h"
+#include "extensions/common/permissions/permissions_data.h"
+#include "ipc/ipc_message_attachment_set.h"
#include "ui/base/webui/web_ui_util.h"
using content::BrowserContext;
@@ -91,6 +93,15 @@ void RendererStartupHelper::InitializeProcess(
WebViewGuest::GetPartitionID(process)));
}
+ // Load default runtime_blocked_hosts and runtime_allowed_hosts settings, part
+ // of the ExtensionSettings policy.
+ ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params params;
+ params.default_runtime_blocked_hosts =
+ PermissionsData::default_runtime_blocked_hosts();
+ params.default_runtime_allowed_hosts =
+ PermissionsData::default_runtime_allowed_hosts();
+ process->Send(new ExtensionMsg_UpdateDefaultPolicyHostRestrictions(params));
+
// Loaded extensions.
std::vector<ExtensionMsg_Loaded_Params> loaded_extensions;
const ExtensionSet& extensions =
@@ -157,8 +168,9 @@ void RendererStartupHelper::OnExtensionLoaded(const Extension& extension) {
std::vector<ExtensionMsg_Loaded_Params> params(
1,
ExtensionMsg_Loaded_Params(&extension, false /* no tab permissions */));
- for (content::RenderProcessHost* process : initialized_processes_)
+ for (content::RenderProcessHost* process : initialized_processes_) {
process->Send(new ExtensionMsg_Loaded(params));
+ }
Devlin 2017/01/26 22:47:40 why this extraneous change?
nrpeter 2017/02/03 19:32:24 Done.
}
void RendererStartupHelper::OnExtensionUnloaded(const Extension& extension) {

Powered by Google App Engine
This is Rietveld 408576698