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

Side by Side Diff: blimp/client/blimp_startup.cc

Issue 1528243002: Add a basic linux client for Blimp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: X11, how does it work? 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "blimp/client/blimp_startup.h"
6
7 #include "base/files/file_path.h"
8 #include "base/lazy_instance.h"
9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h"
11 #include "base/path_service.h"
12 #include "third_party/skia/include/core/SkGraphics.h"
13 #include "ui/gl/gl_surface.h"
14
15 namespace {
16 base::LazyInstance<scoped_ptr<base::MessageLoopForUI>> g_main_message_loop =
17 LAZY_INSTANCE_INITIALIZER;
Wez 2016/01/05 19:15:02 Add a comment to explain the purpose of this membe
18 }
19
20 namespace blimp {
21
22 void InitializeLogging() {
23 logging::LoggingSettings settings;
24 #if defined(OS_ANDROID)
25 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
26 #else
27 base::FilePath log_filename;
28 PathService::Get(base::DIR_EXE, &log_filename);
29 log_filename = log_filename.AppendASCII("blimp_client.log");
30 settings.logging_dest = logging::LOG_TO_ALL;
31 settings.log_file = log_filename.value().c_str();
32 settings.delete_old = logging::DELETE_OLD_LOG_FILE;
33 #endif // OS_ANDROID
34 logging::InitLogging(settings);
35 logging::SetLogItems(false, // Process ID
nyquist 2015/12/17 03:00:21 Why do we not want to log the process and thread I
Wez 2016/01/05 19:15:02 This is blimp_client logging initialization - ther
36 false, // Thread ID
37 false, // Timestamp
38 false); // Tick count
39 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel()
40 << ", default verbosity = " << logging::GetVlogVerbosity();
41 }
42
43 bool InitializeMainMessageLoop() {
44 // TODO(dtrainor): Initialize ICU?
Wez 2016/01/05 19:15:02 Clarify why we might need to initialize ICU here.
45
Wez 2016/01/05 19:15:02 nit: Remove the spurious blank line.
46 if (!gfx::GLSurface::InitializeOneOff())
47 return false;
48 SkGraphics::Init();
Wez 2016/01/05 19:15:02 The function name is InitializeMainMessageLoop, bu
49 g_main_message_loop.Get().reset(new base::MessageLoopForUI);
50 return true;
51 }
52
53 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698