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

Side by Side Diff: gin/interceptor.cc

Issue 467243002: [gin] Allow interceptors to signal whether a they intercepted something (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « gin/interceptor.h ('k') | gin/interceptor_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 2014 The Chromium Authors. All rights reserved. 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 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/interceptor.h" 5 #include "gin/interceptor.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "gin/per_isolate_data.h" 9 #include "gin/per_isolate_data.h"
10 10
11 namespace gin { 11 namespace gin {
12 12
13 NamedPropertyInterceptor::NamedPropertyInterceptor(v8::Isolate* isolate, 13 NamedPropertyInterceptor::NamedPropertyInterceptor(v8::Isolate* isolate,
14 WrappableBase* base) 14 WrappableBase* base)
15 : isolate_(isolate), base_(base) { 15 : isolate_(isolate), base_(base) {
16 PerIsolateData::From(isolate_)->SetNamedPropertyInterceptor(base_, this); 16 PerIsolateData::From(isolate_)->SetNamedPropertyInterceptor(base_, this);
17 } 17 }
18 18
19 NamedPropertyInterceptor::~NamedPropertyInterceptor() { 19 NamedPropertyInterceptor::~NamedPropertyInterceptor() {
20 PerIsolateData::From(isolate_)->ClearNamedPropertyInterceptor(base_, this); 20 PerIsolateData::From(isolate_)->ClearNamedPropertyInterceptor(base_, this);
21 } 21 }
22 22
23 v8::Local<v8::Value> NamedPropertyInterceptor::GetNamedProperty( 23 v8::Local<v8::Value> NamedPropertyInterceptor::GetNamedProperty(
24 v8::Isolate* isolate, 24 v8::Isolate* isolate,
25 const std::string& property) { 25 const std::string& property) {
26 return v8::Local<v8::Value>(); 26 return v8::Local<v8::Value>();
27 } 27 }
28 28
29 void NamedPropertyInterceptor::SetNamedProperty(v8::Isolate* isolate, 29 bool NamedPropertyInterceptor::SetNamedProperty(v8::Isolate* isolate,
30 const std::string& property, 30 const std::string& property,
31 v8::Local<v8::Value> value) {} 31 v8::Local<v8::Value> value) {
32 return false;
33 }
32 34
33 std::vector<std::string> NamedPropertyInterceptor::EnumerateNamedProperties( 35 std::vector<std::string> NamedPropertyInterceptor::EnumerateNamedProperties(
34 v8::Isolate* isolate) { 36 v8::Isolate* isolate) {
35 return std::vector<std::string>(); 37 return std::vector<std::string>();
36 } 38 }
37 39
38 IndexedPropertyInterceptor::IndexedPropertyInterceptor(v8::Isolate* isolate, 40 IndexedPropertyInterceptor::IndexedPropertyInterceptor(v8::Isolate* isolate,
39 WrappableBase* base) 41 WrappableBase* base)
40 : isolate_(isolate), base_(base) { 42 : isolate_(isolate), base_(base) {
41 PerIsolateData::From(isolate_)->SetIndexedPropertyInterceptor(base_, this); 43 PerIsolateData::From(isolate_)->SetIndexedPropertyInterceptor(base_, this);
42 } 44 }
43 45
44 IndexedPropertyInterceptor::~IndexedPropertyInterceptor() { 46 IndexedPropertyInterceptor::~IndexedPropertyInterceptor() {
45 PerIsolateData::From(isolate_)->ClearIndexedPropertyInterceptor(base_, this); 47 PerIsolateData::From(isolate_)->ClearIndexedPropertyInterceptor(base_, this);
46 } 48 }
47 49
48 v8::Local<v8::Value> IndexedPropertyInterceptor::GetIndexedProperty( 50 v8::Local<v8::Value> IndexedPropertyInterceptor::GetIndexedProperty(
49 v8::Isolate* isolate, 51 v8::Isolate* isolate,
50 uint32_t index) { 52 uint32_t index) {
51 return v8::Local<v8::Value>(); 53 return v8::Local<v8::Value>();
52 } 54 }
53 55
54 void IndexedPropertyInterceptor::SetIndexedProperty( 56 bool IndexedPropertyInterceptor::SetIndexedProperty(
55 v8::Isolate* isolate, 57 v8::Isolate* isolate,
56 uint32_t index, 58 uint32_t index,
57 v8::Local<v8::Value> value) {} 59 v8::Local<v8::Value> value) {
60 return false;
61 }
58 62
59 std::vector<uint32_t> IndexedPropertyInterceptor::EnumerateIndexedProperties( 63 std::vector<uint32_t> IndexedPropertyInterceptor::EnumerateIndexedProperties(
60 v8::Isolate* isolate) { 64 v8::Isolate* isolate) {
61 return std::vector<uint32_t>(); 65 return std::vector<uint32_t>();
62 } 66 }
63 67
64 } // namespace gin 68 } // namespace gin
OLDNEW
« no previous file with comments | « gin/interceptor.h ('k') | gin/interceptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698