Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: gin/test/gtest.cc

Issue 214183003: Change mojo JS bindings to expose a handle object, which is Closed when garbage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/test/gtest.h" 5 #include "gin/test/gtest.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "gin/arguments.h" 9 #include "gin/arguments.h"
10 #include "gin/converter.h" 10 #include "gin/converter.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 v8::Local<v8::Value> GTest::GetModule(v8::Isolate* isolate) { 46 v8::Local<v8::Value> GTest::GetModule(v8::Isolate* isolate) {
47 PerIsolateData* data = PerIsolateData::From(isolate); 47 PerIsolateData* data = PerIsolateData::From(isolate);
48 v8::Local<v8::ObjectTemplate> templ = 48 v8::Local<v8::ObjectTemplate> templ =
49 data->GetObjectTemplate(&g_wrapper_info); 49 data->GetObjectTemplate(&g_wrapper_info);
50 if (templ.IsEmpty()) { 50 if (templ.IsEmpty()) {
51 templ = ObjectTemplateBuilder(isolate) 51 templ = ObjectTemplateBuilder(isolate)
52 .SetMethod("fail", Fail) 52 .SetMethod("fail", Fail)
53 .SetMethod("expectTrue", ExpectTrue) 53 .SetMethod("expectTrue", ExpectTrue)
54 .SetMethod("expectFalse", ExpectFalse) 54 .SetMethod("expectFalse", ExpectFalse)
55 .SetMethod("expectEqual", ExpectEqual) 55 .SetMethod("expectEqual", ExpectEqual)
56 .SetMethod("collectGarbage", v8::V8::LowMemoryNotification)
abarth-chromium 2014/03/29 01:56:17 Did you mean to expose this function in two places
Matt Perry 2014/03/31 19:34:17 Oops, thanks. I put it here first as a hack. Remov
56 .Build(); 57 .Build();
57 data->SetObjectTemplate(&g_wrapper_info, templ); 58 data->SetObjectTemplate(&g_wrapper_info, templ);
58 } 59 }
59 return templ->NewInstance(); 60 return templ->NewInstance();
60 } 61 }
61 62
62 } // namespace gin 63 } // namespace gin
OLDNEW
« no previous file with comments | « gin/test/gc.cc ('k') | mojo/bindings/js/core.cc » ('j') | mojo/bindings/js/core.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698