OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <windows.h> | 5 #include <windows.h> |
6 #include <shlwapi.h> | 6 #include <shlwapi.h> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 GoogleUpdateSettings::UpdateDidRunState(false, system_level); | 181 GoogleUpdateSettings::UpdateDidRunState(false, system_level); |
182 } | 182 } |
183 | 183 |
184 } | 184 } |
185 //============================================================================= | 185 //============================================================================= |
186 | 186 |
187 MainDllLoader::MainDllLoader() : dll_(NULL) { | 187 MainDllLoader::MainDllLoader() : dll_(NULL) { |
188 } | 188 } |
189 | 189 |
190 MainDllLoader::~MainDllLoader() { | 190 MainDllLoader::~MainDllLoader() { |
191 #ifdef PURIFY | |
192 // We should never unload the dll. There is only risk and no gain from | |
193 // doing so. The singleton dtors have been already run by AtExitManager. | |
194 ::FreeLibrary(dll_); | |
195 #endif | |
196 } | 191 } |
197 | 192 |
198 // Loading chrome is an interesting affair. First we try loading from the | 193 // Loading chrome is an interesting affair. First we try loading from the |
199 // current directory to support run-what-you-compile and other development | 194 // current directory to support run-what-you-compile and other development |
200 // scenarios. | 195 // scenarios. |
201 // If that fails then we look at the --chrome-version command line flag followed | 196 // If that fails then we look at the --chrome-version command line flag followed |
202 // by the 'CHROME_VERSION' env variable to determine if we should stick with an | 197 // by the 'CHROME_VERSION' env variable to determine if we should stick with an |
203 // older dll version even if a new one is available to support upgrade-in-place | 198 // older dll version even if a new one is available to support upgrade-in-place |
204 // scenarios. | 199 // scenarios. |
205 // If that fails then finally we look at the registry which should point us | 200 // If that fails then finally we look at the registry which should point us |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 } | 328 } |
334 }; | 329 }; |
335 | 330 |
336 MainDllLoader* MakeMainDllLoader() { | 331 MainDllLoader* MakeMainDllLoader() { |
337 #if defined(GOOGLE_CHROME_BUILD) | 332 #if defined(GOOGLE_CHROME_BUILD) |
338 return new ChromeDllLoader(); | 333 return new ChromeDllLoader(); |
339 #else | 334 #else |
340 return new ChromiumDllLoader(); | 335 return new ChromiumDllLoader(); |
341 #endif | 336 #endif |
342 } | 337 } |
OLD | NEW |