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

Side by Side Diff: content/renderer/render_frame_impl.h

Issue 837283003: Start replicating sandbox flags for OOPIF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add conversion functions for SandboxFlags Created 5 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 class RendererAccessibility; 84 class RendererAccessibility;
85 class RendererCdmManager; 85 class RendererCdmManager;
86 class RendererMediaPlayerManager; 86 class RendererMediaPlayerManager;
87 class RendererPpapiHost; 87 class RendererPpapiHost;
88 class RenderFrameObserver; 88 class RenderFrameObserver;
89 class RenderViewImpl; 89 class RenderViewImpl;
90 class RenderWidget; 90 class RenderWidget;
91 class RenderWidgetFullscreenPepper; 91 class RenderWidgetFullscreenPepper;
92 class ScreenOrientationDispatcher; 92 class ScreenOrientationDispatcher;
93 class UserMediaClientImpl; 93 class UserMediaClientImpl;
94 enum class SandboxFlags;
94 struct CommitNavigationParams; 95 struct CommitNavigationParams;
95 struct CommonNavigationParams; 96 struct CommonNavigationParams;
96 struct CustomContextMenuContext; 97 struct CustomContextMenuContext;
97 struct FrameReplicationState; 98 struct FrameReplicationState;
98 struct RequestNavigationParams; 99 struct RequestNavigationParams;
99 struct ResourceResponseHead; 100 struct ResourceResponseHead;
100 101
101 class CONTENT_EXPORT RenderFrameImpl 102 class CONTENT_EXPORT RenderFrameImpl
102 : public RenderFrame, 103 : public RenderFrame,
103 NON_EXPORTED_BASE(public blink::WebFrameClient), 104 NON_EXPORTED_BASE(public blink::WebFrameClient),
(...skipping 11 matching lines...) Expand all
115 // identified by |parent_routing_id| or as the top-level frame if the latter 116 // identified by |parent_routing_id| or as the top-level frame if the latter
116 // is MSG_ROUTING_NONE. If |proxy_routing_id| is MSG_ROUTING_NONE, it creates 117 // is MSG_ROUTING_NONE. If |proxy_routing_id| is MSG_ROUTING_NONE, it creates
117 // the Blink WebLocalFrame and inserts it in the proper place in the frame 118 // the Blink WebLocalFrame and inserts it in the proper place in the frame
118 // tree. Otherwise, the frame is semi-orphaned until it commits, at which 119 // tree. Otherwise, the frame is semi-orphaned until it commits, at which
119 // point it replaces the proxy identified by |proxy_routing_id|. 120 // point it replaces the proxy identified by |proxy_routing_id|.
120 // Note: This is called only when RenderFrame is being created in response to 121 // Note: This is called only when RenderFrame is being created in response to
121 // IPC message from the browser process. All other frame creation is driven 122 // IPC message from the browser process. All other frame creation is driven
122 // through Blink and Create. 123 // through Blink and Create.
123 static void CreateFrame(int routing_id, 124 static void CreateFrame(int routing_id,
124 int parent_routing_id, 125 int parent_routing_id,
125 int proxy_routing_id); 126 int proxy_routing_id,
127 const FrameReplicationState& replicated_state);
126 128
127 // Returns the RenderFrameImpl for the given routing ID. 129 // Returns the RenderFrameImpl for the given routing ID.
128 static RenderFrameImpl* FromRoutingID(int routing_id); 130 static RenderFrameImpl* FromRoutingID(int routing_id);
129 131
130 // Just like RenderFrame::FromWebFrame but returns the implementation. 132 // Just like RenderFrame::FromWebFrame but returns the implementation.
131 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame); 133 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame);
132 134
133 // Used by content_layouttest_support to hook into the creation of 135 // Used by content_layouttest_support to hook into the creation of
134 // RenderFrameImpls. 136 // RenderFrameImpls.
135 using CreateRenderFrameImplFunction = RenderFrameImpl* (*)(RenderViewImpl*, 137 using CreateRenderFrameImplFunction = RenderFrameImpl* (*)(RenderViewImpl*,
136 int32); 138 int32);
137 static void InstallCreateHook( 139 static void InstallCreateHook(
138 CreateRenderFrameImplFunction create_render_frame_impl); 140 CreateRenderFrameImplFunction create_render_frame_impl);
139 141
142 static content::SandboxFlags WebToContentSandboxFlags(
143 blink::WebSandboxFlags flags);
144
145 static blink::WebSandboxFlags ContentToWebSandboxFlags(
146 content::SandboxFlags flags);
147
140 virtual ~RenderFrameImpl(); 148 virtual ~RenderFrameImpl();
141 149
142 bool is_swapped_out() const { 150 bool is_swapped_out() const {
143 return is_swapped_out_; 151 return is_swapped_out_;
144 } 152 }
145 153
146 // TODO(nasko): This can be removed once we don't have a swapped out state on 154 // TODO(nasko): This can be removed once we don't have a swapped out state on
147 // RenderFrames. See https://crbug.com/357747. 155 // RenderFrames. See https://crbug.com/357747.
148 void set_render_frame_proxy(RenderFrameProxy* proxy) { 156 void set_render_frame_proxy(RenderFrameProxy* proxy) {
149 render_frame_proxy_ = proxy; 157 render_frame_proxy_ = proxy;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 blink::WebApplicationCacheHostClient* client); 342 blink::WebApplicationCacheHostClient* client);
335 virtual blink::WebWorkerPermissionClientProxy* 343 virtual blink::WebWorkerPermissionClientProxy*
336 createWorkerPermissionClientProxy(blink::WebLocalFrame* frame); 344 createWorkerPermissionClientProxy(blink::WebLocalFrame* frame);
337 virtual blink::WebExternalPopupMenu* createExternalPopupMenu( 345 virtual blink::WebExternalPopupMenu* createExternalPopupMenu(
338 const blink::WebPopupMenuInfo& popup_menu_info, 346 const blink::WebPopupMenuInfo& popup_menu_info,
339 blink::WebExternalPopupMenuClient* popup_menu_client); 347 blink::WebExternalPopupMenuClient* popup_menu_client);
340 virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame); 348 virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame);
341 virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider( 349 virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider(
342 blink::WebLocalFrame* frame); 350 blink::WebLocalFrame* frame);
343 virtual void didAccessInitialDocument(blink::WebLocalFrame* frame); 351 virtual void didAccessInitialDocument(blink::WebLocalFrame* frame);
352 // TODO(alexmos): Remove once Blink is updated to use the version that takes
353 // sandboxFlags.
344 virtual blink::WebFrame* createChildFrame(blink::WebLocalFrame* parent, 354 virtual blink::WebFrame* createChildFrame(blink::WebLocalFrame* parent,
345 const blink::WebString& name); 355 const blink::WebString& name);
356 virtual blink::WebFrame* createChildFrame(
357 blink::WebLocalFrame* parent,
358 const blink::WebString& name,
359 blink::WebSandboxFlags sandboxFlags);
346 virtual void didDisownOpener(blink::WebLocalFrame* frame); 360 virtual void didDisownOpener(blink::WebLocalFrame* frame);
347 virtual void frameDetached(blink::WebFrame* frame); 361 virtual void frameDetached(blink::WebFrame* frame);
348 virtual void frameFocused(); 362 virtual void frameFocused();
349 virtual void willClose(blink::WebFrame* frame); 363 virtual void willClose(blink::WebFrame* frame);
350 virtual void didChangeName(blink::WebLocalFrame* frame, 364 virtual void didChangeName(blink::WebLocalFrame* frame,
351 const blink::WebString& name); 365 const blink::WebString& name);
352 virtual void didMatchCSS( 366 virtual void didMatchCSS(
353 blink::WebLocalFrame* frame, 367 blink::WebLocalFrame* frame,
354 const blink::WebVector<blink::WebString>& newly_matching_selectors, 368 const blink::WebVector<blink::WebString>& newly_matching_selectors,
355 const blink::WebVector<blink::WebString>& stopped_matching_selectors); 369 const blink::WebVector<blink::WebString>& stopped_matching_selectors);
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 #endif 850 #endif
837 851
838 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; 852 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
839 853
840 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); 854 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
841 }; 855 };
842 856
843 } // namespace content 857 } // namespace content
844 858
845 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 859 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698