Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: content/common/frame.mojom

Issue 2821473002: Service CreateNewWindow on the UI thread with a new mojo interface (Closed)
Patch Set: MakeShared goodness Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 module content.mojom; 5 module content.mojom;
6 6
7 import "content/public/common/window_container_type.mojom";
7 import "services/service_manager/public/interfaces/interface_provider.mojom"; 8 import "services/service_manager/public/interfaces/interface_provider.mojom";
9 import "third_party/WebKit/public/platform/referrer.mojom";
10 import "third_party/WebKit/public/web/window_features.mojom";
11 import "ui/base/mojo/window_open_disposition.mojom";
12 import "url/mojo/url.mojom";
8 13
9 // The name of the InterfaceProviderSpec in service manifests used by the 14 // The name of the InterfaceProviderSpec in service manifests used by the
10 // frame tree to expose frame-specific interfaces between renderer and browser. 15 // frame tree to expose frame-specific interfaces between renderer and browser.
11 const string kNavigation_FrameSpec = "navigation:frame"; 16 const string kNavigation_FrameSpec = "navigation:frame";
12 17
13 // Implemented by the frame provider (e.g. renderer processes). 18 // Implemented by the frame provider (e.g. renderer processes).
14 interface Frame { 19 interface Frame {
15 GetInterfaceProvider(service_manager.mojom.InterfaceProvider& interfaces); 20 GetInterfaceProvider(service_manager.mojom.InterfaceProvider& interfaces);
16 }; 21 };
17 22
18 // Implemented by the frame (e.g. renderer processes). 23 // Implemented by the frame (e.g. renderer processes).
19 // Instances of this interface must be associated with (i.e., FIFO with) the 24 // Instances of this interface must be associated with (i.e., FIFO with) the
20 // legacy IPC channel. 25 // legacy IPC channel.
21 interface FrameBindingsControl { 26 interface FrameBindingsControl {
22 // Used to tell a render frame whether it should expose various bindings 27 // Used to tell a render frame whether it should expose various bindings
23 // that allow JS content extended privileges. See BindingsPolicy for valid 28 // that allow JS content extended privileges. See BindingsPolicy for valid
24 // flag values. 29 // flag values.
25 AllowBindings(int32 enabled_bindings_flags); 30 AllowBindings(int32 enabled_bindings_flags);
26 }; 31 };
27 32
28 // Implemented by the frame server (i.e. the browser process). 33 // Implemented by the frame server (i.e. the browser process).
29 interface FrameHost { 34 interface FrameHostInterfaceBroker {
30 GetInterfaceProvider(service_manager.mojom.InterfaceProvider& interfaces); 35 GetInterfaceProvider(service_manager.mojom.InterfaceProvider& interfaces);
31 }; 36 };
32 37
33 // Implemented by a service that provides implementations of the Frame 38 // Implemented by a service that provides implementations of the Frame
34 // interface. (e.g. renderer processes). 39 // interface. (e.g. renderer processes).
35 interface FrameFactory { 40 interface FrameFactory {
36 CreateFrame(int32 frame_routing_id, Frame& frame, FrameHost host); 41 CreateFrame(int32 frame_routing_id, Frame& frame, FrameHostInterfaceBroker hos t);
37 }; 42 };
43
44 // TODO(csharrison): Clean up this struct. Some of the entries (like
45 // opener_top_level_frame_url) are better suited to be computed in the browser
46 // process. See http://crbug.com/674307.
47 struct CreateNewWindowParams {
48 // True if this open request came in the context of a user gesture.
49 bool user_gesture;
50
51 // Type of window requested.
52 WindowContainerType window_container_type;
53
54 // The session storage namespace ID this window should use.
55 int64 session_storage_namespace_id;
56
57 // The name of the resulting frame that should be created (empty if none
58 // has been specified). UTF8 encoded string.
59 string frame_name;
60
61 // The URL of the frame initiating the open.
62 url.mojom.Url opener_url;
63
64 // The URL of the top frame containing the opener.
65 url.mojom.Url opener_top_level_frame_url;
66
67 // The security origin of the frame initiating the open.
68 url.mojom.Url opener_security_origin;
69
70 // Whether the opener will be suppressed in the new window, in which case
71 // scripting the new window is not allowed.
72 bool opener_suppressed;
73
74 // Whether the window should be opened in the foreground, background, etc.
75 ui.mojom.WindowOpenDisposition disposition;
76
77 // The URL that will be loaded in the new window (empty if none has been
78 // specified).
79 url.mojom.Url target_url;
80
81 // The referrer that will be used to load |target_url| (empty if none has
82 // been specified).
83 blink.mojom.Referrer referrer;
84
85 // The window features to use for the new window.
86 blink.mojom.WindowFeatures features;
87 };
88
89 struct CreateNewWindowReply {
90 // The ID of the view to be created. If the ID is MSG_ROUTING_NONE, then the
91 // opener RenderFrame should not create a RenderView in its process.
92 // MSG_ROUTING_NONE does not necessarily indicate failure; it may also occur
93 // in cases where a window was created, but the opener relationship is
94 // severed.
95 int32 route_id;
96
97 // The ID of the main frame hosted in the view.
98 int32 main_frame_route_id;
99
100 // The ID of the widget for the main frame.
101 int32 main_frame_widget_route_id;
102
103 // Duplicated from CreateNewWindowParams because legacy code.
104 int64 cloned_session_storage_namespace_id;
105 };
106
107 // Implemented by the frame server (i.e. the browser process). For messages that
108 // must be associated with the IPC channel.
109 interface FrameHost {
110 // Sent by the renderer when it is creating a new window. The browser creates
111 // a tab for it. If |reply.route_id| is MSG_ROUTING_NONE, the window couldn't
112 // be created.
113 [Sync] CreateNewWindow(CreateNewWindowParams params)
114 => (CreateNewWindowReply reply);
115 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698