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

Issue 813873004: win: Add Scoped...Handle (Closed)

Created:
6 years ago by scottmg
Modified:
6 years ago
Reviewers:
Mark Mentovai
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

win: Add Scoped...Handle Intended for future use to implement util/file/file_writer. There's a similar class in base: https://code.google.com/p/chromium/codesearch#chromium/src/base/win/scoped_handle.h&l=28 However (perhaps for historical reasons) it does not distinguish between the possible types of HANDLEs which have different invalid values, resulting in a need to copy a bunch of code rather than simply using ScopedGeneric. Instead, distinguish between the types so the caller can use the correct one. Refs: http://blogs.msdn.com/b/oldnewthing/archive/2004/03/02/82639.aspx http://msdn.microsoft.com/en-us/magazine/cc302328.aspx (Figure 2) R=mark@chromium.org BUG=crashpad:1 Committed: https://chromium.googlesource.com/crashpad/crashpad/+/4a9b858fbd1fcddcddfff00c8537a48f07f7ae69

Patch Set 1 #

Patch Set 2 : no-find-copies #

Total comments: 4

Patch Set 3 : header guard #

Patch Set 4 : move to win:: #

Patch Set 5 : Handle to HANDLE #

Patch Set 6 : sort #

Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -0 lines) Patch
M util/util.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A util/win/scoped_handle.h View 1 2 3 4 5 1 chunk +49 lines, -0 lines 0 comments Download
A util/win/scoped_handle.cc View 1 2 3 4 5 1 chunk +31 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
scottmg
6 years ago (2014-12-17 22:04:17 UTC) #1
scottmg
Oops, and now with an R=.
6 years ago (2014-12-17 22:04:46 UTC) #3
Mark Mentovai
https://codereview.chromium.org/813873004/diff/20001/util/win/scoped_handle.h File util/win/scoped_handle.h (right): https://codereview.chromium.org/813873004/diff/20001/util/win/scoped_handle.h#newcode15 util/win/scoped_handle.h:15: #ifndef CRASHPAD_UTIL_WIN_SCOPED_HANDLE_H Needs a trailing _. https://codereview.chromium.org/813873004/diff/20001/util/win/scoped_handle.h#newcode44 util/win/scoped_handle.h:44: using ...
6 years ago (2014-12-17 22:45:00 UTC) #4
scottmg
https://codereview.chromium.org/813873004/diff/20001/util/win/scoped_handle.h File util/win/scoped_handle.h (right): https://codereview.chromium.org/813873004/diff/20001/util/win/scoped_handle.h#newcode15 util/win/scoped_handle.h:15: #ifndef CRASHPAD_UTIL_WIN_SCOPED_HANDLE_H On 2014/12/17 22:45:00, Mark Mentovai wrote: > ...
6 years ago (2014-12-17 22:57:35 UTC) #5
Mark Mentovai
We’ve avoided subnamespaces like this in Crashpad. Since style prohibits “using namespace”, namespaces are cumbersome ...
6 years ago (2014-12-18 14:29:21 UTC) #6
scottmg
On 2014/12/18 14:29:21, Mark Mentovai wrote: > We’ve avoided subnamespaces like this in Crashpad. > ...
6 years ago (2014-12-18 17:20:01 UTC) #8
Mark Mentovai
LGTM
6 years ago (2014-12-18 17:41:17 UTC) #10
scottmg
6 years ago (2014-12-18 17:51:25 UTC) #11
Message was sent while issue was closed.
Committed patchset #6 (id:140001) manually as
4a9b858fbd1fcddcddfff00c8537a48f07f7ae69 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698