summaryrefslogtreecommitdiffstats
path: root/content/browser/mojo
diff options
context:
space:
mode:
authorrockot <rockot@chromium.org>2015-06-08 14:26:05 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-08 21:26:42 +0000
commitcf16f88440880d05949fb0ead39977eaf66be714 (patch)
tree271cebec015920563c901399ecb8acd4cf38637c /content/browser/mojo
parent981616a5f266da9b47ba122ce725d088d260140c (diff)
downloadchromium_src-cf16f88440880d05949fb0ead39977eaf66be714.zip
chromium_src-cf16f88440880d05949fb0ead39977eaf66be714.tar.gz
chromium_src-cf16f88440880d05949fb0ead39977eaf66be714.tar.bz2
Revert of Add a mojo shell service to render frames (patchset #3 id:160001 of https://codereview.chromium.org/1164163002/)
Reason for revert: Broke MSan bot for confusing reasons. Original issue's description: > Add a mojo shell service to render frames > > This adds a Shell service to each render frame's service > registry, allowing frames to connect to Mojo applications. > When connecting to an application, the frame identifies > itself using its SiteInstance's URL. > > BUG=497474 > > Committed: https://crrev.com/89b0cc457ff83154f80709d9b58575047845730e > Cr-Commit-Position: refs/heads/master@{#333312} TBR=jam@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=497474 Review URL: https://codereview.chromium.org/1169933002 Cr-Commit-Position: refs/heads/master@{#333342}
Diffstat (limited to 'content/browser/mojo')
-rw-r--r--content/browser/mojo/mojo_app_connection_impl.cc16
-rw-r--r--content/browser/mojo/mojo_app_connection_impl.h2
-rw-r--r--content/browser/mojo/mojo_shell_context.cc16
-rw-r--r--content/browser/mojo/mojo_shell_context.h5
4 files changed, 14 insertions, 25 deletions
diff --git a/content/browser/mojo/mojo_app_connection_impl.cc b/content/browser/mojo/mojo_app_connection_impl.cc
index 4f567d9..d643bbf 100644
--- a/content/browser/mojo/mojo_app_connection_impl.cc
+++ b/content/browser/mojo/mojo_app_connection_impl.cc
@@ -8,20 +8,12 @@
namespace content {
-const char kBrowserMojoAppUrl[] = "system:content_browser";
-
-// static
-scoped_ptr<MojoAppConnection> MojoAppConnection::Create(
- const GURL& url,
- const GURL& requestor_url) {
- return scoped_ptr<MojoAppConnection>(
- new MojoAppConnectionImpl(url, requestor_url));
+scoped_ptr<MojoAppConnection> MojoAppConnection::Create(const GURL& url) {
+ return scoped_ptr<MojoAppConnection>(new MojoAppConnectionImpl(url));
}
-MojoAppConnectionImpl::MojoAppConnectionImpl(const GURL& url,
- const GURL& requestor_url) {
- MojoShellContext::ConnectToApplication(url, requestor_url,
- mojo::GetProxy(&services_));
+MojoAppConnectionImpl::MojoAppConnectionImpl(const GURL& url) {
+ MojoShellContext::ConnectToApplication(url, mojo::GetProxy(&services_));
}
MojoAppConnectionImpl::~MojoAppConnectionImpl() {
diff --git a/content/browser/mojo/mojo_app_connection_impl.h b/content/browser/mojo/mojo_app_connection_impl.h
index 6fc4ea3..4628acc 100644
--- a/content/browser/mojo/mojo_app_connection_impl.h
+++ b/content/browser/mojo/mojo_app_connection_impl.h
@@ -16,7 +16,7 @@ namespace content {
// Implementation of the app connection mechanism provided to browser code.
class MojoAppConnectionImpl : public MojoAppConnection {
public:
- MojoAppConnectionImpl(const GURL& url, const GURL& requestor_url);
+ explicit MojoAppConnectionImpl(const GURL& url);
~MojoAppConnectionImpl() override;
private:
diff --git a/content/browser/mojo/mojo_shell_context.cc b/content/browser/mojo/mojo_shell_context.cc
index 7541a0e..49e66a9 100644
--- a/content/browser/mojo/mojo_shell_context.cc
+++ b/content/browser/mojo/mojo_shell_context.cc
@@ -28,6 +28,10 @@ namespace content {
namespace {
+// Virtual app URL to use as the requestor identity when connecting from browser
+// code to a Mojo app via the shell proxy.
+const char kBrowserAppUrl[] = "system:content_browser";
+
// An extra set of apps to register on initialization, if set by a test.
const MojoShellContext::StaticApplicationMap* g_applications_for_test;
@@ -84,19 +88,17 @@ class MojoShellContext::Proxy {
void ConnectToApplication(
const GURL& url,
- const GURL& requestor_url,
mojo::InterfaceRequest<mojo::ServiceProvider> request) {
if (task_runner_ == base::ThreadTaskRunnerHandle::Get()) {
if (shell_context_)
- shell_context_->ConnectToApplicationOnOwnThread(url, requestor_url,
- request.Pass());
+ shell_context_->ConnectToApplicationOnOwnThread(url, request.Pass());
} else {
// |shell_context_| outlives the main MessageLoop, so it's safe for it to
// be unretained here.
task_runner_->PostTask(
FROM_HERE,
base::Bind(&MojoShellContext::ConnectToApplicationOnOwnThread,
- base::Unretained(shell_context_), url, requestor_url,
+ base::Unretained(shell_context_), url,
base::Passed(&request)));
}
}
@@ -145,19 +147,17 @@ MojoShellContext::~MojoShellContext() {
// static
void MojoShellContext::ConnectToApplication(
const GURL& url,
- const GURL& requestor_url,
mojo::InterfaceRequest<mojo::ServiceProvider> request) {
- proxy_.Get()->ConnectToApplication(url, requestor_url, request.Pass());
+ proxy_.Get()->ConnectToApplication(url, request.Pass());
}
void MojoShellContext::ConnectToApplicationOnOwnThread(
const GURL& url,
- const GURL& requestor_url,
mojo::InterfaceRequest<mojo::ServiceProvider> request) {
mojo::URLRequestPtr url_request = mojo::URLRequest::New();
url_request->url = mojo::String::From(url);
application_manager_->ConnectToApplication(
- url_request.Pass(), requestor_url, request.Pass(),
+ url_request.Pass(), GURL(kBrowserAppUrl), request.Pass(),
mojo::ServiceProviderPtr(), base::Bind(&base::DoNothing));
}
diff --git a/content/browser/mojo/mojo_shell_context.h b/content/browser/mojo/mojo_shell_context.h
index ab0207b..b0ac5b1 100644
--- a/content/browser/mojo/mojo_shell_context.h
+++ b/content/browser/mojo/mojo_shell_context.h
@@ -36,11 +36,9 @@ class CONTENT_EXPORT MojoShellContext
// Connects an application at |url| and gets a handle to its exposed services.
// This is only intended for use in browser code that's not part of some Mojo
- // application. May be called from any thread. |requestor_url| is given to
- // the target application as the requestor's URL upon connection.
+ // application. May be called from any thread.
static void ConnectToApplication(
const GURL& url,
- const GURL& requestor_url,
mojo::InterfaceRequest<mojo::ServiceProvider> request);
static void SetApplicationsForTest(const StaticApplicationMap* apps);
@@ -51,7 +49,6 @@ class CONTENT_EXPORT MojoShellContext
void ConnectToApplicationOnOwnThread(
const GURL& url,
- const GURL& requestor_url,
mojo::InterfaceRequest<mojo::ServiceProvider> request);
// mojo::shell::ApplicationManager::Delegate: