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

Unified Diff: sky/shell/ios/main_ios.mm

Issue 1171573002: Basic Sky shell for iOS targets (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Service provider platform task runner refactor to be platform agnostic Created 5 years, 6 months 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 | « sky/shell/ios/Info.plist ('k') | sky/shell/ios/platform_service_provider_ios.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/ios/main_ios.mm
diff --git a/sky/shell/ios/main_ios.mm b/sky/shell/ios/main_ios.mm
new file mode 100644
index 0000000000000000000000000000000000000000..f0020606e2c9542e8781b6937f4849f9615f6ccc
--- /dev/null
+++ b/sky/shell/ios/main_ios.mm
@@ -0,0 +1,60 @@
+// 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.
+
+#import <UIKit/UIKit.h>
+#include <asl.h>
+#import "sky_app_delegate.h"
+#include "base/at_exit.h"
+#include "base/logging.h"
+#include "base/i18n/icu_util.h"
+#include "base/command_line.h"
+#include "base/mac/scoped_nsautorelease_pool.h"
+#include "ui/gl/gl_surface.h"
+
+static void InitializeLogging() {
+ logging::LoggingSettings settings;
+ settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
+ logging::InitLogging(settings);
+ logging::SetLogItems(false, // Process ID
+ false, // Thread ID
+ false, // Timestamp
+ false); // Tick count
+}
+
+static void RedirectIOConnectionsToSyslog() {
+ asl_log_descriptor(NULL, NULL, ASL_LEVEL_INFO, STDOUT_FILENO,
+ ASL_LOG_DESCRIPTOR_WRITE);
+ asl_log_descriptor(NULL, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO,
+ ASL_LOG_DESCRIPTOR_WRITE);
+}
+
+#ifndef NDEBUG
+
+static void SkyDebuggerHookMain(void) {
+ // By default, LLDB breaks way too early. This is before libraries have been
+ // loaded and __attribute__((constructor)) methods have been called. In most
+ // situations, this is unnecessary. Also, breakpoint resolution is not
+ // immediate. So we provide this hook to break on.
+}
+
+#endif
+
+int main(int argc, char* argv[]) {
+#ifndef NDEBUG
+ SkyDebuggerHookMain();
+#endif
+ base::mac::ScopedNSAutoreleasePool pool;
+ base::AtExitManager exit_manager;
+ RedirectIOConnectionsToSyslog();
+ auto result = false;
+ result = base::CommandLine::Init(0, nullptr);
+ DLOG_ASSERT(result);
+ InitializeLogging();
+ result = base::i18n::InitializeICU();
+ DLOG_ASSERT(result);
+ result = gfx::GLSurface::InitializeOneOff();
+ DLOG_ASSERT(result);
+ return UIApplicationMain(argc, argv, nil,
+ NSStringFromClass([SkyAppDelegate class]));
+}
« no previous file with comments | « sky/shell/ios/Info.plist ('k') | sky/shell/ios/platform_service_provider_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698