Skip to content

Commit

Permalink
Rebased.
Browse files Browse the repository at this point in the history
  • Loading branch information
boocmp committed Jun 14, 2022
1 parent 04b7162 commit fd015ba
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
3 changes: 1 addition & 2 deletions browser/ui/webui/settings/brave_tor_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "brave/browser/tor//tor_profile_service_factory.h"
Expand Down Expand Up @@ -170,7 +169,7 @@ class BridgeRequest : public content::WebContentsObserver {
image_decoder_ = std::make_unique<ImageDecoderImpl>();
}

image_decoder_->DecodeImage(image_data, {},
image_decoder_->DecodeImage(image_data, {}, /*data_decoder=*/nullptr,
base::BindOnce(&BridgeRequest::OnCaptchaDecoded,
weak_factory_.GetWeakPtr()));
}
Expand Down
12 changes: 4 additions & 8 deletions components/tor/brave_tor_client_updater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,17 @@ void BraveTorClientUpdater::Cleanup() {
base::FilePath tor_component_dir =
user_data_dir_.AppendASCII(kTorClientComponentId);
task_runner_->PostTask(
FROM_HERE, base::BindOnce(base::GetDeletePathRecursivelyCallback(),
tor_component_dir));
FROM_HERE, base::GetDeletePathRecursivelyCallback(tor_component_dir));
task_runner_->PostTask(
FROM_HERE, base::BindOnce(base::GetDeletePathRecursivelyCallback(),
GetTorDataPath()));
FROM_HERE, base::GetDeletePathRecursivelyCallback(GetTorDataPath()));
task_runner_->PostTask(
FROM_HERE, base::BindOnce(base::GetDeletePathRecursivelyCallback(),
GetTorWatchPath()));
FROM_HERE, base::GetDeletePathRecursivelyCallback(GetTorWatchPath()));
}

void BraveTorClientUpdater::RemoveObsoleteFiles() {
// tor log
base::FilePath tor_log = GetTorDataPath().AppendASCII("tor.log");
task_runner_->PostTask(
FROM_HERE, base::BindOnce(base::GetDeleteFileCallback(), tor_log));
task_runner_->PostTask(FROM_HERE, base::GetDeleteFileCallback(tor_log));
}

void BraveTorClientUpdater::SetTorPath(
Expand Down
4 changes: 1 addition & 3 deletions components/tor/brave_tor_pluggable_transport_updater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/task/post_task.h"
#include "base/task/task_traits.h"
#include "build/build_config.h"

Expand Down Expand Up @@ -114,8 +113,7 @@ void BraveTorPluggableTransportUpdater::Cleanup() {
const base::FilePath component_dir =
user_data_dir_.AppendASCII(kTorPluggableTransportComponentId);
GetTaskRunner()->PostTask(
FROM_HERE,
base::BindOnce(base::GetDeletePathRecursivelyCallback(), component_dir));
FROM_HERE, base::GetDeletePathRecursivelyCallback(component_dir));
}

bool BraveTorPluggableTransportUpdater::IsReady() const {
Expand Down
11 changes: 10 additions & 1 deletion components/tor/tor_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/task/post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/threading/sequenced_task_runner_handle.h"
Expand Down Expand Up @@ -593,6 +592,16 @@ void TorControl::SetupBridges(const std::vector<std::string>& bridges,
}
}

void TorControl::OnPluggableTransportsConfigured(
base::OnceCallback<void(bool error)> callback,
bool error,
const std::string& status,
const std::string& reply) {
DCHECK_CALLED_ON_VALID_SEQUENCE(io_sequence_checker_);
VLOG(1) << __func__ << " " << reply;
std::move(callback).Run(error || status != "250" || reply != "OK");
}

void TorControl::OnBrigdesConfigured(
base::OnceCallback<void(bool error)> callback,
bool error,
Expand Down

0 comments on commit fd015ba

Please sign in to comment.