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

Side by Side Diff: app/win/scoped_prop.cc

Issue 6019007: Remove win_util::FormatMessage and FormatLastWin32Error. These were only used... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « app/win/hwnd_util.cc ('k') | app/win/window_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/win/scoped_prop.h" 5 #include "app/win/scoped_prop.h"
6 6
7 #include "base/win_util.h" 7 #include "base/win_util.h"
8 8
9 namespace app { 9 namespace app {
10 10
11 namespace win { 11 namespace win {
12 12
13 ScopedProp::ScopedProp(HWND hwnd, const std::wstring& key, HANDLE data) 13 ScopedProp::ScopedProp(HWND hwnd, const std::wstring& key, HANDLE data)
14 : hwnd_(hwnd), 14 : hwnd_(hwnd),
15 key_(key) { 15 key_(key) {
16 BOOL result = SetProp(hwnd, key.c_str(), data); 16 BOOL result = SetProp(hwnd, key.c_str(), data);
17 // Failure to set a propery on a window is typically fatal. It means someone 17 // Failure to set a propery on a window is typically fatal. It means someone
18 // is going to ask for the property and get NULL. So, rather than crash later 18 // is going to ask for the property and get NULL. So, rather than crash later
19 // on when someone expects a non-NULL value we crash here in hopes of 19 // on when someone expects a non-NULL value we crash here in hopes of
20 // diagnosing the failure. 20 // diagnosing the failure.
21 CHECK(result) << win_util::FormatLastWin32Error(); 21 CHECK(result) << ::GetLastError();
22 } 22 }
23 23
24 ScopedProp::~ScopedProp() { 24 ScopedProp::~ScopedProp() {
25 DCHECK(IsWindow(hwnd_)); 25 DCHECK(IsWindow(hwnd_));
26 RemoveProp(hwnd_, key_.c_str()); 26 RemoveProp(hwnd_, key_.c_str());
27 } 27 }
28 28
29 29
30 } // namespace win 30 } // namespace win
31 31
32 } // namespace app 32 } // namespace app
OLDNEW
« no previous file with comments | « app/win/hwnd_util.cc ('k') | app/win/window_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698