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

Unified Diff: base/debug/close_handle_hook_win.cc

Issue 2667513003: Remove some LazyInstance use in base/ (Closed)
Patch Set: . Created 3 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: base/debug/close_handle_hook_win.cc
diff --git a/base/debug/close_handle_hook_win.cc b/base/debug/close_handle_hook_win.cc
index 168de67bcc066f2f73452185296beeacb6aa4795..2f82674541b8df5caf11f583e7ddafa5850869b7 100644
--- a/base/debug/close_handle_hook_win.cc
+++ b/base/debug/close_handle_hook_win.cc
@@ -12,7 +12,6 @@
#include <memory>
#include <vector>
-#include "base/lazy_instance.h"
#include "base/macros.h"
#include "base/win/iat_patch_function.h"
#include "base/win/pe_image.h"
@@ -203,7 +202,6 @@ class HandleHooks {
std::vector<base::win::IATPatchFunction*> hooks_;
DISALLOW_COPY_AND_ASSIGN(HandleHooks);
};
-base::LazyInstance<HandleHooks> g_hooks = LAZY_INSTANCE_INITIALIZER;
Mark Mentovai 2017/01/31 14:37:01 This one wasn’t “leaky”, but I think that was an o
scottmg 2017/01/31 18:19:16 Yes, I thought it was accidental too. I just now r
void HandleHooks::AddIATPatch(HMODULE module) {
if (!module)
@@ -259,7 +257,7 @@ void PatchLoadedModules(HandleHooks* hooks) {
} // namespace
void InstallHandleHooks() {
- HandleHooks* hooks = g_hooks.Pointer();
+ static HandleHooks* hooks = new HandleHooks();
// Performing EAT interception first is safer in the presence of other
// threads attempting to call CloseHandle.
« no previous file with comments | « base/cpu.cc ('k') | base/memory/memory_pressure_listener.cc » ('j') | base/win/message_window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698