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

Side by Side Diff: third_party/WebKit/Source/bindings/modules/v8/V8IDBObserverCallback.cpp

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, 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
« no previous file with comments | « third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "bindings/modules/v8/V8IDBObserverCallback.h" 5 #include "bindings/modules/v8/V8IDBObserverCallback.h"
6 6
7 #include "bindings/core/v8/ScriptController.h" 7 #include "bindings/core/v8/ScriptController.h"
8 #include "bindings/core/v8/ToV8.h" 8 #include "bindings/core/v8/ToV8.h"
9 #include "bindings/core/v8/V8Binding.h" 9 #include "bindings/core/v8/V8Binding.h"
10 #include "bindings/core/v8/V8PrivateProperty.h" 10 #include "bindings/core/v8/V8PrivateProperty.h"
(...skipping 26 matching lines...) Expand all
37 ScriptState::Scope scope(m_scriptState.get()); 37 ScriptState::Scope scope(m_scriptState.get());
38 38
39 if (m_callback.isEmpty()) 39 if (m_callback.isEmpty())
40 return; 40 return;
41 v8::Local<v8::Value> observerHandle = toV8(&observer, m_scriptState->context ()->Global(), m_scriptState->isolate()); 41 v8::Local<v8::Value> observerHandle = toV8(&observer, m_scriptState->context ()->Global(), m_scriptState->isolate());
42 if (!observerHandle->IsObject()) 42 if (!observerHandle->IsObject())
43 return; 43 return;
44 44
45 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(observerHandl e); 45 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(observerHandl e);
46 v8::Local<v8::Value> changesHandle = toV8(&changes, m_scriptState->context() ->Global(), m_scriptState->isolate()); 46 v8::Local<v8::Value> changesHandle = toV8(&changes, m_scriptState->context() ->Global(), m_scriptState->isolate());
47 if (changesHandle.IsEmpty())
48 return;
49
50 v8::Local<v8::Value> argv[] = { changesHandle }; 47 v8::Local<v8::Value> argv[] = { changesHandle };
51 48
52 V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()), m_scriptState->getExecutionContext(), thisObject, WTF_ARRAY_LENGTH(argv), argv, m_scriptState->isolate()); 49 V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()), m_scriptState->getExecutionContext(), thisObject, WTF_ARRAY_LENGTH(argv), argv, m_scriptState->isolate());
53 } 50 }
54 51
55 DEFINE_TRACE(V8IDBObserverCallback) 52 DEFINE_TRACE(V8IDBObserverCallback)
56 { 53 {
57 IDBObserverCallback::trace(visitor); 54 IDBObserverCallback::trace(visitor);
58 ActiveDOMCallback::trace(visitor); 55 ActiveDOMCallback::trace(visitor);
59 } 56 }
60 57
61 } // namespace blink 58 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698