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

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, 5 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..a10c749e1bbe172af30b4e892c703102dd4768d0 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -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() {

Powered by Google App Engine
This is Rietveld 408576698