Chromium Code Reviews| Index: base/win/wrapped_window_proc.h |
| diff --git a/base/win/wrapped_window_proc.h b/base/win/wrapped_window_proc.h |
| index d464a9c279fe4b3618a22a9c3b5625735fc67fdf..02382b11e32c51d41eec8b778a499e113f06e7e4 100644 |
| --- a/base/win/wrapped_window_proc.h |
| +++ b/base/win/wrapped_window_proc.h |
| @@ -13,6 +13,7 @@ |
| #include <windows.h> |
| #include "base/base_export.h" |
| +#include "base/profiler/scoped_profile.h" |
| #include "base/strings/string16.h" |
| namespace base { |
| @@ -69,11 +70,23 @@ BASE_EXPORT void InitializeWindowClass( |
| // CreateWindowW(class_name, window_name, ... |
| // |
| template <WNDPROC proc> |
| -LRESULT CALLBACK WrappedWindowProc(HWND hwnd, UINT message, |
| - WPARAM wparam, LPARAM lparam) { |
| +LRESULT CALLBACK ProfiledWrappedWindowProc(HWND hwnd, |
| + UINT message, |
| + WPARAM wparam, |
| + LPARAM lparam) { |
| + // The template parameter <proc> identifies the wrapped function. |
| + tracked_objects::ScopedProfile scoped_profile( |
|
grt (UTC plus 2)
2017/05/16 07:27:35
are you doing this in its own function template be
Sigurður Ásgeirsson
2017/05/16 13:16:58
This was pure habit - seems the ScopedProfile work
|
| + FROM_HERE, tracked_objects::ScopedProfile::ENABLED); |
| + |
| + return proc(hwnd, message, wparam, lparam); |
| +} |
| + |
| +template <WNDPROC proc> |
| +LRESULT CALLBACK |
| +WrappedWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { |
| LRESULT rv = 0; |
| __try { |
| - rv = proc(hwnd, message, wparam, lparam); |
| + rv = ProfiledWrappedWindowProc<proc>(hwnd, message, wparam, lparam); |
| } __except(CallExceptionFilter(GetExceptionInformation())) { |
| } |
| return rv; |