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

Side by Side Diff: gin/wrappable.cc

Issue 1161923004: Reland: Plugin Placeholders: Refactor for platforms that don't support plugins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove some enable_plugins that are no longer needed Created 5 years, 6 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
« no previous file with comments | « gin/wrappable.h ('k') | gin/wrappable_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/wrappable.h" 5 #include "gin/wrappable.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gin/object_template_builder.h" 8 #include "gin/object_template_builder.h"
9 #include "gin/per_isolate_data.h" 9 #include "gin/per_isolate_data.h"
10 10
(...skipping 18 matching lines...) Expand all
29 data.SetSecondPassCallback(SecondWeakCallback); 29 data.SetSecondPassCallback(SecondWeakCallback);
30 } 30 }
31 31
32 void WrappableBase::SecondWeakCallback( 32 void WrappableBase::SecondWeakCallback(
33 const v8::WeakCallbackInfo<WrappableBase>& data) { 33 const v8::WeakCallbackInfo<WrappableBase>& data) {
34 WrappableBase* wrappable = data.GetParameter(); 34 WrappableBase* wrappable = data.GetParameter();
35 delete wrappable; 35 delete wrappable;
36 } 36 }
37 37
38 v8::Local<v8::Object> WrappableBase::GetWrapperImpl(v8::Isolate* isolate, 38 v8::Local<v8::Object> WrappableBase::GetWrapperImpl(v8::Isolate* isolate,
39 WrapperInfo* info) { 39 WrapperInfo* info) {
40 if (!wrapper_.IsEmpty()) { 40 if (!wrapper_.IsEmpty()) {
41 return v8::Local<v8::Object>::New(isolate, wrapper_); 41 return v8::Local<v8::Object>::New(isolate, wrapper_);
42 } 42 }
43 43
44 PerIsolateData* data = PerIsolateData::From(isolate); 44 PerIsolateData* data = PerIsolateData::From(isolate);
45 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(info); 45 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(info);
46 if (templ.IsEmpty()) { 46 if (templ.IsEmpty()) {
47 templ = GetObjectTemplateBuilder(isolate).Build(); 47 templ = GetObjectTemplateBuilder(isolate).Build();
48 CHECK(!templ.IsEmpty()); 48 CHECK(!templ.IsEmpty());
49 data->SetObjectTemplate(info, templ); 49 data->SetObjectTemplate(info, templ);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // instance of the C++ class associated with wrapper_info. 84 // instance of the C++ class associated with wrapper_info.
85 if (info != wrapper_info) 85 if (info != wrapper_info)
86 return NULL; 86 return NULL;
87 87
88 return obj->GetAlignedPointerFromInternalField(kEncodedValueIndex); 88 return obj->GetAlignedPointerFromInternalField(kEncodedValueIndex);
89 } 89 }
90 90
91 } // namespace internal 91 } // namespace internal
92 92
93 } // namespace gin 93 } // namespace gin
OLDNEW
« no previous file with comments | « gin/wrappable.h ('k') | gin/wrappable_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698