| 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/object_template_builder.h" | 5 #include "gin/object_template_builder.h" | 
| 6 | 6 | 
| 7 #include "gin/interceptor.h" | 7 #include "gin/interceptor.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 | 10 | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 62 void NamedPropertySetter(v8::Local<v8::String> property, | 62 void NamedPropertySetter(v8::Local<v8::String> property, | 
| 63                          v8::Local<v8::Value> value, | 63                          v8::Local<v8::Value> value, | 
| 64                          const v8::PropertyCallbackInfo<v8::Value>& info) { | 64                          const v8::PropertyCallbackInfo<v8::Value>& info) { | 
| 65   v8::Isolate* isolate = info.GetIsolate(); | 65   v8::Isolate* isolate = info.GetIsolate(); | 
| 66   NamedPropertyInterceptor* interceptor = | 66   NamedPropertyInterceptor* interceptor = | 
| 67       NamedInterceptorFromV8(isolate, info.Holder()); | 67       NamedInterceptorFromV8(isolate, info.Holder()); | 
| 68   if (!interceptor) | 68   if (!interceptor) | 
| 69     return; | 69     return; | 
| 70   std::string name; | 70   std::string name; | 
| 71   ConvertFromV8(isolate, property, &name); | 71   ConvertFromV8(isolate, property, &name); | 
| 72   interceptor->SetNamedProperty(isolate, name, value); | 72   if (interceptor->SetNamedProperty(isolate, name, value)) | 
|  | 73     info.GetReturnValue().Set(value); | 
| 73 } | 74 } | 
| 74 | 75 | 
| 75 void NamedPropertyQuery(v8::Local<v8::String> property, | 76 void NamedPropertyQuery(v8::Local<v8::String> property, | 
| 76                         const v8::PropertyCallbackInfo<v8::Integer>& info) { | 77                         const v8::PropertyCallbackInfo<v8::Integer>& info) { | 
| 77   v8::Isolate* isolate = info.GetIsolate(); | 78   v8::Isolate* isolate = info.GetIsolate(); | 
| 78   NamedPropertyInterceptor* interceptor = | 79   NamedPropertyInterceptor* interceptor = | 
| 79       NamedInterceptorFromV8(isolate, info.Holder()); | 80       NamedInterceptorFromV8(isolate, info.Holder()); | 
| 80   if (!interceptor) | 81   if (!interceptor) | 
| 81     return; | 82     return; | 
| 82   std::string name; | 83   std::string name; | 
| (...skipping 24 matching lines...) Expand all  Loading... | 
| 107 } | 108 } | 
| 108 | 109 | 
| 109 void IndexedPropertySetter(uint32_t index, | 110 void IndexedPropertySetter(uint32_t index, | 
| 110                            v8::Local<v8::Value> value, | 111                            v8::Local<v8::Value> value, | 
| 111                            const v8::PropertyCallbackInfo<v8::Value>& info) { | 112                            const v8::PropertyCallbackInfo<v8::Value>& info) { | 
| 112   v8::Isolate* isolate = info.GetIsolate(); | 113   v8::Isolate* isolate = info.GetIsolate(); | 
| 113   IndexedPropertyInterceptor* interceptor = | 114   IndexedPropertyInterceptor* interceptor = | 
| 114       IndexedInterceptorFromV8(isolate, info.Holder()); | 115       IndexedInterceptorFromV8(isolate, info.Holder()); | 
| 115   if (!interceptor) | 116   if (!interceptor) | 
| 116     return; | 117     return; | 
| 117   interceptor->SetIndexedProperty(isolate, index, value); | 118   if (interceptor->SetIndexedProperty(isolate, index, value)) | 
|  | 119     info.GetReturnValue().Set(value); | 
| 118 } | 120 } | 
| 119 | 121 | 
| 120 void IndexedPropertyEnumerator( | 122 void IndexedPropertyEnumerator( | 
| 121     const v8::PropertyCallbackInfo<v8::Array>& info) { | 123     const v8::PropertyCallbackInfo<v8::Array>& info) { | 
| 122   v8::Isolate* isolate = info.GetIsolate(); | 124   v8::Isolate* isolate = info.GetIsolate(); | 
| 123   IndexedPropertyInterceptor* interceptor = | 125   IndexedPropertyInterceptor* interceptor = | 
| 124       IndexedInterceptorFromV8(isolate, info.Holder()); | 126       IndexedInterceptorFromV8(isolate, info.Holder()); | 
| 125   if (!interceptor) | 127   if (!interceptor) | 
| 126     return; | 128     return; | 
| 127   info.GetReturnValue().Set(v8::Handle<v8::Array>::Cast( | 129   info.GetReturnValue().Set(v8::Handle<v8::Array>::Cast( | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 170   return *this; | 172   return *this; | 
| 171 } | 173 } | 
| 172 | 174 | 
| 173 v8::Local<v8::ObjectTemplate> ObjectTemplateBuilder::Build() { | 175 v8::Local<v8::ObjectTemplate> ObjectTemplateBuilder::Build() { | 
| 174   v8::Local<v8::ObjectTemplate> result = template_; | 176   v8::Local<v8::ObjectTemplate> result = template_; | 
| 175   template_.Clear(); | 177   template_.Clear(); | 
| 176   return result; | 178   return result; | 
| 177 } | 179 } | 
| 178 | 180 | 
| 179 }  // namespace gin | 181 }  // namespace gin | 
| OLD | NEW | 
|---|