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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 212703005: Preserve Page::openedByDOM state across process swaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: creis comments. Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 // WebContentsImpl ------------------------------------------------------------- 302 // WebContentsImpl -------------------------------------------------------------
303 303
304 WebContentsImpl::WebContentsImpl( 304 WebContentsImpl::WebContentsImpl(
305 BrowserContext* browser_context, 305 BrowserContext* browser_context,
306 WebContentsImpl* opener) 306 WebContentsImpl* opener)
307 : delegate_(NULL), 307 : delegate_(NULL),
308 controller_(this, browser_context), 308 controller_(this, browser_context),
309 render_view_host_delegate_view_(NULL), 309 render_view_host_delegate_view_(NULL),
310 opener_(opener), 310 opener_(opener),
311 created_with_opener_(opener != NULL),
nasko 2014/04/08 22:43:25 nit: Most places I've seen use !!ptr for setting b
davidben 2014/04/08 23:48:23 Done. (Huh, didn't know that was our style. Okay.)
311 #if defined(OS_WIN) 312 #if defined(OS_WIN)
312 accessible_parent_(NULL), 313 accessible_parent_(NULL),
313 #endif 314 #endif
314 frame_tree_(new NavigatorImpl(&controller_, this), 315 frame_tree_(new NavigatorImpl(&controller_, this),
315 this, this, this, this), 316 this, this, this, this),
316 is_loading_(false), 317 is_loading_(false),
317 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), 318 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING),
318 crashed_error_code_(0), 319 crashed_error_code_(0),
319 waiting_for_response_(false), 320 waiting_for_response_(false),
320 load_state_(net::LOAD_STATE_IDLE, base::string16()), 321 load_state_(net::LOAD_STATE_IDLE, base::string16()),
(...skipping 3216 matching lines...) Expand 10 before | Expand all | Expand 10 after
3537 rwh_view->SetSize(GetSizeForNewRenderView()); 3538 rwh_view->SetSize(GetSizeForNewRenderView());
3538 3539
3539 // Make sure we use the correct starting page_id in the new RenderView. 3540 // Make sure we use the correct starting page_id in the new RenderView.
3540 UpdateMaxPageIDIfNecessary(render_view_host); 3541 UpdateMaxPageIDIfNecessary(render_view_host);
3541 int32 max_page_id = 3542 int32 max_page_id =
3542 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); 3543 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
3543 3544
3544 if (!static_cast<RenderViewHostImpl*>( 3545 if (!static_cast<RenderViewHostImpl*>(
3545 render_view_host)->CreateRenderView(base::string16(), 3546 render_view_host)->CreateRenderView(base::string16(),
3546 opener_route_id, 3547 opener_route_id,
3547 max_page_id)) { 3548 max_page_id,
3549 created_with_opener_)) {
3548 return false; 3550 return false;
3549 } 3551 }
3550 3552
3551 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 3553 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
3552 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 3554 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
3553 // linux. See crbug.com/83941. 3555 // linux. See crbug.com/83941.
3554 if (rwh_view) { 3556 if (rwh_view) {
3555 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) 3557 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost())
3556 render_widget_host->WasResized(); 3558 render_widget_host->WasResized();
3557 } 3559 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
3674 3676
3675 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { 3677 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) {
3676 if (!delegate_) 3678 if (!delegate_)
3677 return; 3679 return;
3678 const gfx::Size new_size = GetPreferredSize(); 3680 const gfx::Size new_size = GetPreferredSize();
3679 if (new_size != old_size) 3681 if (new_size != old_size)
3680 delegate_->UpdatePreferredSize(this, new_size); 3682 delegate_->UpdatePreferredSize(this, new_size);
3681 } 3683 }
3682 3684
3683 } // namespace content 3685 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698