#include "base/bind.h"
#include "base/logging.h"
#include "base/task/bind_post_task.h"
-#include "base/task/thread_pool.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/common/render_messages_efl.h"
#include "content/public/browser/browser_context.h"
browser_context_->GetStoragePartition(NULL)->GetQuotaManager();
}
waiting_for_clear_quota_managed_data_ = true;
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&BrowsingDataRemoverEfl::ClearQuotaManagedDataOnIOThread,
base::Unretained(this)));
}
quota_managed_origins_to_delete_count_ != 0)
return;
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&BrowsingDataRemoverEfl::OnQuotaManagedDataDeleted,
base::Unretained(this)));
}
int render_frame_id,
const GURL& requesting_frame,
base::OnceCallback<void(PermissionStatus)> callback) const {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(
&GeolocationPermissionContextEfl::RequestPermissionOnUIThread,
weak_ptr_factory_.GetWeakPtr(), render_process_id, render_frame_id,
int render_process_id,
QuotaPermissionContext::PermissionCallback callback) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&QuotaPermissionContextEfl::RequestQuotaPermission, this,
params, render_process_id, std::move(callback)));
return;
DCHECK_EQ(false, callback.is_null());
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&QuotaPermissionContextEfl::DispatchCallback,
std::move(callback), response));
return;
// Since called by IO thread callback trigger needs to
// be posted to UI thread so that IO thread is unblocked
- base::ThreadPool::PostTaskWithTraits(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(TriggerNewDownloadStartCallbackOnUIThread,
render_process_id, render_view_id, request->url(),
user_agent, content_disposition, mime_type,
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/synchronization/waitable_event.h"
-#include "base/task/thread_pool.h"
#include "browser/scoped_allow_wait_for_legacy_web_view_api.h"
#include "browser_context_efl.h"
#include "content/browser/storage_partition_impl.h"
void CookieManager::DeleteCookiesAsync(const std::string& url,
const std::string& cookie_name) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&CookieManager::DeleteCookiesOnIOThread,
base::Unretained(this), url, cookie_name));
}
scoped_refptr<content::URLRequestContextGetterEfl> context_getter = GetContextGetter();
if (context_getter.get()) {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(SetStoragePathOnIOThread, context_getter, path,
persist_session_cookies, file_storage_type));
}
void CookieManager::GetAcceptPolicyAsync(Ewk_Cookie_Manager_Policy_Async_Get_Cb callback, void *data) {
AutoLock lock(lock_);
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&TriggerHostPolicyGetCallbackAsyncOnUIThread,
cookie_policy_, callback, data));
}
void CookieManager::GetHostNamesWithCookiesAsync(AsyncHostnamesGetCb callback, void *data) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
host_callback_queue_.push(new EwkGetHostCallback(callback, data));
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&CookieManager::FetchCookiesOnIOThread, GetSharedThis()));
}
void CookieManager::OnFetchComplete(const net::CookieList& cookies) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI},
- base::BindOnce(&CookieManager::OnFetchComplete,
- base::Unretained(this), cookies));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(&CookieManager::OnFetchComplete,
+ base::Unretained(this), cookies));
return;
}
if (!host_callback_queue_.empty()) {
->GetDefaultStoragePartition()
->GetCookieManagerForBrowserProcess();
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&CookieManager::AllowFileSchemeCookiesOnIOThread,
weak_ptr_factory_.GetWeakPtr(), cookie_manager, allow));
}
std::string cookie_value;
base::WaitableEvent completion(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(GetCookieValueOnIOThread, cookie_store, GURL(url),
&cookie_value, &completion));
// allow wait temporarily.
#endif
#include "base/synchronization/waitable_event.h"
-#include "base/task/thread_pool.h"
#include "browser/favicon/favicon_database.h"
#include "browser/password_manager/password_helper_efl.h"
#include "browser/tizen_extensible_host.h"
// We still trigger callback.
usage = 0;
}
- base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI},
- base::BindOnce(callback, usage, user_data));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(callback, usage, user_data));
}
void OnGetWebDBOrigins(storage::DatabaseQuotaClient* client,
new _Ewk_Security_Origin(key.origin().GetURL());
origin_list = eina_list_append(origin_list, sec_origin);
}
- base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI},
- base::BindOnce(callback, origin_list, user_data));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(callback, origin_list, user_data));
}
void OnGetWebDBUsageForOrigin(Ewk_Web_Database_Usage_Get_Callback callback,
new _Ewk_Security_Origin(key.origin().GetURL());
origin_list = eina_list_append(origin_list, sec_origin);
}
- base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI},
- base::BindOnce(callback, origin_list, user_data));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(callback, origin_list, user_data));
}
void OnGetPasswordDataList(
config.proxy_rules().ParseFromString(proxy_uri_);
base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
- base::BindOnce(
- &SetProxyConfigCallbackOnIOThread, &done,
- base::RetainedRef(
- BrowserContext::GetDefaultStoragePartition(browser_context())
- ->GetURLRequestContext()),
- config));
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(
+ &SetProxyConfigCallbackOnIOThread, &done,
+ base::RetainedRef(
+ BrowserContext::GetDefaultStoragePartition(browser_context())
+ ->GetURLRequestContext()),
+ config));
done.Wait();
#endif
}
content::StoragePartition* partition =
BrowserContext::GetStoragePartition(browser_context_.get(), NULL);
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&storage::QuotaManager::GetUsageAndQuota,
partition->GetQuotaManager(), url,
blink::mojom::StorageType::kTemporary,
void EWebContext::WebStorageDelete() {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&EWebContext::WebStorageDelete, base::Unretained(this)));
return;
}
void EWebContext::WebStorageDeleteForOrigin(const GURL& origin) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&EWebContext::WebStorageDeleteForOrigin,
base::Unretained(this), origin));
return;
void EWebContext::IndexedDBDelete() {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&EWebContext::IndexedDBDelete, base::Unretained(this)));
return;
}
void EWebContext::WebDBDelete(const GURL& host) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI},
- base::BindOnce(&EWebContext::WebDBDelete,
- base::Unretained(this), host));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(&EWebContext::WebDBDelete,
+ base::Unretained(this), host));
return;
}
BrowsingDataRemoverEfl* remover =
void EWebContext::FileSystemDelete(const GURL& host) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI},
- base::BindOnce(&EWebContext::FileSystemDelete,
- base::Unretained(this), host));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(&EWebContext::FileSystemDelete,
+ base::Unretained(this), host));
return;
}
BrowsingDataRemoverEfl* remover =
void EWebContext::ClearCandidateData() {
#if defined(TIZEN_AUTOFILL_SUPPORT)
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI},
- base::BindOnce(&EWebContext::ClearCandidateData,
- base::Unretained(this)));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(&EWebContext::ClearCandidateData,
+ base::Unretained(this)));
return;
}
WebDataServiceFactoryEfl* webDataServiceInstance =
rfh->BlockRequestsForFrame();
#endif
#if 0
- content::BrowserThread::PostTask(
- content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(&content::ResourceDispatcherHost::BlockRequestsForFrameFromUI,
- rfh));
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(
+ &content::ResourceDispatcherHost::BlockRequestsForFrameFromUI, rfh));
if (rvh)
rvh->Send(new EwkViewMsg_SuspendScheduledTask(rvh->GetRoutingID()));
rfh->ResumeBlockedRequestsForFrame();
#endif
#if 0
- content::BrowserThread::PostTask(
- content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(
- &content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI,
- rfh));
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(
+ &content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI,
+ rfh));
if (rvh)
rvh->Send(new EwkViewMsg_ResumeScheduledTasks(rvh->GetRoutingID()));
}
void EWebView::HandleRendererProcessCrash() {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&EWebView::InvokeWebProcessCrashedCallback,
base::Unretained(this)));
}
DCHECK(render_view_host);
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&EWebView::SendDelayedMessages, base::Unretained(this),
render_view_host));
return;
const GURL& origin,
int64_t current_quota) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&EWebView::InvokeExceededIndexedDatabaseQuotaCallback,
base::Unretained(this), origin, current_quota));
return;
}
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
- base::ThreadPool::PostTask(
- FROM_HERE, {BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&URLRequestContextGetterEfl::SetCookieStoragePath, this,
path, persist_session_cookies, file_storage));
return;