OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_PROFILE_SERVICE_PROFILE_APP_H_ | 5 #ifndef COMPONENTS_PROFILE_SERVICE_PROFILE_APP_H_ |
6 #define COMPONENTS_PROFILE_SERVICE_PROFILE_APP_H_ | 6 #define COMPONENTS_PROFILE_SERVICE_PROFILE_APP_H_ |
7 | 7 |
8 #include "components/filesystem/lock_table.h" | 8 #include "components/filesystem/lock_table.h" |
9 #include "components/leveldb/public/interfaces/leveldb.mojom.h" | 9 #include "components/leveldb/public/interfaces/leveldb.mojom.h" |
10 #include "components/profile_service/public/interfaces/profile.mojom.h" | 10 #include "components/profile_service/public/interfaces/profile.mojom.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // BrowserContext is created, the BrowserContext will choose a |user_id| for | 43 // BrowserContext is created, the BrowserContext will choose a |user_id| for |
44 // itself and call us to register the mapping from |user_id| to | 44 // itself and call us to register the mapping from |user_id| to |
45 // |profile_data_dir|. | 45 // |profile_data_dir|. |
46 // | 46 // |
47 // This data is then accessed when we get our Initialize() call. | 47 // This data is then accessed when we get our Initialize() call. |
48 // | 48 // |
49 // TODO(erg): This is a temporary hack until we redo how we initialize mojo | 49 // TODO(erg): This is a temporary hack until we redo how we initialize mojo |
50 // applications inside of chrome in general; this system won't work once | 50 // applications inside of chrome in general; this system won't work once |
51 // ProfileApp gets put in its own sandboxed process. | 51 // ProfileApp gets put in its own sandboxed process. |
52 static void AssociateMojoUserIDWithProfileDir( | 52 static void AssociateMojoUserIDWithProfileDir( |
53 uint32_t user_id, | 53 const std::string& user_id, |
54 const base::FilePath& profile_data_dir); | 54 const base::FilePath& profile_data_dir); |
55 | 55 |
56 private: | 56 private: |
57 // |ShellClient| override: | 57 // |ShellClient| override: |
58 void Initialize(mojo::Connector* connector, | 58 void Initialize(mojo::Connector* connector, |
59 const std::string& url, | 59 const std::string& url, |
60 uint32_t id, | 60 const std::string& user_id, |
61 uint32_t user_id) override; | 61 uint32_t id) override; |
62 bool AcceptConnection(mojo::Connection* connection) override; | 62 bool AcceptConnection(mojo::Connection* connection) override; |
63 | 63 |
64 // |InterfaceFactory<ProfileService>| implementation: | 64 // |InterfaceFactory<ProfileService>| implementation: |
65 void Create(mojo::Connection* connection, | 65 void Create(mojo::Connection* connection, |
66 mojo::InterfaceRequest<ProfileService> request) override; | 66 ProfileServiceRequest request) override; |
67 | 67 |
68 // |InterfaceFactory<LevelDBService>| implementation: | 68 // |InterfaceFactory<LevelDBService>| implementation: |
69 void Create(mojo::Connection* connection, | 69 void Create(mojo::Connection* connection, |
70 mojo::InterfaceRequest<leveldb::LevelDBService> request) override; | 70 leveldb::LevelDBServiceRequest request) override; |
71 | 71 |
72 mojo::TracingImpl tracing_; | 72 mojo::TracingImpl tracing_; |
73 | 73 |
74 scoped_ptr<ProfileService> profile_service_; | 74 scoped_ptr<ProfileService> profile_service_; |
75 mojo::BindingSet<ProfileService> profile_bindings_; | 75 mojo::BindingSet<ProfileService> profile_bindings_; |
76 | 76 |
77 scoped_ptr<leveldb::LevelDBService> leveldb_service_; | 77 scoped_ptr<leveldb::LevelDBService> leveldb_service_; |
78 mojo::BindingSet<leveldb::LevelDBService> leveldb_bindings_; | 78 mojo::BindingSet<leveldb::LevelDBService> leveldb_bindings_; |
79 | 79 |
80 scoped_ptr<filesystem::LockTable> lock_table_; | 80 scoped_ptr<filesystem::LockTable> lock_table_; |
81 | 81 |
82 base::FilePath profile_data_dir_; | 82 base::FilePath profile_data_dir_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(ProfileApp); | 84 DISALLOW_COPY_AND_ASSIGN(ProfileApp); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace profile | 87 } // namespace profile |
88 | 88 |
89 #endif // COMPONENTS_PROFILE_SERVICE_PROFILE_APP_H_ | 89 #endif // COMPONENTS_PROFILE_SERVICE_PROFILE_APP_H_ |
OLD | NEW |