| 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 "mojo/apps/js/bindings/monotonic_clock.h" | 5 #include "mojo/apps/js/bindings/monotonic_clock.h" |
| 6 | 6 |
| 7 #include "gin/object_template_builder.h" | 7 #include "gin/object_template_builder.h" |
| 8 #include "gin/per_isolate_data.h" | 8 #include "gin/per_isolate_data.h" |
| 9 #include "gin/public/wrapper_info.h" | 9 #include "gin/public/wrapper_info.h" |
| 10 #include "mojo/public/system/core_cpp.h" | 10 #include "mojo/public/cpp/system/core.h" |
| 11 | 11 |
| 12 namespace mojo { | 12 namespace mojo { |
| 13 namespace apps { | 13 namespace apps { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin }; | 17 gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin }; |
| 18 | 18 |
| 19 double GetMonotonicSeconds() { | 19 double GetMonotonicSeconds() { |
| 20 const double kMicrosecondsPerSecond = 1000000; | 20 const double kMicrosecondsPerSecond = 1000000; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 33 templ = gin::ObjectTemplateBuilder(isolate) | 33 templ = gin::ObjectTemplateBuilder(isolate) |
| 34 .SetMethod("seconds", GetMonotonicSeconds) | 34 .SetMethod("seconds", GetMonotonicSeconds) |
| 35 .Build(); | 35 .Build(); |
| 36 data->SetObjectTemplate(&g_wrapper_info, templ); | 36 data->SetObjectTemplate(&g_wrapper_info, templ); |
| 37 } | 37 } |
| 38 return templ->NewInstance(); | 38 return templ->NewInstance(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace apps | 41 } // namespace apps |
| 42 } // namespace mojo | 42 } // namespace mojo |
| OLD | NEW |