2019-11-06 22:29:34 +01:00
|
|
|
diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index 1dec904333df..e1f2ec06d93f 100644
|
2019-11-06 22:29:34 +01:00
|
|
|
--- content/app/content_main_runner_impl.cc
|
|
|
|
+++ content/app/content_main_runner_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -45,6 +45,7 @@
|
2019-11-06 22:29:34 +01:00
|
|
|
#include "base/task/post_task.h"
|
2019-11-12 17:11:44 +01:00
|
|
|
#include "base/task/thread_pool/thread_pool_instance.h"
|
2020-08-29 00:39:23 +02:00
|
|
|
#include "base/threading/hang_watcher.h"
|
2019-11-06 22:29:34 +01:00
|
|
|
+#include "base/threading/thread_restrictions.h"
|
|
|
|
#include "base/trace_event/trace_event.h"
|
|
|
|
#include "components/discardable_memory/service/discardable_shared_memory_manager.h"
|
|
|
|
#include "components/download/public/common/download_task_runner.h"
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -1028,6 +1029,11 @@ void ContentMainRunnerImpl::Shutdown() {
|
2019-11-06 22:29:34 +01:00
|
|
|
is_shutdown_ = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
+void ContentMainRunnerImpl::ShutdownOnUIThread() {
|
|
|
|
+ base::ScopedAllowBaseSyncPrimitivesForTesting allow_wait;
|
|
|
|
+ discardable_shared_memory_manager_.reset();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
// static
|
|
|
|
ContentMainRunner* ContentMainRunner::Create() {
|
|
|
|
return ContentMainRunnerImpl::Create();
|
|
|
|
diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h
|
2020-08-29 00:39:23 +02:00
|
|
|
index 50797fdcea18..33acf1f35429 100644
|
2019-11-06 22:29:34 +01:00
|
|
|
--- content/app/content_main_runner_impl.h
|
|
|
|
+++ content/app/content_main_runner_impl.h
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -51,6 +51,8 @@ class ContentMainRunnerImpl : public ContentMainRunner {
|
2019-11-06 22:29:34 +01:00
|
|
|
int Run(bool start_service_manager_only) override;
|
|
|
|
void Shutdown() override;
|
|
|
|
|
|
|
|
+ void ShutdownOnUIThread();
|
|
|
|
+
|
|
|
|
private:
|
|
|
|
int RunServiceManager(MainFunctionParams& main_function_params,
|
2020-06-09 19:48:00 +02:00
|
|
|
bool start_service_manager_only);
|
2019-11-06 22:29:34 +01:00
|
|
|
diff --git content/app/content_service_manager_main_delegate.cc content/app/content_service_manager_main_delegate.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index 1e6ad316bc67..e11e443ae694 100644
|
2019-11-06 22:29:34 +01:00
|
|
|
--- content/app/content_service_manager_main_delegate.cc
|
|
|
|
+++ content/app/content_service_manager_main_delegate.cc
|
2020-07-08 19:23:29 +02:00
|
|
|
@@ -174,4 +174,8 @@ void ContentServiceManagerMainDelegate::SetStartServiceManagerOnly(
|
2019-11-06 22:29:34 +01:00
|
|
|
start_service_manager_only_ = start_service_manager_only;
|
|
|
|
}
|
|
|
|
|
|
|
|
+void ContentServiceManagerMainDelegate::ShutdownOnUIThread() {
|
|
|
|
+ content_main_runner_->ShutdownOnUIThread();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
} // namespace content
|
|
|
|
diff --git content/app/content_service_manager_main_delegate.h content/app/content_service_manager_main_delegate.h
|
2020-07-08 19:23:29 +02:00
|
|
|
index ae9796957e51..f26a578d60ed 100644
|
2019-11-06 22:29:34 +01:00
|
|
|
--- content/app/content_service_manager_main_delegate.h
|
|
|
|
+++ content/app/content_service_manager_main_delegate.h
|
|
|
|
@@ -18,7 +18,8 @@ namespace content {
|
|
|
|
|
|
|
|
class ContentMainRunnerImpl;
|
|
|
|
|
|
|
|
-class ContentServiceManagerMainDelegate : public service_manager::MainDelegate {
|
|
|
|
+class CONTENT_EXPORT ContentServiceManagerMainDelegate :
|
|
|
|
+ public service_manager::MainDelegate {
|
|
|
|
public:
|
|
|
|
explicit ContentServiceManagerMainDelegate(const ContentMainParams& params);
|
|
|
|
~ContentServiceManagerMainDelegate() override;
|
|
|
|
@@ -46,6 +47,8 @@ class ContentServiceManagerMainDelegate : public service_manager::MainDelegate {
|
|
|
|
// full browser.
|
|
|
|
void SetStartServiceManagerOnly(bool start_service_manager_only);
|
|
|
|
|
|
|
|
+ void ShutdownOnUIThread();
|
|
|
|
+
|
|
|
|
private:
|
|
|
|
ContentMainParams content_main_params_;
|
|
|
|
std::unique_ptr<ContentMainRunnerImpl> content_main_runner_;
|