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

Commit 3e8854a1 authored by Zach Johnson's avatar Zach Johnson
Browse files

Remove using statements from handler.h

Ensure folks are not using these indirectly.

Test: cert/run --host
Change-Id: I4a0d2280a2405d1a071e782dfa0a360930095171
parent 5ca147d0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -42,13 +42,13 @@ class Alarm {
  DISALLOW_COPY_AND_ASSIGN(Alarm);

  // Schedule the alarm with given delay
  void Schedule(OnceClosure task, std::chrono::milliseconds delay);
  void Schedule(common::OnceClosure task, std::chrono::milliseconds delay);

  // Cancel the alarm. No-op if it's not armed.
  void Cancel();

 private:
  OnceClosure task_;
  common::OnceClosure task_;
  Handler* handler_;
  int fd_ = 0;
  Reactor::Reactable* token_;
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ class Handler : public common::IPostableContext {
  DISALLOW_COPY_AND_ASSIGN(Handler);

  // Enqueue a closure to the queue of this handler
  virtual void Post(OnceClosure closure) override;
  virtual void Post(common::OnceClosure closure) override;

  // Remove all pending events from the queue of this handler
  void Clear();
@@ -90,7 +90,7 @@ class Handler : public common::IPostableContext {
  inline bool was_cleared() const {
    return tasks_ == nullptr;
  };
  std::queue<OnceClosure>* tasks_;
  std::queue<common::OnceClosure>* tasks_;
  Thread* thread_;
  int fd_;
  Reactor::Reactable* reactable_;
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@

namespace bluetooth {
namespace os {
using common::Closure;
using common::OnceClosure;

Alarm::Alarm(Handler* handler) : handler_(handler), fd_(TIMERFD_CREATE(ALARM_CLOCK, 0)) {
  ASSERT_LOG(fd_ != -1, "cannot create timerfd: %s", strerror(errno));
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@

namespace bluetooth {
namespace os {
using common::OnceClosure;

Handler::Handler(Thread* thread)
    : tasks_(new std::queue<OnceClosure>()), thread_(thread), fd_(eventfd(0, EFD_SEMAPHORE | EFD_NONBLOCK)) {
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ TEST_F(HandlerTest, post_task_invoked) {
  int val = 0;
  std::promise<void> closure_ran;
  auto future = closure_ran.get_future();
  OnceClosure closure = common::BindOnce(
  common::OnceClosure closure = common::BindOnce(
      [](int* val, std::promise<void> closure_ran) {
        *val = *val + 1;
        closure_ran.set_value();
Loading