Correct file line-endings from CRLF to LF (flutter/engine#29164)

This commit is contained in:
Chris Bracken 2021-10-13 12:58:01 -07:00 committed by GitHub
parent acc0ba3dee
commit 794db8c01b
4 changed files with 161 additions and 161 deletions

View File

@ -1,51 +1,51 @@
// Copyright 2013 The Flutter 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 "flutter/shell/platform/windows/task_runner_winuwp.h"
#include <atomic>
#include <utility>
namespace flutter {
// static
std::unique_ptr<TaskRunner> TaskRunner::Create(
DWORD main_thread_id,
CurrentTimeProc get_current_time,
const TaskExpiredCallback& on_task_expired) {
return std::make_unique<TaskRunnerWinUwp>(main_thread_id, on_task_expired);
}
TaskRunnerWinUwp::TaskRunnerWinUwp(DWORD main_thread_id,
const TaskExpiredCallback& on_task_expired)
: main_thread_id_(main_thread_id),
on_task_expired_(std::move(on_task_expired)) {
dispatcher_ =
winrt::Windows::UI::Core::CoreWindow::GetForCurrentThread().Dispatcher();
}
TaskRunnerWinUwp::~TaskRunnerWinUwp() = default;
bool TaskRunnerWinUwp::RunsTasksOnCurrentThread() const {
return GetCurrentThreadId() == main_thread_id_;
}
void TaskRunnerWinUwp::PostFlutterTask(FlutterTask flutter_task,
uint64_t flutter_target_time_nanos) {
// TODO: Handle the target time. See
// https://github.com/flutter/flutter/issues/70890.
dispatcher_.RunAsync(
winrt::Windows::UI::Core::CoreDispatcherPriority::Normal,
[this, flutter_task]() { on_task_expired_(&flutter_task); });
}
void TaskRunnerWinUwp::PostTask(TaskClosure task) {
// TODO: Handle the target time. See PostFlutterTask()
dispatcher_.RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal,
[task]() { task(); });
}
} // namespace flutter
// Copyright 2013 The Flutter 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 "flutter/shell/platform/windows/task_runner_winuwp.h"
#include <atomic>
#include <utility>
namespace flutter {
// static
std::unique_ptr<TaskRunner> TaskRunner::Create(
DWORD main_thread_id,
CurrentTimeProc get_current_time,
const TaskExpiredCallback& on_task_expired) {
return std::make_unique<TaskRunnerWinUwp>(main_thread_id, on_task_expired);
}
TaskRunnerWinUwp::TaskRunnerWinUwp(DWORD main_thread_id,
const TaskExpiredCallback& on_task_expired)
: main_thread_id_(main_thread_id),
on_task_expired_(std::move(on_task_expired)) {
dispatcher_ =
winrt::Windows::UI::Core::CoreWindow::GetForCurrentThread().Dispatcher();
}
TaskRunnerWinUwp::~TaskRunnerWinUwp() = default;
bool TaskRunnerWinUwp::RunsTasksOnCurrentThread() const {
return GetCurrentThreadId() == main_thread_id_;
}
void TaskRunnerWinUwp::PostFlutterTask(FlutterTask flutter_task,
uint64_t flutter_target_time_nanos) {
// TODO: Handle the target time. See
// https://github.com/flutter/flutter/issues/70890.
dispatcher_.RunAsync(
winrt::Windows::UI::Core::CoreDispatcherPriority::Normal,
[this, flutter_task]() { on_task_expired_(&flutter_task); });
}
void TaskRunnerWinUwp::PostTask(TaskClosure task) {
// TODO: Handle the target time. See PostFlutterTask()
dispatcher_.RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal,
[task]() { task(); });
}
} // namespace flutter

View File

@ -1,52 +1,52 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_WINRT_TASK_RUNNER_H_
#define FLUTTER_SHELL_PLATFORM_WINDOWS_WINRT_TASK_RUNNER_H_
#include <windows.h>
#include <third_party/cppwinrt/generated/winrt/Windows.UI.Core.h>
#include <chrono>
#include <functional>
#include <thread>
#include "flutter/shell/platform/embedder/embedder.h"
#include "flutter/shell/platform/windows/task_runner.h"
namespace flutter {
// A custom task runner that uses a CoreDispatcher to schedule
// flutter tasks.
class TaskRunnerWinUwp : public TaskRunner {
public:
TaskRunnerWinUwp(DWORD main_thread_id,
const TaskExpiredCallback& on_task_expired);
~TaskRunnerWinUwp();
TaskRunnerWinUwp(const TaskRunnerWinUwp&) = delete;
TaskRunnerWinUwp& operator=(const TaskRunnerWinUwp&) = delete;
// |TaskRunner|
bool RunsTasksOnCurrentThread() const override;
// |TaskRunner|
void PostFlutterTask(FlutterTask flutter_task,
uint64_t flutter_target_time_nanos) override;
// |TaskRunner|
void PostTask(TaskClosure task) override;
private:
DWORD main_thread_id_;
TaskExpiredCallback on_task_expired_;
winrt::Windows::UI::Core::CoreDispatcher dispatcher_{nullptr};
};
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_WINRT_TASK_RUNNER_H_
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_WINRT_TASK_RUNNER_H_
#define FLUTTER_SHELL_PLATFORM_WINDOWS_WINRT_TASK_RUNNER_H_
#include <windows.h>
#include <third_party/cppwinrt/generated/winrt/Windows.UI.Core.h>
#include <chrono>
#include <functional>
#include <thread>
#include "flutter/shell/platform/embedder/embedder.h"
#include "flutter/shell/platform/windows/task_runner.h"
namespace flutter {
// A custom task runner that uses a CoreDispatcher to schedule
// flutter tasks.
class TaskRunnerWinUwp : public TaskRunner {
public:
TaskRunnerWinUwp(DWORD main_thread_id,
const TaskExpiredCallback& on_task_expired);
~TaskRunnerWinUwp();
TaskRunnerWinUwp(const TaskRunnerWinUwp&) = delete;
TaskRunnerWinUwp& operator=(const TaskRunnerWinUwp&) = delete;
// |TaskRunner|
bool RunsTasksOnCurrentThread() const override;
// |TaskRunner|
void PostFlutterTask(FlutterTask flutter_task,
uint64_t flutter_target_time_nanos) override;
// |TaskRunner|
void PostTask(TaskClosure task) override;
private:
DWORD main_thread_id_;
TaskExpiredCallback on_task_expired_;
winrt::Windows::UI::Core::CoreDispatcher dispatcher_{nullptr};
};
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_WINRT_TASK_RUNNER_H_

View File

@ -1,15 +1,15 @@
// Copyright 2013 The Flutter 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 "flutter/shell/platform/windows/testing/mock_window_binding_handler.h"
namespace flutter {
namespace testing {
MockWindowBindingHandler::MockWindowBindingHandler() : WindowBindingHandler(){};
MockWindowBindingHandler::~MockWindowBindingHandler() = default;
} // namespace testing
} // namespace flutter
// Copyright 2013 The Flutter 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 "flutter/shell/platform/windows/testing/mock_window_binding_handler.h"
namespace flutter {
namespace testing {
MockWindowBindingHandler::MockWindowBindingHandler() : WindowBindingHandler(){};
MockWindowBindingHandler::~MockWindowBindingHandler() = default;
} // namespace testing
} // namespace flutter

View File

@ -1,43 +1,43 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_WINDOW_BINDING_HANDLER_H_
#define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_WINDOW_BINDING_HANDLER_H_
#include <windowsx.h>
#include "flutter/shell/platform/windows/window_binding_handler.h"
#include "gmock/gmock.h"
namespace flutter {
namespace testing {
/// Mock for the |WindowWin32| base class.
class MockWindowBindingHandler : public WindowBindingHandler {
public:
MockWindowBindingHandler();
virtual ~MockWindowBindingHandler();
// Prevent copying.
MockWindowBindingHandler(MockWindowBindingHandler const&) = delete;
MockWindowBindingHandler& operator=(MockWindowBindingHandler const&) = delete;
MOCK_METHOD1(SetView, void(WindowBindingHandlerDelegate* view));
MOCK_METHOD0(GetRenderTarget, WindowsRenderTarget());
MOCK_METHOD0(GetPlatformWindow, PlatformWindow());
MOCK_METHOD0(GetDpiScale, float());
MOCK_METHOD0(IsVisible, bool());
MOCK_METHOD0(OnWindowResized, void());
MOCK_METHOD0(GetPhysicalWindowBounds, PhysicalWindowBounds());
MOCK_METHOD1(UpdateFlutterCursor, void(const std::string& cursor_name));
MOCK_METHOD1(OnCursorRectUpdated, void(const Rect& rect));
MOCK_METHOD0(OnResetImeComposing, void());
MOCK_METHOD3(OnBitmapSurfaceUpdated,
bool(const void* allocation, size_t row_bytes, size_t height));
};
} // namespace testing
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_WINDOW_BINDING_HANDLER_H_
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_WINDOW_BINDING_HANDLER_H_
#define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_WINDOW_BINDING_HANDLER_H_
#include <windowsx.h>
#include "flutter/shell/platform/windows/window_binding_handler.h"
#include "gmock/gmock.h"
namespace flutter {
namespace testing {
/// Mock for the |WindowWin32| base class.
class MockWindowBindingHandler : public WindowBindingHandler {
public:
MockWindowBindingHandler();
virtual ~MockWindowBindingHandler();
// Prevent copying.
MockWindowBindingHandler(MockWindowBindingHandler const&) = delete;
MockWindowBindingHandler& operator=(MockWindowBindingHandler const&) = delete;
MOCK_METHOD1(SetView, void(WindowBindingHandlerDelegate* view));
MOCK_METHOD0(GetRenderTarget, WindowsRenderTarget());
MOCK_METHOD0(GetPlatformWindow, PlatformWindow());
MOCK_METHOD0(GetDpiScale, float());
MOCK_METHOD0(IsVisible, bool());
MOCK_METHOD0(OnWindowResized, void());
MOCK_METHOD0(GetPhysicalWindowBounds, PhysicalWindowBounds());
MOCK_METHOD1(UpdateFlutterCursor, void(const std::string& cursor_name));
MOCK_METHOD1(OnCursorRectUpdated, void(const Rect& rect));
MOCK_METHOD0(OnResetImeComposing, void());
MOCK_METHOD3(OnBitmapSurfaceUpdated,
bool(const void* allocation, size_t row_bytes, size_t height));
};
} // namespace testing
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_WINDOW_BINDING_HANDLER_H_