// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
enum MojoInterfaceInterceptorScope {
// The browser interface broker used by Blink C++ code. It normally routes
// requests to an appropriate browser-side context, such as RenderFrameHost,
// SharedWorkHost.
"context",
// Valid only if MojoJSInterfaceBroker is used. By using this scope, the
// created MojoInterfaceInterceptor will only intercept requests from
// JavaScript Mojo.bindInterface calls, but not those from Blink C++ code.
"context_js",
// The process wide BrowserInterfaceBroker used by Blink C++ code. It
// normally routes requests to the browser-side RenderProcessHost.
"process",
};
[
ActiveScriptWrappable,
Exposed=(Window,Worker),
RuntimeEnabled=MojoJSTest
] interface MojoInterfaceInterceptor : EventTarget {
[CallWith=ExecutionContext, RaisesException] constructor(DOMString interfaceName, optional MojoInterfaceInterceptorScope scope = "context");
[RaisesException] void start();
void stop();
attribute EventHandler oninterfacerequest;
};