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

Side by Side Diff: content/browser/frame_host/render_frame_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 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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 FrameTree* frame_tree, 568 FrameTree* frame_tree,
569 FrameTreeNode* frame_tree_node, 569 FrameTreeNode* frame_tree_node,
570 int32_t routing_id, 570 int32_t routing_id,
571 int32_t widget_routing_id, 571 int32_t widget_routing_id,
572 int flags); 572 int flags);
573 573
574 private: 574 private:
575 friend class TestRenderFrameHost; 575 friend class TestRenderFrameHost;
576 friend class TestRenderViewHost; 576 friend class TestRenderViewHost;
577 577
578 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest,
579 CreateRenderViewAfterProcessKillAndClosedProxy);
580 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest,
581 RenderViewInitAfterNewProxyAndProcessKill);
578 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, CrashSubframe); 582 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, CrashSubframe);
583 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
584 RenderViewHostPendingDeletionIsNotReused);
579 585
580 // IPC Message handlers. 586 // IPC Message handlers.
581 void OnAddMessageToConsole(int32_t level, 587 void OnAddMessageToConsole(int32_t level,
582 const base::string16& message, 588 const base::string16& message,
583 int32_t line_no, 589 int32_t line_no,
584 const base::string16& source_id); 590 const base::string16& source_id);
585 void OnDetach(); 591 void OnDetach();
586 void OnFrameFocused(); 592 void OnFrameFocused();
587 void OnOpenURL(const FrameHostMsg_OpenURL_Params& params); 593 void OnOpenURL(const FrameHostMsg_OpenURL_Params& params);
588 void OnDocumentOnLoadCompleted( 594 void OnDocumentOnLoadCompleted(
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 const content::StartNavigationParams& start_params, 732 const content::StartNavigationParams& start_params,
727 const content::RequestNavigationParams& request_params); 733 const content::RequestNavigationParams& request_params);
728 734
729 // Returns the child FrameTreeNode if |child_frame_routing_id| is an 735 // Returns the child FrameTreeNode if |child_frame_routing_id| is an
730 // immediate child of this FrameTreeNode. |child_frame_routing_id| is 736 // immediate child of this FrameTreeNode. |child_frame_routing_id| is
731 // considered untrusted, so the renderer process is killed if it refers to a 737 // considered untrusted, so the renderer process is killed if it refers to a
732 // FrameTreeNode that is not a child of this node. 738 // FrameTreeNode that is not a child of this node.
733 FrameTreeNode* FindAndVerifyChild(int32_t child_frame_routing_id, 739 FrameTreeNode* FindAndVerifyChild(int32_t child_frame_routing_id,
734 bad_message::BadMessageReason reason); 740 bad_message::BadMessageReason reason);
735 741
742 // Allows tests to disable the swapout event timer to simulate bugs that
743 // happen before it fires (to avoid flakiness).
744 void ResetSwapOutTimerForTesting();
745
736 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a 746 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a
737 // refcount that calls Shutdown when it reaches zero. This allows each 747 // refcount that calls Shutdown when it reaches zero. This allows each
738 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring 748 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring
739 // we have a RenderViewHost for each RenderFrameHost. 749 // we have a RenderViewHost for each RenderFrameHost.
740 // TODO(creis): RenderViewHost will eventually go away and be replaced with 750 // TODO(creis): RenderViewHost will eventually go away and be replaced with
741 // some form of page context. 751 // some form of page context.
742 RenderViewHostImpl* render_view_host_; 752 RenderViewHostImpl* render_view_host_;
743 753
744 RenderFrameHostDelegate* delegate_; 754 RenderFrameHostDelegate* delegate_;
745 755
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 957
948 // NOTE: This must be the last member. 958 // NOTE: This must be the last member.
949 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 959 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
950 960
951 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 961 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
952 }; 962 };
953 963
954 } // namespace content 964 } // namespace content
955 965
956 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 966 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698