| 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 #ifndef CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MANAGER_MAC_H_ | 5 #ifndef CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MANAGER_MAC_H_ |
| 6 #define CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MANAGER_MAC_H_ | 6 #define CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MANAGER_MAC_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "chrome/browser/apps/app_shim/unix_domain_socket_acceptor.h" | 12 #include "chrome/browser/apps/app_shim/unix_domain_socket_acceptor.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 #include "mojo/edk/embedder/scoped_platform_handle.h" |
| 14 | 15 |
| 15 namespace apps { | 16 namespace apps { |
| 16 class ExtensionAppShimHandler; | 17 class ExtensionAppShimHandler; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 class FilePath; | 21 class FilePath; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace test { | 24 namespace test { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 friend class base::RefCountedThreadSafe<AppShimHostManager>; | 47 friend class base::RefCountedThreadSafe<AppShimHostManager>; |
| 47 friend struct content::BrowserThread::DeleteOnThread< | 48 friend struct content::BrowserThread::DeleteOnThread< |
| 48 content::BrowserThread::UI>; | 49 content::BrowserThread::UI>; |
| 49 friend class base::DeleteHelper<AppShimHostManager>; | 50 friend class base::DeleteHelper<AppShimHostManager>; |
| 50 friend class test::AppShimHostManagerTestApi; | 51 friend class test::AppShimHostManagerTestApi; |
| 51 virtual ~AppShimHostManager(); | 52 virtual ~AppShimHostManager(); |
| 52 | 53 |
| 53 // UnixDomainSocketAcceptor::Delegate implementation. | 54 // UnixDomainSocketAcceptor::Delegate implementation. |
| 54 void OnClientConnected(const IPC::ChannelHandle& handle) override; | 55 void OnClientConnected(mojo::edk::ScopedPlatformHandle handle) override; |
| 55 void OnListenError() override; | 56 void OnListenError() override; |
| 56 | 57 |
| 57 // The |acceptor_| must be created on a thread which allows blocking I/O, so | 58 // The |acceptor_| must be created on a thread which allows blocking I/O, so |
| 58 // part of the initialization of this class must be carried out on the file | 59 // part of the initialization of this class must be carried out on the file |
| 59 // thread. | 60 // thread. |
| 60 void InitOnFileThread(); | 61 void InitOnFileThread(); |
| 61 | 62 |
| 62 // Called on the IO thread to begin listening for connections from app shims. | 63 // Called on the IO thread to begin listening for connections from app shims. |
| 63 void ListenOnIOThread(); | 64 void ListenOnIOThread(); |
| 64 | 65 |
| 65 base::FilePath directory_in_tmp_; | 66 base::FilePath directory_in_tmp_; |
| 66 | 67 |
| 67 std::unique_ptr<apps::UnixDomainSocketAcceptor> acceptor_; | 68 std::unique_ptr<apps::UnixDomainSocketAcceptor> acceptor_; |
| 68 | 69 |
| 69 std::unique_ptr<apps::ExtensionAppShimHandler> extension_app_shim_handler_; | 70 std::unique_ptr<apps::ExtensionAppShimHandler> extension_app_shim_handler_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(AppShimHostManager); | 72 DISALLOW_COPY_AND_ASSIGN(AppShimHostManager); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 #endif // CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MANAGER_MAC_H_ | 75 #endif // CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MANAGER_MAC_H_ |
| OLD | NEW |