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/modules/console.h" | 5 #include "gin/modules/console.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "gin/arguments.h" | 10 #include "gin/arguments.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 v8::Local<v8::Value> Console::GetModule(v8::Isolate* isolate) { | 37 v8::Local<v8::Value> Console::GetModule(v8::Isolate* isolate) { |
38 PerIsolateData* data = PerIsolateData::From(isolate); | 38 PerIsolateData* data = PerIsolateData::From(isolate); |
39 v8::Local<ObjectTemplate> templ = data->GetObjectTemplate(&g_wrapper_info); | 39 v8::Local<ObjectTemplate> templ = data->GetObjectTemplate(&g_wrapper_info); |
40 if (templ.IsEmpty()) { | 40 if (templ.IsEmpty()) { |
41 templ = ObjectTemplateBuilder(isolate) | 41 templ = ObjectTemplateBuilder(isolate) |
42 .SetMethod("log", Log) | 42 .SetMethod("log", Log) |
43 .Build(); | 43 .Build(); |
44 data->SetObjectTemplate(&g_wrapper_info, templ); | 44 data->SetObjectTemplate(&g_wrapper_info, templ); |
45 } | 45 } |
46 return templ->NewInstance(isolate->GetCurrentContext()).ToLocalChecked(); | 46 return templ->NewInstance(); |
47 } | 47 } |
48 | 48 |
49 } // namespace gin | 49 } // namespace gin |
OLD | NEW |