<commit_before>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/dbus/liveness_service_provider.h"

#include "base/bind.h"
#include "content/public/browser/browser_thread.h"
#include "dbus/bus.h"
#include "dbus/message.h"
#include "third_party/cros_system_api/dbus/service_constants.h"

using content::BrowserThread;

namespace chromeos {

LivenessServiceProvider::LivenessServiceProvider() : weak_ptr_factory_(this) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}

LivenessServiceProvider::~LivenessServiceProvider() {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}

void LivenessServiceProvider::Start(
    scoped_refptr<dbus::ExportedObject> exported_object) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
  exported_object->ExportMethod(
      kLibCrosServiceInterface,
      kCheckLiveness,
      base::Bind(&LivenessServiceProvider::CheckLiveness,
                 weak_ptr_factory_.GetWeakPtr()),
      base::Bind(&LivenessServiceProvider::OnExported,
                 weak_ptr_factory_.GetWeakPtr()));
}

void LivenessServiceProvider::OnExported(const std::string& interface_name,
                                         const std::string& method_name,
                                         bool success) {
  if (!success) {
    LOG(ERROR) << "Failed to export " << interface_name << "."
               << method_name;
  }
}

void LivenessServiceProvider::CheckLiveness(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
  response_sender.Run(dbus::Response::FromMethodCall(method_call));
}

}  // namespace chromeos<commit_msg>chromeos: Remove thread DCHECKs in LivenessServiceProvider.<commit_after>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/dbus/liveness_service_provider.h"

#include "base/bind.h"
#include "dbus/bus.h"
#include "dbus/message.h"
#include "third_party/cros_system_api/dbus/service_constants.h"

namespace chromeos {

LivenessServiceProvider::LivenessServiceProvider() : weak_ptr_factory_(this) {}

LivenessServiceProvider::~LivenessServiceProvider() {}

void LivenessServiceProvider::Start(
    scoped_refptr<dbus::ExportedObject> exported_object) {
  exported_object->ExportMethod(
      kLibCrosServiceInterface,
      kCheckLiveness,
      base::Bind(&LivenessServiceProvider::CheckLiveness,
                 weak_ptr_factory_.GetWeakPtr()),
      base::Bind(&LivenessServiceProvider::OnExported,
                 weak_ptr_factory_.GetWeakPtr()));
}

void LivenessServiceProvider::OnExported(const std::string& interface_name,
                                         const std::string& method_name,
                                         bool success) {
  if (!success) {
    LOG(ERROR) << "Failed to export " << interface_name << "."
               << method_name;
  }
}

void LivenessServiceProvider::CheckLiveness(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  response_sender.Run(dbus::Response::FromMethodCall(method_call));
}

}  // namespace chromeos
{'fraction_non_alphanumeric': 0.11058823529411765, 'fraction_numerical': 0.002352941176470588, 'mean_word_length': 4.031065088757397, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2649534', 'n_tokens_mistral': 980, 'n_tokens_neox': 962, 'n_words': 174}