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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.h

Issue 1835833002: Fix 3 crashes related to navigations after a process dies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes from review Created 4 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
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 base::TerminationStatus render_view_termination_status() const { 181 base::TerminationStatus render_view_termination_status() const {
182 return render_view_termination_status_; 182 return render_view_termination_status_;
183 } 183 }
184 184
185 // Tracks whether this RenderViewHost is in an active state (rather than 185 // Tracks whether this RenderViewHost is in an active state (rather than
186 // pending swap out, pending deletion, or swapped out), according to its main 186 // pending swap out, pending deletion, or swapped out), according to its main
187 // frame RenderFrameHost. 187 // frame RenderFrameHost.
188 bool is_active() const { return is_active_; } 188 bool is_active() const { return is_active_; }
189 void set_is_active(bool is_active) { is_active_ = is_active; } 189 void set_is_active(bool is_active) { is_active_ = is_active; }
190 190
191 // Tracks whether this RenderViewHost is pending deletion. This is tracked
192 // separately from the main frame pending deletion state, because the
193 // RenderViewHost's main frame is cleared when the main frame's
194 // RenderFrameHost is marked for deletion.
195 //
196 // TODO(nasko,alexmos): This should not be necessary once swapped-out is
197 // removed.
198 bool is_pending_deletion() const { return is_pending_deletion_; }
199 void set_pending_deletion() { is_pending_deletion_ = true; }
200
201 // Tracks whether this RenderViewHost is swapped out, according to its main 191 // Tracks whether this RenderViewHost is swapped out, according to its main
202 // frame RenderFrameHost. 192 // frame RenderFrameHost.
203 void set_is_swapped_out(bool is_swapped_out) { 193 void set_is_swapped_out(bool is_swapped_out) {
204 is_swapped_out_ = is_swapped_out; 194 is_swapped_out_ = is_swapped_out;
205 } 195 }
206 196
207 // TODO(creis): Remove as part of http://crbug.com/418265. 197 // TODO(creis): Remove as part of http://crbug.com/418265.
208 bool is_waiting_for_close_ack() const { return is_waiting_for_close_ack_; } 198 bool is_waiting_for_close_ack() const { return is_waiting_for_close_ack_; }
209 199
210 // Tells the renderer that this RenderView will soon be swapped out, and thus 200 // Tells the renderer that this RenderView will soon be swapped out, and thus
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 247
258 void set_main_frame_routing_id(int routing_id) { 248 void set_main_frame_routing_id(int routing_id) {
259 main_frame_routing_id_ = routing_id; 249 main_frame_routing_id_ = routing_id;
260 } 250 }
261 251
262 void OnTextSurroundingSelectionResponse(const base::string16& content, 252 void OnTextSurroundingSelectionResponse(const base::string16& content,
263 size_t start_offset, 253 size_t start_offset,
264 size_t end_offset); 254 size_t end_offset);
265 255
266 // Increases the refcounting on this RVH. This is done by the FrameTree on 256 // Increases the refcounting on this RVH. This is done by the FrameTree on
267 // creation of a RenderFrameHost. 257 // creation of a RenderFrameHost or RenderFrameProxyHost.
268 void increment_ref_count() { ++frames_ref_count_; } 258 void increment_ref_count() { ++frames_ref_count_; }
269 259
270 // Decreases the refcounting on this RVH. This is done by the FrameTree on 260 // Decreases the refcounting on this RVH. This is done by the FrameTree on
271 // destruction of a RenderFrameHost. 261 // destruction of a RenderFrameHost or RenderFrameProxyHost.
272 void decrement_ref_count() { --frames_ref_count_; } 262 void decrement_ref_count() { --frames_ref_count_; }
273 263
274 // Returns the refcount on this RVH, that is the number of RenderFrameHosts 264 // Returns the refcount on this RVH, that is the number of RenderFrameHosts
275 // currently using it. 265 // and RenderFrameProxyHosts currently using it.
276 int ref_count() { return frames_ref_count_; } 266 int ref_count() { return frames_ref_count_; }
277 267
278 // NOTE: Do not add functions that just send an IPC message that are called in 268 // NOTE: Do not add functions that just send an IPC message that are called in
279 // one or two places. Have the caller send the IPC message directly (unless 269 // one or two places. Have the caller send the IPC message directly (unless
280 // the caller places are in different platforms, in which case it's better 270 // the caller places are in different platforms, in which case it's better
281 // to keep them consistent). 271 // to keep them consistent).
282 272
283 protected: 273 protected:
284 // RenderWidgetHostOwnerDelegate overrides. 274 // RenderWidgetHostOwnerDelegate overrides.
285 bool OnMessageReceived(const IPC::Message& msg) override; 275 bool OnMessageReceived(const IPC::Message& msg) override;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // The most recent page ID we've heard from the renderer process. This is 376 // The most recent page ID we've heard from the renderer process. This is
387 // used as context when other session history related IPCs arrive. 377 // used as context when other session history related IPCs arrive.
388 // TODO(creis): Allocate this in WebContents/NavigationController instead. 378 // TODO(creis): Allocate this in WebContents/NavigationController instead.
389 int32_t page_id_; 379 int32_t page_id_;
390 380
391 // Tracks whether this RenderViewHost is in an active state. False if the 381 // Tracks whether this RenderViewHost is in an active state. False if the
392 // main frame is pending swap out, pending deletion, or swapped out, because 382 // main frame is pending swap out, pending deletion, or swapped out, because
393 // it is not visible to the user in any of these cases. 383 // it is not visible to the user in any of these cases.
394 bool is_active_; 384 bool is_active_;
395 385
396 // True if this RenderViewHost is pending deletion.
397 bool is_pending_deletion_;
398
399 // Tracks whether the main frame RenderFrameHost is swapped out. Unlike 386 // Tracks whether the main frame RenderFrameHost is swapped out. Unlike
400 // is_active_, this is false when the frame is pending swap out or deletion. 387 // is_active_, this is false when the frame is pending swap out or deletion.
401 // TODO(creis): Remove this when we no longer use swappedout://. 388 // TODO(creis): Remove this when we no longer use swappedout://.
402 // See http://crbug.com/357747. 389 // See http://crbug.com/357747.
403 bool is_swapped_out_; 390 bool is_swapped_out_;
404 391
405 // Routing ID for the main frame's RenderFrameHost. 392 // Routing ID for the main frame's RenderFrameHost.
406 int main_frame_routing_id_; 393 int main_frame_routing_id_;
407 394
408 // Set to true when waiting for a ViewHostMsg_ClosePageACK. 395 // Set to true when waiting for a ViewHostMsg_ClosePageACK.
(...skipping 23 matching lines...) Expand all
432 bool render_view_ready_on_process_launch_; 419 bool render_view_ready_on_process_launch_;
433 420
434 base::WeakPtrFactory<RenderViewHostImpl> weak_factory_; 421 base::WeakPtrFactory<RenderViewHostImpl> weak_factory_;
435 422
436 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); 423 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl);
437 }; 424 };
438 425
439 } // namespace content 426 } // namespace content
440 427
441 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ 428 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698