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 "chrome/browser/prerender/prerender_contents.h" | 5 #include "chrome/browser/prerender/prerender_contents.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <functional> | 10 #include <functional> |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 // session_storage_namespace and only test with matches. | 522 // session_storage_namespace and only test with matches. |
523 if (session_storage_namespace && | 523 if (session_storage_namespace && |
524 session_storage_namespace_id_ != session_storage_namespace->id()) { | 524 session_storage_namespace_id_ != session_storage_namespace->id()) { |
525 return false; | 525 return false; |
526 } | 526 } |
527 return std::find(alias_urls_.begin(), alias_urls_.end(), url) != | 527 return std::find(alias_urls_.begin(), alias_urls_.end(), url) != |
528 alias_urls_.end(); | 528 alias_urls_.end(); |
529 } | 529 } |
530 | 530 |
531 void PrerenderContents::RenderProcessGone(base::TerminationStatus status) { | 531 void PrerenderContents::RenderProcessGone(base::TerminationStatus status) { |
| 532 if (status == base::TERMINATION_STATUS_STILL_RUNNING) { |
| 533 // The renderer process is being killed because of the browser/test |
| 534 // shutdown, before the termination notification is received. |
| 535 Destroy(FINAL_STATUS_APP_TERMINATING); |
| 536 } |
532 Destroy(FINAL_STATUS_RENDERER_CRASHED); | 537 Destroy(FINAL_STATUS_RENDERER_CRASHED); |
533 } | 538 } |
534 | 539 |
535 void PrerenderContents::RenderFrameCreated( | 540 void PrerenderContents::RenderFrameCreated( |
536 content::RenderFrameHost* render_frame_host) { | 541 content::RenderFrameHost* render_frame_host) { |
537 // When a new RenderFrame is created for a prerendering WebContents, tell the | 542 // When a new RenderFrame is created for a prerendering WebContents, tell the |
538 // new RenderFrame it's being used for prerendering before any navigations | 543 // new RenderFrame it's being used for prerendering before any navigations |
539 // occur. Note that this is always triggered before the first navigation, so | 544 // occur. Note that this is always triggered before the first navigation, so |
540 // there's no need to send the message just after the WebContents is created. | 545 // there's no need to send the message just after the WebContents is created. |
541 render_frame_host->Send(new PrerenderMsg_SetIsPrerendering( | 546 render_frame_host->Send(new PrerenderMsg_SetIsPrerendering( |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 void PrerenderContents::AddResourceThrottle( | 750 void PrerenderContents::AddResourceThrottle( |
746 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 751 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
747 resource_throttles_.push_back(throttle); | 752 resource_throttles_.push_back(throttle); |
748 } | 753 } |
749 | 754 |
750 void PrerenderContents::AddNetworkBytes(int64_t bytes) { | 755 void PrerenderContents::AddNetworkBytes(int64_t bytes) { |
751 network_bytes_ += bytes; | 756 network_bytes_ += bytes; |
752 } | 757 } |
753 | 758 |
754 } // namespace prerender | 759 } // namespace prerender |
OLD | NEW |