OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 | 417 |
418 void InjectedScript::setCustomObjectFormatterEnabled(bool enabled) | 418 void InjectedScript::setCustomObjectFormatterEnabled(bool enabled) |
419 { | 419 { |
420 ASSERT(!isEmpty()); | 420 ASSERT(!isEmpty()); |
421 ScriptFunctionCall function(injectedScriptObject(), "setCustomObjectFormatte rEnabled"); | 421 ScriptFunctionCall function(injectedScriptObject(), "setCustomObjectFormatte rEnabled"); |
422 function.appendArgument(enabled); | 422 function.appendArgument(enabled); |
423 RefPtr<JSONValue> result; | 423 RefPtr<JSONValue> result; |
424 makeCall(function, &result); | 424 makeCall(function, &result); |
425 } | 425 } |
426 | 426 |
427 v8::Local<v8::Array> InjectedScript::frameworksEventListeners(v8::Local<v8::Valu e> object) | |
428 { | |
429 ScriptFunctionCall function(injectedScriptObject(), "frameworksEventListener s"); | |
yurys
2015/08/13 23:49:06
Extract common code into a method.
kozy
2015/08/14 17:07:03
Done.
| |
430 function.appendArgument(object); | |
431 bool hadException = false; | |
432 ScriptValue result = callFunctionWithEvalEnabled(function, hadException); | |
433 if (!hadException && !result.isEmpty()) | |
434 return result.v8Value().As<v8::Array>(); | |
435 return v8::Local<v8::Array>(); | |
436 } | |
437 | |
438 v8::Local<v8::Set> InjectedScript::frameworksEventHandlers(v8::Local<v8::Value> object) | |
439 { | |
440 ScriptFunctionCall function(injectedScriptObject(), "frameworksEventHandlers "); | |
441 function.appendArgument(object); | |
442 bool hadException = false; | |
443 ScriptValue result = callFunctionWithEvalEnabled(function, hadException); | |
444 if (!hadException && !result.isEmpty()) | |
445 return result.v8Value().As<v8::Set>(); | |
446 return v8::Local<v8::Set>(); | |
447 } | |
448 | |
427 void InjectedScript::initialize(ScriptValue injectedScriptObject, InspectedState AccessCheck accessCheck) | 449 void InjectedScript::initialize(ScriptValue injectedScriptObject, InspectedState AccessCheck accessCheck) |
428 { | 450 { |
429 m_injectedScriptObject = injectedScriptObject; | 451 m_injectedScriptObject = injectedScriptObject; |
430 m_inspectedStateAccessCheck = accessCheck; | 452 m_inspectedStateAccessCheck = accessCheck; |
431 } | 453 } |
432 | 454 |
433 bool InjectedScript::canAccessInspectedWindow() const | 455 bool InjectedScript::canAccessInspectedWindow() const |
434 { | 456 { |
435 ASSERT(!isEmpty()); | 457 ASSERT(!isEmpty()); |
436 return m_inspectedStateAccessCheck(m_injectedScriptObject.scriptState()); | 458 return m_inspectedStateAccessCheck(m_injectedScriptObject.scriptState()); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
533 *exceptionDetails = TypeBuilder::Debugger::ExceptionDetails::create().se tText(text); | 555 *exceptionDetails = TypeBuilder::Debugger::ExceptionDetails::create().se tText(text); |
534 } else { | 556 } else { |
535 *result = toJSONValue(resultValue); | 557 *result = toJSONValue(resultValue); |
536 if (!*result) | 558 if (!*result) |
537 *result = JSONString::create(String::format("Object has too long ref erence chain(must not be longer than %d)", JSONValue::maxDepth)); | 559 *result = JSONString::create(String::format("Object has too long ref erence chain(must not be longer than %d)", JSONValue::maxDepth)); |
538 } | 560 } |
539 } | 561 } |
540 | 562 |
541 } // namespace blink | 563 } // namespace blink |
542 | 564 |
OLD | NEW |