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

Side by Side Diff: Source/bindings/core/v8/Iterable.h

Issue 1061503005: bindings: Use Maybe version of Call() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | « no previous file | Source/bindings/core/v8/NPV8Object.cpp » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef Iterable_h 5 #ifndef Iterable_h
6 #define Iterable_h 6 #define Iterable_h
7 7
8 #include "bindings/core/v8/V8IteratorResultValue.h" 8 #include "bindings/core/v8/V8IteratorResultValue.h"
9 #include "bindings/core/v8/V8ScriptRunner.h" 9 #include "bindings/core/v8/V8ScriptRunner.h"
10 #include "core/dom/Iterator.h" 10 #include "core/dom/Iterator.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 ValueType value; 58 ValueType value;
59 59
60 if (!source->next(scriptState, key, value, exceptionState)) 60 if (!source->next(scriptState, key, value, exceptionState))
61 return; 61 return;
62 62
63 ASSERT(!exceptionState.hadException()); 63 ASSERT(!exceptionState.hadException());
64 64
65 args[0] = toV8(value, creationContext, isolate); 65 args[0] = toV8(value, creationContext, isolate);
66 args[1] = toV8(key, creationContext, isolate); 66 args[1] = toV8(key, creationContext, isolate);
67 67
68 V8ScriptRunner::callFunction(v8Callback, scriptState->executionConte xt(), v8ThisArg, 3, args, isolate); 68 v8::Local<v8::Value> result;
69 69 if (!V8ScriptRunner::callFunction(v8Callback, scriptState->execution Context(), v8ThisArg, 3, args, isolate).ToLocal(&result)) {
70 if (tryCatch.HasCaught()) {
71 exceptionState.rethrowV8Exception(tryCatch.Exception()); 70 exceptionState.rethrowV8Exception(tryCatch.Exception());
72 return; 71 return;
73 } 72 }
74 } 73 }
75 } 74 }
76 75
77 class IterationSource : public GarbageCollectedFinalized<IterationSource> { 76 class IterationSource : public GarbageCollectedFinalized<IterationSource> {
78 public: 77 public:
79 virtual ~IterationSource() { } 78 virtual ~IterationSource() { }
80 79
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 public: 191 public:
193 Iterator* iterator(ScriptState* scriptState, ExceptionState& exceptionState) 192 Iterator* iterator(ScriptState* scriptState, ExceptionState& exceptionState)
194 { 193 {
195 return this->entriesForBinding(scriptState, exceptionState); 194 return this->entriesForBinding(scriptState, exceptionState);
196 } 195 }
197 }; 196 };
198 197
199 } // namespace blink 198 } // namespace blink
200 199
201 #endif // Iterable_h 200 #endif // Iterable_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/NPV8Object.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698