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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp

Issue 2817533003: Replace ASSERT, RELEASE_ASSERT, and ASSERT_NOT_REACHED in bindings (Closed)
Patch Set: fixed dcheck build error Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return v8::Local<v8::Function>::Cast(property); 82 return v8::Local<v8::Function>::Cast(property);
83 } 83 }
84 84
85 return v8::Local<v8::Function>(); 85 return v8::Local<v8::Function>();
86 } 86 }
87 87
88 v8::Local<v8::Value> V8EventListener::CallListenerFunction( 88 v8::Local<v8::Value> V8EventListener::CallListenerFunction(
89 ScriptState* script_state, 89 ScriptState* script_state,
90 v8::Local<v8::Value> js_event, 90 v8::Local<v8::Value> js_event,
91 Event* event) { 91 Event* event) {
92 ASSERT(!js_event.IsEmpty()); 92 DCHECK(!js_event.IsEmpty());
93 v8::Local<v8::Function> handler_function = GetListenerFunction(script_state); 93 v8::Local<v8::Function> handler_function = GetListenerFunction(script_state);
94 v8::Local<v8::Object> receiver = GetReceiverObject(script_state, event); 94 v8::Local<v8::Object> receiver = GetReceiverObject(script_state, event);
95 if (handler_function.IsEmpty() || receiver.IsEmpty()) 95 if (handler_function.IsEmpty() || receiver.IsEmpty())
96 return v8::Local<v8::Value>(); 96 return v8::Local<v8::Value>();
97 97
98 if (!ExecutionContext::From(script_state)->IsDocument()) 98 if (!ExecutionContext::From(script_state)->IsDocument())
99 return v8::Local<v8::Value>(); 99 return v8::Local<v8::Value>();
100 100
101 LocalFrame* frame = 101 LocalFrame* frame =
102 ToDocument(ExecutionContext::From(script_state))->GetFrame(); 102 ToDocument(ExecutionContext::From(script_state))->GetFrame();
(...skipping 11 matching lines...) Expand all
114 v8::Local<v8::Value> result; 114 v8::Local<v8::Value> result;
115 if (!V8ScriptRunner::CallFunction(handler_function, frame->GetDocument(), 115 if (!V8ScriptRunner::CallFunction(handler_function, frame->GetDocument(),
116 receiver, WTF_ARRAY_LENGTH(parameters), 116 receiver, WTF_ARRAY_LENGTH(parameters),
117 parameters, script_state->GetIsolate()) 117 parameters, script_state->GetIsolate())
118 .ToLocal(&result)) 118 .ToLocal(&result))
119 return v8::Local<v8::Value>(); 119 return v8::Local<v8::Value>();
120 return result; 120 return result;
121 } 121 }
122 122
123 } // namespace blink 123 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698