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 "content/browser/frame_host/render_frame_message_filter.h" | 5 #include "content/browser/frame_host/render_frame_message_filter.h" |
6 | 6 |
7 #include "content/browser/frame_host/render_frame_host_impl.h" | 7 #include "content/browser/frame_host/render_frame_host_impl.h" |
8 #include "content/browser/renderer_host/render_widget_helper.h" | 8 #include "content/browser/renderer_host/render_widget_helper.h" |
9 #include "content/common/frame_messages.h" | 9 #include "content/common/frame_messages.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 void CreateChildFrameOnUI(int process_id, | 16 void CreateChildFrameOnUI(int process_id, |
17 int parent_routing_id, | 17 int parent_routing_id, |
18 const std::string& frame_name, | 18 const std::string& frame_name, |
19 SandboxFlags sandbox_flags, | 19 SandboxFlags sandbox_flags, |
20 int new_routing_id) { | 20 int new_routing_id) { |
21 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 21 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
22 RenderFrameHostImpl* render_frame_host = | 22 RenderFrameHostImpl* render_frame_host = |
23 RenderFrameHostImpl::FromID(process_id, parent_routing_id); | 23 RenderFrameHostImpl::FromID(process_id, parent_routing_id); |
24 // Handles the RenderFrameHost being deleted on the UI thread while | 24 // Handles the RenderFrameHost being deleted on the UI thread while |
25 // processing a subframe creation message. | 25 // processing a subframe creation message. |
26 if (render_frame_host) { | 26 if (render_frame_host) { |
27 render_frame_host->OnCreateChildFrame(new_routing_id, frame_name, | 27 render_frame_host->OnCreateChildFrame(new_routing_id, frame_name, |
28 sandbox_flags); | 28 sandbox_flags); |
29 } | 29 } |
30 } | 30 } |
31 | 31 |
(...skipping 25 matching lines...) Expand all Loading... |
57 SandboxFlags sandbox_flags, | 57 SandboxFlags sandbox_flags, |
58 int* new_routing_id) { | 58 int* new_routing_id) { |
59 *new_routing_id = render_widget_helper_->GetNextRoutingID(); | 59 *new_routing_id = render_widget_helper_->GetNextRoutingID(); |
60 BrowserThread::PostTask( | 60 BrowserThread::PostTask( |
61 BrowserThread::UI, FROM_HERE, | 61 BrowserThread::UI, FROM_HERE, |
62 base::Bind(&CreateChildFrameOnUI, render_process_id_, parent_routing_id, | 62 base::Bind(&CreateChildFrameOnUI, render_process_id_, parent_routing_id, |
63 frame_name, sandbox_flags, *new_routing_id)); | 63 frame_name, sandbox_flags, *new_routing_id)); |
64 } | 64 } |
65 | 65 |
66 } // namespace content | 66 } // namespace content |
OLD | NEW |