| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/test/test_io_thread.h" | 10 #include "base/test/test_io_thread.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 public: | 97 public: |
| 98 StubShellImpl(ApplicationPtr application) | 98 StubShellImpl(ApplicationPtr application) |
| 99 : application_(application.Pass()), binding_(this) { | 99 : application_(application.Pass()), binding_(this) { |
| 100 ShellPtr shell; | 100 ShellPtr shell; |
| 101 binding_.Bind(GetProxy(&shell)); | 101 binding_.Bind(GetProxy(&shell)); |
| 102 application_->Initialize(shell.Pass(), Array<String>(), ""); | 102 application_->Initialize(shell.Pass(), Array<String>(), ""); |
| 103 } | 103 } |
| 104 ~StubShellImpl() override {} | 104 ~StubShellImpl() override {} |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 void ConnectToApplication(const String& requestor_url, | 107 void ConnectToApplication(const String& app_url, |
| 108 InterfaceRequest<ServiceProvider> services, | 108 InterfaceRequest<ServiceProvider> services, |
| 109 ServiceProviderPtr exposed_services) override { | 109 ServiceProviderPtr exposed_services) override { |
| 110 application_->AcceptConnection(requestor_url, services.Pass(), | 110 application_->AcceptConnection("", services.Pass(), exposed_services.Pass(), |
| 111 exposed_services.Pass()); | 111 app_url); |
| 112 } | 112 } |
| 113 | 113 |
| 114 ApplicationPtr application_; | 114 ApplicationPtr application_; |
| 115 StrongBinding<Shell> binding_; | 115 StrongBinding<Shell> binding_; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 void DoLocalRegister(const GURL& app_url, | 118 void DoLocalRegister(const GURL& app_url, |
| 119 const std::vector<std::string>& args, | 119 const std::vector<std::string>& args, |
| 120 ApplicationPtr application) { | 120 ApplicationPtr application) { |
| 121 new StubShellImpl(application.Pass()); | 121 new StubShellImpl(application.Pass()); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 run_loop.Run(); | 274 run_loop.Run(); |
| 275 | 275 |
| 276 // The apps need to be destroyed on the thread where they did socket stuff. | 276 // The apps need to be destroyed on the thread where they did socket stuff. |
| 277 io_runner()->PostTask( | 277 io_runner()->PostTask( |
| 278 FROM_HERE, base::Bind(&DestroyOnIOThread, base::Passed(&supersweet_app), | 278 FROM_HERE, base::Bind(&DestroyOnIOThread, base::Passed(&supersweet_app), |
| 279 base::Passed(&awesome_app))); | 279 base::Passed(&awesome_app))); |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namespace shell | 282 } // namespace shell |
| 283 } // namespace mojo | 283 } // namespace mojo |
| OLD | NEW |