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

Side by Side Diff: chrome/gpu/gpu_video_service.cc

Issue 5581008: Add a new GetInstance() method for singleton classes, take 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/gpu_messages.h" 5 #include "chrome/common/gpu_messages.h"
6 #include "chrome/gpu/gpu_channel.h" 6 #include "chrome/gpu/gpu_channel.h"
7 #include "chrome/gpu/gpu_video_decoder.h" 7 #include "chrome/gpu/gpu_video_decoder.h"
8 #include "chrome/gpu/gpu_video_service.h" 8 #include "chrome/gpu/gpu_video_service.h"
9 9
10 struct GpuVideoService::GpuVideoDecoderInfo { 10 struct GpuVideoService::GpuVideoDecoderInfo {
11 scoped_refptr<GpuVideoDecoder> decoder; 11 scoped_refptr<GpuVideoDecoder> decoder;
12 GpuChannel* channel; 12 GpuChannel* channel;
13 }; 13 };
14 14
15 15
16 GpuVideoService::GpuVideoService() { 16 GpuVideoService::GpuVideoService() {
17 // TODO(jiesun): move this time consuming stuff out of here. 17 // TODO(jiesun): move this time consuming stuff out of here.
18 IntializeGpuVideoService(); 18 IntializeGpuVideoService();
19 } 19 }
20 20
21 GpuVideoService::~GpuVideoService() { 21 GpuVideoService::~GpuVideoService() {
22 // TODO(jiesun): move this time consuming stuff out of here. 22 // TODO(jiesun): move this time consuming stuff out of here.
23 UnintializeGpuVideoService(); 23 UnintializeGpuVideoService();
24 } 24 }
25 25
26 // static
27 GpuVideoService* GpuVideoService::GetInstance() {
28 return Singleton<GpuVideoService>::get();
29 }
30
26 void GpuVideoService::OnChannelConnected(int32 peer_pid) { 31 void GpuVideoService::OnChannelConnected(int32 peer_pid) {
27 LOG(ERROR) << "GpuVideoService::OnChannelConnected"; 32 LOG(ERROR) << "GpuVideoService::OnChannelConnected";
28 } 33 }
29 34
30 void GpuVideoService::OnChannelError() { 35 void GpuVideoService::OnChannelError() {
31 LOG(ERROR) << "GpuVideoService::OnChannelError"; 36 LOG(ERROR) << "GpuVideoService::OnChannelError";
32 } 37 }
33 38
34 void GpuVideoService::OnMessageReceived(const IPC::Message& msg) { 39 void GpuVideoService::OnMessageReceived(const IPC::Message& msg) {
35 #if 0 40 #if 0
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 decoder_host_id, decoder_id)); 72 decoder_host_id, decoder_id));
68 return true; 73 return true;
69 } 74 }
70 75
71 void GpuVideoService::DestroyVideoDecoder( 76 void GpuVideoService::DestroyVideoDecoder(
72 MessageRouter* router, 77 MessageRouter* router,
73 int32 decoder_id) { 78 int32 decoder_id) {
74 router->RemoveRoute(decoder_id); 79 router->RemoveRoute(decoder_id);
75 decoder_map_.erase(decoder_id); 80 decoder_map_.erase(decoder_id);
76 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698