OLD | NEW |
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 r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 #include "core/layout/TextAutosizer.h" | 188 #include "core/layout/TextAutosizer.h" |
189 #include "core/layout/api/LayoutViewItem.h" | 189 #include "core/layout/api/LayoutViewItem.h" |
190 #include "core/layout/compositing/PaintLayerCompositor.h" | 190 #include "core/layout/compositing/PaintLayerCompositor.h" |
191 #include "core/loader/CookieJar.h" | 191 #include "core/loader/CookieJar.h" |
192 #include "core/loader/DocumentLoader.h" | 192 #include "core/loader/DocumentLoader.h" |
193 #include "core/loader/FrameFetchContext.h" | 193 #include "core/loader/FrameFetchContext.h" |
194 #include "core/loader/FrameLoader.h" | 194 #include "core/loader/FrameLoader.h" |
195 #include "core/loader/FrameLoaderClient.h" | 195 #include "core/loader/FrameLoaderClient.h" |
196 #include "core/loader/ImageLoader.h" | 196 #include "core/loader/ImageLoader.h" |
197 #include "core/loader/NavigationScheduler.h" | 197 #include "core/loader/NavigationScheduler.h" |
| 198 #include "core/loader/PrerendererClient.h" |
198 #include "core/loader/appcache/ApplicationCacheHost.h" | 199 #include "core/loader/appcache/ApplicationCacheHost.h" |
199 #include "core/observer/ResizeObserverController.h" | 200 #include "core/observer/ResizeObserverController.h" |
200 #include "core/page/ChromeClient.h" | 201 #include "core/page/ChromeClient.h" |
201 #include "core/page/EventWithHitTestResults.h" | 202 #include "core/page/EventWithHitTestResults.h" |
202 #include "core/page/FocusController.h" | 203 #include "core/page/FocusController.h" |
203 #include "core/page/FrameTree.h" | 204 #include "core/page/FrameTree.h" |
204 #include "core/page/Page.h" | 205 #include "core/page/Page.h" |
205 #include "core/page/PointerLockController.h" | 206 #include "core/page/PointerLockController.h" |
206 #include "core/page/scrolling/ChildViewportScrollCallback.h" | 207 #include "core/page/scrolling/ChildViewportScrollCallback.h" |
207 #include "core/page/scrolling/RootScrollerController.h" | 208 #include "core/page/scrolling/RootScrollerController.h" |
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 if (!m_frame || !m_frame->page()) | 1321 if (!m_frame || !m_frame->page()) |
1321 return PageVisibilityStateHidden; | 1322 return PageVisibilityStateHidden; |
1322 // While visibilitychange is being dispatched during unloading it is | 1323 // While visibilitychange is being dispatched during unloading it is |
1323 // expected that the visibility is hidden regardless of the page's | 1324 // expected that the visibility is hidden regardless of the page's |
1324 // visibility. | 1325 // visibility. |
1325 if (m_loadEventProgress >= UnloadVisibilityChangeInProgress) | 1326 if (m_loadEventProgress >= UnloadVisibilityChangeInProgress) |
1326 return PageVisibilityStateHidden; | 1327 return PageVisibilityStateHidden; |
1327 return m_frame->page()->visibilityState(); | 1328 return m_frame->page()->visibilityState(); |
1328 } | 1329 } |
1329 | 1330 |
| 1331 bool Document::isPrefetchOnly() const |
| 1332 { |
| 1333 if (!m_frame || !m_frame->page()) |
| 1334 return false; |
| 1335 |
| 1336 PrerendererClient* prerendererClient = PrerendererClient::from(m_frame->page
()); |
| 1337 return prerendererClient && prerendererClient->isPrefetchOnly(); |
| 1338 } |
| 1339 |
1330 String Document::visibilityState() const | 1340 String Document::visibilityState() const |
1331 { | 1341 { |
1332 return pageVisibilityStateString(pageVisibilityState()); | 1342 return pageVisibilityStateString(pageVisibilityState()); |
1333 } | 1343 } |
1334 | 1344 |
1335 bool Document::hidden() const | 1345 bool Document::hidden() const |
1336 { | 1346 { |
1337 return pageVisibilityState() != PageVisibilityStateVisible; | 1347 return pageVisibilityState() != PageVisibilityStateVisible; |
1338 } | 1348 } |
1339 | 1349 |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 | 2440 |
2431 DocumentParser* Document::implicitOpen(ParserSynchronizationPolicy parserSyncPol
icy) | 2441 DocumentParser* Document::implicitOpen(ParserSynchronizationPolicy parserSyncPol
icy) |
2432 { | 2442 { |
2433 detachParser(); | 2443 detachParser(); |
2434 | 2444 |
2435 removeChildren(); | 2445 removeChildren(); |
2436 DCHECK(!m_focusedElement); | 2446 DCHECK(!m_focusedElement); |
2437 | 2447 |
2438 setCompatibilityMode(NoQuirksMode); | 2448 setCompatibilityMode(NoQuirksMode); |
2439 | 2449 |
2440 if (!threadedParsingEnabledForTesting()) | 2450 if (!threadedParsingEnabledForTesting()) { |
2441 parserSyncPolicy = ForceSynchronousParsing; | 2451 parserSyncPolicy = ForceSynchronousParsing; |
| 2452 } else if (parserSyncPolicy == AllowAsynchronousParsing && isPrefetchOnly())
{ |
| 2453 // Prefetch must be synchronous. |
| 2454 parserSyncPolicy = ForceSynchronousParsing; |
| 2455 } |
2442 | 2456 |
2443 m_parserSyncPolicy = parserSyncPolicy; | 2457 m_parserSyncPolicy = parserSyncPolicy; |
2444 m_parser = createParser(); | 2458 m_parser = createParser(); |
2445 DocumentParserTiming::from(*this).markParserStart(); | 2459 DocumentParserTiming::from(*this).markParserStart(); |
2446 setParsingState(Parsing); | 2460 setParsingState(Parsing); |
2447 setReadyState(Loading); | 2461 setReadyState(Loading); |
2448 | 2462 |
2449 return m_parser; | 2463 return m_parser; |
2450 } | 2464 } |
2451 | 2465 |
(...skipping 3588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6040 } | 6054 } |
6041 | 6055 |
6042 void showLiveDocumentInstances() | 6056 void showLiveDocumentInstances() |
6043 { | 6057 { |
6044 WeakDocumentSet& set = liveDocumentSet(); | 6058 WeakDocumentSet& set = liveDocumentSet(); |
6045 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6059 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6046 for (Document* document : set) | 6060 for (Document* document : set) |
6047 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); | 6061 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); |
6048 } | 6062 } |
6049 #endif | 6063 #endif |
OLD | NEW |