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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 5429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5440 // different process. This involves running the unload handler and clearing | 5440 // different process. This involves running the unload handler and clearing |
| 5441 // the page. Once WasSwappedOut is called, we also allow this process to | 5441 // the page. Once WasSwappedOut is called, we also allow this process to |
| 5442 // exit if there are no other active RenderViews in it. | 5442 // exit if there are no other active RenderViews in it. |
| 5443 | 5443 |
| 5444 // Send an UpdateState message before we get swapped out. | 5444 // Send an UpdateState message before we get swapped out. |
| 5445 SyncNavigationState(); | 5445 SyncNavigationState(); |
| 5446 | 5446 |
| 5447 // Synchronously run the unload handler before sending the ACK. | 5447 // Synchronously run the unload handler before sending the ACK. |
| 5448 webview()->dispatchUnloadEvent(); | 5448 webview()->dispatchUnloadEvent(); |
| 5449 | 5449 |
| 5450 // Mark the view as hidden, to make sure that it does not erase the paint | |
| 5451 // contents. | |
| 5452 SetHidden(true); | |
|
Charlie Reis
2013/01/09 00:49:23
Interesting. This looks similar to the setVisibil
sadrul
2013/01/09 17:44:19
I moved the call to setVisibilityState up here.
S
| |
| 5453 | |
| 5450 // Swap out and stop sending any IPC messages that are not ACKs. | 5454 // Swap out and stop sending any IPC messages that are not ACKs. |
| 5451 SetSwappedOut(true); | 5455 SetSwappedOut(true); |
| 5452 | 5456 |
| 5453 // Replace the page with a blank dummy URL. The unload handler will not be | 5457 // Replace the page with a blank dummy URL. The unload handler will not be |
| 5454 // run a second time, thanks to a check in FrameLoader::stopLoading. | 5458 // run a second time, thanks to a check in FrameLoader::stopLoading. |
| 5455 // TODO(creis): Need to add a better way to do this that avoids running the | 5459 // TODO(creis): Need to add a better way to do this that avoids running the |
| 5456 // beforeunload handler. For now, we just run it a second time silently. | 5460 // beforeunload handler. For now, we just run it a second time silently. |
| 5457 NavigateToSwappedOutURL(webview()->mainFrame()); | 5461 NavigateToSwappedOutURL(webview()->mainFrame()); |
| 5458 | 5462 |
| 5459 // Let WebKit know that this view is hidden so it can drop resources and | 5463 // Let WebKit know that this view is hidden so it can drop resources and |
| (...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6506 } | 6510 } |
| 6507 #endif | 6511 #endif |
| 6508 | 6512 |
| 6509 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6513 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
| 6510 TransportDIB::Handle dib_handle) { | 6514 TransportDIB::Handle dib_handle) { |
| 6511 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6515 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6512 RenderProcess::current()->ReleaseTransportDIB(dib); | 6516 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6513 } | 6517 } |
| 6514 | 6518 |
| 6515 } // namespace content | 6519 } // namespace content |
| OLD | NEW |