Files
brave-core/browser/ftx/ftx_protocol_handler.h
T
mkarolin 0e7b362863 base::Optional -> absl::optional.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/2d59e682ab9eb904124f5778eb8ceb3cb2a90231

commit 2d59e682ab9eb904124f5778eb8ceb3cb2a90231
Author: Anton Bikineev <bikineev@chromium.org>
Date:   Tue May 18 12:29:22 2021 +0000

    Deprecate base/optional.h and fix remaining mentions.

    Docs are still to be updated (in a followup).

    Bug: 1202909

Converted remaining cases of base::Optional to absl::optional, plus
updated DEPS file with an exception that is temporarily required
while we don't have such exception added to Chromium's toplevel DEPS
file (see commit linked below, not yet included in 92.0.4503.5).

Chromium change:

https://source.chromium.org/chromium/chromium/src/+/9662571bb2954fb1759c49e5c45e59571cd1899e

commit 9662571bb2954fb1759c49e5c45e59571cd1899e
Author: Anton Bikineev <bikineev@chromium.org>
Date:   Thu May 13 19:17:50 2021 +0000

    Reland "Alias base::Optional to absl::optional"

    This relands f3493eb4f80c5716ed2d7de195f710537beacc6b. The reason of the
    failure: missing base// dep in some of the internal components, which
    caused the branded builds to fail.

    For sherrifs: the change may cause build failures on bots that are not
    tested in the regular CQ pipeline. Those issues are mostly caused by
    missing base// dependencies. Before reverting this change, please
    consider fixing missing dependencies, similar to what the CL 2891488
    does.

    Original CL description:
    > Alias base::Optional to absl::optional
    >
    > This CL does the following:
    > 1) Replaces base::Optional and friends with aliases to corresponding
    > entities from abseil. base::in_place is the only thing not aliased, as
    > it's also used in other contexts (e.g. StructPtr in mojo).
    > 2) Replaces all optional-related uses of base::in_place with
    > absl::in_place.
    > 3) Fixes missing headers (e.g. base/check.h) that used to be recursively
    > included from base/optional.h
    > 4) Also, removes forward declarations for base::Optional and instead
    > includes "base/optional.h" directly. The argument is the same as for
    > forward declarations of std types - the exact declaration (struct vs
    > class, number of template arguments (e.g. for SFINAE)) is an
    > implementation detail that can change.
    >
    > The CL also tries to support base/optional_unittest.cc (will be removed
    > with base/optional.h) however the nocompile is already removed, since
    > supporting it seems to be harder.
    >
    > Followup CLs will replace base::optional with absl::optional per
    > component.
    >
    > Bug: 1202909
    > Change-Id: I25b276401ceba13da35b3a0331d5ccbd338c4539
    > AX-Relnotes: n/a.
    > Reviewed-on:
    > https://chromium-review.googlesource.com/c/chromium/src/+/2892208
    > Commit-Queue: Anton Bikineev <bikineev@chromium.org>
    > Commit-Queue: Peter Kasting <pkasting@chromium.org>
    > Reviewed-by: Peter Kasting <pkasting@chromium.org>
    > Reviewed-by: Kentaro Hara <haraken@chromium.org>
    > Owners-Override: Peter Kasting <pkasting@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#882460}

    Bug: 1202909
2021-06-29 16:35:39 -04:00

29 lines
959 B
C++

// Copyright (c) 2021 The Brave Authors. All rights reserved.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef BRAVE_BROWSER_FTX_FTX_PROTOCOL_HANDLER_H_
#define BRAVE_BROWSER_FTX_FTX_PROTOCOL_HANDLER_H_
#include <string>
#include "content/public/browser/web_contents.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace ftx {
void HandleFTXProtocol(const GURL& url,
content::WebContents::OnceGetter web_contents_getter,
ui::PageTransition page_transition,
bool has_user_gesture,
const absl::optional<url::Origin>& initiator);
bool IsFTXProtocol(const GURL& url);
} // namespace ftx
#endif // BRAVE_BROWSER_FTX_FTX_PROTOCOL_HANDLER_H_