| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/shell/context.h" | 5 #include "mojo/shell/context.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 public: | 131 public: |
| 132 NativeViewportApplicationLoader() | 132 NativeViewportApplicationLoader() |
| 133 : share_group_(new gfx::GLShareGroup), | 133 : share_group_(new gfx::GLShareGroup), |
| 134 mailbox_manager_(new gpu::gles2::MailboxManagerImpl) {} | 134 mailbox_manager_(new gpu::gles2::MailboxManagerImpl) {} |
| 135 virtual ~NativeViewportApplicationLoader() {} | 135 virtual ~NativeViewportApplicationLoader() {} |
| 136 | 136 |
| 137 private: | 137 private: |
| 138 // ApplicationLoader implementation. | 138 // ApplicationLoader implementation. |
| 139 virtual void Load(ApplicationManager* manager, | 139 virtual void Load(ApplicationManager* manager, |
| 140 const GURL& url, | 140 const GURL& url, |
| 141 ScopedMessagePipeHandle shell_handle, |
| 141 scoped_refptr<LoadCallbacks> callbacks) override { | 142 scoped_refptr<LoadCallbacks> callbacks) override { |
| 142 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); | 143 DCHECK(shell_handle.is_valid()); |
| 143 if (shell_handle.is_valid()) | 144 app_.reset(new ApplicationImpl(this, shell_handle.Pass())); |
| 144 app_.reset(new ApplicationImpl(this, shell_handle.Pass())); | |
| 145 } | 145 } |
| 146 | 146 |
| 147 virtual void OnApplicationError(ApplicationManager* manager, | 147 virtual void OnApplicationError(ApplicationManager* manager, |
| 148 const GURL& url) override {} | 148 const GURL& url) override {} |
| 149 | 149 |
| 150 // ApplicationDelegate implementation. | 150 // ApplicationDelegate implementation. |
| 151 virtual bool ConfigureIncomingConnection( | 151 virtual bool ConfigureIncomingConnection( |
| 152 mojo::ApplicationConnection* connection) override { | 152 mojo::ApplicationConnection* connection) override { |
| 153 connection->AddService<NativeViewport>(this); | 153 connection->AddService<NativeViewport>(this); |
| 154 connection->AddService<Gpu>(this); | 154 connection->AddService<Gpu>(this); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 ScopedMessagePipeHandle Context::ConnectToServiceByName( | 293 ScopedMessagePipeHandle Context::ConnectToServiceByName( |
| 294 const GURL& application_url, | 294 const GURL& application_url, |
| 295 const std::string& service_name) { | 295 const std::string& service_name) { |
| 296 app_urls_.insert(application_url); | 296 app_urls_.insert(application_url); |
| 297 return application_manager_.ConnectToServiceByName( | 297 return application_manager_.ConnectToServiceByName( |
| 298 application_url, service_name).Pass(); | 298 application_url, service_name).Pass(); |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace shell | 301 } // namespace shell |
| 302 } // namespace mojo | 302 } // namespace mojo |
| OLD | NEW |