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

Side by Side Diff: chrome/browser/gpu_process_host.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/browser/gpu_process_host.h" 5 #include "chrome/browser/gpu_process_host.h"
6 6
7 #include "app/app_switches.h" 7 #include "app/app_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/thread.h" 10 #include "base/thread.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 namespace { 216 namespace {
217 217
218 void SendDelayedReply(IPC::Message* reply_msg) { 218 void SendDelayedReply(IPC::Message* reply_msg) {
219 GpuProcessHost::Get()->Send(reply_msg); 219 GpuProcessHost::Get()->Send(reply_msg);
220 } 220 }
221 221
222 void GetViewXIDDispatcher(gfx::NativeViewId id, IPC::Message* reply_msg) { 222 void GetViewXIDDispatcher(gfx::NativeViewId id, IPC::Message* reply_msg) {
223 XID xid; 223 XID xid;
224 224
225 GtkNativeViewManager* manager = Singleton<GtkNativeViewManager>::get(); 225 GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance();
226 if (!manager->GetPermanentXIDForId(&xid, id)) { 226 if (!manager->GetPermanentXIDForId(&xid, id)) {
227 DLOG(ERROR) << "Can't find XID for view id " << id; 227 DLOG(ERROR) << "Can't find XID for view id " << id;
228 xid = 0; 228 xid = 0;
229 } 229 }
230 230
231 GpuHostMsg_GetViewXID::WriteReplyParams(reply_msg, xid); 231 GpuHostMsg_GetViewXID::WriteReplyParams(reply_msg, xid);
232 232
233 // Have to reply from IO thread. 233 // Have to reply from IO thread.
234 BrowserThread::PostTask( 234 BrowserThread::PostTask(
235 BrowserThread::IO, FROM_HERE, 235 BrowserThread::IO, FROM_HERE,
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 #elif defined(OS_POSIX) 529 #elif defined(OS_POSIX)
530 false, // Never use the zygote (GPU plugin can't be sandboxed). 530 false, // Never use the zygote (GPU plugin can't be sandboxed).
531 base::environment_vector(), 531 base::environment_vector(),
532 #endif 532 #endif
533 cmd_line); 533 cmd_line);
534 534
535 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents", 535 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents",
536 kLaunched, kGPUProcessLifetimeEvent_Max); 536 kLaunched, kGPUProcessLifetimeEvent_Max);
537 return true; 537 return true;
538 } 538 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698