OLD | NEW |
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/icu/icu.h" | 10 #include "mojo/icu/icu.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 ~Viewer() override { blink::shutdown(); } | 31 ~Viewer() override { blink::shutdown(); } |
32 | 32 |
33 private: | 33 private: |
34 // Overridden from ApplicationDelegate: | 34 // Overridden from ApplicationDelegate: |
35 void Initialize(mojo::ApplicationImpl* app) override { | 35 void Initialize(mojo::ApplicationImpl* app) override { |
36 RuntimeFlags::Initialize(app); | 36 RuntimeFlags::Initialize(app); |
37 | 37 |
38 blink::WebRuntimeFeatures::enableObservatory( | 38 blink::WebRuntimeFeatures::enableObservatory( |
39 !RuntimeFlags::Get().testing()); | 39 !RuntimeFlags::Get().testing()); |
40 | 40 |
41 mojo::NetworkServicePtr network_service; | 41 platform_impl_.reset(new PlatformImpl()); |
42 app->ConnectToService("mojo:authenticated_network_service", | |
43 &network_service); | |
44 platform_impl_.reset(new PlatformImpl(network_service.Pass())); | |
45 blink::initialize(platform_impl_.get()); | 42 blink::initialize(platform_impl_.get()); |
46 | 43 |
47 mojo::icu::Initialize(app); | 44 mojo::icu::Initialize(app); |
48 tracing_.Initialize(app); | 45 tracing_.Initialize(app); |
49 } | 46 } |
50 | 47 |
51 bool ConfigureIncomingConnection( | 48 bool ConfigureIncomingConnection( |
52 mojo::ApplicationConnection* connection) override { | 49 mojo::ApplicationConnection* connection) override { |
53 connection->AddService<mojo::ContentHandler>(this); | 50 connection->AddService<mojo::ContentHandler>(this); |
54 return true; | 51 return true; |
(...skipping 10 matching lines...) Expand all Loading... |
65 | 62 |
66 DISALLOW_COPY_AND_ASSIGN(Viewer); | 63 DISALLOW_COPY_AND_ASSIGN(Viewer); |
67 }; | 64 }; |
68 | 65 |
69 } // namespace sky | 66 } // namespace sky |
70 | 67 |
71 MojoResult MojoMain(MojoHandle application_request) { | 68 MojoResult MojoMain(MojoHandle application_request) { |
72 mojo::ApplicationRunnerChromium runner(new sky::Viewer); | 69 mojo::ApplicationRunnerChromium runner(new sky::Viewer); |
73 return runner.Run(application_request); | 70 return runner.Run(application_request); |
74 } | 71 } |
OLD | NEW |