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

Side by Side Diff: Source/bindings/v8/Dictionary.h

Issue 74533003: Add Perl IDL support for method parameter type sequence<Dictionary> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 // This object can only be used safely when stack allocated because of v8::L ocal. 106 // This object can only be used safely when stack allocated because of v8::L ocal.
107 static void* operator new(size_t); 107 static void* operator new(size_t);
108 static void* operator new[](size_t); 108 static void* operator new[](size_t);
109 static void operator delete(void *); 109 static void operator delete(void *);
110 110
111 v8::Local<v8::Value> m_options; 111 v8::Local<v8::Value> m_options;
112 v8::Isolate* m_isolate; 112 v8::Isolate* m_isolate;
113 }; 113 };
114 114
115 class DictionarySequence {
116 public:
117 DictionarySequence()
118 : m_length(0)
119 , m_isolate(0)
120 {
121 }
122
123 DictionarySequence(v8::Local<v8::Object> list, size_t length, v8::Isolate* i solate)
124 : m_list(list)
125 , m_length(length)
126 , m_isolate(isolate)
127 {
128 }
129
130 size_t length() const { return m_length; }
131 Dictionary operator[](size_t i) const
132 {
133 if (i < m_length)
134 return Dictionary(m_list->Get(i), m_isolate);
135 ASSERT_NOT_REACHED();
136 return Dictionary();
137 }
138
139 private:
140 v8::Local<v8::Object> m_list;
141 size_t m_length;
142 v8::Isolate* m_isolate;
143 };
144
115 } 145 }
116 146
117 #endif // Dictionary_h 147 #endif // Dictionary_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698