<commit_before>// This file was GENERATED by command:
//     pump.py callback.h.pump
// DO NOT EDIT BY HAND!!!



// Copyright 2014 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.

#ifndef MOJO_PUBLIC_CPP_BINDINGS_CALLBACK_H_
#define MOJO_PUBLIC_CPP_BINDINGS_CALLBACK_H_

#include "mojo/public/cpp/bindings/lib/callback_internal.h"
#include "mojo/public/cpp/bindings/lib/shared_ptr.h"
#include "mojo/public/cpp/bindings/lib/template_util.h"

namespace mojo {

template <typename Sig>
class Callback;

template <>
class Callback<void()> {
 public:
  struct Runnable {
    virtual ~Runnable() {}
    virtual void Run(
        ) const = 0;
  };

  Callback() {}

  // The Callback assumes ownership of |runnable|.
  explicit Callback(Runnable* runnable) : sink_(runnable) {}

  // Any class that is copy-constructable and has a compatible Run method may
  // be adapted to a Callback using this constructor.
  template <typename Sink>
  Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}

  void Run(
      ) const {
    if (sink_.get())
      sink_->Run(
          );
  }

  bool is_null() const {
    return !sink_.get();
  }

 private:
  template <typename Sink>
  struct Adapter : public Runnable {
    explicit Adapter(const Sink& sink) : sink(sink) {}
    virtual void Run(
        ) const MOJO_OVERRIDE {
      sink.Run(
          );
    }
    Sink sink;
  };

  internal::SharedPtr<Runnable> sink_;
};

template <typename A1>
class Callback<void(A1)> {
 public:
  struct Runnable {
    virtual ~Runnable() {}
    virtual void Run(
        typename internal::Callback_ParamTraits<A1>::ForwardType a1) const = 0;
  };

  Callback() {}

  // The Callback assumes ownership of |runnable|.
  explicit Callback(Runnable* runnable) : sink_(runnable) {}

  // Any class that is copy-constructable and has a compatible Run method may
  // be adapted to a Callback using this constructor.
  template <typename Sink>
  Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}

  void Run(
      typename internal::Callback_ParamTraits<A1>::ForwardType a1) const {
    if (sink_.get())
      sink_->Run(
          internal::Forward(a1));
  }

  bool is_null() const {
    return !sink_.get();
  }

 private:
  template <typename Sink>
  struct Adapter : public Runnable {
    explicit Adapter(const Sink& sink) : sink(sink) {}
    virtual void Run(
        typename internal::Callback_ParamTraits<A1>::ForwardType a1) const
            MOJO_OVERRIDE {
      sink.Run(
          internal::Forward(a1));
    }
    Sink sink;
  };

  internal::SharedPtr<Runnable> sink_;
};

template <typename A1, typename A2>
class Callback<void(A1, A2)> {
 public:
  struct Runnable {
    virtual ~Runnable() {}
    virtual void Run(
        typename internal::Callback_ParamTraits<A1>::ForwardType a1,
        typename internal::Callback_ParamTraits<A2>::ForwardType a2) const = 0;<commit_msg>Tweak whitespace in mojo::Callback for readability<commit_after>// This file was GENERATED by command:
//     pump.py callback.h.pump
// DO NOT EDIT BY HAND!!!



// Copyright 2014 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.

#ifndef MOJO_PUBLIC_CPP_BINDINGS_CALLBACK_H_
#define MOJO_PUBLIC_CPP_BINDINGS_CALLBACK_H_

#include "mojo/public/cpp/bindings/lib/callback_internal.h"
#include "mojo/public/cpp/bindings/lib/shared_ptr.h"
#include "mojo/public/cpp/bindings/lib/template_util.h"

namespace mojo {

template <typename Sig>
class Callback;

template <>
class Callback<void()> {
 public:
  struct Runnable {
    virtual ~Runnable() {}
    virtual void Run() const = 0;
  };

  Callback() {}

  // The Callback assumes ownership of |runnable|.
  explicit Callback(Runnable* runnable) : sink_(runnable) {}

  // Any class that is copy-constructable and has a compatible Run method may
  // be adapted to a Callback using this constructor.
  template <typename Sink>
  Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}

  void Run() const {
    if (sink_.get())
      sink_->Run();
  }

  bool is_null() const {
    return !sink_.get();
  }

 private:
  template <typename Sink>
  struct Adapter : public Runnable {
    explicit Adapter(const Sink& sink) : sink(sink) {}
    virtual void Run() const MOJO_OVERRIDE { sink.Run(); }
    Sink sink;
  };

  internal::SharedPtr<Runnable> sink_;
};

template <typename A1>
class Callback<void(A1)> {
 public:
  struct Runnable {
    virtual ~Runnable() {}
    virtual void Run(
        typename internal::Callback_ParamTraits<A1>::ForwardType a1) const = 0;
  };

  Callback() {}

  // The Callback assumes ownership of |runnable|.
  explicit Callback(Runnable* runnable) : sink_(runnable) {}

  // Any class that is copy-constructable and has a compatible Run method may
  // be adapted to a Callback using this constructor.
  template <typename Sink>
  Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}

  void Run(
      typename internal::Callback_ParamTraits<A1>::ForwardType a1) const {
    if (sink_.get())
      sink_->Run(internal::Forward(a1));
  }

  bool is_null() const {
    return !sink_.get();
  }

 private:
  template <typename Sink>
  struct Adapter : public Runnable {
    explicit Adapter(const Sink& sink) : sink(sink) {}
    virtual void Run(
        typename internal::Callback_ParamTraits<A1>::ForwardType a1) const
            MOJO_OVERRIDE {
      sink.Run(internal::Forward(a1));
    }
    Sink sink;
  };

  internal::SharedPtr<Runnable> sink_;
};

template <typename A1, typename A2>
class Callback<void(A1, A2)> {
 public:
  struct Runnable {
    virtual ~Runnable() {}
    virtual void Run(
        typename internal::Callback_ParamTraits<A1>::ForwardType a1,
        typename internal::Callback_ParamTraits<A2>::ForwardType a2) const = 0;
{'fraction_non_alphanumeric': 0.11496965610249495, 'fraction_numerical': 0.008428860418071477, 'mean_word_length': 3.4309185959671398, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4422243', 'n_tokens_mistral': 1991, 'n_tokens_neox': 1894, 'n_words': 536}