FoxiGram/TMessagesProj/jni/voip/webrtc/base/task/thread_pool/task.cc
instant992 8e79f2ee9c FoxiGram: Telegram client with built-in Xray VLESS proxy
Based on Nekogram. Key additions:
- Rebrand to FoxiGram (app name, APK name, applicationId com.foxigram.app)
- Embedded Xray (VLESS+Reality) proxy client via JNI libxray.so
- Bundled hidden one-tap proxies (LTE + WiFi), read-only in UI
- Auto-restore proxy on restart, rebind to active network (LTE/WiFi)
- Server credentials externalized to git-ignored XrayServers.java (+ template)
- libxray Go source included; compiled .so, keystore, google-services.json ignored
2026-06-08 16:41:07 +04:00

45 lines
1.4 KiB
C++

// Copyright 2016 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 "base/task/thread_pool/task.h"
#include <utility>
#include "base/atomic_sequence_num.h"
namespace base {
namespace internal {
namespace {
AtomicSequenceNumber g_sequence_nums_for_tracing;
} // namespace
Task::Task() = default;
Task::Task(const Location& posted_from, OnceClosure task, TimeDelta delay)
: PendingTask(posted_from,
std::move(task),
delay.is_zero() ? TimeTicks() : TimeTicks::Now() + delay,
Nestable::kNonNestable) {
// ThreadPoolImpl doesn't use |sequence_num| but tracing (toplevel.flow)
// relies on it being unique. While this subtle dependency is a bit
// overreaching, ThreadPoolImpl is the only task system that doesn't use
// |sequence_num| and the dependent code rarely changes so this isn't worth a
// big change and faking it here isn't too bad for now (posting tasks is full
// of atomic ops already).
this->sequence_num = g_sequence_nums_for_tracing.GetNext();
}
// This should be "= default but MSVC has trouble with "noexcept = default" in
// this case.
Task::Task(Task&& other) noexcept : PendingTask(std::move(other)) {}
Task::~Task() = default;
Task& Task::operator=(Task&& other) = default;
} // namespace internal
} // namespace base