| OLD | NEW |
| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, |
| 236 NewRunnableFunction(&SendDelayedReply, reply_msg)); | 236 NewRunnableFunction(&SendDelayedReply, reply_msg)); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void ReleaseXIDDispatcher(unsigned long xid) { | 239 void ReleaseXIDDispatcher(unsigned long xid) { |
| 240 GtkNativeViewManager* manager = Singleton<GtkNativeViewManager>::get(); | 240 GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance(); |
| 241 manager->ReleasePermanentXID(xid); | 241 manager->ReleasePermanentXID(xid); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void ResizeXIDDispatcher(unsigned long xid, gfx::Size size, | 244 void ResizeXIDDispatcher(unsigned long xid, gfx::Size size, |
| 245 IPC::Message *reply_msg) { | 245 IPC::Message *reply_msg) { |
| 246 GdkWindow* window = reinterpret_cast<GdkWindow*>(gdk_xid_table_lookup(xid)); | 246 GdkWindow* window = reinterpret_cast<GdkWindow*>(gdk_xid_table_lookup(xid)); |
| 247 if (window) { | 247 if (window) { |
| 248 Display* display = GDK_WINDOW_XDISPLAY(window); | 248 Display* display = GDK_WINDOW_XDISPLAY(window); |
| 249 gdk_window_resize(window, size.width(), size.height()); | 249 gdk_window_resize(window, size.width(), size.height()); |
| 250 XSync(display, False); | 250 XSync(display, False); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |