summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu/browser_gpu_channel_host_factory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/gpu/browser_gpu_channel_host_factory.cc')
-rw-r--r--content/browser/gpu/browser_gpu_channel_host_factory.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 687ef0c..5f20475 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -15,6 +15,8 @@
namespace content {
+BrowserGpuChannelHostFactory* BrowserGpuChannelHostFactory::instance_ = NULL;
+
BrowserGpuChannelHostFactory::CreateRequest::CreateRequest()
: event(false, false),
route_id(MSG_ROUTING_NONE) {
@@ -32,27 +34,22 @@ BrowserGpuChannelHostFactory::EstablishRequest::~EstablishRequest() {
}
void BrowserGpuChannelHostFactory::Initialize() {
- new BrowserGpuChannelHostFactory();
+ instance_ = new BrowserGpuChannelHostFactory();
}
void BrowserGpuChannelHostFactory::Terminate() {
- delete instance();
-}
-
-BrowserGpuChannelHostFactory* BrowserGpuChannelHostFactory::Get() {
- return static_cast<BrowserGpuChannelHostFactory*>(instance());
+ delete instance_;
+ instance_ = NULL;
}
BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory()
: gpu_client_id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()),
shutdown_event_(new base::WaitableEvent(true, false)),
gpu_host_id_(0) {
- set_instance(this);
}
BrowserGpuChannelHostFactory::~BrowserGpuChannelHostFactory() {
shutdown_event_->Signal();
- set_instance(NULL);
}
bool BrowserGpuChannelHostFactory::IsMainThread() {