3566412: [base] Remove base/android dependency on post_task.h and officially remove post_task.h!

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3566412
This commit is contained in:
Keeley Hammond 2022-05-03 13:24:41 -07:00
Родитель b60e509729
Коммит e3ea3e14cc
34 изменённых файлов: 50 добавлений и 60 удалений

Просмотреть файл

@ -96,7 +96,7 @@ index 5a64220aaf1309832dc0ad543e353de67fe0a779..5b701b1361707b610ed60c344e441e67
// Return true if the given pid is one of our child processes.
// Assumes that the current pid is the root of all pids of the current
diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc
index be2c417c07a4206fac4a9a6c03e516fd0493c942..78f74b0b21242553b6af98628dc48190f7d1137d 100644
index 3f065e5ead177579142560e38f0516ff117a9d26..063620f2485c3057aed74b85ba21dc69daa8e237 100644
--- a/chrome/browser/process_singleton_posix.cc
+++ b/chrome/browser/process_singleton_posix.cc
@@ -146,7 +146,7 @@ const char kACKToken[] = "ACK";

Просмотреть файл

@ -75,7 +75,7 @@ index 16bb3aa15a5378e8319f75f4b6b72b39177828f4..5a64220aaf1309832dc0ad543e353de6
#if BUILDFLAG(IS_MAC)
diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc
index 22331cd6985b2aa2347fe9d4211f51634e94d0a6..be2c417c07a4206fac4a9a6c03e516fd0493c942 100644
index 22331cd6985b2aa2347fe9d4211f51634e94d0a6..3f065e5ead177579142560e38f0516ff117a9d26 100644
--- a/chrome/browser/process_singleton_posix.cc
+++ b/chrome/browser/process_singleton_posix.cc
@@ -54,6 +54,7 @@
@ -90,7 +90,7 @@ index 22331cd6985b2aa2347fe9d4211f51634e94d0a6..be2c417c07a4206fac4a9a6c03e516fd
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner_helpers.h"
#include "base/task/single_thread_task_runner.h"
+#include "base/task/post_task.h"
+#include "base/task/thread_pool.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
@ -163,7 +163,7 @@ index 22331cd6985b2aa2347fe9d4211f51634e94d0a6..be2c417c07a4206fac4a9a6c03e516fd
+void ProcessSingleton::StartListeningOnSocket() {
+ watcher_ = base::MakeRefCounted<LinuxWatcher>(this);
+ base::PostTask(FROM_HERE, {BrowserThread::IO},
+ base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::IO},
+ base::BindOnce(&ProcessSingleton::LinuxWatcher::StartListening,
+ watcher_, sock_));
+}

Просмотреть файл

@ -10,7 +10,7 @@
#include <string>
#include <vector>
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "gin/handle.h"
@ -258,7 +258,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
template <typename... Args>
void EmitEventSoon(base::StringPiece eventName) {
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(base::IgnoreResult(&BaseWindow::Emit<Args...>),
weak_factory_.GetWeakPtr(), eventName));

Просмотреть файл

@ -10,7 +10,6 @@
#include "base/mac/scoped_sending_event.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/current_thread.h"
#include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"

Просмотреть файл

@ -6,7 +6,7 @@
#include <string>
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "gin/handle.h"
@ -39,7 +39,7 @@ void NativeTheme::OnNativeThemeUpdatedOnUI() {
}
void NativeTheme::OnNativeThemeUpdated(ui::NativeTheme* theme) {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::ThreadPool::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(&NativeTheme::OnNativeThemeUpdatedOnUI,
base::Unretained(this)));
}

Просмотреть файл

@ -7,7 +7,6 @@
#include <string>
#include "base/callback_helpers.h"
#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/public/browser/device_service.h"
#include "gin/dictionary.h"

Просмотреть файл

@ -17,7 +17,7 @@
#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/thread_pool.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@ -952,7 +952,7 @@ void Session::Preconnect(const gin_helper::Dictionary& options,
}
DCHECK_GT(num_sockets_to_preconnect, 0);
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(&StartPreconnectOnUI, base::Unretained(browser_context_),
url, num_sockets_to_preconnect));

Просмотреть файл

@ -18,7 +18,6 @@
#include "base/no_destructor.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/current_thread.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
#include "base/threading/sequenced_task_runner_handle.h"
@ -995,7 +994,7 @@ void WebContents::Destroy() {
if (Browser::Get()->is_shutting_down() || IsGuest()) {
DeleteThisIfAlive();
} else {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::ThreadPool::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(
[](base::WeakPtr<WebContents> contents) {
if (contents)

Просмотреть файл

@ -26,7 +26,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@ -395,7 +395,7 @@ ElectronBrowserClient* ElectronBrowserClient::Get() {
// static
void ElectronBrowserClient::SetApplicationLocale(const std::string& locale) {
if (!BrowserThread::IsThreadInitialized(BrowserThread::IO) ||
!base::PostTask(
!base::ThreadPool::PostTask(
FROM_HERE, {BrowserThread::IO},
base::BindOnce(&SetApplicationLocaleOnIOThread, locale))) {
g_io_thread_application_locale.Get() = locale;
@ -1057,7 +1057,7 @@ bool ElectronBrowserClient::HandleExternalProtocol(
const absl::optional<url::Origin>& initiating_origin,
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {BrowserThread::UI},
base::BindOnce(&HandleExternalProtocolInUI, url,
std::move(web_contents_getter), has_user_gesture));

Просмотреть файл

@ -16,7 +16,6 @@
#include "base/path_service.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/task/post_task.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/common/chrome_paths.h"

Просмотреть файл

@ -16,6 +16,7 @@
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/icon_manager.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@ -346,7 +347,7 @@ int ElectronBrowserMainParts::PreCreateThreads() {
}
void ElectronBrowserMainParts::PostCreateThreads() {
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::IO},
base::BindOnce(&tracing::TracingSamplerProfiler::CreateOnChildThread));
}
@ -440,7 +441,7 @@ int ElectronBrowserMainParts::PreMainMessageLoopRun() {
if (command_line->HasSwitch(switches::kRemoteDebuggingPipe)) {
// --remote-debugging-pipe
auto on_disconnect = base::BindOnce([]() {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::ThreadPool::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce([]() { Browser::Get()->Quit(); }));
});
content::DevToolsAgentHost::StartRemoteDebuggingPipeHandler(

Просмотреть файл

@ -15,7 +15,6 @@
#include "base/debug/leak_annotations.h"
#include "base/posix/eintr_wrapper.h"
#include "base/task/post_task.h"
#include "base/threading/platform_thread.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"

Просмотреть файл

@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/common/pref_names.h"

Просмотреть файл

@ -13,7 +13,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 "chrome/common/extensions/extension_metrics.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "chrome/common/webui_url_constants.h"

Просмотреть файл

@ -14,7 +14,6 @@
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"

Просмотреть файл

@ -13,7 +13,7 @@
#include "base/files/file_util.h"
#include "base/json/json_string_value_serializer.h"
#include "base/path_service.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/grit/browser_resources.h"
#include "components/value_store/value_store_factory_impl.h"
@ -204,7 +204,7 @@ AppSorting* ElectronExtensionSystem::app_sorting() {
void ElectronExtensionSystem::RegisterExtensionWithRequestContexts(
const Extension* extension,
base::OnceClosure callback) {
base::PostTaskAndReply(FROM_HERE, {BrowserThread::IO},
base::ThreadPool::PostTaskAndReply(FROM_HERE, {BrowserThread::IO},
base::BindOnce(&InfoMap::AddExtension, info_map(),
base::RetainedRef(extension),
base::Time::Now(), false, false),

Просмотреть файл

@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/chrome_url_request_util.h"
#include "chrome/common/chrome_paths.h"
@ -301,7 +301,7 @@ void ElectronExtensionsBrowserClient::BroadcastEventToRenderers(
std::unique_ptr<base::ListValue> args,
bool dispatch_to_off_the_record_profiles) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {BrowserThread::UI},
base::BindOnce(
&ElectronExtensionsBrowserClient::BroadcastEventToRenderers,

Просмотреть файл

@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
@ -122,7 +122,7 @@
*/
- (void)runCallback:(bool)isProductValid {
if (callback_) {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::ThreadPool::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(std::move(callback_), isProductValid));
}
// Release this delegate.

Просмотреть файл

@ -8,7 +8,7 @@
#include "base/bind.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
@ -75,7 +75,7 @@ using InAppTransactionCallback = base::RepeatingCallback<void(
}
// Send the callback to the browser thread.
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::ThreadPool::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(callback_, converted));
}

Просмотреть файл

@ -10,7 +10,7 @@
#include "base/bind.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
@ -83,7 +83,7 @@
}
// Send the callback to the browser thread.
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::ThreadPool::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(std::move(callback_), converted));
[self release];

Просмотреть файл

@ -16,7 +16,7 @@
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h"
#include "components/remote_cocoa/browser/scoped_cg_window_id.h"
#include "content/public/browser/browser_accessibility_state.h"
@ -999,7 +999,7 @@ void NativeWindowMac::OnDisplayMetricsChanged(const display::Display& display,
if (!is_simple_fullscreen_)
return;
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::ThreadPool::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(&NativeWindow::UpdateFrame, GetWeakPtr()));
}
@ -1778,7 +1778,7 @@ bool NativeWindowMac::CanMaximize() const {
}
void NativeWindowMac::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) {
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(&NativeWindow::RedrawTrafficLights, GetWeakPtr()));
}

Просмотреть файл

@ -11,7 +11,6 @@
#include <vector>
#include "base/strings/stringprintf.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/file_url_loader.h"
#include "electron/fuses.h"

Просмотреть файл

@ -12,8 +12,8 @@
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/task/post_task.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
@ -765,7 +765,7 @@ void OffScreenRenderWidgetHostView::ReleaseResize() {
hold_resize_ = false;
if (pending_resize_) {
pending_resize_ = false;
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(
&OffScreenRenderWidgetHostView::SynchronizeVisualProperties,
@ -870,7 +870,7 @@ void OffScreenRenderWidgetHostView::SendMouseWheelEvent(
// Scrolling outside of the popup widget so destroy it.
// Execute asynchronously to avoid deleting the widget from inside some
// other callback.
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(&OffScreenRenderWidgetHostView::CancelWidget,
popup_host_view_->weak_ptr_factory_.GetWeakPtr()));

Просмотреть файл

@ -11,7 +11,7 @@
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_memory.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/printer_query.h"
@ -43,7 +43,7 @@ void StopWorker(int document_cookie) {
std::unique_ptr<printing::PrinterQuery> printer_query =
queue->PopPrinterQuery(document_cookie);
if (printer_query.get()) {
base::PostTask(FROM_HERE, {BrowserThread::IO},
base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::IO},
base::BindOnce(&printing::PrinterQuery::StopWorker,
std::move(printer_query)));
}

Просмотреть файл

@ -12,7 +12,7 @@
#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/mac/url_conversions.h"
@ -227,7 +227,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
if (model_)
model_->MenuWillClose();
if (!closeCallback.is_null()) {
base::PostTask(FROM_HERE, {BrowserThread::UI}, std::move(closeCallback));
base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI}, std::move(closeCallback));
}
}
}
@ -536,7 +536,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// Post async task so that itemSelected runs before the close callback
// deletes the controller from the map which deallocates it
if (!closeCallback.is_null()) {
base::PostTask(FROM_HERE, {BrowserThread::UI}, std::move(closeCallback));
base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI}, std::move(closeCallback));
}
}
}

Просмотреть файл

@ -14,6 +14,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_frontend_host.h"
@ -117,7 +118,7 @@ void DevToolsManagerDelegate::HandleCommand(
// Since we only have one method and it is supposed to close Electron,
// we don't need to add this complexity. Should we decide to support
// methods like Browser.setWindowBounds, we'll need to do it though.
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::ThreadPool::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce([]() { Browser::Get()->Quit(); }));
return;
}

Просмотреть файл

@ -16,7 +16,7 @@
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
@ -301,7 +301,7 @@ void ResolvePromiseInNextTick(gin_helper::Promise<v8::Local<v8::Value>> promise,
// users will run in the microtask, we have to delay the resolution until
// next tick, otherwise crash like this may happen:
// https://github.com/electron/electron/issues/26884
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(
[](gin_helper::Promise<v8::Local<v8::Value>> promise,

Просмотреть файл

@ -19,7 +19,6 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/values.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"

Просмотреть файл

@ -17,7 +17,7 @@
#include "base/mac/scoped_nsobject.h"
#include "base/no_destructor.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "shell/browser/native_window.h"
@ -178,7 +178,7 @@ void ShowMessageBox(const MessageBoxSettings& settings,
// users will run in the callback, we have to delay running the callback
// until next tick, otherwise crash like this may happen:
// https://github.com/electron/electron/issues/26884
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(std::move(callback_), response, suppressed));
};

Просмотреть файл

@ -10,7 +10,7 @@
#include "base/message_loop/message_pump_mac.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/current_thread.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "shell/browser/ui/cocoa/NSString+ANSI.h"
@ -365,7 +365,7 @@ void TrayIconCocoa::PopUpOnUI(ElectronMenuModel* menu_model) {
void TrayIconCocoa::PopUpContextMenu(const gfx::Point& pos,
ElectronMenuModel* menu_model) {
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(&TrayIconCocoa::PopUpOnUI, weak_factory_.GetWeakPtr(),
base::Unretained(menu_model)));

Просмотреть файл

@ -15,7 +15,6 @@
#include "base/logging.h"
#include "base/pickle.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "electron/fuses.h"

Просмотреть файл

@ -68,7 +68,7 @@ v8::Local<v8::Promise::Resolver> PromiseBase::GetInner() const {
void Promise<void>::ResolvePromise(Promise<void> promise) {
if (gin_helper::Locker::IsBrowserProcess() &&
!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce([](Promise<void> promise) { promise.Resolve(); },
std::move(promise)));

Просмотреть файл

@ -11,7 +11,7 @@
#include <utility>
#include "base/strings/string_piece.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "shell/common/gin_converters/std_converter.h"
@ -48,7 +48,7 @@ class PromiseBase {
static void RejectPromise(PromiseBase&& promise, base::StringPiece errmsg) {
if (gin_helper::Locker::IsBrowserProcess() &&
!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
base::PostTask(
base::ThreadPool::PostTask(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(
// Note that this callback can not take StringPiece,
@ -91,7 +91,7 @@ class Promise : public PromiseBase {
static void ResolvePromise(Promise<RT> promise, RT result) {
if (gin_helper::Locker::IsBrowserProcess() &&
!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::ThreadPool::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce([](Promise<RT> promise,
RT result) { promise.Resolve(result); },
std::move(promise), std::move(result)));

Просмотреть файл

@ -4,7 +4,6 @@
#include <string>
#include "base/task/post_task.h"
#include "base/values.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_frame_observer.h"