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

Unified Diff: mojo/apps/js/bindings/waiting_callback.cc

Issue 105743007: Gin: Make it easier to implement Wrappable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/apps/js/bindings/waiting_callback.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/apps/js/bindings/waiting_callback.cc
diff --git a/mojo/apps/js/bindings/waiting_callback.cc b/mojo/apps/js/bindings/waiting_callback.cc
index a1d230c174b0e0c0b03b36b66457c154fa7ec5fe..48166d16bab606cb91e02d92e0a2a9c7fbbe60c8 100644
--- a/mojo/apps/js/bindings/waiting_callback.cc
+++ b/mojo/apps/js/bindings/waiting_callback.cc
@@ -7,6 +7,8 @@
#include "gin/per_context_data.h"
#include "gin/per_isolate_data.h"
+INIT_WRAPPABLE(mojo::js::WaitingCallback);
+
namespace mojo {
namespace js {
@@ -35,19 +37,14 @@ gin::Handle<WaitingCallback> WaitingCallback::Create(
return gin::CreateHandle(isolate, new WaitingCallback(isolate, callback));
}
-gin::WrapperInfo WaitingCallback::kWrapperInfo = { gin::kEmbedderNativeGin };
-
-gin::WrapperInfo* WaitingCallback::GetWrapperInfo() {
- return &kWrapperInfo;
-}
-
void WaitingCallback::EnsureRegistered(v8::Isolate* isolate) {
gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
- if (!data->GetObjectTemplate(&kWrapperInfo).IsEmpty())
+ if (!data->GetObjectTemplate(&WaitingCallback::kWrapperInfo).IsEmpty()) {
return;
+ }
v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate);
templ->SetInternalFieldCount(gin::kNumberOfInternalFields);
- data->SetObjectTemplate(&kWrapperInfo, templ);
+ data->SetObjectTemplate(&WaitingCallback::kWrapperInfo, templ);
}
void WaitingCallback::OnHandleReady(MojoResult result) {
« no previous file with comments | « mojo/apps/js/bindings/waiting_callback.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698