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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 23129015: Initialize RenderWidget(Host)(View)s with correct visibility state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // static 108 // static
109 size_t RenderWidgetHost::BackingStoreMemorySize() { 109 size_t RenderWidgetHost::BackingStoreMemorySize() {
110 return BackingStoreManager::MemorySize(); 110 return BackingStoreManager::MemorySize();
111 } 111 }
112 112
113 /////////////////////////////////////////////////////////////////////////////// 113 ///////////////////////////////////////////////////////////////////////////////
114 // RenderWidgetHostImpl 114 // RenderWidgetHostImpl
115 115
116 RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, 116 RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
117 RenderProcessHost* process, 117 RenderProcessHost* process,
118 int routing_id) 118 int routing_id,
119 bool hidden)
119 : view_(NULL), 120 : view_(NULL),
120 renderer_initialized_(false), 121 renderer_initialized_(false),
121 hung_renderer_delay_ms_(kHungRendererDelayMs), 122 hung_renderer_delay_ms_(kHungRendererDelayMs),
122 delegate_(delegate), 123 delegate_(delegate),
123 process_(process), 124 process_(process),
124 routing_id_(routing_id), 125 routing_id_(routing_id),
125 surface_id_(0), 126 surface_id_(0),
126 is_loading_(false), 127 is_loading_(false),
127 is_hidden_(false), 128 is_hidden_(hidden),
Charlie Reis 2013/08/19 22:18:02 Ah, so here's the culprit. :)
128 is_fullscreen_(false), 129 is_fullscreen_(false),
129 is_accelerated_compositing_active_(false), 130 is_accelerated_compositing_active_(false),
130 repaint_ack_pending_(false), 131 repaint_ack_pending_(false),
131 resize_ack_pending_(false), 132 resize_ack_pending_(false),
132 overdraw_bottom_height_(0.f), 133 overdraw_bottom_height_(0.f),
133 should_auto_resize_(false), 134 should_auto_resize_(false),
134 waiting_for_screen_rects_ack_(false), 135 waiting_for_screen_rects_ack_(false),
135 accessibility_mode_(AccessibilityModeOff), 136 accessibility_mode_(AccessibilityModeOff),
136 needs_repainting_on_restore_(false), 137 needs_repainting_on_restore_(false),
137 is_unresponsive_(false), 138 is_unresponsive_(false),
(...skipping 30 matching lines...) Expand all
168 process_->GetID(), 169 process_->GetID(),
169 routing_id_); 170 routing_id_);
170 DCHECK(surface_id_); 171 DCHECK(surface_id_);
171 } 172 }
172 173
173 is_threaded_compositing_enabled_ = IsThreadedCompositingEnabled(); 174 is_threaded_compositing_enabled_ = IsThreadedCompositingEnabled();
174 175
175 g_routing_id_widget_map.Get().insert(std::make_pair( 176 g_routing_id_widget_map.Get().insert(std::make_pair(
176 RenderWidgetHostID(process->GetID(), routing_id_), this)); 177 RenderWidgetHostID(process->GetID(), routing_id_), this));
177 process_->AddRoute(routing_id_, this); 178 process_->AddRoute(routing_id_, this);
178 // Because the widget initializes as is_hidden_ == false, 179 if (!hidden)
179 // tell the process host that we're alive. 180 process_->WidgetRestored();
180 process_->WidgetRestored();
181 181
182 accessibility_mode_ = 182 accessibility_mode_ =
183 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); 183 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode();
184 184
185 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++) 185 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++)
186 g_created_callbacks.Get().at(i).Run(this); 186 g_created_callbacks.Get().at(i).Run(this);
187 187
188 input_router_.reset(new ImmediateInputRouter(process, this, routing_id_)); 188 input_router_.reset(new ImmediateInputRouter(process, this, routing_id_));
189 189
190 #if defined(USE_AURA) 190 #if defined(USE_AURA)
(...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 int process_id = (b->first.second >> 32) & 0xffffffff; 2476 int process_id = (b->first.second >> 32) & 0xffffffff;
2477 RenderWidgetHost* rwh = 2477 RenderWidgetHost* rwh =
2478 RenderWidgetHost::FromID(process_id, routing_id); 2478 RenderWidgetHost::FromID(process_id, routing_id);
2479 if (!rwh) 2479 if (!rwh)
2480 continue; 2480 continue;
2481 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); 2481 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info);
2482 } 2482 }
2483 } 2483 }
2484 2484
2485 } // namespace content 2485 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698