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

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

Issue 972313002: Make <webview> use out-of-process iframe architecture. (Closed) Base URL: ssh://saopaulo.wat/mnt/dev/shared/src@testoopif2z-better-chrome
Patch Set: Make <webview> work without --site-per-process as well Created 5 years, 7 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 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 while ((observer = it.GetNext()) != NULL) { 995 while ((observer = it.GetNext()) != NULL) {
996 if (observer->OnMessageReceived(msg)) 996 if (observer->OnMessageReceived(msg))
997 return true; 997 return true;
998 } 998 }
999 999
1000 bool handled = true; 1000 bool handled = true;
1001 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) 1001 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg)
1002 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) 1002 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate)
1003 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) 1003 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload)
1004 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) 1004 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut)
1005 IPC_MESSAGE_HANDLER(FrameMsg_ReplaceLocalFrameWithProxy,
1006 OnReplaceLocalFrameWithProxy)
1005 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop) 1007 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop)
1006 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) 1008 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed)
1007 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, 1009 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction,
1008 OnCustomContextMenuAction) 1010 OnCustomContextMenuAction)
1009 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo) 1011 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo)
1010 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo) 1012 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo)
1011 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut) 1013 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut)
1012 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy) 1014 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy)
1013 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste) 1015 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste)
1014 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) 1016 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle)
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 // When we do an unconditional swap for all frames, we can remove 1345 // When we do an unconditional swap for all frames, we can remove
1344 // !is_main_frame below. 1346 // !is_main_frame below.
1345 if (is_site_per_process && proxy && !is_main_frame) 1347 if (is_site_per_process && proxy && !is_main_frame)
1346 proxy->SetReplicatedState(replicated_frame_state); 1348 proxy->SetReplicatedState(replicated_frame_state);
1347 1349
1348 // Safe to exit if no one else is using the process. 1350 // Safe to exit if no one else is using the process.
1349 if (is_main_frame) 1351 if (is_main_frame)
1350 render_view_->WasSwappedOut(); 1352 render_view_->WasSwappedOut();
1351 } 1353 }
1352 1354
1355 void RenderFrameImpl::OnReplaceLocalFrameWithProxy(int proxy_routing_id) {
1356 RenderFrameProxy* proxy_to_replace_frame = RenderFrameProxy::FromRoutingID(
1357 proxy_routing_id);
1358 DCHECK(proxy_to_replace_frame);
1359
1360 blink::WebRemoteFrame* web_frame =
1361 blink::WebRemoteFrame::create(proxy_to_replace_frame);
Charlie Reis 2015/04/30 23:06:47 It's not obvious why the existing proxy and swap c
lazyboy 2015/05/05 07:28:15 Using OnSwapOut() now. Lucas and I checked this bi
1362 proxy_to_replace_frame->SetWebRemoteFrame(web_frame);
1363 proxy_to_replace_frame->web_frame()->initializeFromFrame(frame_);
1364 frame_->swap(proxy_to_replace_frame->web_frame());
1365 render_view_->RegisterRenderFrameProxy(proxy_to_replace_frame);
1366 }
1367
1353 void RenderFrameImpl::OnContextMenuClosed( 1368 void RenderFrameImpl::OnContextMenuClosed(
1354 const CustomContextMenuContext& custom_context) { 1369 const CustomContextMenuContext& custom_context) {
1355 if (custom_context.request_id) { 1370 if (custom_context.request_id) {
1356 // External request, should be in our map. 1371 // External request, should be in our map.
1357 ContextMenuClient* client = 1372 ContextMenuClient* client =
1358 pending_context_menus_.Lookup(custom_context.request_id); 1373 pending_context_menus_.Lookup(custom_context.request_id);
1359 if (client) { 1374 if (client) {
1360 client->OnMenuClosed(custom_context.request_id); 1375 client->OnMenuClosed(custom_context.request_id);
1361 pending_context_menus_.Remove(custom_context.request_id); 1376 pending_context_menus_.Remove(custom_context.request_id);
1362 } 1377 }
(...skipping 3508 matching lines...) Expand 10 before | Expand all | Expand 10 after
4871 #elif defined(ENABLE_BROWSER_CDMS) 4886 #elif defined(ENABLE_BROWSER_CDMS)
4872 cdm_manager_, 4887 cdm_manager_,
4873 #endif 4888 #endif
4874 this); 4889 this);
4875 } 4890 }
4876 4891
4877 return cdm_factory_; 4892 return cdm_factory_;
4878 } 4893 }
4879 4894
4880 } // namespace content 4895 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698