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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.cpp

Issue 1823863002: Simplify parsing/loading state, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes Created 4 years, 9 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) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 17 matching lines...) Expand all
28 #include "core/dom/Document.h" 28 #include "core/dom/Document.h"
29 #include "core/html/parser/HTMLDocumentParser.h" 29 #include "core/html/parser/HTMLDocumentParser.h"
30 #include "core/frame/FrameView.h" 30 #include "core/frame/FrameView.h"
31 #include "public/platform/Platform.h" 31 #include "public/platform/Platform.h"
32 #include "public/platform/WebScheduler.h" 32 #include "public/platform/WebScheduler.h"
33 #include "public/platform/WebThread.h" 33 #include "public/platform/WebThread.h"
34 #include "wtf/CurrentTime.h" 34 #include "wtf/CurrentTime.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 ActiveParserSession::ActiveParserSession(unsigned& nestingLevel, Document* docum ent) 38 PumpSession::PumpSession(unsigned& nestingLevel)
39 : NestingLevelIncrementer(nestingLevel) 39 : NestingLevelIncrementer(nestingLevel)
40 , m_document(document)
41 {
42 if (!m_document)
43 return;
44 m_document->incrementActiveParserCount();
45 }
46
47 ActiveParserSession::~ActiveParserSession()
48 {
49 if (!m_document)
50 return;
51 m_document->decrementActiveParserCount();
52 }
53
54 PumpSession::PumpSession(unsigned& nestingLevel, Document* document)
55 : ActiveParserSession(nestingLevel, document)
56 { 40 {
57 } 41 }
58 42
59 PumpSession::~PumpSession() 43 PumpSession::~PumpSession()
60 { 44 {
61 } 45 }
62 46
63 SpeculationsPumpSession::SpeculationsPumpSession(unsigned& nestingLevel, Documen t* document) 47 SpeculationsPumpSession::SpeculationsPumpSession(unsigned& nestingLevel)
64 : ActiveParserSession(nestingLevel, document) 48 : NestingLevelIncrementer(nestingLevel)
65 , m_startTime(currentTime()) 49 , m_startTime(currentTime())
66 , m_processedElementTokens(0) 50 , m_processedElementTokens(0)
67 { 51 {
68 } 52 }
69 53
70 SpeculationsPumpSession::~SpeculationsPumpSession() 54 SpeculationsPumpSession::~SpeculationsPumpSession()
71 { 55 {
72 } 56 }
73 57
74 inline double SpeculationsPumpSession::elapsedTime() const 58 inline double SpeculationsPumpSession::elapsedTime() const
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 ASSERT(!m_cancellableContinueParse->isPending()); 152 ASSERT(!m_cancellableContinueParse->isPending());
169 m_isSuspendedWithActiveTimer = true; 153 m_isSuspendedWithActiveTimer = true;
170 } 154 }
171 155
172 void HTMLParserScheduler::continueParsing() 156 void HTMLParserScheduler::continueParsing()
173 { 157 {
174 m_parser->resumeParsingAfterYield(); 158 m_parser->resumeParsingAfterYield();
175 } 159 }
176 160
177 } // namespace blink 161 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698