Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "gin/initialize.h" | 5 #include "gin/gin.h" |
| 6 #include "mojo/public/system/core.h" | 6 #include "mojo/public/system/core.h" |
| 7 #include "mojo/public/system/macros.h" | 7 #include "mojo/public/system/macros.h" |
| 8 | 8 |
| 9 #if defined(WIN32) | 9 #if defined(WIN32) |
| 10 #if !defined(CDECL) | 10 #if !defined(CDECL) |
| 11 #define CDECL __cdecl | 11 #define CDECL __cdecl |
| 12 #endif | 12 #endif |
| 13 #define MOJO_APPS_JS_EXPORT __declspec(dllexport) | 13 #define MOJO_APPS_JS_EXPORT __declspec(dllexport) |
| 14 #else | 14 #else |
| 15 #define CDECL | 15 #define CDECL |
| 16 #define MOJO_APPS_JS_EXPORT __attribute__((visibility("default"))) | 16 #define MOJO_APPS_JS_EXPORT __attribute__((visibility("default"))) |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 extern "C" MOJO_APPS_JS_EXPORT MojoResult CDECL MojoMain( | 19 extern "C" MOJO_APPS_JS_EXPORT MojoResult CDECL MojoMain( |
| 20 mojo::Handle pipe) { | 20 mojo::Handle pipe) { |
| 21 gin::Initialize(); | 21 gin::Gin* instance = new gin::Gin; |
|
abarth-chromium
2013/11/19 15:49:21
Why not allocate on the stack?
jochen (gone - plz use gerrit)
2013/11/19 15:57:24
Done.
| |
| 22 // TODO(abarth): Load JS off the network and execute it. | 22 // TODO(abarth): Load JS off the network and execute it. |
| 23 delete instance; | |
| 23 return MOJO_RESULT_OK; | 24 return MOJO_RESULT_OK; |
| 24 } | 25 } |
| OLD | NEW |