2017-08-25 21:35:28 +02:00
|
|
|
diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
|
2018-05-16 11:28:49 +02:00
|
|
|
index 7742a5367ff0..0ec2381dc558 100644
|
2017-08-25 21:35:28 +02:00
|
|
|
--- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
|
|
|
|
+++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
|
2018-04-02 23:17:40 +02:00
|
|
|
@@ -17,6 +17,7 @@
|
|
|
|
#include "chrome/browser/profiles/profile_manager.h"
|
|
|
|
#include "chrome/browser/sync/profile_sync_service_factory.h"
|
|
|
|
#include "chrome/common/channel_info.h"
|
|
|
|
+#include "chrome/common/chrome_switches.h"
|
|
|
|
#include "chrome/common/pref_names.h"
|
|
|
|
#include "components/browser_sync/profile_sync_service.h"
|
|
|
|
#include "components/prefs/pref_service.h"
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -171,6 +172,10 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) {
|
2017-08-25 21:35:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) {
|
|
|
|
+ // CEF should avoid loading ProfileSyncServiceFactory which depends on a lot
|
|
|
|
+ // of unnecessary Chrome-specific factories.
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
// We are only interested in sync logs for the primary user profile.
|
|
|
|
Profile* profile = ProfileManager::GetPrimaryUserProfile();
|
|
|
|
if (!profile ||
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -215,6 +220,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs(
|
2018-03-29 19:58:48 +02:00
|
|
|
if (!profile)
|
|
|
|
return;
|
|
|
|
|
|
|
|
+ // CEF should avoid accessing ExtensionRegistry when extensions are disabled.
|
|
|
|
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
|
|
|
+ switches::kDisableExtensions)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
extensions::ExtensionRegistry* extension_registry =
|
|
|
|
extensions::ExtensionRegistry::Get(profile);
|
|
|
|
std::string extensions_list;
|
|
|
|
diff --git chrome/browser/memory_details.cc chrome/browser/memory_details.cc
|
2018-05-21 14:54:08 +02:00
|
|
|
index 509b62c78375..f48dd53e30c3 100644
|
2018-03-29 19:58:48 +02:00
|
|
|
--- chrome/browser/memory_details.cc
|
|
|
|
+++ chrome/browser/memory_details.cc
|
2018-04-02 23:17:40 +02:00
|
|
|
@@ -16,6 +16,7 @@
|
|
|
|
#include "base/task_scheduler/post_task.h"
|
|
|
|
#include "build/build_config.h"
|
|
|
|
#include "chrome/browser/profiles/profile.h"
|
|
|
|
+#include "chrome/common/chrome_switches.h"
|
|
|
|
#include "components/nacl/common/nacl_process_type.h"
|
|
|
|
#include "components/strings/grit/components_strings.h"
|
|
|
|
#include "content/public/browser/browser_child_process_host_iterator.h"
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -250,8 +251,11 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
|
2018-03-29 19:58:48 +02:00
|
|
|
|
|
|
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
|
|
|
// Determine if this is an extension process.
|
|
|
|
+ // CEF should avoid accessing ExtensionRegistry when extensions are disabled.
|
|
|
|
bool process_is_for_extensions = false;
|
|
|
|
- if (render_process_host) {
|
|
|
|
+ if (render_process_host &&
|
|
|
|
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
|
|
|
|
+ switches::kDisableExtensions)) {
|
|
|
|
content::BrowserContext* context =
|
|
|
|
render_process_host->GetBrowserContext();
|
|
|
|
extensions::ExtensionRegistry* extension_registry =
|
2016-11-07 20:14:09 +01:00
|
|
|
diff --git chrome/browser/ui/webui/net_internals/net_internals_ui.cc chrome/browser/ui/webui/net_internals/net_internals_ui.cc
|
2018-05-20 15:51:42 +02:00
|
|
|
index 12c2eb2e1271..0de1335e91c7 100644
|
2016-11-07 20:14:09 +01:00
|
|
|
--- chrome/browser/ui/webui/net_internals/net_internals_ui.cc
|
|
|
|
+++ chrome/browser/ui/webui/net_internals/net_internals_ui.cc
|
2018-05-20 15:51:42 +02:00
|
|
|
@@ -552,41 +552,31 @@ void NetInternalsMessageHandler::OnClearBrowserCache(
|
2017-08-10 22:55:48 +02:00
|
|
|
void NetInternalsMessageHandler::OnGetPrerenderInfo(
|
2017-01-23 18:36:54 +01:00
|
|
|
const base::ListValue* list) {
|
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
2017-08-10 22:55:48 +02:00
|
|
|
- SendJavascriptCommand(
|
|
|
|
- "receivedPrerenderInfo",
|
|
|
|
- chrome_browser_net::GetPrerenderInfo(Profile::FromWebUI(web_ui())));
|
|
|
|
+ SendJavascriptCommand("receivedPrerenderInfo", nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void NetInternalsMessageHandler::OnGetHistoricNetworkStats(
|
|
|
|
const base::ListValue* list) {
|
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
- SendJavascriptCommand("receivedHistoricNetworkStats",
|
|
|
|
- chrome_browser_net::GetHistoricNetworkStats(
|
|
|
|
- Profile::FromWebUI(web_ui())));
|
|
|
|
+ SendJavascriptCommand("receivedHistoricNetworkStats", nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void NetInternalsMessageHandler::OnGetSessionNetworkStats(
|
|
|
|
const base::ListValue* list) {
|
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
- SendJavascriptCommand(
|
2017-03-03 23:37:23 +01:00
|
|
|
- "receivedSessionNetworkStats",
|
|
|
|
- chrome_browser_net::GetSessionNetworkStats(Profile::FromWebUI(web_ui())));
|
2017-08-10 22:55:48 +02:00
|
|
|
+ SendJavascriptCommand("receivedSessionNetworkStats", nullptr);
|
2017-01-23 18:36:54 +01:00
|
|
|
}
|
2017-03-03 23:37:23 +01:00
|
|
|
|
|
|
|
void NetInternalsMessageHandler::OnGetExtensionInfo(
|
2017-08-10 22:55:48 +02:00
|
|
|
const base::ListValue* list) {
|
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
- SendJavascriptCommand(
|
|
|
|
- "receivedExtensionInfo",
|
|
|
|
- chrome_browser_net::GetExtensionInfo(Profile::FromWebUI(web_ui())));
|
|
|
|
+ SendJavascriptCommand("receivedExtensionInfo", nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void NetInternalsMessageHandler::OnGetDataReductionProxyInfo(
|
|
|
|
const base::ListValue* list) {
|
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
- SendJavascriptCommand("receivedDataReductionProxyInfo",
|
|
|
|
- chrome_browser_net::GetDataReductionProxyInfo(
|
|
|
|
- Profile::FromWebUI(web_ui())));
|
|
|
|
+ SendJavascriptCommand("receivedDataReductionProxyInfo", nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2018-05-20 15:51:42 +02:00
|
|
|
@@ -666,9 +656,17 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady(
|
2016-11-07 20:14:09 +01:00
|
|
|
|
|
|
|
PrePopulateEventList();
|
|
|
|
|
|
|
|
- // Register with network stack to observe events.
|
2017-07-27 01:19:27 +02:00
|
|
|
- io_thread_->net_log()->AddObserver(
|
2016-11-07 20:14:09 +01:00
|
|
|
- this, net::NetLogCaptureMode::IncludeCookiesAndCredentials());
|
|
|
|
+ net::NetLog* net_log = nullptr;
|
|
|
|
+ if (io_thread_)
|
|
|
|
+ net_log = io_thread_->net_log();
|
|
|
|
+ else
|
|
|
|
+ net_log = g_browser_process->net_log();
|
|
|
|
+
|
|
|
|
+ if (net_log) {
|
|
|
|
+ // Register with network stack to observe events.
|
2017-07-27 01:19:27 +02:00
|
|
|
+ net_log->AddObserver(
|
2016-11-07 20:14:09 +01:00
|
|
|
+ this, net::NetLogCaptureMode::IncludeCookiesAndCredentials());
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
void NetInternalsMessageHandler::IOThreadImpl::OnGetNetInfo(
|
2018-05-20 15:51:42 +02:00
|
|
|
@@ -1179,7 +1177,8 @@ void NetInternalsMessageHandler::IOThreadImpl::PrePopulateEventList() {
|
2016-11-07 20:14:09 +01:00
|
|
|
std::set<net::URLRequestContext*> contexts;
|
|
|
|
for (const auto& getter : context_getters_)
|
|
|
|
contexts.insert(getter->GetURLRequestContext());
|
2017-07-27 01:19:27 +02:00
|
|
|
- contexts.insert(io_thread_->globals()->system_request_context);
|
|
|
|
+ if (io_thread_)
|
|
|
|
+ contexts.insert(io_thread_->globals()->system_request_context);
|
2016-11-07 20:14:09 +01:00
|
|
|
|
|
|
|
// Add entries for ongoing network objects.
|
|
|
|
CreateNetLogEntriesForActiveObjects(contexts, this);
|
|
|
|
diff --git content/browser/resource_context_impl.cc content/browser/resource_context_impl.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
index 261e9343b8a2..0fe566c705a4 100644
|
2016-11-07 20:14:09 +01:00
|
|
|
--- content/browser/resource_context_impl.cc
|
|
|
|
+++ content/browser/resource_context_impl.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -56,6 +56,10 @@ URLDataManagerBackend* GetURLDataManagerForResourceContext(
|
2016-11-07 20:14:09 +01:00
|
|
|
context->GetUserData(kURLDataManagerBackendKeyName));
|
|
|
|
}
|
|
|
|
|
|
|
|
+const void* GetURLDataManagerBackendUserDataKey() {
|
|
|
|
+ return kURLDataManagerBackendKeyName;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void InitializeResourceContext(BrowserContext* browser_context) {
|
|
|
|
ResourceContext* resource_context = browser_context->GetResourceContext();
|
|
|
|
|
|
|
|
diff --git content/browser/resource_context_impl.h content/browser/resource_context_impl.h
|
2017-09-06 23:40:58 +02:00
|
|
|
index 903cc543a242..5bd30ae82974 100644
|
2016-11-07 20:14:09 +01:00
|
|
|
--- content/browser/resource_context_impl.h
|
|
|
|
+++ content/browser/resource_context_impl.h
|
|
|
|
@@ -28,6 +28,8 @@ CONTENT_EXPORT StreamContext* GetStreamContextForResourceContext(
|
|
|
|
URLDataManagerBackend* GetURLDataManagerForResourceContext(
|
|
|
|
ResourceContext* context);
|
|
|
|
|
2017-07-06 22:39:37 +02:00
|
|
|
+CONTENT_EXPORT const void* GetURLDataManagerBackendUserDataKey();
|
2016-11-07 20:14:09 +01:00
|
|
|
+
|
|
|
|
// Initialize the above data on the ResourceContext from a given BrowserContext.
|
|
|
|
CONTENT_EXPORT void InitializeResourceContext(BrowserContext* browser_context);
|
|
|
|
|
|
|
|
diff --git content/browser/webui/url_data_manager.cc content/browser/webui/url_data_manager.cc
|
2018-05-20 15:51:42 +02:00
|
|
|
index ce87d5984c09..6d31657e5c6c 100644
|
2016-11-07 20:14:09 +01:00
|
|
|
--- content/browser/webui/url_data_manager.cc
|
|
|
|
+++ content/browser/webui/url_data_manager.cc
|
2018-05-20 15:51:42 +02:00
|
|
|
@@ -148,6 +148,11 @@ void URLDataManager::UpdateWebUIDataSource(
|
2017-09-06 23:40:58 +02:00
|
|
|
->UpdateWebUIDataSource(source_name, std::move(update));
|
2016-11-07 20:14:09 +01:00
|
|
|
}
|
|
|
|
|
2017-09-06 23:40:58 +02:00
|
|
|
+// static
|
2016-11-07 20:14:09 +01:00
|
|
|
+const void* URLDataManager::GetUserDataKey() {
|
|
|
|
+ return kURLDataManagerKeyName;
|
|
|
|
+}
|
|
|
|
+
|
2017-09-06 23:40:58 +02:00
|
|
|
// static
|
2016-11-07 20:14:09 +01:00
|
|
|
bool URLDataManager::IsScheduledForDeletion(
|
|
|
|
const URLDataSourceImpl* data_source) {
|
|
|
|
diff --git content/browser/webui/url_data_manager.h content/browser/webui/url_data_manager.h
|
2017-09-06 23:40:58 +02:00
|
|
|
index 5ceb74d411fc..0c584d6e69b5 100644
|
2016-11-07 20:14:09 +01:00
|
|
|
--- content/browser/webui/url_data_manager.h
|
|
|
|
+++ content/browser/webui/url_data_manager.h
|
2017-01-23 18:36:54 +01:00
|
|
|
@@ -69,6 +69,8 @@ class CONTENT_EXPORT URLDataManager : public base::SupportsUserData::Data {
|
|
|
|
const std::string& source_name,
|
|
|
|
std::unique_ptr<base::DictionaryValue> update);
|
2016-11-07 20:14:09 +01:00
|
|
|
|
|
|
|
+ static const void* GetUserDataKey();
|
|
|
|
+
|
|
|
|
private:
|
|
|
|
friend class URLDataSourceImpl;
|
|
|
|
friend struct DeleteURLDataSource;
|