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

Unified Diff: blimp/client/blimp_startup.cc

Issue 1551683002: [Blimp Client] Land CL 1528243002 (Add a basic linux client for Blimp) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/client/blimp_startup.h ('k') | blimp/client/compositor/blimp_compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/blimp_startup.cc
diff --git a/blimp/client/blimp_startup.cc b/blimp/client/blimp_startup.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8e51b28cfd2bf5076eb8b4b2b4b706cbcbb7d47d
--- /dev/null
+++ b/blimp/client/blimp_startup.cc
@@ -0,0 +1,53 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "blimp/client/blimp_startup.h"
+
+#include "base/files/file_path.h"
+#include "base/lazy_instance.h"
+#include "base/logging.h"
+#include "base/message_loop/message_loop.h"
+#include "base/path_service.h"
+#include "third_party/skia/include/core/SkGraphics.h"
+#include "ui/gl/gl_surface.h"
+
+namespace {
+base::LazyInstance<scoped_ptr<base::MessageLoopForUI>> g_main_message_loop =
+ LAZY_INSTANCE_INITIALIZER;
+}
+
+namespace blimp {
+
+void InitializeLogging() {
+ logging::LoggingSettings settings;
+#if defined(OS_ANDROID)
+ settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
+#else
+ base::FilePath log_filename;
+ PathService::Get(base::DIR_EXE, &log_filename);
+ log_filename = log_filename.AppendASCII("blimp_client.log");
+ settings.logging_dest = logging::LOG_TO_ALL;
+ settings.log_file = log_filename.value().c_str();
+ settings.delete_old = logging::DELETE_OLD_LOG_FILE;
+#endif // OS_ANDROID
+ logging::InitLogging(settings);
+ logging::SetLogItems(false, // Process ID
+ false, // Thread ID
+ false, // Timestamp
+ false); // Tick count
+ VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel()
+ << ", default verbosity = " << logging::GetVlogVerbosity();
+}
+
+bool InitializeMainMessageLoop() {
+ // TODO(dtrainor): Initialize ICU?
+
+ if (!gfx::GLSurface::InitializeOneOff())
+ return false;
+ SkGraphics::Init();
+ g_main_message_loop.Get().reset(new base::MessageLoopForUI);
+ return true;
+}
+
+} // namespace blimp
« no previous file with comments | « blimp/client/blimp_startup.h ('k') | blimp/client/compositor/blimp_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698