| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "base/win/message_window.h" | 5 #include "base/win/message_window.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/process/memory.h" | 9 #include "base/process/memory.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 | 115 |
| 116 return true; | 116 return true; |
| 117 } | 117 } |
| 118 | 118 |
| 119 // static | 119 // static |
| 120 LRESULT CALLBACK MessageWindow::WindowProc(HWND hwnd, | 120 LRESULT CALLBACK MessageWindow::WindowProc(HWND hwnd, |
| 121 UINT message, | 121 UINT message, |
| 122 WPARAM wparam, | 122 WPARAM wparam, |
| 123 LPARAM lparam) { | 123 LPARAM lparam) { |
| 124 // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed. | |
| 125 tracked_objects::ScopedTracker tracking_profile( | |
| 126 FROM_HERE_WITH_EXPLICIT_FUNCTION("440919 MessageWindow::WindowProc")); | |
| 127 | |
| 128 MessageWindow* self = reinterpret_cast<MessageWindow*>( | 124 MessageWindow* self = reinterpret_cast<MessageWindow*>( |
| 129 GetWindowLongPtr(hwnd, GWLP_USERDATA)); | 125 GetWindowLongPtr(hwnd, GWLP_USERDATA)); |
| 130 | 126 |
| 131 switch (message) { | 127 switch (message) { |
| 132 // Set up the self before handling WM_CREATE. | 128 // Set up the self before handling WM_CREATE. |
| 133 case WM_CREATE: { | 129 case WM_CREATE: { |
| 134 CREATESTRUCT* cs = reinterpret_cast<CREATESTRUCT*>(lparam); | 130 CREATESTRUCT* cs = reinterpret_cast<CREATESTRUCT*>(lparam); |
| 135 self = reinterpret_cast<MessageWindow*>(cs->lpCreateParams); | 131 self = reinterpret_cast<MessageWindow*>(cs->lpCreateParams); |
| 136 | 132 |
| 137 // Make |hwnd| available to the message handler. At this point the control | 133 // Make |hwnd| available to the message handler. At this point the control |
| (...skipping 23 matching lines...) Expand all Loading... |
| 161 LRESULT message_result; | 157 LRESULT message_result; |
| 162 if (self->message_callback_.Run(message, wparam, lparam, &message_result)) | 158 if (self->message_callback_.Run(message, wparam, lparam, &message_result)) |
| 163 return message_result; | 159 return message_result; |
| 164 } | 160 } |
| 165 | 161 |
| 166 return DefWindowProc(hwnd, message, wparam, lparam); | 162 return DefWindowProc(hwnd, message, wparam, lparam); |
| 167 } | 163 } |
| 168 | 164 |
| 169 } // namespace win | 165 } // namespace win |
| 170 } // namespace base | 166 } // namespace base |
| OLD | NEW |