2020-06-25 04:34:12 +02:00
|
|
|
// Copyright 2019 The Chromium 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 "libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h"
|
|
|
|
|
2020-07-04 04:51:17 +02:00
|
|
|
#include "libcef/browser/context.h"
|
|
|
|
|
2020-06-25 04:34:12 +02:00
|
|
|
#include "base/task/post_task.h"
|
|
|
|
|
|
|
|
ChromeBrowserMainExtraPartsCef::ChromeBrowserMainExtraPartsCef() = default;
|
|
|
|
|
|
|
|
ChromeBrowserMainExtraPartsCef::~ChromeBrowserMainExtraPartsCef() = default;
|
|
|
|
|
2020-07-04 04:51:17 +02:00
|
|
|
void ChromeBrowserMainExtraPartsCef::PostProfileInit() {
|
|
|
|
CefRequestContextSettings settings;
|
|
|
|
CefContext::Get()->PopulateGlobalRequestContextSettings(&settings);
|
|
|
|
|
|
|
|
// Create the global RequestContext.
|
|
|
|
global_request_context_ =
|
|
|
|
CefRequestContextImpl::CreateGlobalRequestContext(settings);
|
|
|
|
}
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
void ChromeBrowserMainExtraPartsCef::PreMainMessageLoopRun() {
|
2020-06-25 04:34:12 +02:00
|
|
|
background_task_runner_ = base::CreateSingleThreadTaskRunner(
|
|
|
|
{base::ThreadPool(), base::TaskPriority::BEST_EFFORT,
|
|
|
|
base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()});
|
|
|
|
user_visible_task_runner_ = base::CreateSingleThreadTaskRunner(
|
|
|
|
{base::ThreadPool(), base::TaskPriority::USER_VISIBLE,
|
|
|
|
base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()});
|
|
|
|
user_blocking_task_runner_ = base::CreateSingleThreadTaskRunner(
|
|
|
|
{base::ThreadPool(), base::TaskPriority::USER_BLOCKING,
|
|
|
|
base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()});
|
|
|
|
}
|