| OLD | NEW |
| 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 #include "platform/v8_inspector/V8InjectedScriptHost.h" | 5 #include "platform/v8_inspector/V8InjectedScriptHost.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
| 8 #include "platform/inspector_protocol/Values.h" | 8 #include "platform/inspector_protocol/Values.h" |
| 9 #include "platform/v8_inspector/InjectedScript.h" | 9 #include "platform/v8_inspector/InjectedScript.h" |
| 10 #include "platform/v8_inspector/InjectedScriptHost.h" | 10 #include "platform/v8_inspector/InjectedScriptHost.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 { | 172 { |
| 173 v8::Local<v8::Array> result = v8::Array::New(isolate); | 173 v8::Local<v8::Array> result = v8::Array::New(isolate); |
| 174 size_t handlersCount = listeners.size(); | 174 size_t handlersCount = listeners.size(); |
| 175 for (size_t i = 0, outputIndex = 0; i < handlersCount; ++i) { | 175 for (size_t i = 0, outputIndex = 0; i < handlersCount; ++i) { |
| 176 if (listeners[i].eventType != type) | 176 if (listeners[i].eventType != type) |
| 177 continue; | 177 continue; |
| 178 v8::Local<v8::Object> function = listeners[i].handler; | 178 v8::Local<v8::Object> function = listeners[i].handler; |
| 179 v8::Local<v8::Object> listenerEntry = v8::Object::New(isolate); | 179 v8::Local<v8::Object> listenerEntry = v8::Object::New(isolate); |
| 180 listenerEntry->Set(toV8StringInternalized(isolate, "listener"), function
); | 180 listenerEntry->Set(toV8StringInternalized(isolate, "listener"), function
); |
| 181 listenerEntry->Set(toV8StringInternalized(isolate, "useCapture"), v8::Bo
olean::New(isolate, listeners[i].useCapture)); | 181 listenerEntry->Set(toV8StringInternalized(isolate, "useCapture"), v8::Bo
olean::New(isolate, listeners[i].useCapture)); |
| 182 listenerEntry->Set(toV8StringInternalized(isolate, "passive"), v8::Boole
an::New(isolate, listeners[i].passive)); |
| 182 result->Set(v8::Number::New(isolate, outputIndex++), listenerEntry); | 183 result->Set(v8::Number::New(isolate, outputIndex++), listenerEntry); |
| 183 } | 184 } |
| 184 return result; | 185 return result; |
| 185 } | 186 } |
| 186 | 187 |
| 187 void V8InjectedScriptHost::getEventListenersCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 188 void V8InjectedScriptHost::getEventListenersCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 188 { | 189 { |
| 189 if (info.Length() < 1) | 190 if (info.Length() < 1) |
| 190 return; | 191 return; |
| 191 | 192 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 { | 428 { |
| 428 return InjectedScriptHostWrapper::wrap(constructorTemplate, context, host); | 429 return InjectedScriptHostWrapper::wrap(constructorTemplate, context, host); |
| 429 } | 430 } |
| 430 | 431 |
| 431 InjectedScriptHost* V8InjectedScriptHost::unwrap(v8::Local<v8::Context> context,
v8::Local<v8::Object> object) | 432 InjectedScriptHost* V8InjectedScriptHost::unwrap(v8::Local<v8::Context> context,
v8::Local<v8::Object> object) |
| 432 { | 433 { |
| 433 return InjectedScriptHostWrapper::unwrap(context, object); | 434 return InjectedScriptHostWrapper::unwrap(context, object); |
| 434 } | 435 } |
| 435 | 436 |
| 436 } // namespace blink | 437 } // namespace blink |
| OLD | NEW |