OLD | NEW |
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 #include <set> | 5 #include <set> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/location.h" | |
10 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
11 #include "base/path_service.h" | 10 #include "base/path_service.h" |
12 #include "base/single_thread_task_runner.h" | |
13 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
14 #include "base/thread_task_runner_handle.h" | |
15 #include "base/values.h" | 12 #include "base/values.h" |
16 #include "content/browser/child_process_security_policy_impl.h" | 13 #include "content/browser/child_process_security_policy_impl.h" |
17 #include "content/browser/renderer_host/render_view_host_impl.h" | 14 #include "content/browser/renderer_host/render_view_host_impl.h" |
18 #include "content/browser/site_instance_impl.h" | 15 #include "content/browser/site_instance_impl.h" |
19 #include "content/browser/web_contents/web_contents_impl.h" | 16 #include "content/browser/web_contents/web_contents_impl.h" |
20 #include "content/browser/webui/web_ui_impl.h" | 17 #include "content/browser/webui/web_ui_impl.h" |
21 #include "content/common/content_constants_internal.h" | 18 #include "content/common/content_constants_internal.h" |
22 #include "content/public/browser/navigation_controller.h" | 19 #include "content/public/browser/navigation_controller.h" |
23 #include "content/public/browser/navigation_entry.h" | 20 #include "content/public/browser/navigation_entry.h" |
24 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 } | 1753 } |
1757 | 1754 |
1758 // WebContentsObserver implementation: | 1755 // WebContentsObserver implementation: |
1759 void RenderFrameDeleted(RenderFrameHost* rfh) override { | 1756 void RenderFrameDeleted(RenderFrameHost* rfh) override { |
1760 if (rfh == render_frame_host_) { | 1757 if (rfh == render_frame_host_) { |
1761 CHECK(!deleted_); | 1758 CHECK(!deleted_); |
1762 deleted_ = true; | 1759 deleted_ = true; |
1763 } | 1760 } |
1764 | 1761 |
1765 if (deleted_ && message_loop_runner_->loop_running()) { | 1762 if (deleted_ && message_loop_runner_->loop_running()) { |
1766 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1763 base::MessageLoop::current()->PostTask( |
1767 FROM_HERE, message_loop_runner_->QuitClosure()); | 1764 FROM_HERE, message_loop_runner_->QuitClosure()); |
1768 } | 1765 } |
1769 } | 1766 } |
1770 | 1767 |
1771 private: | 1768 private: |
1772 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 1769 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
1773 bool deleted_; | 1770 bool deleted_; |
1774 RenderFrameHost* render_frame_host_; | 1771 RenderFrameHost* render_frame_host_; |
1775 }; | 1772 }; |
1776 | 1773 |
(...skipping 26 matching lines...) Expand all Loading... |
1803 NavigateToURL(shell(), cross_site_url); | 1800 NavigateToURL(shell(), cross_site_url); |
1804 rfh_observer.Wait(); | 1801 rfh_observer.Wait(); |
1805 | 1802 |
1806 EXPECT_NE(orig_site_instance_id, | 1803 EXPECT_NE(orig_site_instance_id, |
1807 root->current_frame_host()->GetSiteInstance()->GetId()); | 1804 root->current_frame_host()->GetSiteInstance()->GetId()); |
1808 EXPECT_FALSE(RenderFrameHost::FromID(initial_process_id, initial_rfh_id)); | 1805 EXPECT_FALSE(RenderFrameHost::FromID(initial_process_id, initial_rfh_id)); |
1809 EXPECT_FALSE(RenderViewHost::FromID(initial_process_id, initial_rvh_id)); | 1806 EXPECT_FALSE(RenderViewHost::FromID(initial_process_id, initial_rvh_id)); |
1810 } | 1807 } |
1811 | 1808 |
1812 } // namespace content | 1809 } // namespace content |
OLD | NEW |