OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_CONTROLLER_H_ | |
6 #define CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_CONTROLLER_H_ | |
7 | |
8 #include "base/mac/scoped_cftyperef.h" | |
9 #include "base/memory/weak_ptr.h" | |
10 #include "base/threading/thread.h" | |
11 #include "ipc/ipc_channel_factory.h" | |
12 | |
13 // The AppShimHostController receives connections from app shims on a UNIX | |
14 // socket (|factory_|) and creates a helper object to manage the connection. | |
15 class AppShimHostController | |
16 : public IPC::ChannelFactory::Delegate, | |
17 public base::SupportsWeakPtr<AppShimHostController> { | |
18 public: | |
19 AppShimHostController(); | |
20 virtual ~AppShimHostController(); | |
21 | |
22 private: | |
23 // IPC::ChannelFactory::Delegate implementation. | |
24 virtual void OnClientConnected(const IPC::ChannelHandle& handle) OVERRIDE; | |
25 virtual void OnListenError() OVERRIDE; | |
26 | |
27 // The |factory_| must be created on a thread which allows blocking I/O, so | |
28 // part of the initialization of this class must be carried out on the file | |
29 // thread. | |
30 void InitOnFileThread(); | |
31 | |
32 // Once the |factory_| has been created, its messages should be received on | |
33 // the IO thread. | |
jeremy
2013/03/11 09:32:04
nit: How about adding something like "Called on th
jeremya
2013/03/12 03:45:36
Done.
| |
34 void ListenOnIO(); | |
35 | |
36 IPC::ChannelFactory* factory_; | |
37 }; | |
38 | |
39 #endif // CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_CONTROLLER_H_ | |
OLD | NEW |