
ChildProcess shuts down its ChildThread and destroys it before shutting down its IOThread. Since the ChildThread owns the PowerMonitor, this means that unlike the brower process's IOThread, it's unsafe to use PowerMonitor on a ChildProcess's IOThread. This CL fixes that by making PowerMonitor a leaked global object. TBR=vmiura@chromium.org BUG=967993 Change-Id: I9314f886b0bbd103e7ed1266a6c80256aebe1266 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1643781 Commit-Queue: Matt Menke <mmenke@chromium.org> Reviewed-by: Peter Beverloo <peter@chromium.org> Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Reviewed-by: Eric Roman <eroman@chromium.org> Reviewed-by: Shakti Sahu <shaktisahu@chromium.org> Reviewed-by: Nasko Oskov <nasko@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Mark Seaborn <mseaborn@chromium.org> Reviewed-by: Kurt Horimoto <kkhorimoto@chromium.org> Reviewed-by: Alexander Alekseev <alemate@chromium.org> Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Colin Blundell <blundell@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#670554}
31 lines
936 B
C++
31 lines
936 B
C++
// Copyright 2018 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 CONTENT_BROWSER_STARTUP_DATA_IMPL_H_
|
|
#define CONTENT_BROWSER_STARTUP_DATA_IMPL_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "base/callback.h"
|
|
#include "content/browser/browser_process_sub_thread.h"
|
|
#include "content/common/content_export.h"
|
|
#include "content/public/browser/startup_data.h"
|
|
#include "mojo/core/embedder/scoped_ipc_support.h"
|
|
|
|
namespace content {
|
|
|
|
// The browser implementation of StartupData.
|
|
struct CONTENT_EXPORT StartupDataImpl : public StartupData {
|
|
StartupDataImpl();
|
|
~StartupDataImpl() override;
|
|
|
|
std::unique_ptr<BrowserProcessSubThread> ipc_thread;
|
|
std::unique_ptr<mojo::core::ScopedIPCSupport> mojo_ipc_support;
|
|
base::OnceClosure service_manager_shutdown_closure;
|
|
};
|
|
|
|
} // namespace content
|
|
|
|
#endif // CONTENT_BROWSER_STARTUP_DATA_IMPL_H_
|