aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows/sender
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/windows/sender')
-rw-r--r--src/client/windows/sender/crash_report_sender.cc19
-rw-r--r--src/client/windows/sender/crash_report_sender.gyp46
-rw-r--r--src/client/windows/sender/crash_report_sender.h23
3 files changed, 20 insertions, 68 deletions
diff --git a/src/client/windows/sender/crash_report_sender.cc b/src/client/windows/sender/crash_report_sender.cc
index eb2b422a..27a7ec39 100644
--- a/src/client/windows/sender/crash_report_sender.cc
+++ b/src/client/windows/sender/crash_report_sender.cc
@@ -1,5 +1,4 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
+// Copyright 2006 Google LLC
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -11,7 +10,7 @@
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
-// * Neither the name of Google Inc. nor the names of its
+// * Neither the name of Google LLC nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
@@ -45,12 +44,12 @@ namespace google_breakpad {
static const char kCheckpointSignature[] = "GBP1\n";
-CrashReportSender::CrashReportSender(const wstring &checkpoint_file)
+CrashReportSender::CrashReportSender(const wstring& checkpoint_file)
: checkpoint_file_(checkpoint_file),
max_reports_per_day_(-1),
last_sent_date_(-1),
reports_sent_(0) {
- FILE *fd;
+ FILE* fd;
if (OpenCheckpointFile(L"r", &fd) == 0) {
ReadCheckpoint(fd);
fclose(fd);
@@ -58,8 +57,8 @@ CrashReportSender::CrashReportSender(const wstring &checkpoint_file)
}
ReportResult CrashReportSender::SendCrashReport(
- const wstring &url, const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files, wstring *report_code) {
+ const wstring& url, const map<wstring, wstring>& parameters,
+ const map<wstring, wstring>& files, wstring* report_code) {
int today = GetCurrentDate();
if (today == last_sent_date_ &&
max_reports_per_day_ != -1 &&
@@ -82,7 +81,7 @@ ReportResult CrashReportSender::SendCrashReport(
}
}
-void CrashReportSender::ReadCheckpoint(FILE *fd) {
+void CrashReportSender::ReadCheckpoint(FILE* fd) {
char buf[128];
if (!fgets(buf, sizeof(buf), fd) ||
strcmp(buf, kCheckpointSignature) != 0) {
@@ -108,7 +107,7 @@ void CrashReportSender::ReportSent(int today) {
++reports_sent_;
// Update the checkpoint file
- FILE *fd;
+ FILE* fd;
if (OpenCheckpointFile(L"w", &fd) == 0) {
fputs(kCheckpointSignature, fd);
fprintf(fd, "%d\n", last_sent_date_);
@@ -124,7 +123,7 @@ int CrashReportSender::GetCurrentDate() const {
system_time.wDay;
}
-int CrashReportSender::OpenCheckpointFile(const wchar_t *mode, FILE **fd) {
+int CrashReportSender::OpenCheckpointFile(const wchar_t* mode, FILE** fd) {
if (checkpoint_file_.empty()) {
return ENOENT;
}
diff --git a/src/client/windows/sender/crash_report_sender.gyp b/src/client/windows/sender/crash_report_sender.gyp
deleted file mode 100644
index dc8583a0..00000000
--- a/src/client/windows/sender/crash_report_sender.gyp
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'crash_report_sender',
- 'type': 'static_library',
- 'sources': [
- 'crash_report_sender.cc',
- 'crash_report_sender.h',
- ],
- 'dependencies': [
- '../breakpad_client.gyp:common'
- ],
- },
- ],
-}
diff --git a/src/client/windows/sender/crash_report_sender.h b/src/client/windows/sender/crash_report_sender.h
index 7786cc69..758adbb4 100644
--- a/src/client/windows/sender/crash_report_sender.h
+++ b/src/client/windows/sender/crash_report_sender.h
@@ -1,5 +1,4 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
+// Copyright 2006 Google LLC
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -11,7 +10,7 @@
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
-// * Neither the name of Google Inc. nor the names of its
+// * Neither the name of Google LLC nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
@@ -65,7 +64,7 @@ class CrashReportSender {
// If checkpoint_file is non-empty, breakpad will persist crash report
// state to this file. A checkpoint file is required for
// set_max_reports_per_day() to function properly.
- explicit CrashReportSender(const wstring &checkpoint_file);
+ explicit CrashReportSender(const wstring& checkpoint_file);
~CrashReportSender() {}
// Sets the maximum number of crash reports that will be sent in a 24-hour
@@ -87,14 +86,14 @@ class CrashReportSender {
// the return value is RESULT_SUCCEEDED), a code uniquely identifying the
// report will be returned in report_code.
// (Otherwise, report_code will be unchanged.)
- ReportResult SendCrashReport(const wstring &url,
- const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files,
- wstring *report_code);
+ ReportResult SendCrashReport(const wstring& url,
+ const map<wstring, wstring>& parameters,
+ const map<wstring, wstring>& files,
+ wstring* report_code);
private:
// Reads persistent state from a checkpoint file.
- void ReadCheckpoint(FILE *fd);
+ void ReadCheckpoint(FILE* fd);
// Called when a new report has been sent, to update the checkpoint state.
void ReportSent(int today);
@@ -104,7 +103,7 @@ class CrashReportSender {
// Opens the checkpoint file with the specified mode.
// Returns zero on success, or an error code on failure.
- int OpenCheckpointFile(const wchar_t *mode, FILE **fd);
+ int OpenCheckpointFile(const wchar_t* mode, FILE** fd);
wstring checkpoint_file_;
int max_reports_per_day_;
@@ -114,8 +113,8 @@ class CrashReportSender {
int reports_sent_;
// Disallow copy constructor and operator=
- explicit CrashReportSender(const CrashReportSender &);
- void operator=(const CrashReportSender &);
+ explicit CrashReportSender(const CrashReportSender&);
+ void operator=(const CrashReportSender&);
};
} // namespace google_breakpad