Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome_frame/chrome_tab.cc

Issue 5581008: Add a new GetInstance() method for singleton classes, take 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // chrome_tab.cc : Implementation of DLL Exports. 5 // chrome_tab.cc : Implementation of DLL Exports.
6 6
7 // Include without path to make GYP build see it. 7 // Include without path to make GYP build see it.
8 #include "chrome_tab.h" // NOLINT 8 #include "chrome_tab.h" // NOLINT
9 9
10 #include <atlsecurity.h> 10 #include <atlsecurity.h>
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ATLTRACESTATUS_DISABLED); 205 ATLTRACESTATUS_DISABLED);
206 #endif 206 #endif
207 InitGoogleUrl(); 207 InitGoogleUrl();
208 208
209 g_exit_manager = new base::AtExitManager(); 209 g_exit_manager = new base::AtExitManager();
210 CommandLine::Init(0, NULL); 210 CommandLine::Init(0, NULL);
211 InitializeCrashReporting(); 211 InitializeCrashReporting();
212 logging::InitLogging(NULL, logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, 212 logging::InitLogging(NULL, logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
213 logging::LOCK_LOG_FILE, logging::DELETE_OLD_LOG_FILE); 213 logging::LOCK_LOG_FILE, logging::DELETE_OLD_LOG_FILE);
214 214
215 DllRedirector* dll_redirector = Singleton<DllRedirector>::get(); 215 DllRedirector* dll_redirector = DllRedirector::GetInstance();
216 DCHECK(dll_redirector); 216 DCHECK(dll_redirector);
217 217
218 if (!dll_redirector->RegisterAsFirstCFModule()) { 218 if (!dll_redirector->RegisterAsFirstCFModule()) {
219 // Someone else was here first, try and get a pointer to their 219 // Someone else was here first, try and get a pointer to their
220 // DllGetClassObject export: 220 // DllGetClassObject export:
221 g_dll_get_class_object_redir_ptr = 221 g_dll_get_class_object_redir_ptr =
222 dll_redirector->GetDllGetClassObjectPtr(); 222 dll_redirector->GetDllGetClassObjectPtr();
223 DCHECK(g_dll_get_class_object_redir_ptr != NULL) 223 DCHECK(g_dll_get_class_object_redir_ptr != NULL)
224 << "Found CF module with no DllGetClassObject export."; 224 << "Found CF module with no DllGetClassObject export.";
225 } 225 }
226 226
227 // Enable ETW logging. 227 // Enable ETW logging.
228 logging::LogEventProvider::Initialize(kChromeFrameProvider); 228 logging::LogEventProvider::Initialize(kChromeFrameProvider);
229 } else if (reason == DLL_PROCESS_DETACH) { 229 } else if (reason == DLL_PROCESS_DETACH) {
230 DllRedirector* dll_redirector = Singleton<DllRedirector>::get(); 230 DllRedirector* dll_redirector = DllRedirector::GetInstance();
231 DCHECK(dll_redirector); 231 DCHECK(dll_redirector);
232 232
233 dll_redirector->UnregisterAsFirstCFModule(); 233 dll_redirector->UnregisterAsFirstCFModule();
234 g_patch_helper.UnpatchIfNeeded(); 234 g_patch_helper.UnpatchIfNeeded();
235 delete g_exit_manager; 235 delete g_exit_manager;
236 g_exit_manager = NULL; 236 g_exit_manager = NULL;
237 ShutdownCrashReporting(); 237 ShutdownCrashReporting();
238 } 238 }
239 return _AtlModule.DllMain(reason, reserved); 239 return _AtlModule.DllMain(reason, reserved);
240 } 240 }
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 sd.GetDacl(&new_dacl); 748 sd.GetDacl(&new_dacl);
749 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); 749 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ);
750 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { 750 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) {
751 result = SetOrDeleteMimeHandlerKey(enable, HKEY_LOCAL_MACHINE); 751 result = SetOrDeleteMimeHandlerKey(enable, HKEY_LOCAL_MACHINE);
752 } 752 }
753 } 753 }
754 754
755 backup.RestoreSecurity(object_name.c_str()); 755 backup.RestoreSecurity(object_name.c_str());
756 return result; 756 return result;
757 } 757 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698