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

Unified Diff: extensions/browser/renderer_startup_helper.cc

Issue 2241203003: Pass user session type to extension feature checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass user session type to extension renderer Created 4 years, 4 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 452c816963ddd1b509e6b12ea30c540b9b7ce566..4311172206652cd58de81ad9df06703c09eafc1c 100644
--- a/extensions/browser/renderer_startup_helper.cc
+++ b/extensions/browser/renderer_startup_helper.cc
@@ -17,6 +17,7 @@
#include "extensions/common/extension_set.h"
#include "extensions/common/extensions_client.h"
#include "extensions/common/features/feature_channel.h"
+#include "extensions/common/features/feature_session_type.h"
#include "ui/base/webui/web_ui_util.h"
using content::BrowserContext;
@@ -70,6 +71,14 @@ void RendererStartupHelper::InitializeProcess(
// to all renderers, as the non-extension renderers may have content scripts.
process->Send(new ExtensionMsg_SetChannel(GetCurrentChannel()));
+ // Extensions need to know the session type for API restrictions. The session
+ // type is determined based on the user for which the current session is
Devlin 2016/08/18 17:19:15 omit "The session type is determined..." - that's
+ // started.
+ // The value is sent to all renderers, as the non-extension renderers may have
+ // content scripts.
+ process->Send(
Devlin 2016/08/18 17:19:15 IPCs aren't free, and I think it's probably cheape
+ new ExtensionMsg_SetUserSessionType(GetCurrentFeatureSessionType()));
+
// Platform apps need to know the system font.
// TODO(dbeam): this is not the system font in all cases.
process->Send(new ExtensionMsg_SetSystemFont(webui::GetFontFamily(),

Powered by Google App Engine
This is Rietveld 408576698