12 Commits

Author SHA1 Message Date
Mark Mentovai
583d1dc3ef Provide std::move() in compat instead of using crashpad::move()
This more-natural spelling doesn’t require Crashpad developers to have
to remember anything special when writing code in Crashpad. It’s easier
to grep for and it’s easier to remove the “compat” part when pre-C++11
libraries are no longer relevant.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1513573005 .
2015-12-09 17:36:32 -05:00
Dana Jansens
6bebb10829 Replace use of .Pass() with crashpad::move().
Since C++11 library support isn't available everywhere crashpad is
compiled, add our own move() method in the crashpad namespace to replace
std::move() for now. Replace uses of .Pass() with this method.

R=mark@chromium.org, scottmg@chromium.org
BUG=chromium:557422

Review URL: https://codereview.chromium.org/1483073004 .
2015-11-30 14:20:54 -08:00
Mark Mentovai
81ece89d6a Make ScopedGeneric uses slightly more consistent
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1426533008 .
2015-11-09 15:33:36 -05:00
Scott Graham
4b780ba040 Tidy up to enable C4800 on Windows
Fixes two incorrect usages of ssize_t/off_t being implicitly converted
to bool. As such, I think it's worth the cost of the additional !! on
BOOL returning Win32 functions.

R=mark@chromium.org

Review URL: https://codereview.chromium.org/1408123006 .
2015-10-22 14:32:13 -07:00
Mark Mentovai
0884d4d3a8 Don’t log an error when creating a new crash report database
Previously, any attempt to create a new crash report database would
result in this message being logged:

[p:t:yyyymmdd,hhmmss.uuuuuu:ERROR file_io.cc:30] read: expected 40,
observed 0

This would be the first thing that a developer embedding Crashpad into
their application would see after getting everything right. It doesn’t
exactly seem like everything’s right with that being logged. It would
also be the first thing that a user would see on stderr or in logs upon
launching a Crashpad-enabled application, which also seems kind of
dodgy.

The crash report database settings creation logic is restructured to
avoid logging this error when definitely creating a new database, while
retaining all other error logging.

BUG=crashpad:63
TEST=crashpad_database_util --database $new_db --show-client-id
     (should not show any errors)

R=rsesek@chromium.org, scottmg@chromium.org

Review URL: https://codereview.chromium.org/1392953002 .
2015-10-07 16:20:29 -04:00
Scott Graham
6082aed2f2 win: Get Crashpad compiling under VS2015
R=mark@chromium.org
BUG=crashpad:1, chromium:440500

Review URL: https://codereview.chromium.org/1357833002 .
2015-09-21 10:51:15 -07:00
Scott Graham
8272a4cefe Use LockFile/UnlockFile for Settings to port to Windows
Adds LoggingOpenFileForReadAndWrite, LoggingTruncateFile, and UUID::GenerateFromSystem
in support.

R=mark@chromium.org, rsesek@chromium.org
BUG=crashpad:13

Review URL: https://codereview.chromium.org/999953002
2015-04-20 14:21:48 -07:00
Mark Mentovai
58c7519598 Add a magic number to settings.dat for better identification.
“1” is probably one of the more common things for files to begin with.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1007433003
2015-03-12 19:34:05 -04:00
Robert Sesek
995e762a45 Use new ScopedGeneric move support.
BUG=crashpad:14
R=mark@chromium.org

Review URL: https://codereview.chromium.org/1001713002
2015-03-12 09:47:55 -04:00
Mark Mentovai
bdcc1e7625 Return a FilePath from Settings::file_path().
This makes it possible to #include "client/settings.h" for the interface
even on Windows. Although Settings is not currently implemented on
Windows (bug crashpad:13), it’s easier to have the interface declaration
available without having to have it be guarded.

TEST=crashpad_client_test SettingsTest.*
BUG=
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/987383002
2015-03-10 14:26:24 -04:00
Robert Sesek
e4c8b6cc72 Fix Settings::OpenForReadingAndWriting using O_CREAT with no mode.
R=mark@chromium.org

Review URL: https://codereview.chromium.org/997613002
2015-03-10 13:52:19 -04:00
Robert Sesek
1a635e3a79 Define the Settings interface for a CrashReportDatabase and provide a Mac implementation.
R=mark@chromium.org

Review URL: https://codereview.chromium.org/988063003
2015-03-09 18:47:52 -04:00