Skip to content

Commit

Permalink
Review.
Browse files Browse the repository at this point in the history
  • Loading branch information
boocmp committed Aug 2, 2022
1 parent d392909 commit 340df6f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class BravePrivateNewTabPageHandler
#if BUILDFLAG(ENABLE_TOR)
raw_ptr<TorLauncherFactory> tor_launcher_factory_ = nullptr;
#endif

// Timer for detecting a Tor connection failuer. It starts at each connection
// event and shots when the time between events exceeds 15 seconds.
base::OneShotTimer stuck_timer_;

mojo::Receiver<brave_private_new_tab::mojom::PageHandler> receiver_;
Expand Down
8 changes: 7 additions & 1 deletion browser/ui/webui/settings/brave_tor_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "brave/browser/tor//tor_profile_service_factory.h"
#include "brave/browser/tor/tor_profile_service_factory.h"
#include "brave/components/tor/pref_names.h"
#include "brave/components/tor/tor_profile_service.h"
#include "brave/components/tor/tor_utils.h"
Expand Down Expand Up @@ -90,6 +90,12 @@ constexpr const char16_t kParseBridgesScript[] =
constexpr int kIsolatedWorldId = content::ISOLATED_WORLD_ID_CONTENT_END + 1;
} // namespace

// This class is designed for making request to the Tor bridge web site.
// It creates WebContents and loads kTorBridgesUrl. When the load complete
// queries for captcha image and post it to CaptchaCallback.
// When user resolves captcha BridgeRequest paste it into the loaded WebContents
// and sumbit a form. Tor bridges site returns list of bridges which parsed and
// posted to the BridgesCallback.
class BridgeRequest : public content::WebContentsObserver {
public:
using CaptchaCallback = base::OnceCallback<void(const base::Value& image)>;
Expand Down
4 changes: 2 additions & 2 deletions components/tor/tor_launcher_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ void TorLauncherFactory::GetTorLog(GetLogCallback callback) {

void TorLauncherFactory::SetupPluggableTransport(
const base::FilePath& snowflake,
const base::FilePath& obsf4) {
const base::FilePath& obfs4) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
control_->SetupPluggableTransport(snowflake, obsf4, base::DoNothing());
control_->SetupPluggableTransport(snowflake, obfs4, base::DoNothing());
}

void TorLauncherFactory::SetupBridges(tor::BridgesConfig bridges_config) {
Expand Down
2 changes: 1 addition & 1 deletion components/tor/tor_launcher_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TorLauncherFactory : public tor::TorControl::Delegate {
virtual std::string GetTorVersion() const;
virtual void GetTorLog(GetLogCallback);
virtual void SetupPluggableTransport(const base::FilePath& snowflake,
const base::FilePath& obsf4);
const base::FilePath& obfs4);
virtual void SetupBridges(tor::BridgesConfig bridges_config);

void AddObserver(TorLauncherObserver* observer);
Expand Down

0 comments on commit 340df6f

Please sign in to comment.