Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e774579 authored by Benjamin Lerman's avatar Benjamin Lerman
Browse files

crash-reporter: Replace the crash_sender script by a service daemon.

BUG=chromium:391887
TEST=Integration tests
CQ-DEPEND=I02ce7593fcfae4ba1d7d3ebdf3912901e635f1c9
CQ-DEPEND=I00315ad47657cebd9e8a4a0121ecb54114a7e200

Change-Id: I2f4546c82fb3769b5f3da5d22949551412096b10
Reviewed-on: https://chromium-review.googlesource.com/208671


Tested-by: default avatarBenjamin Lerman <qsr@chromium.org>
Reviewed-by: default avatarBen Chan <benchan@chromium.org>
parent ab6cc905
Loading
Loading
Loading
Loading
+37 −3
Original line number Diff line number Diff line
@@ -63,17 +63,51 @@
      ],
    },
    {
      'target_name': 'list_proxies',
      'target_name': 'libproxies',
      'type': 'static_library',
      'variables': {
        'exported_deps': [
          'libchrome-<(libbase_ver)',
        ],
        'deps': ['<@(exported_deps)'],
      },
      'all_dependent_settings': {
        'variables': {
          'deps': [
            '<@(exported_deps)',
          ],
        },
      },
      'sources': [
        'libproxies.cc',
        'libproxies.h',
      ],
    },
    {
      'target_name': 'crash_sender',
      'type': 'executable',
      'variables': {
        'deps': [
          'dbus-1',
          'dbus-glib-1',
          'libchrome-<(libbase_ver)',
          'libchromeos-<(libbase_ver)',
          'libcurl',
          'libmetrics-<(libbase_ver)',
        ],
      },
      'dependencies': [
        'libproxies',
      ],
      'libraries': [
        '-lvboot_host',
      ],
      'sources': [
        'list_proxies.cc',
        'crash_sender_daemon.cc',
        'crash_sender_daemon.h',
        'crash_sender_service.cc',
        'crash_sender_service.h',
        'proxy_resolver.cc',
        'proxy_resolver.h',
      ],
    },
    {

crash_reporter/crash_sender

deleted100755 → 0
+0 −685

File deleted.

Preview size limit exceeded, changes collapsed.

+28 −0
Original line number Diff line number Diff line
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.

# This file has the format:
# NAME=value

# Product ID in crash report.
CHROMEOS_PRODUCT=ChromeOS

# Set this to 1 to allow uploading crash reports for unofficial versions.
FORCE_OFFICIAL=0

# Maximum crashes to send per day.
MAX_CRASH_RATE=32

# Set this to 1 to pretend to have booted in developer mode. This is used by
# autotests.
MOCK_DEVELOPER_MODE=0

# Ignore PAUSE_CRASH_SENDING file if set.
OVERRIDE_PAUSE_SENDING=0

# URL to send official build crash reports to.
REPORT_UPLOAD_PROD_URL=https://clients2.google.com/cr/report

# Maximum time to sleep between sends.
SECONDS_SEND_SPREAD=600
+101 −0

File added.

Preview size limit exceeded, changes collapsed.

+43 −0
Original line number Diff line number Diff line
// Copyright 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CRASH_REPORTER_CRASH_SENDER_DAEMON_H_
#define CRASH_REPORTER_CRASH_SENDER_DAEMON_H_

#include <base/files/file_path.h>
#include <base/memory/scoped_ptr.h>
#include <base/message_loop/message_loop.h>
#include <chromeos/asynchronous_signal_handler.h>

#include "crash-reporter/crash_sender_service.h"

namespace crash_reporter {

class CrashSenderDaemon {
 public:
  // |config_file| specifies the config file for the crash sender.
  explicit CrashSenderDaemon(const base::FilePath& config_file);
  ~CrashSenderDaemon();

  // Does all the work. Blocks until the daemon is finished.
  void Run();

 private:
  base::MessageLoopForIO loop_;
  base::FilePath config_file_;
  scoped_ptr<CrashSenderService> crash_sender_service_;
  chromeos::AsynchronousSignalHandler async_signal_handler_;

  // Shutdown the sender.
  bool Shutdown(const signalfd_siginfo& info);

  // Restart the service, reading the configuration file again.
  bool Restart(const signalfd_siginfo& info);

  DISALLOW_COPY_AND_ASSIGN(CrashSenderDaemon);
};

}  // namespace crash_reporter

#endif  // CRASH_REPORTER_CRASH_SENDER_DAEMON_H_
Loading