Commit 4074761b authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

Remove unused content::ThreadSafeSender.

Tbr: lazyboy
Change-Id: I2c05fe707f912a7de3d32e2cccdcb458b8c6482b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390596Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804656}
parent 6de1a7b8
...@@ -69,8 +69,6 @@ target(link_target_type, "child") { ...@@ -69,8 +69,6 @@ target(link_target_type, "child") {
"runtime_features.h", "runtime_features.h",
"scoped_child_process_reference.cc", "scoped_child_process_reference.cc",
"scoped_child_process_reference.h", "scoped_child_process_reference.h",
"thread_safe_sender.cc",
"thread_safe_sender.h",
"webthemeengine_impl_android.cc", "webthemeengine_impl_android.cc",
"webthemeengine_impl_android.h", "webthemeengine_impl_android.h",
"webthemeengine_impl_conversions.cc", "webthemeengine_impl_conversions.cc",
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "content/child/browser_exposed_child_interfaces.h" #include "content/child/browser_exposed_child_interfaces.h"
#include "content/child/child_process.h" #include "content/child/child_process.h"
#include "content/child/thread_safe_sender.h"
#include "content/common/child_process.mojom.h" #include "content/common/child_process.mojom.h"
#include "content/common/field_trial_recorder.mojom.h" #include "content/common/field_trial_recorder.mojom.h"
#include "content/common/in_process_child_thread_params.h" #include "content/common/in_process_child_thread_params.h"
...@@ -593,8 +592,6 @@ void ChildThreadImpl::Init(const Options& options) { ...@@ -593,8 +592,6 @@ void ChildThreadImpl::Init(const Options& options) {
} }
sync_message_filter_ = channel_->CreateSyncMessageFilter(); sync_message_filter_ = channel_->CreateSyncMessageFilter();
thread_safe_sender_ =
new ThreadSafeSender(main_thread_runner_, sync_message_filter_.get());
// In single process mode, browser-side tracing and memory will cover the // In single process mode, browser-side tracing and memory will cover the
// whole process including renderers. // whole process including renderers.
......
...@@ -62,7 +62,6 @@ class BackgroundTracingAgentProviderImpl; ...@@ -62,7 +62,6 @@ class BackgroundTracingAgentProviderImpl;
namespace content { namespace content {
class InProcessChildThreadParams; class InProcessChildThreadParams;
class ThreadSafeSender;
// The main thread of a child process derives from this class. // The main thread of a child process derives from this class.
class CONTENT_EXPORT ChildThreadImpl class CONTENT_EXPORT ChildThreadImpl
...@@ -118,13 +117,6 @@ class CONTENT_EXPORT ChildThreadImpl ...@@ -118,13 +117,6 @@ class CONTENT_EXPORT ChildThreadImpl
return sync_message_filter_.get(); return sync_message_filter_.get();
} }
// The getter should only be called on the main thread, however the
// IPC::Sender it returns may be safely called on any thread including
// the main thread.
ThreadSafeSender* thread_safe_sender() const {
return thread_safe_sender_.get();
}
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner() const { scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner() const {
return main_thread_runner_; return main_thread_runner_;
} }
...@@ -229,8 +221,6 @@ class CONTENT_EXPORT ChildThreadImpl ...@@ -229,8 +221,6 @@ class CONTENT_EXPORT ChildThreadImpl
// Allows threads other than the main thread to send sync messages. // Allows threads other than the main thread to send sync messages.
scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_;
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
// Implements message routing functionality to the consumers of // Implements message routing functionality to the consumers of
// ChildThreadImpl. // ChildThreadImpl.
ChildThreadMessageRouter router_; ChildThreadMessageRouter router_;
......
// Copyright (c) 2013 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 "content/child/thread_safe_sender.h"
#include "base/single_thread_task_runner.h"
#include "content/child/child_thread_impl.h"
#include "ipc/ipc_sync_message_filter.h"
namespace content {
ThreadSafeSender::~ThreadSafeSender() {
}
ThreadSafeSender::ThreadSafeSender(
const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner,
const scoped_refptr<IPC::SyncMessageFilter>& sync_filter)
: main_task_runner_(main_task_runner), sync_filter_(sync_filter) {
}
bool ThreadSafeSender::Send(IPC::Message* msg) {
if (main_task_runner_->BelongsToCurrentThread())
return ChildThreadImpl::current()->Send(msg);
return sync_filter_->Send(msg);
}
} // namespace content
// Copyright (c) 2013 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_CHILD_THREAD_SAFE_SENDER_H_
#define CONTENT_CHILD_THREAD_SAFE_SENDER_H_
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
#include "ipc/ipc_sender.h"
namespace base {
class SingleThreadTaskRunner;
}
namespace IPC {
class SyncMessageFilter;
}
namespace content {
class ChildThreadImpl;
// The class of Sender returned by ChildThreadImpl::thread_safe_sender().
class CONTENT_EXPORT ThreadSafeSender
: public IPC::Sender,
public base::RefCountedThreadSafe<ThreadSafeSender> {
public:
bool Send(IPC::Message* msg) override;
protected:
ThreadSafeSender(
const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner,
const scoped_refptr<IPC::SyncMessageFilter>& sync_filter);
~ThreadSafeSender() override;
private:
friend class ChildThreadImpl; // for construction
friend class IndexedDBDispatcherTest;
friend class WebIDBCursorImplTest;
friend class base::RefCountedThreadSafe<ThreadSafeSender>;
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
scoped_refptr<IPC::SyncMessageFilter> sync_filter_;
DISALLOW_COPY_AND_ASSIGN(ThreadSafeSender);
};
} // namespace content
#endif // CONTENT_CHILD_THREAD_SAFE_SENDER_H_
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
#include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/frame_sinks/copy_output_request.h"
#include "components/viz/common/switches.h" #include "components/viz/common/switches.h"
#include "content/child/runtime_features.h" #include "content/child/runtime_features.h"
#include "content/child/thread_safe_sender.h"
#include "content/common/buildflags.h" #include "content/common/buildflags.h"
#include "content/common/content_constants_internal.h" #include "content/common/content_constants_internal.h"
#include "content/common/frame_messages.h" #include "content/common/frame_messages.h"
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "components/url_formatter/url_formatter.h" #include "components/url_formatter/url_formatter.h"
#include "content/child/child_process.h" #include "content/child/child_process.h"
#include "content/child/thread_safe_sender.h"
#include "content/common/frame_messages.h" #include "content/common/frame_messages.h"
#include "content/public/common/content_features.h" #include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "content/child/thread_safe_sender.h"
#include "content/public/common/content_features.h" #include "content/public/common/content_features.h"
#include "content/renderer/service_worker/controller_service_worker_connector.h" #include "content/renderer/service_worker/controller_service_worker_connector.h"
#include "content/renderer/service_worker/web_service_worker_provider_impl.h" #include "content/renderer/service_worker/web_service_worker_provider_impl.h"
......
...@@ -43,7 +43,9 @@ struct PortId; ...@@ -43,7 +43,9 @@ struct PortId;
// two: // two:
// 1) A content::WorkerThreadMessageFilter, so that we can receive IPC directly // 1) A content::WorkerThreadMessageFilter, so that we can receive IPC directly
// on worker thread. // on worker thread.
// 2) A content::ThreadSafeSender, so we can safely send IPC from worker thread. // 2) A thread-safe version of IPC::Sender, so we can safely send IPC from
// worker thread (this TODO formerly referred to content::ThreadSafeSender
// which no longer exists).
class WorkerThreadDispatcher : public content::RenderThreadObserver, class WorkerThreadDispatcher : public content::RenderThreadObserver,
public IPC::Sender { public IPC::Sender {
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment