| 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "mojo/public/c/system/main.h" | 7 #include "mojo/public/c/system/main.h" |
| 8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
| 9 #include "mojo/public/cpp/application/application_impl.h" | 9 #include "mojo/public/cpp/application/application_impl.h" |
| 10 #include "mojo/public/cpp/application/application_runner.h" | 10 #include "mojo/public/cpp/application/application_runner.h" |
| 11 #include "mojo/public/cpp/application/interface_factory_impl.h" | 11 #include "mojo/public/cpp/application/interface_factory_impl.h" |
| 12 #include "mojo/services/public/interfaces/content_handler/content_handler.mojom.
h" | 12 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.
h" |
| 13 | 13 |
| 14 namespace mojo { | 14 namespace mojo { |
| 15 namespace examples { | 15 namespace examples { |
| 16 | 16 |
| 17 class PrintBodyApplication : public InterfaceImpl<Application> { | 17 class PrintBodyApplication : public InterfaceImpl<Application> { |
| 18 public: | 18 public: |
| 19 PrintBodyApplication(ShellPtr shell, ScopedDataPipeConsumerHandle body) | 19 PrintBodyApplication(ShellPtr shell, ScopedDataPipeConsumerHandle body) |
| 20 : shell_(shell.Pass()), body_(body.Pass()) { | 20 : shell_(shell.Pass()), body_(body.Pass()) { |
| 21 shell_.set_client(this); | 21 shell_.set_client(this); |
| 22 } | 22 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 MOJO_DISALLOW_COPY_AND_ASSIGN(ContentHandlerApp); | 92 MOJO_DISALLOW_COPY_AND_ASSIGN(ContentHandlerApp); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace examples | 95 } // namespace examples |
| 96 } // namespace mojo | 96 } // namespace mojo |
| 97 | 97 |
| 98 MojoResult MojoMain(MojoHandle shell_handle) { | 98 MojoResult MojoMain(MojoHandle shell_handle) { |
| 99 mojo::ApplicationRunner runner(new mojo::examples::ContentHandlerApp); | 99 mojo::ApplicationRunner runner(new mojo::examples::ContentHandlerApp); |
| 100 return runner.Run(shell_handle); | 100 return runner.Run(shell_handle); |
| 101 } | 101 } |
| OLD | NEW |