Commit f2e33798 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert ui/snapshot away from base::Bind/base::Callback

base::Bind/base::Callback are deprecated in favor of either
base::BindOnce/base::OnceCallback or base::BindRepeating/
base::RepeatingCallback (depending on whether the callback
is invoked once or multiple time).

Convert all uses of base::Bind/base::Callback in ui/snapshot
to the recommended methods/types.

Bug: 1007853
Change-Id: I3e8fee3aa46ecd3c2fe5898c5e5294887f4f5eee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829338Reviewed-by: default avatarDenis Kuznetsov <antrim@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701055}
parent 5c21992e
......@@ -52,11 +52,12 @@ const char* const kUploadUrlFieldName = "fileUploadUrl";
// A helper function which invokes |store_screenshot_callback| on |task_runner|.
void RunStoreScreenshotOnTaskRunner(
const ui::GrabWindowSnapshotAsyncPNGCallback& store_screenshot_callback,
ui::GrabWindowSnapshotAsyncPNGCallback store_screenshot_callback,
scoped_refptr<base::TaskRunner> task_runner,
scoped_refptr<base::RefCountedMemory> png_data) {
task_runner->PostTask(FROM_HERE,
base::BindOnce(store_screenshot_callback, png_data));
task_runner->PostTask(
FROM_HERE,
base::BindOnce(std::move(store_screenshot_callback), png_data));
}
} // namespace
......@@ -222,10 +223,11 @@ void DeviceCommandScreenshotJob::RunImpl(CallbackWithResult succeeded_callback,
gfx::Rect rect = root_window->bounds();
screenshot_delegate_->TakeSnapshot(
root_window, rect,
base::Bind(&RunStoreScreenshotOnTaskRunner,
base::Bind(&DeviceCommandScreenshotJob::StoreScreenshot,
weak_ptr_factory_.GetWeakPtr(), screen),
base::ThreadTaskRunnerHandle::Get()));
base::BindOnce(
&RunStoreScreenshotOnTaskRunner,
base::BindOnce(&DeviceCommandScreenshotJob::StoreScreenshot,
weak_ptr_factory_.GetWeakPtr(), screen),
base::ThreadTaskRunnerHandle::Get()));
}
}
......
......@@ -78,7 +78,7 @@ class DeviceCommandScreenshotJob : public RemoteCommandJob,
virtual void TakeSnapshot(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const ui::GrabWindowSnapshotAsyncPNGCallback& callback) = 0;
ui::GrabWindowSnapshotAsyncPNGCallback callback) = 0;
// Creates a new fully configured instance of an UploadJob. This method
// may be called any number of times.
......
......@@ -143,10 +143,9 @@ class MockScreenshotDelegate : public DeviceCommandScreenshotJob::Delegate {
~MockScreenshotDelegate() override;
bool IsScreenshotAllowed() override;
void TakeSnapshot(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const ui::GrabWindowSnapshotAsyncPNGCallback& callback) override;
void TakeSnapshot(gfx::NativeWindow window,
const gfx::Rect& source_rect,
ui::GrabWindowSnapshotAsyncPNGCallback callback) override;
std::unique_ptr<UploadJob> CreateUploadJob(const GURL&,
UploadJob::Delegate*) override;
......@@ -171,13 +170,13 @@ bool MockScreenshotDelegate::IsScreenshotAllowed() {
void MockScreenshotDelegate::TakeSnapshot(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const ui::GrabWindowSnapshotAsyncPNGCallback& callback) {
ui::GrabWindowSnapshotAsyncPNGCallback callback) {
const int width = source_rect.width();
const int height = source_rect.height();
scoped_refptr<base::RefCountedBytes> test_png =
GenerateTestPNG(width, height);
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(callback, test_png));
FROM_HERE, base::BindOnce(std::move(callback), test_png));
}
std::unique_ptr<UploadJob> MockScreenshotDelegate::CreateUploadJob(
......
......@@ -41,11 +41,11 @@ bool ScreenshotDelegate::IsScreenshotAllowed() {
void ScreenshotDelegate::TakeSnapshot(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const ui::GrabWindowSnapshotAsyncPNGCallback& callback) {
ui::GrabWindowSnapshotAsyncPNGCallback callback) {
ui::GrabWindowSnapshotAsyncPNG(
window, source_rect,
base::Bind(&ScreenshotDelegate::StoreScreenshot,
weak_ptr_factory_.GetWeakPtr(), callback));
base::BindOnce(&ScreenshotDelegate::StoreScreenshot,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
std::unique_ptr<UploadJob> ScreenshotDelegate::CreateUploadJob(
......@@ -86,9 +86,9 @@ std::unique_ptr<UploadJob> ScreenshotDelegate::CreateUploadJob(
}
void ScreenshotDelegate::StoreScreenshot(
const ui::GrabWindowSnapshotAsyncPNGCallback& callback,
ui::GrabWindowSnapshotAsyncPNGCallback callback,
scoped_refptr<base::RefCountedMemory> png_data) {
callback.Run(png_data);
std::move(callback).Run(png_data);
}
} // namespace policy
......@@ -28,16 +28,15 @@ class ScreenshotDelegate : public DeviceCommandScreenshotJob::Delegate {
// DeviceCommandScreenshotJob::Delegate:
bool IsScreenshotAllowed() override;
void TakeSnapshot(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const ui::GrabWindowSnapshotAsyncPNGCallback& callback) override;
void TakeSnapshot(gfx::NativeWindow window,
const gfx::Rect& source_rect,
ui::GrabWindowSnapshotAsyncPNGCallback callback) override;
std::unique_ptr<UploadJob> CreateUploadJob(
const GURL& upload_url,
UploadJob::Delegate* delegate) override;
private:
void StoreScreenshot(const ui::GrabWindowSnapshotAsyncPNGCallback& callback,
void StoreScreenshot(ui::GrabWindowSnapshotAsyncPNGCallback callback,
scoped_refptr<base::RefCountedMemory> png_data);
base::WeakPtrFactory<ScreenshotDelegate> weak_ptr_factory_{this};
......
......@@ -90,9 +90,9 @@ void ScreenshotGrabber::TakeScreenshot(gfx::NativeWindow window,
#endif
ui::GrabWindowSnapshotAsyncPNG(
window, rect,
base::Bind(&ScreenshotGrabber::GrabWindowSnapshotAsyncCallback,
factory_.GetWeakPtr(), window_identifier, is_partial,
base::Passed(&callback)));
base::BindOnce(&ScreenshotGrabber::GrabWindowSnapshotAsyncCallback,
factory_.GetWeakPtr(), window_identifier, is_partial,
std::move(callback)));
}
bool ScreenshotGrabber::CanTakeScreenshot() {
......
......@@ -39,33 +39,33 @@ scoped_refptr<base::RefCountedMemory> EncodeImageAsJPEG(
void EncodeImageAndScheduleCallback(
scoped_refptr<base::RefCountedMemory> (*encode_func)(const gfx::Image&),
const base::Callback<void(scoped_refptr<base::RefCountedMemory> data)>&
base::OnceCallback<void(scoped_refptr<base::RefCountedMemory> data)>
callback,
gfx::Image image) {
base::PostTaskAndReplyWithResult(
FROM_HERE,
{base::ThreadPool(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::Bind(encode_func, std::move(image)), callback);
base::BindOnce(encode_func, std::move(image)), std::move(callback));
}
} // namespace
void GrabWindowSnapshotAsyncPNG(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncPNGCallback& callback) {
void GrabWindowSnapshotAsyncPNG(gfx::NativeWindow window,
const gfx::Rect& source_rect,
GrabWindowSnapshotAsyncPNGCallback callback) {
GrabWindowSnapshotAsync(
window, source_rect,
base::Bind(EncodeImageAndScheduleCallback, &EncodeImageAsPNG, callback));
base::BindOnce(&EncodeImageAndScheduleCallback, &EncodeImageAsPNG,
std::move(callback)));
}
void GrabWindowSnapshotAsyncJPEG(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncJPEGCallback& callback) {
void GrabWindowSnapshotAsyncJPEG(gfx::NativeWindow window,
const gfx::Rect& source_rect,
GrabWindowSnapshotAsyncJPEGCallback callback) {
GrabWindowSnapshotAsync(
window, source_rect,
base::Bind(EncodeImageAndScheduleCallback, &EncodeImageAsJPEG, callback));
base::BindOnce(&EncodeImageAndScheduleCallback, &EncodeImageAsJPEG,
std::move(callback)));
}
} // namespace ui
......@@ -38,37 +38,40 @@ SNAPSHOT_EXPORT bool GrabViewSnapshot(gfx::NativeView view,
// These functions take a snapshot of |source_rect|, specified in layer space
// coordinates (DIP for desktop, physical pixels for Android), and scale the
// snapshot to |target_size| (in physical pixels), asynchronously.
typedef base::Callback<void(gfx::Image snapshot)>
GrabWindowSnapshotAsyncCallback;
using GrabWindowSnapshotAsyncCallback =
base::OnceCallback<void(gfx::Image snapshot)>;
SNAPSHOT_EXPORT void GrabWindowSnapshotAndScaleAsync(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const gfx::Size& target_size,
const GrabWindowSnapshotAsyncCallback& callback);
GrabWindowSnapshotAsyncCallback callback);
SNAPSHOT_EXPORT void GrabWindowSnapshotAsync(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback);
GrabWindowSnapshotAsyncCallback callback);
SNAPSHOT_EXPORT void GrabViewSnapshotAsync(
gfx::NativeView view,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback);
GrabWindowSnapshotAsyncCallback callback);
using GrabWindowSnapshotAsyncPNGCallback =
base::Callback<void(scoped_refptr<base::RefCountedMemory> data)>;
base::OnceCallback<void(scoped_refptr<base::RefCountedMemory> data)>;
SNAPSHOT_EXPORT void GrabWindowSnapshotAsyncPNG(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncPNGCallback& callback);
GrabWindowSnapshotAsyncPNGCallback callback);
using GrabWindowSnapshotAsyncJPEGCallback =
base::Callback<void(scoped_refptr<base::RefCountedMemory> data)>;
base::OnceCallback<void(scoped_refptr<base::RefCountedMemory> data)>;
SNAPSHOT_EXPORT void GrabWindowSnapshotAsyncJPEG(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncJPEGCallback& callback);
GrabWindowSnapshotAsyncJPEGCallback callback);
} // namespace ui
......
......@@ -57,37 +57,36 @@ static void MakeAsyncCopyRequest(
std::move(copy_request));
}
void GrabWindowSnapshotAndScaleAsync(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const gfx::Size& target_size,
const GrabWindowSnapshotAsyncCallback& callback) {
void GrabWindowSnapshotAndScaleAsync(gfx::NativeWindow window,
const gfx::Rect& source_rect,
const gfx::Size& target_size,
GrabWindowSnapshotAsyncCallback callback) {
MakeAsyncCopyRequest(
window, source_rect,
CreateCopyRequest(window, source_rect,
base::BindOnce(&SnapshotAsync::ScaleCopyOutputResult,
callback, target_size)));
std::move(callback), target_size)));
}
void GrabWindowSnapshotAsync(gfx::NativeWindow window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
GrabWindowSnapshotAsyncCallback callback) {
MakeAsyncCopyRequest(
window, source_rect,
CreateCopyRequest(
window, source_rect,
base::BindOnce(&SnapshotAsync::RunCallbackWithCopyOutputResult,
callback)));
std::move(callback))));
}
void GrabViewSnapshotAsync(gfx::NativeView view,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
GrabWindowSnapshotAsyncCallback callback) {
std::unique_ptr<viz::CopyOutputRequest> copy_request =
view->MaybeRequestCopyOfView(CreateCopyRequest(
view, source_rect,
base::BindOnce(&SnapshotAsync::RunCallbackWithCopyOutputResult,
callback)));
std::move(callback))));
if (!copy_request)
return;
......
......@@ -18,9 +18,9 @@ namespace ui {
namespace {
void OnFrameScalingFinished(const GrabWindowSnapshotAsyncCallback& callback,
void OnFrameScalingFinished(GrabWindowSnapshotAsyncCallback callback,
const SkBitmap& scaled_bitmap) {
callback.Run(gfx::Image::CreateFrom1xBitmap(scaled_bitmap));
std::move(callback).Run(gfx::Image::CreateFrom1xBitmap(scaled_bitmap));
}
SkBitmap ScaleBitmap(const SkBitmap& input_bitmap,
......@@ -35,12 +35,12 @@ SkBitmap ScaleBitmap(const SkBitmap& input_bitmap,
} // namespace
void SnapshotAsync::ScaleCopyOutputResult(
const GrabWindowSnapshotAsyncCallback& callback,
GrabWindowSnapshotAsyncCallback callback,
const gfx::Size& target_size,
std::unique_ptr<viz::CopyOutputResult> result) {
const SkBitmap bitmap = result->AsSkBitmap();
if (!bitmap.readyToDraw()) {
callback.Run(gfx::Image());
std::move(callback).Run(gfx::Image());
return;
}
......@@ -51,19 +51,19 @@ void SnapshotAsync::ScaleCopyOutputResult(
base::PostTaskAndReplyWithResult(
FROM_HERE,
{base::ThreadPool(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::Bind(ScaleBitmap, bitmap, target_size),
base::Bind(&OnFrameScalingFinished, callback));
base::BindOnce(ScaleBitmap, bitmap, target_size),
base::BindOnce(&OnFrameScalingFinished, std::move(callback)));
}
void SnapshotAsync::RunCallbackWithCopyOutputResult(
const GrabWindowSnapshotAsyncCallback& callback,
GrabWindowSnapshotAsyncCallback callback,
std::unique_ptr<viz::CopyOutputResult> result) {
const SkBitmap bitmap = result->AsSkBitmap();
if (!bitmap.readyToDraw()) {
callback.Run(gfx::Image());
std::move(callback).Run(gfx::Image());
return;
}
callback.Run(gfx::Image::CreateFrom1xBitmap(bitmap));
std::move(callback).Run(gfx::Image::CreateFrom1xBitmap(bitmap));
}
} // namespace ui
......@@ -22,12 +22,12 @@ namespace ui {
class SnapshotAsync {
public:
static void ScaleCopyOutputResult(
const GrabWindowSnapshotAsyncCallback& callback,
GrabWindowSnapshotAsyncCallback callback,
const gfx::Size& target_size,
std::unique_ptr<viz::CopyOutputResult> result);
static void RunCallbackWithCopyOutputResult(
const GrabWindowSnapshotAsyncCallback& callback,
GrabWindowSnapshotAsyncCallback callback,
std::unique_ptr<viz::CopyOutputResult> result);
private:
......
......@@ -82,21 +82,20 @@ void GrabWindowSnapshotAndScaleAsyncAura(
aura::Window* window,
const gfx::Rect& source_rect,
const gfx::Size& target_size,
const GrabWindowSnapshotAsyncCallback& callback) {
GrabWindowSnapshotAsyncCallback callback) {
MakeInitialAsyncCopyRequest(
window, source_rect,
base::BindOnce(&SnapshotAsync::ScaleCopyOutputResult, callback,
base::BindOnce(&SnapshotAsync::ScaleCopyOutputResult, std::move(callback),
target_size));
}
void GrabWindowSnapshotAsyncAura(
aura::Window* window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
void GrabWindowSnapshotAsyncAura(aura::Window* window,
const gfx::Rect& source_rect,
GrabWindowSnapshotAsyncCallback callback) {
MakeInitialAsyncCopyRequest(
window, source_rect,
base::BindOnce(&SnapshotAsync::RunCallbackWithCopyOutputResult,
callback));
std::move(callback)));
}
#if !defined(OS_WIN)
......@@ -113,34 +112,33 @@ bool GrabViewSnapshot(gfx::NativeView view,
return GrabWindowSnapshot(view, snapshot_bounds, image);
}
void GrabWindowSnapshotAndScaleAsync(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const gfx::Size& target_size,
const GrabWindowSnapshotAsyncCallback& callback) {
void GrabWindowSnapshotAndScaleAsync(gfx::NativeWindow window,
const gfx::Rect& source_rect,
const gfx::Size& target_size,
GrabWindowSnapshotAsyncCallback callback) {
GrabWindowSnapshotAndScaleAsyncAura(window, source_rect, target_size,
callback);
std::move(callback));
}
void GrabWindowSnapshotAsync(gfx::NativeWindow window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
GrabWindowSnapshotAsyncAura(window, source_rect, callback);
GrabWindowSnapshotAsyncCallback callback) {
GrabWindowSnapshotAsyncAura(window, source_rect, std::move(callback));
}
void GrabViewSnapshotAsync(gfx::NativeView view,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
GrabWindowSnapshotAsyncAura(view, source_rect, callback);
GrabWindowSnapshotAsyncCallback callback) {
GrabWindowSnapshotAsyncAura(view, source_rect, std::move(callback));
}
void GrabLayerSnapshotAsync(ui::Layer* layer,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
GrabWindowSnapshotAsyncCallback callback) {
MakeAsyncCopyRequest(
layer, source_rect,
base::BindOnce(&SnapshotAsync::RunCallbackWithCopyOutputResult,
callback));
std::move(callback)));
}
#endif
......
......@@ -19,19 +19,19 @@ SNAPSHOT_EXPORT void GrabWindowSnapshotAndScaleAsyncAura(
aura::Window* window,
const gfx::Rect& source_rect,
const gfx::Size& target_size,
const GrabWindowSnapshotAsyncCallback& callback);
GrabWindowSnapshotAsyncCallback callback);
SNAPSHOT_EXPORT void GrabWindowSnapshotAsyncAura(
aura::Window* window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback);
GrabWindowSnapshotAsyncCallback callback);
// Grabs a snapshot of a |layer| and all its descendants.
// |source_rect| is the bounds of the snapshot content relative to |layer|.
SNAPSHOT_EXPORT void GrabLayerSnapshotAsync(
Layer* layer,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback);
GrabWindowSnapshotAsyncCallback callback);
} // namespace ui
......
......@@ -152,7 +152,7 @@ class SnapshotAuraTest : public testing::TestWithParam<bool> {
scoped_refptr<SnapshotHolder> holder(new SnapshotHolder);
ui::GrabWindowSnapshotAsync(
root_window(), source_rect,
base::Bind(&SnapshotHolder::SnapshotCallback, holder));
base::BindOnce(&SnapshotHolder::SnapshotCallback, holder));
holder->WaitForSnapshot();
DCHECK(holder->completed());
......
......@@ -29,19 +29,19 @@ void GrabWindowSnapshotAndScaleAsync(
const gfx::Rect& snapshot_bounds,
const gfx::Size& target_size,
GrabWindowSnapshotAsyncCallback callback) {
callback.Run(gfx::Image());
std::move(callback).Run(gfx::Image());
}
void GrabViewSnapshotAsync(gfx::NativeView view,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
callback.Run(gfx::Image());
GrabWindowSnapshotAsyncCallback callback) {
std::move(callback).Run(gfx::Image());
}
void GrabWindowSnapshotAsync(gfx::NativeWindow window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
callback.Run(gfx::Image());
GrabWindowSnapshotAsyncCallback callback) {
std::move(callback).Run(gfx::Image());
}
} // namespace ui
......@@ -71,21 +71,21 @@ void GrabWindowSnapshotAndScaleAsync(
const gfx::Rect& snapshot_bounds,
const gfx::Size& target_size,
GrabWindowSnapshotAsyncCallback callback) {
callback.Run(gfx::Image());
std::move(callback).Run(gfx::Image());
}
void GrabViewSnapshotAsync(gfx::NativeView view,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
callback.Run(gfx::Image());
GrabWindowSnapshotAsyncCallback callback) {
std::move(callback).Run(gfx::Image());
}
void GrabWindowSnapshotAsync(gfx::NativeWindow native_window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
GrabWindowSnapshotAsyncCallback callback) {
NSWindow* window = native_window.GetNativeNSWindow();
return GrabViewSnapshotAsync([[window contentView] superview], source_rect,
callback);
std::move(callback));
}
} // namespace ui
......@@ -125,39 +125,38 @@ bool GrabWindowSnapshot(gfx::NativeWindow window_handle,
void GrabWindowSnapshotAsync(gfx::NativeWindow window,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
GrabWindowSnapshotAsyncCallback callback) {
if (UseAuraSnapshot()) {
GrabWindowSnapshotAsyncAura(window, source_rect, callback);
GrabWindowSnapshotAsyncAura(window, source_rect, std::move(callback));
return;
}
gfx::Image image;
GrabWindowSnapshot(window, source_rect, &image);
callback.Run(image);
std::move(callback).Run(image);
}
void GrabViewSnapshotAsync(gfx::NativeView view,
const gfx::Rect& source_rect,
const GrabWindowSnapshotAsyncCallback& callback) {
GrabWindowSnapshotAsyncCallback callback) {
if (UseAuraSnapshot()) {
GrabWindowSnapshotAsyncAura(view, source_rect, callback);
GrabWindowSnapshotAsyncAura(view, source_rect, std::move(callback));
return;
}
NOTIMPLEMENTED();
callback.Run(gfx::Image());
std::move(callback).Run(gfx::Image());
}
void GrabWindowSnapshotAndScaleAsync(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
const gfx::Size& target_size,
const GrabWindowSnapshotAsyncCallback& callback) {
void GrabWindowSnapshotAndScaleAsync(gfx::NativeWindow window,
const gfx::Rect& source_rect,
const gfx::Size& target_size,
GrabWindowSnapshotAsyncCallback callback) {
if (UseAuraSnapshot()) {
GrabWindowSnapshotAndScaleAsyncAura(window, source_rect, target_size,
callback);
std::move(callback));
return;
}
NOTIMPLEMENTED();
callback.Run(gfx::Image());
std::move(callback).Run(gfx::Image());
}
} // namespace ui
......@@ -22,6 +22,6 @@ int main(int argc, char** argv) {
base::TestSuite test_suite(argc, argv);
return base::LaunchUnitTests(
argc, argv,
base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
base::BindOnce(&base::TestSuite::Run, base::Unretained(&test_suite)));
#endif
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment