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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2411863002: [NoStatePrefetch] Kill renderer after preload scanning (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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 1420
1421 bool Document::isPrefetchOnly() const { 1421 bool Document::isPrefetchOnly() const {
1422 if (!m_frame || !m_frame->page()) 1422 if (!m_frame || !m_frame->page())
1423 return false; 1423 return false;
1424 1424
1425 PrerendererClient* prerendererClient = 1425 PrerendererClient* prerendererClient =
1426 PrerendererClient::from(m_frame->page()); 1426 PrerendererClient::from(m_frame->page());
1427 return prerendererClient && prerendererClient->isPrefetchOnly(); 1427 return prerendererClient && prerendererClient->isPrefetchOnly();
1428 } 1428 }
1429 1429
1430 void Document::onPrefetchFinished() const {
1431 if (!m_frame || !m_frame->page())
1432 return;
1433 PrerendererClient* prerendererClient =
1434 PrerendererClient::from(m_frame->page());
1435 if (!prerendererClient)
1436 return;
1437 prerendererClient->onPrefetchFinished();
1438 }
1439
1430 String Document::visibilityState() const { 1440 String Document::visibilityState() const {
1431 return pageVisibilityStateString(pageVisibilityState()); 1441 return pageVisibilityStateString(pageVisibilityState());
1432 } 1442 }
1433 1443
1434 bool Document::hidden() const { 1444 bool Document::hidden() const {
1435 return pageVisibilityState() != PageVisibilityStateVisible; 1445 return pageVisibilityState() != PageVisibilityStateVisible;
1436 } 1446 }
1437 1447
1438 void Document::didChangeVisibilityState() { 1448 void Document::didChangeVisibilityState() {
1439 dispatchEvent(Event::createBubble(EventTypeNames::visibilitychange)); 1449 dispatchEvent(Event::createBubble(EventTypeNames::visibilitychange));
(...skipping 4948 matching lines...) Expand 10 before | Expand all | Expand 10 after
6388 } 6398 }
6389 6399
6390 void showLiveDocumentInstances() { 6400 void showLiveDocumentInstances() {
6391 WeakDocumentSet& set = liveDocumentSet(); 6401 WeakDocumentSet& set = liveDocumentSet();
6392 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6402 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6393 for (Document* document : set) 6403 for (Document* document : set)
6394 fprintf(stderr, "- Document %p URL: %s\n", document, 6404 fprintf(stderr, "- Document %p URL: %s\n", document,
6395 document->url().getString().utf8().data()); 6405 document->url().getString().utf8().data());
6396 } 6406 }
6397 #endif 6407 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698