提交 88a3004d 编写于 作者: A Aaron Boodman

Simple multi-url support for mojo apps.

This patch makes it so that querystrings are no longer considered part of a mojo application's identity.

So if you connect to http://a?foo, then http://a?bar, you'll end up talking to the same application, just two different connections.

The URL of each connection is sent to the app via a new param in AcceptConnection().

This patch also adds some app tests that exercise http app loading, which wasn't tested before.

R=qsr@chromium.org

Review URL: https://codereview.chromium.org/943053003
上级 79aa3684
......@@ -17,8 +17,7 @@ class SkyApplication : public mojo::Application {
public:
SkyApplication(mojo::InterfaceRequest<mojo::Application> application,
mojo::URLResponsePtr response)
: url_(response->url),
binding_(this, application.Pass()),
: binding_(this, application.Pass()),
initial_response_(response.Pass()) {}
void Initialize(mojo::ShellPtr shell,
......@@ -33,7 +32,8 @@ class SkyApplication : public mojo::Application {
void AcceptConnection(const mojo::String& requestor_url,
mojo::InterfaceRequest<mojo::ServiceProvider> services,
mojo::ServiceProviderPtr exposed_services) override {
mojo::ServiceProviderPtr exposed_services,
const mojo::String& url) override {
if (initial_response_) {
OnResponseReceived(mojo::URLLoaderPtr(), services.Pass(),
exposed_services.Pass(), initial_response_.Pass());
......@@ -41,7 +41,7 @@ class SkyApplication : public mojo::Application {
mojo::URLLoaderPtr loader;
network_service_->CreateURLLoader(mojo::GetProxy(&loader));
mojo::URLRequestPtr request(mojo::URLRequest::New());
request->url = url_;
request->url = url;
request->auto_follow_redirects = true;
// |loader| will be pass to the OnResponseReceived method through a
......@@ -70,7 +70,6 @@ class SkyApplication : public mojo::Application {
shell_.get());
}
mojo::String url_;
mojo::StrongBinding<mojo::Application> binding_;
mojo::ShellPtr shell_;
mojo::NetworkServicePtr network_service_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册