|
win: Remove GetModuleFromAddress, deduplicate __ImageBase code.
8 different places were using __ImageBase to get the current module,
create a CURRENT_MODULE() macro that all these places can use.
All but one use of base::GetModuleFromAddress() were used to get
the module of the current file; change all these to use
CURRENT_MODULE() instead.
The (somewhat lame) motivation is that GetModuleFromAddress() took
a void* but was always called with function pointers, and converting
function pointers to void* has undefined behavior. POSIX (dlsym())
requires that conversions between void* and function pointers work
in practice, but on posix an explicit reinterpret_cast is required, and it
seems nice to have compilers behave identically between platforms
here (i.e. we should turn on clang/win's -Wmicrosoft-cast).
In the one place where GetModuleFromAddress() didn't refer to the
current TU's module, add an explicit reinterpret_cast.
BUG= 550065
TBR=asvitkine,wez
Committed: https://crrev.com/d62f5447b35d5d8d1b3521a05b7ed312ab31dbd1
Cr-Commit-Position: refs/heads/master@{#384841}
Total comments: 8
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+68 lines, -112 lines) |
Patch |
 |
M |
base/base_paths_win.cc
|
View
|
|
2 chunks |
+2 lines, -5 lines |
0 comments
|
Download
|
 |
M |
base/debug/profiler.cc
|
View
|
|
4 chunks |
+3 lines, -7 lines |
0 comments
|
Download
|
 |
M |
base/file_version_info.h
|
View
|
1
2
3
4
|
3 chunks |
+5 lines, -21 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_loop_unittest.cc
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_win.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
base/process/memory.h
|
View
|
|
2 chunks |
+0 lines, -10 lines |
0 comments
|
Download
|
 |
M |
base/process/memory_unittest.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+0 lines, -18 lines |
2 comments
|
Download
|
 |
M |
base/process/memory_win.cc
|
View
|
|
1 chunk |
+0 lines, -11 lines |
0 comments
|
Download
|
 |
A |
base/win/current_module.h
|
View
|
1
2
3
|
1 chunk |
+15 lines, -0 lines |
2 comments
|
Download
|
 |
M |
base/win/message_window.cc
|
View
|
1
2
|
2 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
base/win/scoped_handle.cc
|
View
|
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
 |
M |
base/win/scoped_handle_test_dll.cc
|
View
|
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
 |
M |
base/win/wrapped_window_proc.cc
|
View
|
|
2 chunks |
+17 lines, -2 lines |
2 comments
|
Download
|
 |
M |
chrome/child/pdf_child_init.cc
|
View
|
|
2 chunks |
+2 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/installer/util/module_util_win.cc
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
components/metrics/metrics_log.cc
|
View
|
|
2 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
remoting/base/breakpad_win.cc
|
View
|
1
2
3
4
5
6
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
 |
M |
remoting/host/continue_window_win.cc
|
View
|
1
2
|
2 chunks |
+3 lines, -4 lines |
2 comments
|
Download
|
 |
M |
remoting/host/disconnect_window_win.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
Total messages: 28 (13 generated)
|