[email protected] | 5c969b8 | 2014-03-12 04:59:05 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "gin/interceptor.h" |
| 6 | |
avi | 90e658dd | 2015-12-21 07:16:19 | [diff] [blame] | 7 | #include <stdint.h> |
| 8 | |
[email protected] | 5c969b8 | 2014-03-12 04:59:05 | [diff] [blame] | 9 | #include <map> |
| 10 | |
| 11 | #include "gin/per_isolate_data.h" |
| 12 | |
| 13 | namespace gin { |
| 14 | |
| 15 | NamedPropertyInterceptor::NamedPropertyInterceptor(v8::Isolate* isolate, |
| 16 | WrappableBase* base) |
| 17 | : isolate_(isolate), base_(base) { |
| 18 | PerIsolateData::From(isolate_)->SetNamedPropertyInterceptor(base_, this); |
| 19 | } |
| 20 | |
| 21 | NamedPropertyInterceptor::~NamedPropertyInterceptor() { |
| 22 | PerIsolateData::From(isolate_)->ClearNamedPropertyInterceptor(base_, this); |
| 23 | } |
| 24 | |
| 25 | v8::Local<v8::Value> NamedPropertyInterceptor::GetNamedProperty( |
| 26 | v8::Isolate* isolate, |
| 27 | const std::string& property) { |
| 28 | return v8::Local<v8::Value>(); |
| 29 | } |
| 30 | |
[email protected] | d656f87 | 2014-08-13 17:12:55 | [diff] [blame] | 31 | bool NamedPropertyInterceptor::SetNamedProperty(v8::Isolate* isolate, |
[email protected] | 5c969b8 | 2014-03-12 04:59:05 | [diff] [blame] | 32 | const std::string& property, |
[email protected] | d656f87 | 2014-08-13 17:12:55 | [diff] [blame] | 33 | v8::Local<v8::Value> value) { |
| 34 | return false; |
| 35 | } |
[email protected] | 5c969b8 | 2014-03-12 04:59:05 | [diff] [blame] | 36 | |
| 37 | std::vector<std::string> NamedPropertyInterceptor::EnumerateNamedProperties( |
| 38 | v8::Isolate* isolate) { |
| 39 | return std::vector<std::string>(); |
| 40 | } |
| 41 | |
| 42 | IndexedPropertyInterceptor::IndexedPropertyInterceptor(v8::Isolate* isolate, |
| 43 | WrappableBase* base) |
| 44 | : isolate_(isolate), base_(base) { |
| 45 | PerIsolateData::From(isolate_)->SetIndexedPropertyInterceptor(base_, this); |
| 46 | } |
| 47 | |
| 48 | IndexedPropertyInterceptor::~IndexedPropertyInterceptor() { |
| 49 | PerIsolateData::From(isolate_)->ClearIndexedPropertyInterceptor(base_, this); |
| 50 | } |
| 51 | |
| 52 | v8::Local<v8::Value> IndexedPropertyInterceptor::GetIndexedProperty( |
| 53 | v8::Isolate* isolate, |
| 54 | uint32_t index) { |
| 55 | return v8::Local<v8::Value>(); |
| 56 | } |
| 57 | |
[email protected] | d656f87 | 2014-08-13 17:12:55 | [diff] [blame] | 58 | bool IndexedPropertyInterceptor::SetIndexedProperty( |
[email protected] | 5c969b8 | 2014-03-12 04:59:05 | [diff] [blame] | 59 | v8::Isolate* isolate, |
| 60 | uint32_t index, |
[email protected] | d656f87 | 2014-08-13 17:12:55 | [diff] [blame] | 61 | v8::Local<v8::Value> value) { |
| 62 | return false; |
| 63 | } |
[email protected] | 5c969b8 | 2014-03-12 04:59:05 | [diff] [blame] | 64 | |
| 65 | std::vector<uint32_t> IndexedPropertyInterceptor::EnumerateIndexedProperties( |
| 66 | v8::Isolate* isolate) { |
| 67 | return std::vector<uint32_t>(); |
| 68 | } |
| 69 | |
| 70 | } // namespace gin |