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.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_MAIN_EXTRA_PARTS_CEF_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_MAIN_EXTRA_PARTS_CEF_H_
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2020-07-04 04:51:17 +02:00
|
|
|
#include "libcef/browser/request_context_impl.h"
|
|
|
|
|
2021-11-10 22:57:31 +01:00
|
|
|
#include "base/task/single_thread_task_runner.h"
|
2020-06-25 04:34:12 +02:00
|
|
|
#include "chrome/browser/chrome_browser_main_extra_parts.h"
|
|
|
|
|
|
|
|
// Wrapper that owns and initialize the browser memory-related extra parts.
|
|
|
|
class ChromeBrowserMainExtraPartsCef : public ChromeBrowserMainExtraParts {
|
|
|
|
public:
|
|
|
|
ChromeBrowserMainExtraPartsCef();
|
2021-12-06 21:40:25 +01:00
|
|
|
|
|
|
|
ChromeBrowserMainExtraPartsCef(const ChromeBrowserMainExtraPartsCef&) =
|
|
|
|
delete;
|
|
|
|
ChromeBrowserMainExtraPartsCef& operator=(
|
|
|
|
const ChromeBrowserMainExtraPartsCef&) = delete;
|
|
|
|
|
2020-06-25 04:34:12 +02:00
|
|
|
~ChromeBrowserMainExtraPartsCef() override;
|
|
|
|
|
2020-07-04 04:51:17 +02:00
|
|
|
CefRefPtr<CefRequestContextImpl> request_context() const {
|
|
|
|
return global_request_context_;
|
|
|
|
}
|
|
|
|
|
2020-06-25 04:34:12 +02:00
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> background_task_runner() const {
|
|
|
|
return background_task_runner_;
|
|
|
|
}
|
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner() const {
|
|
|
|
return user_visible_task_runner_;
|
|
|
|
}
|
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> user_blocking_task_runner()
|
|
|
|
const {
|
|
|
|
return user_blocking_task_runner_;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
// ChromeBrowserMainExtraParts overrides.
|
2022-01-25 21:26:51 +01:00
|
|
|
void PostProfileInit(Profile* profile, bool is_initial_profile) override;
|
2023-11-29 02:33:44 +01:00
|
|
|
void PostBrowserStart() override;
|
2020-09-25 03:40:47 +02:00
|
|
|
void PreMainMessageLoopRun() override;
|
2020-06-25 04:34:12 +02:00
|
|
|
|
2020-07-04 04:51:17 +02:00
|
|
|
CefRefPtr<CefRequestContextImpl> global_request_context_;
|
|
|
|
|
2020-06-25 04:34:12 +02:00
|
|
|
// Blocking task runners exposed via CefTaskRunner. For consistency with
|
|
|
|
// previous named thread behavior always execute all pending tasks before
|
|
|
|
// shutdown (e.g. to make sure critical data is saved to disk).
|
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> background_task_runner_;
|
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner_;
|
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> user_blocking_task_runner_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_MAIN_EXTRA_PARTS_CEF_H_
|