Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: chrome/browser/prerender/prerender_contents.cc

Issue 2435693005: Change the final status to APP_TERMINATING on shutdown (Closed)
Patch Set: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698