add taskpriority when creating sequences task runners
This commit is contained in:
parent
1f2d229862
commit
b552ad7065
4 changed files with 12 additions and 14 deletions
|
@ -135,10 +135,11 @@ AtomBrowserContext::CreateURLRequestJobFactory(
|
|||
job_factory->SetProtocolHandler(
|
||||
url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler));
|
||||
job_factory->SetProtocolHandler(
|
||||
url::kFileScheme, base::WrapUnique(new asar::AsarProtocolHandler(
|
||||
base::CreateSequencedTaskRunnerWithTraits(
|
||||
{base::MayBlock(),
|
||||
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))));
|
||||
url::kFileScheme,
|
||||
base::WrapUnique(
|
||||
new asar::AsarProtocolHandler(base::CreateTaskRunnerWithTraits(
|
||||
{base::MayBlock(), base::TaskPriority::USER_VISIBLE,
|
||||
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))));
|
||||
job_factory->SetProtocolHandler(
|
||||
url::kHttpScheme,
|
||||
base::WrapUnique(new HttpProtocolHandler(url::kHttpScheme)));
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include "atom/common/atom_constants.h"
|
||||
#include "base/task_scheduler/post_task.h"
|
||||
#include "base/threading/sequenced_worker_pool.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
@ -33,7 +32,8 @@ void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr<base::Value> options) {
|
|||
} else {
|
||||
asar::URLRequestAsarJob::Initialize(
|
||||
base::CreateSequencedTaskRunnerWithTraits(
|
||||
{base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}),
|
||||
{base::MayBlock(), base::TaskPriority::USER_VISIBLE,
|
||||
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}),
|
||||
base::FilePath(file_path));
|
||||
asar::URLRequestAsarJob::Start();
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/task_scheduler/post_task.h"
|
||||
#include "base/threading/sequenced_worker_pool.h"
|
||||
#include "brightray/browser/browser_client.h"
|
||||
#include "brightray/browser/net/require_ct_delegate.h"
|
||||
#include "brightray/browser/net_log.h"
|
||||
|
@ -73,14 +72,14 @@ URLRequestContextGetter::Delegate::CreateURLRequestJobFactory(
|
|||
}
|
||||
protocol_handlers->clear();
|
||||
|
||||
auto runner = base::CreateSequencedTaskRunnerWithTraits(
|
||||
{base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
|
||||
|
||||
job_factory->SetProtocolHandler(
|
||||
url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler));
|
||||
job_factory->SetProtocolHandler(
|
||||
url::kFileScheme,
|
||||
base::WrapUnique(new net::FileProtocolHandler(runner)));
|
||||
base::WrapUnique(
|
||||
new net::FileProtocolHandler(base::CreateTaskRunnerWithTraits(
|
||||
{base::MayBlock(), base::TaskPriority::USER_VISIBLE,
|
||||
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))));
|
||||
|
||||
return std::move(job_factory);
|
||||
}
|
||||
|
@ -227,7 +226,6 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
|
|||
}
|
||||
|
||||
// --proxy-server
|
||||
net::DhcpProxyScriptFetcherFactory dhcp_factory;
|
||||
if (command_line.HasSwitch(switches::kNoProxyServer)) {
|
||||
storage_->set_proxy_service(net::ProxyService::CreateDirect());
|
||||
} else if (command_line.HasSwitch(switches::kProxyServer)) {
|
||||
|
|
|
@ -15,7 +15,6 @@ using base::PlatformThreadRef;
|
|||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task_scheduler/post_task.h"
|
||||
#include "base/threading/sequenced_worker_pool.h"
|
||||
#include "chrome/browser/media/desktop_media_list_observer.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "media/base/video_util.h"
|
||||
|
@ -237,7 +236,7 @@ NativeDesktopMediaList::NativeDesktopMediaList(
|
|||
observer_(NULL),
|
||||
weak_factory_(this) {
|
||||
capture_task_runner_ = base::CreateSequencedTaskRunnerWithTraits(
|
||||
{base::MayBlock()});
|
||||
{base::MayBlock(), base::TaskPriority::USER_VISIBLE});
|
||||
}
|
||||
|
||||
NativeDesktopMediaList::~NativeDesktopMediaList() {
|
||||
|
|
Loading…
Reference in a new issue