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

Side by Side Diff: sky/engine/core/dom/DocumentParser.cpp

Issue 712423002: Simplify some parsing-related code (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 23 matching lines...) Expand all
34 34
35 DocumentParser::DocumentParser(Document* document) 35 DocumentParser::DocumentParser(Document* document)
36 : m_state(ParsingState) 36 : m_state(ParsingState)
37 , m_document(document) 37 , m_document(document)
38 { 38 {
39 ASSERT(document); 39 ASSERT(document);
40 } 40 }
41 41
42 DocumentParser::~DocumentParser() 42 DocumentParser::~DocumentParser()
43 { 43 {
44 #if !ENABLE(OILPAN)
45 // Document is expected to call detach() before releasing its ref. 44 // Document is expected to call detach() before releasing its ref.
46 // This ASSERT is slightly awkward for parsers with a fragment case 45 // This ASSERT is slightly awkward for parsers with a fragment case
47 // as there is no Document to release the ref. 46 // as there is no Document to release the ref.
48 ASSERT(!m_document); 47 ASSERT(!m_document);
49 #endif
50 }
51
52 void DocumentParser::trace(Visitor* visitor)
53 {
54 visitor->trace(m_document);
55 } 48 }
56 49
57 void DocumentParser::prepareToStopParsing() 50 void DocumentParser::prepareToStopParsing()
58 { 51 {
59 ASSERT(m_state == ParsingState); 52 ASSERT(m_state == ParsingState);
60 m_state = StoppingState; 53 m_state = StoppingState;
61 } 54 }
62 55
63 void DocumentParser::stopParsing() 56 void DocumentParser::stopParsing()
64 { 57 {
65 m_state = StoppedState; 58 m_state = StoppedState;
66 } 59 }
67 60
68 void DocumentParser::detach() 61 void DocumentParser::detach()
69 { 62 {
70 m_state = DetachedState; 63 m_state = DetachedState;
71 m_document = nullptr; 64 m_document = nullptr;
72 } 65 }
73 66
74 }; 67 };
75 68
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698