2010-10-03 23:04:50 +02:00
|
|
|
// Copyright (c) 2010 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright (c) 2010 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.
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#include "libcef/cef_process_sub_thread.h"
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
#include "build/build_config.h"
|
2012-01-10 00:46:23 +01:00
|
|
|
#include "base/compiler_specific.h"
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
CefProcessSubThread::CefProcessSubThread(CefThread::ID identifier)
|
|
|
|
: CefThread(identifier) {}
|
|
|
|
|
|
|
|
CefProcessSubThread::CefProcessSubThread(CefThread::ID identifier,
|
|
|
|
MessageLoop* message_loop)
|
|
|
|
: CefThread(identifier, message_loop) {}
|
|
|
|
|
|
|
|
CefProcessSubThread::~CefProcessSubThread() {
|
|
|
|
// We cannot rely on our base class to stop the thread since we want our
|
|
|
|
// CleanUp function to run.
|
|
|
|
Stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefProcessSubThread::CleanUp() {
|
|
|
|
// Flush any remaining messages. This ensures that any accumulated
|
|
|
|
// Task objects get destroyed before we exit, which avoids noise in
|
|
|
|
// purify leak-test results.
|
|
|
|
MessageLoop::current()->RunAllPending();
|
|
|
|
|
2012-02-10 17:22:47 +01:00
|
|
|
CefThread::Cleanup();
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|