Commit 70e0e659 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[BrowserThread] Remove unused SetIOThreadDelegate method

The last caller was removed in crrev.com/669295.


Bug: 934009
Change-Id: I3cabd207d231c95787ad4511abbf296fa39feebb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1902271
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713581}
parent 350be2da
......@@ -17,7 +17,6 @@
#include "content/browser/utility_process_host.h"
#include "content/common/child_process_host_impl.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
#include "content/public/browser/browser_thread_delegate.h"
#include "content/public/common/process_type.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request.h"
......@@ -32,20 +31,6 @@
namespace content {
namespace {
BrowserThreadDelegate* g_io_thread_delegate = nullptr;
} // namespace
// static
void BrowserThread::SetIOThreadDelegate(BrowserThreadDelegate* delegate) {
// |delegate| can only be set/unset while BrowserThread::IO isn't up.
DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::IO));
// and it cannot be set twice.
DCHECK(!g_io_thread_delegate || !delegate);
g_io_thread_delegate = delegate;
}
BrowserProcessSubThread::BrowserProcessSubThread(BrowserThread::ID identifier)
: base::Thread(BrowserThreadImpl::GetThreadName(identifier)),
identifier_(identifier) {
......@@ -122,9 +107,6 @@ void BrowserProcessSubThread::CleanUp() {
if (BrowserThread::CurrentlyOn(BrowserThread::IO))
IOThreadCleanUp();
if (identifier_ == BrowserThread::IO && g_io_thread_delegate)
g_io_thread_delegate->CleanUp();
notification_service_.reset();
#if defined(OS_WIN)
......@@ -136,12 +118,6 @@ void BrowserProcessSubThread::CompleteInitializationOnBrowserThread() {
DCHECK_CALLED_ON_VALID_THREAD(browser_thread_checker_);
notification_service_ = std::make_unique<NotificationServiceImpl>();
if (identifier_ == BrowserThread::IO && g_io_thread_delegate) {
// Allow blocking calls while initializing the IO thread.
base::ScopedAllowBlocking allow_blocking_for_init;
g_io_thread_delegate->Init();
}
}
// Mark following two functions as NOINLINE so the compiler doesn't merge
......
......@@ -99,7 +99,6 @@ jumbo_source_set("browser_sources") {
"browser_task_traits.h",
"browser_thread.cc",
"browser_thread.h",
"browser_thread_delegate.h",
"browser_url_handler.h",
"browsing_data_filter_builder.h",
"browsing_data_remover.h",
......
......@@ -21,7 +21,6 @@
namespace content {
class BrowserThreadDelegate;
class BrowserThreadImpl;
// Use DCHECK_CURRENTLY_ON(BrowserThread::ID) to assert that a function can only
......@@ -121,16 +120,6 @@ class CONTENT_EXPORT BrowserThread {
// sets identifier to its ID. Otherwise returns false.
static bool GetCurrentThreadIdentifier(ID* identifier) WARN_UNUSED_RESULT;
// Sets the delegate for BrowserThread::IO.
//
// Only one delegate may be registered at a time. The delegate may be
// unregistered by providing a nullptr pointer.
//
// The delegate can only be registered through this call before
// BrowserThreadImpl(BrowserThread::IO) is created and unregistered after
// it was destroyed and its underlying thread shutdown.
static void SetIOThreadDelegate(BrowserThreadDelegate* delegate);
// Use these templates in conjunction with RefCountedThreadSafe or scoped_ptr
// when you want to ensure that an object is deleted on a specific thread.
// This is needed when an object can hop between threads (i.e. UI -> IO ->
......
// Copyright (c) 2012 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_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_
#define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_
#include "content/common/content_export.h"
namespace content {
// A Delegate for content embedders to perform extra initialization/cleanup on
// BrowserThread::IO.
class BrowserThreadDelegate {
public:
virtual ~BrowserThreadDelegate() = default;
// Called prior to completing initialization of BrowserThread::IO.
virtual void Init() = 0;
// Called during teardown of BrowserThread::IO.
virtual void CleanUp() = 0;
};
} // namespace content
#endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_
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