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

Unified Diff: content/browser/browser_context.cc

Issue 2183703005: Renderers should obtain browser InterfaceProvider by connecting to browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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: content/browser/browser_context.cc
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 59b0047b06762270ccd31eb0b1abae02ed25d0d7..7cbb5f4407648beba997b2773dee05a2aed612f5 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -23,10 +23,10 @@
#include "content/browser/download/download_manager_impl.h"
#include "content/browser/indexed_db/indexed_db_context_impl.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
-#include "content/browser/mojo/constants.h"
#include "content/browser/push_messaging/push_messaging_router.h"
#include "content/browser/storage_partition_impl_map.h"
#include "content/common/child_process_host_impl.h"
+#include "content/common/mojo/constants.h"
#include "content/public/browser/blob_handle.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -473,12 +473,17 @@ BrowserContext* BrowserContext::GetBrowserContextForShellUserId(
// static
shell::Connector* BrowserContext::GetShellConnectorFor(
BrowserContext* browser_context) {
+ MojoShellConnection* connection = GetMojoShellConnectionFor(browser_context);
+ return connection ? connection->GetConnector() : nullptr;
+}
+
+// static
+MojoShellConnection* BrowserContext::GetMojoShellConnectionFor(
+ BrowserContext* browser_context) {
BrowserContextShellConnectionHolder* connection_holder =
static_cast<BrowserContextShellConnectionHolder*>(
browser_context->GetUserData(kMojoShellConnection));
- if (!connection_holder)
- return nullptr;
- return connection_holder->shell_connection()->GetConnector();
+ return connection_holder ? connection_holder->shell_connection() : nullptr;
}
BrowserContext::~BrowserContext() {
« no previous file with comments | « content/browser/battery_status/battery_monitor_integration_browsertest.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698