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_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 // renderer to suppress any further dialogs until it is swapped out. However, | 1006 // renderer to suppress any further dialogs until it is swapped out. However, |
1007 // crash reports indicate that it's still possible for modal dialogs to exist | 1007 // crash reports indicate that it's still possible for modal dialogs to exist |
1008 // at this point, which poses a risk if we delete their RenderViewHost below. | 1008 // at this point, which poses a risk if we delete their RenderViewHost below. |
1009 // Cancel them again to be safe. http://crbug.com/324320. | 1009 // Cancel them again to be safe. http://crbug.com/324320. |
1010 delegate_->CancelModalDialogsForRenderManager(); | 1010 delegate_->CancelModalDialogsForRenderManager(); |
1011 | 1011 |
1012 // Next commit the Web UI, if any. Either replace |web_ui_| with | 1012 // Next commit the Web UI, if any. Either replace |web_ui_| with |
1013 // |pending_web_ui_|, or clear |web_ui_| if there is no pending WebUI, or | 1013 // |pending_web_ui_|, or clear |web_ui_| if there is no pending WebUI, or |
1014 // leave |web_ui_| as is if reusing it. | 1014 // leave |web_ui_| as is if reusing it. |
1015 DCHECK(!(pending_web_ui_.get() && pending_and_current_web_ui_.get())); | 1015 DCHECK(!(pending_web_ui_.get() && pending_and_current_web_ui_.get())); |
1016 if (pending_web_ui_) | 1016 if (pending_web_ui_) { |
1017 web_ui_.reset(pending_web_ui_.release()); | 1017 web_ui_.reset(pending_web_ui_.release()); |
1018 else if (!pending_and_current_web_ui_.get()) | 1018 } else if (!pending_and_current_web_ui_.get()) { |
1019 web_ui_.reset(); | 1019 web_ui_.reset(); |
| 1020 } else { |
| 1021 DCHECK_EQ(pending_and_current_web_ui_.get(), web_ui_.get()); |
| 1022 pending_and_current_web_ui_.reset(); |
| 1023 } |
1020 | 1024 |
1021 // It's possible for the pending_render_frame_host_ to be NULL when we aren't | 1025 // It's possible for the pending_render_frame_host_ to be NULL when we aren't |
1022 // crossing process boundaries. If so, we just needed to handle the Web UI | 1026 // crossing process boundaries. If so, we just needed to handle the Web UI |
1023 // committing above and we're done. | 1027 // committing above and we're done. |
1024 if (!pending_render_frame_host_) { | 1028 if (!pending_render_frame_host_) { |
1025 if (will_focus_location_bar) | 1029 if (will_focus_location_bar) |
1026 delegate_->SetFocusToLocationBar(false); | 1030 delegate_->SetFocusToLocationBar(false); |
1027 return; | 1031 return; |
1028 } | 1032 } |
1029 | 1033 |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 SiteInstance* instance) const { | 1445 SiteInstance* instance) const { |
1442 RenderFrameHostMap::const_iterator iter = | 1446 RenderFrameHostMap::const_iterator iter = |
1443 swapped_out_hosts_.find(instance->GetId()); | 1447 swapped_out_hosts_.find(instance->GetId()); |
1444 if (iter != swapped_out_hosts_.end()) | 1448 if (iter != swapped_out_hosts_.end()) |
1445 return iter->second; | 1449 return iter->second; |
1446 | 1450 |
1447 return NULL; | 1451 return NULL; |
1448 } | 1452 } |
1449 | 1453 |
1450 } // namespace content | 1454 } // namespace content |
OLD | NEW |