diff options
author | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-08 10:43:08 +0000 |
---|---|---|
committer | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-08 10:43:08 +0000 |
commit | 687b96058845cdaa59f9d81c468f81222e60bdfd (patch) | |
tree | 9c97670a35e5f6abe40f3c4bf50ee7b5a257a0e3 /chrome/gpu | |
parent | d22618c155cd40c5740755a5f0bcaab59f13f9a7 (diff) | |
download | chromium_src-687b96058845cdaa59f9d81c468f81222e60bdfd.zip chromium_src-687b96058845cdaa59f9d81c468f81222e60bdfd.tar.gz chromium_src-687b96058845cdaa59f9d81c468f81222e60bdfd.tar.bz2 |
Add a new GetInstance() method for singleton classes, take 2.
This is a small step towards making all singleton classes use the Singleton<T> pattern within their code and not expect the callers to know about it.
This CL includes all files except those under chrome/browser, chrome/net, chrome/service and third_party/WebKit (these will be done in future CLs).
Suggested files to focus for reviewers:
- joi@ for files under src/ceee
- tommi@ for files under src/chrome_frame
- maruel@ for the rest of the files.
BUG=65298
TEST=all existing tests should continue to pass.
Review URL: http://codereview.chromium.org/5581008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68577 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu')
-rw-r--r-- | chrome/gpu/gpu_channel.cc | 4 | ||||
-rw-r--r-- | chrome/gpu/gpu_video_service.cc | 5 | ||||
-rw-r--r-- | chrome/gpu/gpu_video_service.h | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/chrome/gpu/gpu_channel.cc b/chrome/gpu/gpu_channel.cc index 10641ed..9d3ebd3 100644 --- a/chrome/gpu/gpu_channel.cc +++ b/chrome/gpu/gpu_channel.cc @@ -206,7 +206,7 @@ void GpuChannel::OnCreateVideoDecoder(int32 context_route_id, int32 decoder_host_id) { #if defined(ENABLE_GPU) VLOG(1) << "GpuChannel::OnCreateVideoDecoder"; - GpuVideoService* service = GpuVideoService::get(); + GpuVideoService* service = GpuVideoService::GetInstance(); if (service == NULL) { // TODO(hclam): Need to send a failure message. return; @@ -228,7 +228,7 @@ void GpuChannel::OnCreateVideoDecoder(int32 context_route_id, void GpuChannel::OnDestroyVideoDecoder(int32 decoder_id) { #if defined(ENABLE_GPU) LOG(ERROR) << "GpuChannel::OnDestroyVideoDecoder"; - GpuVideoService* service = GpuVideoService::get(); + GpuVideoService* service = GpuVideoService::GetInstance(); if (service == NULL) return; service->DestroyVideoDecoder(&router_, decoder_id); diff --git a/chrome/gpu/gpu_video_service.cc b/chrome/gpu/gpu_video_service.cc index 03025b8..ca9d482 100644 --- a/chrome/gpu/gpu_video_service.cc +++ b/chrome/gpu/gpu_video_service.cc @@ -23,6 +23,11 @@ GpuVideoService::~GpuVideoService() { UnintializeGpuVideoService(); } +// static +GpuVideoService* GpuVideoService::GetInstance() { + return Singleton<GpuVideoService>::get(); +} + void GpuVideoService::OnChannelConnected(int32 peer_pid) { LOG(ERROR) << "GpuVideoService::OnChannelConnected"; } diff --git a/chrome/gpu/gpu_video_service.h b/chrome/gpu/gpu_video_service.h index e6af444..b9ad6da 100644 --- a/chrome/gpu/gpu_video_service.h +++ b/chrome/gpu/gpu_video_service.h @@ -14,9 +14,10 @@ class GpuChannel; -class GpuVideoService : public IPC::Channel::Listener, - public Singleton<GpuVideoService> { +class GpuVideoService : public IPC::Channel::Listener { public: + static GpuVideoService* GetInstance(); + // IPC::Channel::Listener. virtual void OnChannelConnected(int32 peer_pid); virtual void OnChannelError(); |