Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/base/checks.h" | 11 #include "webrtc/base/checks.h" |
| 12 #include "webrtc/base/common.h" | |
| 13 #include "webrtc/base/logging.h" | 12 #include "webrtc/base/logging.h" |
| 14 #include "webrtc/base/win32window.h" | 13 #include "webrtc/base/win32window.h" |
| 15 | 14 |
| 16 namespace rtc { | 15 namespace rtc { |
| 17 | 16 |
| 18 /////////////////////////////////////////////////////////////////////////////// | 17 /////////////////////////////////////////////////////////////////////////////// |
| 19 // Win32Window | 18 // Win32Window |
| 20 /////////////////////////////////////////////////////////////////////////////// | 19 /////////////////////////////////////////////////////////////////////////////// |
| 21 | 20 |
| 22 static const wchar_t kWindowBaseClassName[] = L"WindowBaseClass"; | 21 static const wchar_t kWindowBaseClassName[] = L"WindowBaseClass"; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 LOG_GLE(LS_ERROR) << "RegisterClassEx failed"; | 57 LOG_GLE(LS_ERROR) << "RegisterClassEx failed"; |
| 59 return false; | 58 return false; |
| 60 } | 59 } |
| 61 } | 60 } |
| 62 wnd_ = ::CreateWindowEx(exstyle, kWindowBaseClassName, title, style, | 61 wnd_ = ::CreateWindowEx(exstyle, kWindowBaseClassName, title, style, |
| 63 x, y, cx, cy, parent, NULL, instance_, this); | 62 x, y, cx, cy, parent, NULL, instance_, this); |
| 64 return (NULL != wnd_); | 63 return (NULL != wnd_); |
| 65 } | 64 } |
| 66 | 65 |
| 67 void Win32Window::Destroy() { | 66 void Win32Window::Destroy() { |
| 68 VERIFY(::DestroyWindow(wnd_) != FALSE); | 67 bool res = (::DestroyWindow(wnd_) != FALSE); |
| 68 RTC_DCHECK(res); | |
|
kwiberg-webrtc
2017/02/07 09:39:49
Or
const XXX res = ::DestroyWindow(wnd_);
RTC
nisse-webrtc
2017/02/07 10:48:15
I think I'll instead write it as
const bool succe
kwiberg-webrtc
2017/02/07 11:45:08
Excellent.
| |
| 69 } | 69 } |
| 70 | 70 |
| 71 void Win32Window::Shutdown() { | 71 void Win32Window::Shutdown() { |
| 72 if (window_class_) { | 72 if (window_class_) { |
| 73 ::UnregisterClass(MAKEINTATOM(window_class_), instance_); | 73 ::UnregisterClass(MAKEINTATOM(window_class_), instance_); |
| 74 window_class_ = 0; | 74 window_class_ = 0; |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool Win32Window::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, | 78 bool Win32Window::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 that->OnNcDestroy(); | 113 that->OnNcDestroy(); |
| 114 } | 114 } |
| 115 if (handled) { | 115 if (handled) { |
| 116 return result; | 116 return result; |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 return ::DefWindowProc(hwnd, uMsg, wParam, lParam); | 119 return ::DefWindowProc(hwnd, uMsg, wParam, lParam); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace rtc | 122 } // namespace rtc |
| OLD | NEW |