mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 14:26:09 +03:00
258 lines
11 KiB
Plaintext
258 lines
11 KiB
Plaintext
// Copyright 2016 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
module content.mojom;
|
|
|
|
import "content/common/native_types.mojom";
|
|
import "content/common/service_worker/embedded_worker.mojom";
|
|
import "ipc/constants.mojom";
|
|
import "mojo/public/mojom/base/time.mojom";
|
|
import "mojo/public/mojom/base/unguessable_token.mojom";
|
|
import "services/network/public/mojom/network_types.mojom";
|
|
import "services/service_manager/public/mojom/interface_provider.mojom";
|
|
import "services/service_manager/public/mojom/service.mojom";
|
|
import "ui/gfx/geometry/mojo/geometry.mojom";
|
|
import "ui/gfx/mojo/icc_profile.mojom";
|
|
|
|
struct CreateViewParams {
|
|
// Renderer-wide preferences.
|
|
RendererPreferences renderer_preferences;
|
|
|
|
// Preferences for this view.
|
|
WebPreferences web_preferences;
|
|
|
|
// The ID of the view to be created.
|
|
int32 view_id = IPC.mojom.kRoutingIdNone;
|
|
|
|
// The ID of the main frame hosted in the view, or None if creating a view to
|
|
// host a main frame proxy.
|
|
int32 main_frame_routing_id = IPC.mojom.kRoutingIdNone;
|
|
|
|
// The InterfaceProvider through which the main RenderFrame can access
|
|
// services exposed by its RenderFrameHost.
|
|
//
|
|
// This is null precisely when |main_frame_routing_id| is MSG_ROUTING_NONE,
|
|
// that is, when creating a RenderView for a remote main frame.
|
|
service_manager.mojom.InterfaceProvider? main_frame_interface_provider;
|
|
|
|
// The ID of the widget for the main frame.
|
|
int32 main_frame_widget_routing_id = IPC.mojom.kRoutingIdNone;
|
|
|
|
// The session storage namespace ID this view should use.
|
|
string session_storage_namespace_id;
|
|
|
|
// The route ID of the opener RenderFrame or RenderFrameProxy, if we need to
|
|
// set one (MSG_ROUTING_NONE otherwise).
|
|
int32 opener_frame_route_id = IPC.mojom.kRoutingIdNone;
|
|
|
|
// Whether the RenderView should initially be swapped out.
|
|
bool swapped_out;
|
|
|
|
// Carries replicated information, such as frame name and sandbox flags, for
|
|
// this view's main frame, which will be a proxy in |swapped_out|
|
|
// views when in --site-per-process mode, or a RenderFrame in all other
|
|
// cases.
|
|
FrameReplicationState replicated_frame_state;
|
|
|
|
// Used for devtools instrumentation and trace-ability. The token is
|
|
// propagated to Blink's LocalFrame and both Blink and content/
|
|
// can tag calls and requests with this instrumentation token in order to
|
|
// attribute them to the context frame.
|
|
// |devtools_main_frame_token| is only defined by the browser and is never
|
|
// sent back from the renderer in the control calls.
|
|
mojo_base.mojom.UnguessableToken devtools_main_frame_token;
|
|
|
|
// The ID of the proxy object for the main frame in this view. It is only
|
|
// used if |swapped_out| is true.
|
|
int32 proxy_routing_id = IPC.mojom.kRoutingIdNone;
|
|
|
|
// Whether the RenderView should initially be hidden.
|
|
bool hidden;
|
|
|
|
// Whether the RenderView will never be visible.
|
|
bool never_visible;
|
|
|
|
// Whether the window associated with this view was created with an opener.
|
|
bool window_was_created_with_opener;
|
|
|
|
// Whether or not the frame has previously committed a real load.
|
|
bool has_committed_real_load;
|
|
|
|
// The initial renderer size.
|
|
VisualProperties visual_properties;
|
|
|
|
// The page zoom level.
|
|
double page_zoom_level;
|
|
|
|
// Whether lookup of frames in the created RenderView (e.g. lookup via
|
|
// window.open or via <a target=...>) should be renderer-wide (i.e. going
|
|
// beyond the usual opener-relationship-based BrowsingInstance boundaries).
|
|
bool renderer_wide_named_frame_lookup;
|
|
};
|
|
|
|
struct CreateFrameWidgetParams {
|
|
// Gives the routing ID for the RenderWidget that will be attached to the
|
|
// new RenderFrame. If the RenderFrame does not need a RenderWidget, this
|
|
// is MSG_ROUTING_NONE and the other parameters are not read.
|
|
int32 routing_id;
|
|
|
|
// Tells the new RenderWidget whether it is initially hidden.
|
|
bool hidden;
|
|
};
|
|
|
|
struct CreateFrameParams {
|
|
// Specifies the routing ID of the new RenderFrame object.
|
|
int32 routing_id;
|
|
|
|
// If a valid |proxy_routing_id| is provided, the new frame will be
|
|
// configured to replace the proxy on commit.
|
|
int32 proxy_routing_id;
|
|
|
|
// Specifies the new frame's opener. The opener will be null if this is
|
|
// MSG_ROUTING_NONE.
|
|
int32 opener_routing_id;
|
|
|
|
// The new frame should be created as a child of the object
|
|
// identified by |parent_routing_id| or as top level if that is
|
|
// MSG_ROUTING_NONE.
|
|
int32 parent_routing_id;
|
|
|
|
// Identifies the previous sibling of the new frame, so that the new frame is
|
|
// inserted into the correct place in the frame tree. If this is
|
|
// MSG_ROUTING_NONE, the frame will be created as the leftmost child of its
|
|
// parent frame, in front of any other children.
|
|
int32 previous_sibling_routing_id;
|
|
|
|
// The InterfaceProvider through which the RenderFrame can access services
|
|
// exposed by its RenderFrameHost.
|
|
service_manager.mojom.InterfaceProvider interface_provider;
|
|
|
|
// When the new frame has a parent, |replication_state| holds the new frame's
|
|
// properties replicated from the process rendering the parent frame, such as
|
|
// the new frame's sandbox flags.
|
|
FrameReplicationState replication_state;
|
|
|
|
// Used for devtools instrumentation and trace-ability. The token is
|
|
// propagated to Blink's LocalFrame and both Blink and content/
|
|
// can tag calls and requests with this instrumentation token in order to
|
|
// attribute them to the context frame.
|
|
// |devtools_frame_token| is only defined by the browser and is never
|
|
// sent back from the renderer in the control calls.
|
|
mojo_base.mojom.UnguessableToken devtools_frame_token;
|
|
|
|
// When the new frame has a parent, |frame_owner_properties| holds the
|
|
// properties of the HTMLFrameOwnerElement from the parent process.
|
|
// Note that unlike FrameReplicationState, this is not replicated for remote
|
|
// frames.
|
|
FrameOwnerProperties frame_owner_properties;
|
|
|
|
// Specifies properties for a new RenderWidget that will be attached to the
|
|
// new RenderFrame (if one is needed).
|
|
CreateFrameWidgetParams widget_params;
|
|
|
|
// Whether or not the frame has previously committed a real load.
|
|
bool has_committed_real_load;
|
|
};
|
|
|
|
struct UpdateScrollbarThemeParams {
|
|
float initial_button_delay;
|
|
float autoscroll_button_delay;
|
|
bool jump_on_track_click;
|
|
ScrollerStyle preferred_scroller_style;
|
|
bool redraw;
|
|
ScrollbarButtonsPlacement button_placement;
|
|
bool scroll_view_rubber_banding;
|
|
};
|
|
|
|
// The primordial Channel-associated interface implemented by a render process.
|
|
// This should be used for implementing browser-to-renderer control messages
|
|
// which need to retain FIFO with respect to legacy IPC messages.
|
|
interface Renderer {
|
|
// Tells the renderer to ask its embedder to bind |service_request| to an
|
|
// embedder-provided renderer-side service implementation. This is required to
|
|
// ensure that embedder-provided renderer-side service is initialized at the
|
|
// appropriate time.
|
|
CreateEmbedderRendererService(service_manager.mojom.Service& service_request);
|
|
|
|
// Tells the renderer to create a new view.
|
|
CreateView(CreateViewParams params);
|
|
|
|
// Tells the renderer to create a new RenderFrame.
|
|
CreateFrame(CreateFrameParams params);
|
|
|
|
// Tells the renderer to create a new RenderFrameProxy object with
|
|
// |routing_id|. |render_view_routing_id| identifies the
|
|
// RenderView to be associated with this proxy. The new proxy's opener should
|
|
// be set to the object identified by |opener_routing_id|, or to null if that
|
|
// is MSG_ROUTING_NONE. The new proxy should be created as a child of the
|
|
// object identified by |parent_routing_id| or as top level if that is
|
|
// MSG_ROUTING_NONE.
|
|
// |devtools_frame_token| is used for devtools instrumentation
|
|
// and trace-ability. It is defined by the browser and is never
|
|
// sent back from the renderer in the control calls.
|
|
CreateFrameProxy(int32 routing_id, int32 render_view_routing_id,
|
|
int32 opener_routing_id, int32 parent_routing_id,
|
|
FrameReplicationState replication_state,
|
|
mojo_base.mojom.UnguessableToken devtools_frame_token);
|
|
|
|
// Tells the renderer to create an EmbeddedWorkerInstanceClient, which is what
|
|
// manages service worker startup and shutdown.
|
|
// TODO(shimazu): Send all params for starting service worker to reduce the
|
|
// number of IPCs.
|
|
SetUpEmbeddedWorkerChannelForServiceWorker(
|
|
EmbeddedWorkerInstanceClient& client_request);
|
|
|
|
// Tells the renderer that the network type has changed so that
|
|
// navigator.onLine and navigator.connection can be updated.
|
|
OnNetworkConnectionChanged(NetworkConnectionType connection_type,
|
|
double max_bandwidth_mbps);
|
|
|
|
// Tells the renderer process that the network quality estimate has changed.
|
|
// EffectiveConnectionType is the connection type whose typical performance is
|
|
// most similar to the measured performance of the network in use.
|
|
// The downstream throughput is computed in kilobits per second. If an
|
|
// estimate of the HTTP or transport RTT is unavailable, it will be set to
|
|
// net::nqe::internal::InvalidRTT(). If the throughput estimate is
|
|
// unavailable, it will be set to net::nqe::internal::INVALID_RTT_THROUGHPUT.
|
|
OnNetworkQualityChanged(
|
|
network.mojom.EffectiveConnectionType effective_connection_type,
|
|
mojo_base.mojom.TimeDelta http_rtt,
|
|
mojo_base.mojom.TimeDelta transport_rtt,
|
|
double bandwidth_kbps);
|
|
|
|
// Tells the renderer to suspend/resume the webkit timers. Only for use on
|
|
// Android.
|
|
SetWebKitSharedTimersSuspended(bool suspend);
|
|
|
|
// Sets the user-agent string. This is needed because getting the value in the
|
|
// renderer from the system leads to a wrong value due to sandboxing. This
|
|
// must be called as early as possible, during the renderer process
|
|
// initialization.
|
|
SetUserAgent(string user_agent);
|
|
|
|
// Tells the renderer about a scrollbar appearance change. Only for use on
|
|
// OS X.
|
|
UpdateScrollbarTheme(UpdateScrollbarThemeParams params);
|
|
|
|
// Notification that the OS X Aqua color preferences changed.
|
|
OnSystemColorsChanged(int32 aqua_color_variant, string highlight_text_color,
|
|
string highlight_color);
|
|
|
|
// Tells the renderer to empty its plugin list cache, optional reloading
|
|
// pages containing plugins.
|
|
PurgePluginListCache(bool reload_pages);
|
|
|
|
|
|
// Tells the renderer process to enter or leave background mode.
|
|
SetProcessBackgrounded(bool background);
|
|
|
|
// Tells the scheduler about "keep-alive" state which can be due to:
|
|
// service workers, shared workers, or fetch keep-alive.
|
|
// If set to true, then the scheduler should not freeze the renderer.
|
|
SetSchedulerKeepActive(bool keep_active);
|
|
|
|
// Tells the renderer process to purge and suspend.
|
|
ProcessPurgeAndSuspend();
|
|
};
|