| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 namespace { | 148 namespace { |
| 149 | 149 |
| 150 class InternalsIterator FINAL : public Iterator { | 150 class InternalsIterator FINAL : public Iterator { |
| 151 public: | 151 public: |
| 152 InternalsIterator() : m_current(0) { } | 152 InternalsIterator() : m_current(0) { } |
| 153 | 153 |
| 154 virtual ScriptValue next(ScriptState* scriptState, ExceptionState& exception
State) OVERRIDE | 154 virtual ScriptValue next(ScriptState* scriptState, ExceptionState& exception
State) OVERRIDE |
| 155 { | 155 { |
| 156 v8::Isolate* isolate = scriptState->isolate(); | 156 v8::Isolate* isolate = scriptState->isolate(); |
| 157 v8::Local<v8::Value> value = v8::Integer::New(isolate, m_current * m_cur
rent); | 157 int value = m_current * m_current; |
| 158 bool done = (m_current >= 5); | 158 if (m_current >= 5) |
| 159 return ScriptValue(scriptState, v8DoneIteratorResult(isolate)); |
| 159 ++m_current; | 160 ++m_current; |
| 160 | 161 return ScriptValue(scriptState, v8IteratorResult(scriptState, value)); |
| 161 v8::Local<v8::Object> result = v8::Object::New(isolate); | |
| 162 result->Set(v8String(isolate, "value"), value); | |
| 163 result->Set(v8String(isolate, "done"), v8Boolean(done, isolate)); | |
| 164 return ScriptValue(scriptState, result); | |
| 165 } | 162 } |
| 166 | 163 |
| 167 virtual ScriptValue next(ScriptState* scriptState, ScriptValue value, Except
ionState& exceptionState) OVERRIDE | 164 virtual ScriptValue next(ScriptState* scriptState, ScriptValue value, Except
ionState& exceptionState) OVERRIDE |
| 168 { | 165 { |
| 169 exceptionState.throwTypeError("Not implemented"); | 166 exceptionState.throwTypeError("Not implemented"); |
| 170 return ScriptValue(); | 167 return ScriptValue(); |
| 171 } | 168 } |
| 172 | 169 |
| 173 private: | 170 private: |
| 174 int m_current; | 171 int m_current; |
| (...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2262 element->ensureUserAgentShadowRoot().setInnerHTML(htmlSource, exceptionState
); | 2259 element->ensureUserAgentShadowRoot().setInnerHTML(htmlSource, exceptionState
); |
| 2263 toHTMLPlugInElement(element)->setUsePlaceholderContent(true); | 2260 toHTMLPlugInElement(element)->setUsePlaceholderContent(true); |
| 2264 } | 2261 } |
| 2265 | 2262 |
| 2266 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio
nState) | 2263 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio
nState) |
| 2267 { | 2264 { |
| 2268 return new InternalsIterator; | 2265 return new InternalsIterator; |
| 2269 } | 2266 } |
| 2270 | 2267 |
| 2271 } // namespace blink | 2268 } // namespace blink |
| OLD | NEW |