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

Side by Side Diff: tools/memory_watcher/dllmain.cc

Issue 146833020: Remove some uses of ATL in UI code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/services/native_viewport/native_viewport_win.cc ('k') | tools/memory_watcher/hotkey.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // The memory_watcher.dll is hooked by simply linking it. When we get the 5 // The memory_watcher.dll is hooked by simply linking it. When we get the
6 // windows notification that this DLL is loaded, we do a few things: 6 // windows notification that this DLL is loaded, we do a few things:
7 // 1) Register a Hot Key. 7 // 1) Register a Hot Key.
8 // Only one process can hook the Hot Key, so one will get it, and the 8 // Only one process can hook the Hot Key, so one will get it, and the
9 // others will silently fail. 9 // others will silently fail.
10 // 2) Create a thread to wait on an event. 10 // 2) Create a thread to wait on an event.
(...skipping 17 matching lines...) Expand all
28 static HANDLE g_dump_event = INVALID_HANDLE_VALUE; 28 static HANDLE g_dump_event = INVALID_HANDLE_VALUE;
29 static HANDLE g_quit_event = INVALID_HANDLE_VALUE; 29 static HANDLE g_quit_event = INVALID_HANDLE_VALUE;
30 static HANDLE g_watcher_thread = INVALID_HANDLE_VALUE; 30 static HANDLE g_watcher_thread = INVALID_HANDLE_VALUE;
31 31
32 // A HotKey to dump the memory statistics. 32 // A HotKey to dump the memory statistics.
33 class MemoryWatcherDumpKey : public HotKeyHandler { 33 class MemoryWatcherDumpKey : public HotKeyHandler {
34 public: 34 public:
35 MemoryWatcherDumpKey(UINT modifiers, UINT vkey) 35 MemoryWatcherDumpKey(UINT modifiers, UINT vkey)
36 : HotKeyHandler(modifiers, vkey) {} 36 : HotKeyHandler(modifiers, vkey) {}
37 37
38 virtual LRESULT OnHotKey(UINT, WPARAM, LPARAM, BOOL& bHandled) { 38 virtual void OnHotKey(UINT, WPARAM, LPARAM) {
39 SetEvent(g_dump_event); 39 SetEvent(g_dump_event);
40 return 1;
41 } 40 }
42 }; 41 };
43 42
44 // Creates the global memory watcher. 43 // Creates the global memory watcher.
45 void CreateMemoryWatcher() { 44 void CreateMemoryWatcher() {
46 g_memory_watcher_exit_manager = new base::AtExitManager(); 45 g_memory_watcher_exit_manager = new base::AtExitManager();
47 g_memory_watcher = new MemoryWatcher(); 46 g_memory_watcher = new MemoryWatcher();
48 // Register ALT-CONTROL-D to Dump Memory stats. 47 // Register ALT-CONTROL-D to Dump Memory stats.
49 g_hotkey_handler = new MemoryWatcherDumpKey(MOD_ALT|MOD_CONTROL, 0x44); 48 g_hotkey_handler = new MemoryWatcherDumpKey(MOD_ALT|MOD_CONTROL, 0x44);
50 } 49 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 break; 145 break;
147 } 146 }
148 return TRUE; 147 return TRUE;
149 } 148 }
150 149
151 __declspec(dllexport) void __cdecl SetLogName(char* name) { 150 __declspec(dllexport) void __cdecl SetLogName(char* name) {
152 g_memory_watcher->SetLogName(name); 151 g_memory_watcher->SetLogName(name);
153 } 152 }
154 153
155 } // extern "C" 154 } // extern "C"
OLDNEW
« no previous file with comments | « mojo/services/native_viewport/native_viewport_win.cc ('k') | tools/memory_watcher/hotkey.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698