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

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

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 16 matching lines...) Expand all
27 #define HTMLParserScheduler_h 27 #define HTMLParserScheduler_h
28 28
29 #include "core/html/parser/NestingLevelIncrementer.h" 29 #include "core/html/parser/NestingLevelIncrementer.h"
30 #include "platform/scheduler/CancellableTaskFactory.h" 30 #include "platform/scheduler/CancellableTaskFactory.h"
31 #include "wtf/Allocator.h" 31 #include "wtf/Allocator.h"
32 #include "wtf/PassOwnPtr.h" 32 #include "wtf/PassOwnPtr.h"
33 #include "wtf/RefPtr.h" 33 #include "wtf/RefPtr.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class Document;
38 class HTMLDocumentParser; 37 class HTMLDocumentParser;
39 class WebTaskRunner; 38 class WebTaskRunner;
40 39
41 class ActiveParserSession : public NestingLevelIncrementer { 40 class PumpSession : public NestingLevelIncrementer {
42 STACK_ALLOCATED(); 41 STACK_ALLOCATED();
43 public: 42 public:
44 ActiveParserSession(unsigned& nestingLevel, Document*); 43 PumpSession(unsigned& nestingLevel);
45 ~ActiveParserSession();
46
47 private:
48 RefPtrWillBeMember<Document> m_document;
49 };
50
51 class PumpSession : public ActiveParserSession {
52 STACK_ALLOCATED();
53 public:
54 PumpSession(unsigned& nestingLevel, Document*);
55 ~PumpSession(); 44 ~PumpSession();
56 }; 45 };
57 46
58 class SpeculationsPumpSession : public ActiveParserSession { 47 class SpeculationsPumpSession : public NestingLevelIncrementer {
59 STACK_ALLOCATED(); 48 STACK_ALLOCATED();
60 public: 49 public:
61 SpeculationsPumpSession(unsigned& nestingLevel, Document*); 50 SpeculationsPumpSession(unsigned& nestingLevel);
62 ~SpeculationsPumpSession(); 51 ~SpeculationsPumpSession();
63 52
64 double elapsedTime() const; 53 double elapsedTime() const;
65 void addedElementTokens(size_t count); 54 void addedElementTokens(size_t count);
66 size_t processedElementTokens() const { return m_processedElementTokens; } 55 size_t processedElementTokens() const { return m_processedElementTokens; }
67 56
68 private: 57 private:
69 double m_startTime; 58 double m_startTime;
70 size_t m_processedElementTokens; 59 size_t m_processedElementTokens;
71 }; 60 };
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 RawPtrWillBeMember<HTMLDocumentParser> m_parser; 99 RawPtrWillBeMember<HTMLDocumentParser> m_parser;
111 OwnPtr<WebTaskRunner> m_loadingTaskRunner; 100 OwnPtr<WebTaskRunner> m_loadingTaskRunner;
112 101
113 OwnPtr<CancellableTaskFactory> m_cancellableContinueParse; 102 OwnPtr<CancellableTaskFactory> m_cancellableContinueParse;
114 bool m_isSuspendedWithActiveTimer; 103 bool m_isSuspendedWithActiveTimer;
115 }; 104 };
116 105
117 } // namespace blink 106 } // namespace blink
118 107
119 #endif 108 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698