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

Unified Diff: chrome/gpu/gpu_thread.cc

Issue 4508004: gtk: refactor copy-pasted code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « no previous file | chrome/plugin/plugin_thread.cc » ('j') | gfx/gtk_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/gpu_thread.cc
diff --git a/chrome/gpu/gpu_thread.cc b/chrome/gpu/gpu_thread.cc
index 8c1059f54395510f4daa533e18df3878bd3e13b4..85aea62b6d283191eeb486b6ce7045f6c1a4453a 100644
--- a/chrome/gpu/gpu_thread.cc
+++ b/chrome/gpu/gpu_thread.cc
@@ -15,6 +15,7 @@
#include "chrome/common/gpu_info.h"
#include "chrome/common/gpu_messages.h"
#include "chrome/gpu/gpu_info_collector.h"
+#include "gfx/gtk_util.h"
#include "ipc/ipc_channel_handle.h"
#if defined(OS_WIN)
@@ -43,22 +44,7 @@ GpuThread::GpuThread() {
// rethink whether initializing Gtk is really necessary or whether we
// should just send the display connection down to the GPUProcessor.
g_thread_init(NULL);
- const std::vector<std::string>& args =
- CommandLine::ForCurrentProcess()->argv();
- int argc = args.size();
- scoped_array<char *> argv(new char *[argc + 1]);
- for (size_t i = 0; i < args.size(); ++i) {
- // TODO(piman@google.com): can gtk_init modify argv? Just being safe
- // here.
- argv[i] = strdup(args[i].c_str());
- }
- argv[argc] = NULL;
- char **argv_pointer = argv.get();
-
- gtk_init(&argc, &argv_pointer);
- for (size_t i = 0; i < args.size(); ++i) {
- free(argv[i]);
- }
+ gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess());
x11_util::SetDefaultX11ErrorHandlers();
}
#endif
« no previous file with comments | « no previous file | chrome/plugin/plugin_thread.cc » ('j') | gfx/gtk_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698