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

Unified Diff: extensions/browser/renderer_startup_helper.cc

Issue 2089333002: [Extensions] Add renderer-side logic to short circuit activity logging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Guard adding dom activity loggers Created 4 years, 6 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/browser/extensions_browser_client.cc ('k') | extensions/common/extension_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/renderer_startup_helper.cc
diff --git a/extensions/browser/renderer_startup_helper.cc b/extensions/browser/renderer_startup_helper.cc
index d268a63b09abc0f06b368963a177dd82a10be4da..4a9c961de65845fcda1b23856a59ee5ab11eb772 100644
--- a/extensions/browser/renderer_startup_helper.cc
+++ b/extensions/browser/renderer_startup_helper.cc
@@ -38,10 +38,19 @@ void RendererStartupHelper::Observe(
DCHECK_EQ(content::NOTIFICATION_RENDERER_PROCESS_CREATED, type);
content::RenderProcessHost* process =
content::Source<content::RenderProcessHost>(source).ptr();
- if (!ExtensionsBrowserClient::Get()->IsSameContext(
- browser_context_, process->GetBrowserContext()))
+ ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get();
+ if (!client->IsSameContext(browser_context_, process->GetBrowserContext()))
return;
+ bool activity_logging_enabled =
+ client->IsActivityLoggingEnabled(process->GetBrowserContext());
+ // We only send the ActivityLoggingEnabled message if it is enabled; otherwise
+ // the default (not enabled) is correct.
+ if (activity_logging_enabled) {
+ process->Send(
+ new ExtensionMsg_SetActivityLoggingEnabled(activity_logging_enabled));
+ }
+
// 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(),
« no previous file with comments | « extensions/browser/extensions_browser_client.cc ('k') | extensions/common/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698