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

Side by Side Diff: sky/viewer/viewer.cc

Issue 826063003: Make Sky not crash when run in MojoShell.apk (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « sky/tools/debugger/prompt/prompt.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/threading/thread.h" 7 #include "base/threading/thread.h"
8 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
9 #include "mojo/common/tracing_impl.h" 9 #include "mojo/common/tracing_impl.h"
10 #include "mojo/public/c/system/main.h" 10 #include "mojo/public/c/system/main.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 if (app->HasArg(kTesting)) { 42 if (app->HasArg(kTesting)) {
43 DisplayDelegate::setDisplayDelegateCreateFunction( 43 DisplayDelegate::setDisplayDelegateCreateFunction(
44 DisplayDelegateBitmap::create); 44 DisplayDelegateBitmap::create);
45 } else { 45 } else {
46 DisplayDelegate::setDisplayDelegateCreateFunction( 46 DisplayDelegate::setDisplayDelegateCreateFunction(
47 DisplayDelegateGanesh::create); 47 DisplayDelegateGanesh::create);
48 } 48 }
49 49
50 platform_impl_.reset(new PlatformImpl(app)); 50 platform_impl_.reset(new PlatformImpl(app));
51 blink::initialize(platform_impl_.get()); 51 blink::initialize(platform_impl_.get());
52
53 // TODO(eseidel): Haven't solved ICU data loading for MojoShell.apk yet.
54 #if !defined(OS_ANDROID)
52 base::i18n::InitializeICU(); 55 base::i18n::InitializeICU();
56 #endif
53 57
54 mojo::TracingImpl::Create(app); 58 mojo::TracingImpl::Create(app);
55 } 59 }
56 60
57 virtual bool ConfigureIncomingConnection( 61 virtual bool ConfigureIncomingConnection(
58 mojo::ApplicationConnection* connection) override { 62 mojo::ApplicationConnection* connection) override {
59 connection->AddService<mojo::ContentHandler>(this); 63 connection->AddService<mojo::ContentHandler>(this);
60 return true; 64 return true;
61 } 65 }
62 66
63 // Overridden from InterfaceFactory<ContentHandler> 67 // Overridden from InterfaceFactory<ContentHandler>
64 virtual void Create(mojo::ApplicationConnection* connection, 68 virtual void Create(mojo::ApplicationConnection* connection,
65 mojo::InterfaceRequest<mojo::ContentHandler> request) over ride { 69 mojo::InterfaceRequest<mojo::ContentHandler> request) over ride {
66 mojo::BindToRequest(new ContentHandlerImpl(), &request); 70 mojo::BindToRequest(new ContentHandlerImpl(), &request);
67 } 71 }
68 72
69 scoped_ptr<PlatformImpl> platform_impl_; 73 scoped_ptr<PlatformImpl> platform_impl_;
70 74
71 DISALLOW_COPY_AND_ASSIGN(Viewer); 75 DISALLOW_COPY_AND_ASSIGN(Viewer);
72 }; 76 };
73 77
74 } // namespace mojo 78 } // namespace mojo
75 79
76 MojoResult MojoMain(MojoHandle shell_handle) { 80 MojoResult MojoMain(MojoHandle shell_handle) {
77 mojo::ApplicationRunnerChromium runner(new sky::Viewer); 81 mojo::ApplicationRunnerChromium runner(new sky::Viewer);
78 return runner.Run(shell_handle); 82 return runner.Run(shell_handle);
79 } 83 }
OLDNEW
« no previous file with comments | « sky/tools/debugger/prompt/prompt.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698