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

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

Issue 2267403006: Remove redundant IsEmpty checks after calling toV8() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h » ('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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 KeyType key; 57 KeyType key;
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 if (args[0].IsEmpty() || args[1].IsEmpty()) {
68 if (tryCatch.HasCaught())
69 exceptionState.rethrowV8Exception(tryCatch.Exception());
70 return;
71 }
72
73 v8::Local<v8::Value> result; 67 v8::Local<v8::Value> result;
74 if (!V8ScriptRunner::callFunction(v8Callback, scriptState->getExecut ionContext(), v8ThisArg, 3, args, isolate).ToLocal(&result)) { 68 if (!V8ScriptRunner::callFunction(v8Callback, scriptState->getExecut ionContext(), v8ThisArg, 3, args, isolate).ToLocal(&result)) {
75 exceptionState.rethrowV8Exception(tryCatch.Exception()); 69 exceptionState.rethrowV8Exception(tryCatch.Exception());
76 return; 70 return;
77 } 71 }
78 } 72 }
79 } 73 }
80 74
81 class IterationSource : public GarbageCollectedFinalized<IterationSource> { 75 class IterationSource : public GarbageCollectedFinalized<IterationSource> {
82 public: 76 public:
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 public: 193 public:
200 Iterator* iterator(ScriptState* scriptState, ExceptionState& exceptionState) 194 Iterator* iterator(ScriptState* scriptState, ExceptionState& exceptionState)
201 { 195 {
202 return this->entriesForBinding(scriptState, exceptionState); 196 return this->entriesForBinding(scriptState, exceptionState);
203 } 197 }
204 }; 198 };
205 199
206 } // namespace blink 200 } // namespace blink
207 201
208 #endif // Iterable_h 202 #endif // Iterable_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698