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 CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ | 5 #ifndef CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ |
6 #define CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ | 6 #define CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 bool VersionMismatch() const; | 115 bool VersionMismatch() const; |
116 | 116 |
117 // Sets the instance for the process. This must be called only once per | 117 // Sets the instance for the process. This must be called only once per |
118 // process during startup. | 118 // process during startup. |
119 static void SetForProcess(std::unique_ptr<PrimaryInstallDetails> details); | 119 static void SetForProcess(std::unique_ptr<PrimaryInstallDetails> details); |
120 | 120 |
121 // Returns a pointer to the module's payload so that it may be shared with | 121 // Returns a pointer to the module's payload so that it may be shared with |
122 // other modules in the process. | 122 // other modules in the process. |
123 static const Payload* GetPayload(); | 123 static const Payload* GetPayload(); |
124 | 124 |
125 // Initializes this module's instance with the payload owned by the process's | 125 // Initializes this module's instance with the payload from the process's |
126 // primary module (the one that used SetForProcess). Said primary module must | 126 // primary module (the one that used SetForProcess). |
127 // export the function: | 127 static void InitializeFromPayload(const Payload* payload); |
128 // extern "C" const install_static::InstallDetails::Payload* | |
129 // GetInstallDetailsPayload(); | |
130 static void InitializeFromPrimaryModule(const wchar_t* primary_module_name); | |
131 | 128 |
132 protected: | 129 protected: |
133 explicit InstallDetails(const Payload* payload) : payload_(payload) {} | 130 explicit InstallDetails(const Payload* payload) : payload_(payload) {} |
134 const wchar_t* default_channel_name() const { | 131 const wchar_t* default_channel_name() const { |
135 return payload_->mode->default_channel_name; | 132 return payload_->mode->default_channel_name; |
136 } | 133 } |
137 | 134 |
138 private: | 135 private: |
139 const Payload* const payload_; | 136 const Payload* const payload_; |
140 }; | 137 }; |
(...skipping 21 matching lines...) Expand all Loading... |
162 } | 159 } |
163 | 160 |
164 private: | 161 private: |
165 std::wstring channel_; | 162 std::wstring channel_; |
166 Payload payload_ = Payload(); | 163 Payload payload_ = Payload(); |
167 }; | 164 }; |
168 | 165 |
169 } // namespace install_static | 166 } // namespace install_static |
170 | 167 |
171 #endif // CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ | 168 #endif // CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ |
OLD | NEW |