Skip to content

Commit

Permalink
Makes BackgroundServiceLoader destroy loader on background thread
Browse files Browse the repository at this point in the history
As the loader is used on the background thread it should also be
destroyed on the background thread. This way all usage is kept to a
single thread so that if the loader uses resources that require access
on the same thread we don't run into issues.

BUG=372585
TEST=covered by tests
R=davemoore@chromium.org

Review URL: https://codereview.chromium.org/276573013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270212 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
sky@chromium.org committed May 13, 2014
1 parent 9a79ccb commit fdaf9d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
2 changes: 2 additions & 0 deletions mojo/service_manager/background_service_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ void BackgroundServiceLoader::OnServiceErrorOnBackgroundThread(

void BackgroundServiceLoader::ShutdownOnBackgroundThread() {
delete background_loader_;
// Destroy |loader_| on the thread it's actually used on.
loader_.reset();
}

} // namespace mojo
38 changes: 0 additions & 38 deletions tools/valgrind/drmemory/suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -512,41 +512,3 @@ NPCTRL.dll!DllGetClassObject
NPCTRL.dll!DllGetClassObject
NPCTRL.dll!DllGetClassObject
NPCTRL.dll!DllGetClassObject

GDI USAGE ERROR
name=http://crbug.com/372512
system call NtUserCallOneParam.RELEASEDC
USER32.dll!ReleaseDC
*!gfx::NativeViewGLSurfaceOSMesa::Destroy
...
*!mojo::services::CommandBufferImpl::~CommandBufferImpl
...
*!mojo::services::NativeViewportImpl::~NativeViewportImpl
...
*!mojo::Application::~Application
...
*!mojo::BackgroundServiceLoader::~BackgroundServiceLoader
...
*!mojo::ServiceManager::~ServiceManager
*!mojo::shell::Context::~Context
*!base::DeleteHelper<>::DoDelete

HANDLE LEAK
name=http://crbug.com/372585
system call NtUserCreateWindowEx
...
USER32.dll!CreateWindowExW
gfx.dll!gfx::WindowImpl::Init
mojo_native_viewport_service.dll!mojo::services::NativeViewportWin::Init
mojo_native_viewport_service.dll!mojo::services::NativeViewportImpl::Create
mojo_native_viewport_service.dll!mojo::NativeViewportStub::Accept
mojo_native_viewport_service.dll!mojo::internal::Router::HandleIncomingMessage
mojo_native_viewport_service.dll!mojo::internal::MessageHeaderValidator::Accept
mojo_native_viewport_service.dll!mojo::ReadAndDispatchMessage
...
base.dll!base::MessageLoop::RunTask
base.dll!base::MessageLoop::DeferOrRunPendingTask
base.dll!base::MessageLoop::DoWork
base.dll!base::MessagePumpDefault::Run
...
base.dll!base::Thread::ThreadMain

0 comments on commit fdaf9d1

Please sign in to comment.