Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 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 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1409 } | 1409 } |
| 1410 | 1410 |
| 1411 // If a page calls window.close() twice, we'll end up here twice, but that's | 1411 // If a page calls window.close() twice, we'll end up here twice, but that's |
| 1412 // OK. It is safe to send multiple Close messages. | 1412 // OK. It is safe to send multiple Close messages. |
| 1413 | 1413 |
| 1414 // Ask the RenderWidgetHost to initiate close. We could be called from deep | 1414 // Ask the RenderWidgetHost to initiate close. We could be called from deep |
| 1415 // in Javascript. If we ask the RendwerWidgetHost to close now, the window | 1415 // in Javascript. If we ask the RendwerWidgetHost to close now, the window |
| 1416 // could be closed before the JS finishes executing. So instead, post a | 1416 // could be closed before the JS finishes executing. So instead, post a |
| 1417 // message back to the message loop, which won't run until the JS is | 1417 // message back to the message loop, which won't run until the JS is |
| 1418 // complete, and then the Close message can be sent. | 1418 // complete, and then the Close message can be sent. |
| 1419 base::MessageLoop::current()->PostTask( | 1419 base::MessageLoop::current()->PostNonNestableTask( |
|
darin (slow to review)
2014/08/29 17:17:08
I suppose it is possible that this may cause probl
| |
| 1420 FROM_HERE, base::Bind(&RenderWidget::DoDeferredClose, this)); | 1420 FROM_HERE, base::Bind(&RenderWidget::DoDeferredClose, this)); |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 void RenderWidget::QueueSyntheticGesture( | 1423 void RenderWidget::QueueSyntheticGesture( |
| 1424 scoped_ptr<SyntheticGestureParams> gesture_params, | 1424 scoped_ptr<SyntheticGestureParams> gesture_params, |
| 1425 const SyntheticGestureCompletionCallback& callback) { | 1425 const SyntheticGestureCompletionCallback& callback) { |
| 1426 DCHECK(!callback.is_null()); | 1426 DCHECK(!callback.is_null()); |
| 1427 | 1427 |
| 1428 pending_synthetic_gesture_callbacks_.push(callback); | 1428 pending_synthetic_gesture_callbacks_.push(callback); |
| 1429 | 1429 |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2178 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2178 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2179 video_hole_frames_.AddObserver(frame); | 2179 video_hole_frames_.AddObserver(frame); |
| 2180 } | 2180 } |
| 2181 | 2181 |
| 2182 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2182 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2183 video_hole_frames_.RemoveObserver(frame); | 2183 video_hole_frames_.RemoveObserver(frame); |
| 2184 } | 2184 } |
| 2185 #endif // defined(VIDEO_HOLE) | 2185 #endif // defined(VIDEO_HOLE) |
| 2186 | 2186 |
| 2187 } // namespace content | 2187 } // namespace content |
| OLD | NEW |