interceptor.cc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #include "gin/interceptor.h"
  5. #include <stdint.h>
  6. #include <map>
  7. #include "gin/per_isolate_data.h"
  8. namespace gin {
  9. NamedPropertyInterceptor::NamedPropertyInterceptor(v8::Isolate* isolate,
  10. WrappableBase* base)
  11. : isolate_(isolate), base_(base) {
  12. PerIsolateData::From(isolate_)->SetNamedPropertyInterceptor(base_, this);
  13. }
  14. NamedPropertyInterceptor::~NamedPropertyInterceptor() {
  15. PerIsolateData::From(isolate_)->ClearNamedPropertyInterceptor(base_, this);
  16. }
  17. v8::Local<v8::Value> NamedPropertyInterceptor::GetNamedProperty(
  18. v8::Isolate* isolate,
  19. const std::string& property) {
  20. return v8::Local<v8::Value>();
  21. }
  22. bool NamedPropertyInterceptor::SetNamedProperty(v8::Isolate* isolate,
  23. const std::string& property,
  24. v8::Local<v8::Value> value) {
  25. return false;
  26. }
  27. std::vector<std::string> NamedPropertyInterceptor::EnumerateNamedProperties(
  28. v8::Isolate* isolate) {
  29. return std::vector<std::string>();
  30. }
  31. IndexedPropertyInterceptor::IndexedPropertyInterceptor(v8::Isolate* isolate,
  32. WrappableBase* base)
  33. : isolate_(isolate), base_(base) {
  34. PerIsolateData::From(isolate_)->SetIndexedPropertyInterceptor(base_, this);
  35. }
  36. IndexedPropertyInterceptor::~IndexedPropertyInterceptor() {
  37. PerIsolateData::From(isolate_)->ClearIndexedPropertyInterceptor(base_, this);
  38. }
  39. v8::Local<v8::Value> IndexedPropertyInterceptor::GetIndexedProperty(
  40. v8::Isolate* isolate,
  41. uint32_t index) {
  42. return v8::Local<v8::Value>();
  43. }
  44. bool IndexedPropertyInterceptor::SetIndexedProperty(
  45. v8::Isolate* isolate,
  46. uint32_t index,
  47. v8::Local<v8::Value> value) {
  48. return false;
  49. }
  50. std::vector<uint32_t> IndexedPropertyInterceptor::EnumerateIndexedProperties(
  51. v8::Isolate* isolate) {
  52. return std::vector<uint32_t>();
  53. }
  54. } // namespace gin