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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 32343006: Turn the flag off and see what happens (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable tests Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/swapped_out_messages.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index c848027768d1f10cea884eab901fdab9e881a4f3..cb0575e77d5bd240a33e73e343ef2e421187487d 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -199,27 +199,23 @@ void RenderFrameImpl::didAccessInitialDocument(WebKit::WebFrame* frame) {
WebKit::WebFrame* RenderFrameImpl::createChildFrame(
WebKit::WebFrame* parent,
const WebKit::WebString& name) {
- RenderFrameImpl* child_render_frame = this;
long long child_frame_identifier = WebFrame::generateEmbedderIdentifier();
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) {
- // Synchronously notify the browser of a child frame creation to get the
- // routing_id for the RenderFrame.
- int routing_id;
- Send(new FrameHostMsg_CreateChildFrame(GetRoutingID(),
- parent->identifier(),
- child_frame_identifier,
- UTF16ToUTF8(name),
- &routing_id));
- child_render_frame = RenderFrameImpl::Create(render_view_, routing_id);
- }
+ // Synchronously notify the browser of a child frame creation to get the
+ // routing_id for the RenderFrame.
+ int routing_id;
+ Send(new FrameHostMsg_CreateChildFrame(GetRoutingID(),
+ parent->identifier(),
+ child_frame_identifier,
+ UTF16ToUTF8(name),
+ &routing_id));
+ RenderFrameImpl* child_render_frame =
+ RenderFrameImpl::Create(render_view_, routing_id);
WebKit::WebFrame* web_frame = WebFrame::create(child_render_frame,
child_frame_identifier);
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) {
- g_child_frame_map.Get().insert(
- std::make_pair(web_frame, child_render_frame));
- }
+ g_child_frame_map.Get().insert(
+ std::make_pair(web_frame, child_render_frame));
return web_frame;
}
@@ -229,35 +225,33 @@ void RenderFrameImpl::didDisownOpener(WebKit::WebFrame* frame) {
}
void RenderFrameImpl::frameDetached(WebKit::WebFrame* frame) {
- // Currently multiple WebCore::Frames can send frameDetached to a single
- // RenderFrameImpl. This is legacy behavior from when RenderViewImpl served
- // as a shared WebFrameClient for multiple Webcore::Frame objects. It also
- // prevents this class from entering the |is_detaching_| state because
- // even though one WebCore::Frame may have detached itself, others will
- // still need to use this object.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) {
- // TODO(ajwong): Add CHECK(!is_detaching_) once we guarantee each
- // RenderFrameImpl is only used by one WebCore::Frame.
- is_detaching_ = true;
- }
-
int64 parent_frame_id = -1;
if (frame->parent())
parent_frame_id = frame->parent()->identifier();
- render_view_->Send(new FrameHostMsg_Detach(GetRoutingID(), parent_frame_id,
- frame->identifier()));
+ Send(new FrameHostMsg_Detach(GetRoutingID(), parent_frame_id,
+ frame->identifier()));
+
+ // Mark ourselves as officially detaching after the message has been sent
+ // to the browser. This will disable sending of any further messages
+ // from this object.
+ CHECK(!is_detaching_);
+// is_detaching_ = true;
// Call back to RenderViewImpl for observers to be notified.
// TODO(nasko): Remove once we have RenderFrameObserver.
render_view_->frameDetached(frame);
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) {
+ // The main frame's RenderFrameImpl is allocated manually by RenderViewImpl so
+ // it is not recorded in this map.
+ //
+ // TODO(ajwong): Use english when writing this comment.
+ if(frame->parent()) {
FrameMap::iterator it = g_child_frame_map.Get().find(frame);
DCHECK(it != g_child_frame_map.Get().end());
DCHECK_EQ(it->second, this);
- delete it->second;
g_child_frame_map.Get().erase(it);
+ delete this;
}
frame->close();
« no previous file with comments | « content/common/swapped_out_messages.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698