Commit 903d0ef
committed
refactor: Update log.h include path and extract GetExecutablePath helper
This commit includes two main changes:
1. Updated the include path for `log.h` in `analytics_windows.cc` and
`analytics_desktop.cc` from `app/src/include/firebase/log.h` to
`app/src/log.h` for consistency.
2. Refactored `VerifyAndLoadAnalyticsLibrary` in `analytics_windows.cc`
to improve readability and modularity by extracting the logic for
obtaining the executable's full path into a new static helper
function `GetExecutablePath()`.
- The new `GetExecutablePath()` function encapsulates the prioritized
use of `_get_wpgmptr()`, fallback to `_get_pgmptr()`, and the
necessary `MultiByteToWideChar` conversion, along with all
associated error handling and logging. It returns `std::wstring`.
- `VerifyAndLoadAnalyticsLibrary` now calls `GetExecutablePath()` and
checks its return value before proceeding with path manipulation.
- This change makes `VerifyAndLoadAnalyticsLibrary` shorter and easier
to understand.
All previous security enhancements and fixes are maintained.1 parent 4a6b397 commit 903d0ef
2 files changed
+7
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 148 | + | |
182 | 149 | | |
183 | 150 | | |
184 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
185 | 154 | | |
186 | 155 | | |
187 | 156 | | |
188 | 157 | | |
189 | 158 | | |
| 159 | + | |
190 | 160 | | |
191 | 161 | | |
192 | 162 | | |
| |||
0 commit comments