Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(798)

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 9667012: Fix --single-process mode issues with GpuChannelHostFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 687ef0cf16c0407ff00aa6f9cafde021eaa01a9c..5f20475f5bae32743bb7b8af7f20baa907ee6d13 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() {

Powered by Google App Engine
This is Rietveld 408576698