• Alexey Kozyatinskiy's avatar
    [inspector] added Runtime.installBinding method · 49c4ac77
    Alexey Kozyatinskiy authored
    A lot of different clients use console.debug as a message channel from
    page to protocol client. console.debug is a little slow and not
    designed for this use case.
    
    This CL introduces new method: Runtime.installBinding. This method
    installs binding function by given name on global object on each
    inspected context including any context created later.
    Binding function takes exactly one string argument. Each time when
    binding function is called, Runtime.bindingCalled notification is
    triggered and includes passed payload.
    
    Binding function survives page reload and reinstalled right after
    console object is setup. So installed binding can be used inside
    script added by Page.addScriptToEvaluateOnNewDocument so client may do
    something like:
    Runtime.installBinding({name: 'send'});
    Page.addScriptToEvaluateOnNewDocument({source: 'console.debug = send'});
    .. navigate page ..
    
    In microbenchmark this function is ~4.6 times faster then
    console.debug.
    
    R=lushnikov@chromium.org,pfeldman@chromium.org
    
    Bug: none
    Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
    Change-Id: I3e0e231dde9d45116709d248f6e9e7ec7037e8e3
    Reviewed-on: https://chromium-review.googlesource.com/1077662
    Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
    Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#53462}
    49c4ac77
Name
Last commit
Last update
..
build Loading commit data...
BUILD.gn Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
injected-script-source.js Loading commit data...
injected-script.cc Loading commit data...
injected-script.h Loading commit data...
injected_script_externs.js Loading commit data...
inspected-context.cc Loading commit data...
inspected-context.h Loading commit data...
inspector_protocol_config.json Loading commit data...
js_protocol-1.2.json Loading commit data...
js_protocol-1.3.json Loading commit data...
js_protocol.json Loading commit data...
js_protocol.pdl Loading commit data...
remote-object-id.cc Loading commit data...
remote-object-id.h Loading commit data...
search-util.cc Loading commit data...
search-util.h Loading commit data...
string-16.cc Loading commit data...
string-16.h Loading commit data...
string-util.cc Loading commit data...
string-util.h Loading commit data...
test-interface.cc Loading commit data...
test-interface.h Loading commit data...
v8-console-agent-impl.cc Loading commit data...
v8-console-agent-impl.h Loading commit data...
v8-console-message.cc Loading commit data...
v8-console-message.h Loading commit data...
v8-console.cc Loading commit data...
v8-console.h Loading commit data...
v8-debugger-agent-impl.cc Loading commit data...
v8-debugger-agent-impl.h Loading commit data...
v8-debugger-script.cc Loading commit data...
v8-debugger-script.h Loading commit data...
v8-debugger.cc Loading commit data...
v8-debugger.h Loading commit data...
v8-function-call.cc Loading commit data...
v8-function-call.h Loading commit data...
v8-heap-profiler-agent-impl.cc Loading commit data...
v8-heap-profiler-agent-impl.h Loading commit data...
v8-injected-script-host.cc Loading commit data...
v8-injected-script-host.h Loading commit data...
v8-inspector-impl.cc Loading commit data...
v8-inspector-impl.h Loading commit data...
v8-inspector-session-impl.cc Loading commit data...
v8-inspector-session-impl.h Loading commit data...
v8-internal-value-type.cc Loading commit data...
v8-internal-value-type.h Loading commit data...
v8-profiler-agent-impl.cc Loading commit data...
v8-profiler-agent-impl.h Loading commit data...
v8-regex.cc Loading commit data...
v8-regex.h Loading commit data...
v8-runtime-agent-impl.cc Loading commit data...
v8-runtime-agent-impl.h Loading commit data...
v8-schema-agent-impl.cc Loading commit data...
v8-schema-agent-impl.h Loading commit data...
v8-stack-trace-impl.cc Loading commit data...
v8-stack-trace-impl.h Loading commit data...
v8-value-utils.cc Loading commit data...
v8-value-utils.h Loading commit data...
wasm-translation.cc Loading commit data...
wasm-translation.h Loading commit data...