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

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

Issue 2550373005: Make WebTaskRunner ThreadSafeRefCounted (Closed)
Patch Set: +DISALLOW_COPY_AND_ASSIGN for win build fix Created 3 years, 11 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 SpeculationsPumpSession::~SpeculationsPumpSession() {} 49 SpeculationsPumpSession::~SpeculationsPumpSession() {}
50 50
51 inline double SpeculationsPumpSession::elapsedTime() const { 51 inline double SpeculationsPumpSession::elapsedTime() const {
52 return currentTime() - m_startTime; 52 return currentTime() - m_startTime;
53 } 53 }
54 54
55 void SpeculationsPumpSession::addedElementTokens(size_t count) { 55 void SpeculationsPumpSession::addedElementTokens(size_t count) {
56 m_processedElementTokens += count; 56 m_processedElementTokens += count;
57 } 57 }
58 58
59 HTMLParserScheduler::HTMLParserScheduler(HTMLDocumentParser* parser, 59 HTMLParserScheduler::HTMLParserScheduler(
60 WebTaskRunner* loadingTaskRunner) 60 HTMLDocumentParser* parser,
61 RefPtr<WebTaskRunner> loadingTaskRunner)
61 : m_parser(parser), 62 : m_parser(parser),
62 m_loadingTaskRunner(loadingTaskRunner->clone()), 63 m_loadingTaskRunner(std::move(loadingTaskRunner)),
63 m_isSuspendedWithActiveTimer(false) {} 64 m_isSuspendedWithActiveTimer(false) {}
64 65
65 HTMLParserScheduler::~HTMLParserScheduler() {} 66 HTMLParserScheduler::~HTMLParserScheduler() {}
66 67
67 DEFINE_TRACE(HTMLParserScheduler) { 68 DEFINE_TRACE(HTMLParserScheduler) {
68 visitor->trace(m_parser); 69 visitor->trace(m_parser);
69 } 70 }
70 71
71 bool HTMLParserScheduler::isScheduledForResume() const { 72 bool HTMLParserScheduler::isScheduledForResume() const {
72 return m_isSuspendedWithActiveTimer || 73 return m_isSuspendedWithActiveTimer ||
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 void HTMLParserScheduler::forceResumeAfterYield() { 144 void HTMLParserScheduler::forceResumeAfterYield() {
144 DCHECK(!m_cancellableContinueParseTaskHandle.isActive()); 145 DCHECK(!m_cancellableContinueParseTaskHandle.isActive());
145 m_isSuspendedWithActiveTimer = true; 146 m_isSuspendedWithActiveTimer = true;
146 } 147 }
147 148
148 void HTMLParserScheduler::continueParsing() { 149 void HTMLParserScheduler::continueParsing() {
149 m_parser->resumeParsingAfterYield(); 150 m_parser->resumeParsingAfterYield();
150 } 151 }
151 152
152 } // namespace blink 153 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698