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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/renderer_startup_helper.h" 5 #include "extensions/browser/renderer_startup_helper.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" 8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "content/public/browser/notification_service.h" 9 #include "content/public/browser/notification_service.h"
10 #include "content/public/browser/notification_types.h" 10 #include "content/public/browser/notification_types.h"
(...skipping 20 matching lines...) Expand all
31 31
32 RendererStartupHelper::~RendererStartupHelper() {} 32 RendererStartupHelper::~RendererStartupHelper() {}
33 33
34 void RendererStartupHelper::Observe( 34 void RendererStartupHelper::Observe(
35 int type, 35 int type,
36 const content::NotificationSource& source, 36 const content::NotificationSource& source,
37 const content::NotificationDetails& details) { 37 const content::NotificationDetails& details) {
38 DCHECK_EQ(content::NOTIFICATION_RENDERER_PROCESS_CREATED, type); 38 DCHECK_EQ(content::NOTIFICATION_RENDERER_PROCESS_CREATED, type);
39 content::RenderProcessHost* process = 39 content::RenderProcessHost* process =
40 content::Source<content::RenderProcessHost>(source).ptr(); 40 content::Source<content::RenderProcessHost>(source).ptr();
41 if (!ExtensionsBrowserClient::Get()->IsSameContext( 41 ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get();
42 browser_context_, process->GetBrowserContext())) 42 if (!client->IsSameContext(browser_context_, process->GetBrowserContext()))
43 return; 43 return;
44 44
45 bool activity_logging_enabled =
46 client->IsActivityLoggingEnabled(process->GetBrowserContext());
47 // We only send the ActivityLoggingEnabled message if it is enabled; otherwise
48 // the default (not enabled) is correct.
49 if (activity_logging_enabled) {
50 process->Send(
51 new ExtensionMsg_SetActivityLoggingEnabled(activity_logging_enabled));
52 }
53
45 // Platform apps need to know the system font. 54 // Platform apps need to know the system font.
46 // TODO(dbeam): this is not the system font in all cases. 55 // TODO(dbeam): this is not the system font in all cases.
47 process->Send(new ExtensionMsg_SetSystemFont(webui::GetFontFamily(), 56 process->Send(new ExtensionMsg_SetSystemFont(webui::GetFontFamily(),
48 webui::GetFontSize())); 57 webui::GetFontSize()));
49 58
50 // Scripting whitelist. This is modified by tests and must be communicated 59 // Scripting whitelist. This is modified by tests and must be communicated
51 // to renderers. 60 // to renderers.
52 process->Send(new ExtensionMsg_SetScriptingWhitelist( 61 process->Send(new ExtensionMsg_SetScriptingWhitelist(
53 extensions::ExtensionsClient::Get()->GetScriptingWhitelist())); 62 extensions::ExtensionsClient::Get()->GetScriptingWhitelist()));
54 63
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 BrowserContext* context) const { 120 BrowserContext* context) const {
112 // Redirected in incognito. 121 // Redirected in incognito.
113 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); 122 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
114 } 123 }
115 124
116 bool RendererStartupHelperFactory::ServiceIsCreatedWithBrowserContext() const { 125 bool RendererStartupHelperFactory::ServiceIsCreatedWithBrowserContext() const {
117 return true; 126 return true;
118 } 127 }
119 128
120 } // namespace extensions 129 } // namespace extensions
OLDNEW
« 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