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

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

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TemporaryChange -> AutoReset Created 4 years, 5 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 #include "platform/CrossThreadFunctional.h" 49 #include "platform/CrossThreadFunctional.h"
50 #include "platform/Histogram.h" 50 #include "platform/Histogram.h"
51 #include "platform/SharedBuffer.h" 51 #include "platform/SharedBuffer.h"
52 #include "platform/TraceEvent.h" 52 #include "platform/TraceEvent.h"
53 #include "platform/heap/Handle.h" 53 #include "platform/heap/Handle.h"
54 #include "public/platform/Platform.h" 54 #include "public/platform/Platform.h"
55 #include "public/platform/WebFrameScheduler.h" 55 #include "public/platform/WebFrameScheduler.h"
56 #include "public/platform/WebLoadingBehaviorFlag.h" 56 #include "public/platform/WebLoadingBehaviorFlag.h"
57 #include "public/platform/WebScheduler.h" 57 #include "public/platform/WebScheduler.h"
58 #include "public/platform/WebThread.h" 58 #include "public/platform/WebThread.h"
59 #include "wtf/AutoReset.h"
59 #include "wtf/PtrUtil.h" 60 #include "wtf/PtrUtil.h"
60 #include "wtf/TemporaryChange.h"
61 #include <memory> 61 #include <memory>
62 62
63 namespace blink { 63 namespace blink {
64 64
65 using namespace HTMLNames; 65 using namespace HTMLNames;
66 66
67 // This is a direct transcription of step 4 from: 67 // This is a direct transcription of step 4 from:
68 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#frag ment-case 68 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#frag ment-case
69 static HTMLTokenizer::State tokenizerStateForContextElement(Element* contextElem ent, bool reportErrors, const HTMLParserOptions& options) 69 static HTMLTokenizer::State tokenizerStateForContextElement(Element* contextElem ent, bool reportErrors, const HTMLParserOptions& options)
70 { 70 {
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 checkpoint->unparsedInput = m_input.current().toString().isolatedCopy(); 409 checkpoint->unparsedInput = m_input.current().toString().isolatedCopy();
410 m_input.current().clear(); // FIXME: This should be passed in instead of cle ared. 410 m_input.current().clear(); // FIXME: This should be passed in instead of cle ared.
411 411
412 ASSERT(checkpoint->unparsedInput.isSafeToSendToAnotherThread()); 412 ASSERT(checkpoint->unparsedInput.isSafeToSendToAnotherThread());
413 postTaskToLookaheadParser(Asynchronous, &BackgroundHTMLParser::resumeFrom, m _backgroundParser, passed(std::move(checkpoint))); 413 postTaskToLookaheadParser(Asynchronous, &BackgroundHTMLParser::resumeFrom, m _backgroundParser, passed(std::move(checkpoint)));
414 } 414 }
415 415
416 size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(std::unique_pt r<ParsedChunk> popChunk) 416 size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(std::unique_pt r<ParsedChunk> popChunk)
417 { 417 {
418 TRACE_EVENT_WITH_FLOW0("blink,loading", "HTMLDocumentParser::processParsedCh unkFromBackgroundParser", popChunk.get(), TRACE_EVENT_FLAG_FLOW_IN); 418 TRACE_EVENT_WITH_FLOW0("blink,loading", "HTMLDocumentParser::processParsedCh unkFromBackgroundParser", popChunk.get(), TRACE_EVENT_FLAG_FLOW_IN);
419 TemporaryChange<bool> hasLineNumber(m_isParsingAtLineNumber, true); 419 AutoReset<bool> hasLineNumber(&m_isParsingAtLineNumber, true);
420 420
421 ASSERT_WITH_SECURITY_IMPLICATION(m_pumpSpeculationsSessionNestingLevel == 1) ; 421 ASSERT_WITH_SECURITY_IMPLICATION(m_pumpSpeculationsSessionNestingLevel == 1) ;
422 ASSERT_WITH_SECURITY_IMPLICATION(!inPumpSession()); 422 ASSERT_WITH_SECURITY_IMPLICATION(!inPumpSession());
423 ASSERT(!isParsingFragment()); 423 ASSERT(!isParsingFragment());
424 ASSERT(!isWaitingForScripts()); 424 ASSERT(!isWaitingForScripts());
425 ASSERT(!isStopped()); 425 ASSERT(!isStopped());
426 ASSERT(shouldUseThreading()); 426 ASSERT(shouldUseThreading());
427 ASSERT(!m_tokenizer); 427 ASSERT(!m_tokenizer);
428 ASSERT(!m_token); 428 ASSERT(!m_token);
429 ASSERT(!m_lastChunkBeforeScript); 429 ASSERT(!m_lastChunkBeforeScript);
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 (*WTF::bind(function, std::forward<Ps>(parameters)...))(); 1150 (*WTF::bind(function, std::forward<Ps>(parameters)...))();
1151 return; 1151 return;
1152 case Asynchronous: 1152 case Asynchronous:
1153 m_loadingTaskRunner->postTask(BLINK_FROM_HERE, WTF::bind(function, std:: forward<Ps>(parameters)...)); 1153 m_loadingTaskRunner->postTask(BLINK_FROM_HERE, WTF::bind(function, std:: forward<Ps>(parameters)...));
1154 return; 1154 return;
1155 } 1155 }
1156 NOTREACHED(); 1156 NOTREACHED();
1157 } 1157 }
1158 1158
1159 } // namespace blink 1159 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTitleElement.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698