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

Side by Side Diff: Source/core/html/parser/BackgroundHTMLParser.h

Issue 1306413003: Make classes and structures in core/html fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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) 2013 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2013 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 28 matching lines...) Expand all
39 #include "wtf/WeakPtr.h" 39 #include "wtf/WeakPtr.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class HTMLDocumentParser; 43 class HTMLDocumentParser;
44 class XSSAuditor; 44 class XSSAuditor;
45 class WebScheduler; 45 class WebScheduler;
46 46
47 class BackgroundHTMLParser { 47 class BackgroundHTMLParser {
48 WTF_MAKE_FAST_ALLOCATED(BackgroundHTMLParser); 48 WTF_MAKE_FAST_ALLOCATED(BackgroundHTMLParser);
49 WTF_MAKE_NONCOPYABLE(BackgroundHTMLParser);
49 public: 50 public:
50 struct Configuration { 51 struct Configuration {
52 WTF_MAKE_FAST_ALLOCATED(Configuration);
53 public:
51 Configuration(); 54 Configuration();
52 HTMLParserOptions options; 55 HTMLParserOptions options;
53 WeakPtr<HTMLDocumentParser> parser; 56 WeakPtr<HTMLDocumentParser> parser;
54 OwnPtr<XSSAuditor> xssAuditor; 57 OwnPtr<XSSAuditor> xssAuditor;
55 OwnPtr<TokenPreloadScanner> preloadScanner; 58 OwnPtr<TokenPreloadScanner> preloadScanner;
56 OwnPtr<TextResourceDecoder> decoder; 59 OwnPtr<TextResourceDecoder> decoder;
57 // outstandingTokenLimit must be greater than or equal to 60 // outstandingTokenLimit must be greater than or equal to
58 // pendingTokenLimit 61 // pendingTokenLimit
59 size_t outstandingTokenLimit; 62 size_t outstandingTokenLimit;
60 size_t pendingTokenLimit; 63 size_t pendingTokenLimit;
61 }; 64 };
62 65
63 static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPt r<Configuration>, WebScheduler*); 66 static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPt r<Configuration>, WebScheduler*);
64 67
65 struct Checkpoint { 68 struct Checkpoint {
69 WTF_MAKE_FAST_ALLOCATED(CheckPoint);
70 public:
66 WeakPtr<HTMLDocumentParser> parser; 71 WeakPtr<HTMLDocumentParser> parser;
67 OwnPtr<HTMLToken> token; 72 OwnPtr<HTMLToken> token;
68 OwnPtr<HTMLTokenizer> tokenizer; 73 OwnPtr<HTMLTokenizer> tokenizer;
69 HTMLTreeBuilderSimulator::State treeBuilderState; 74 HTMLTreeBuilderSimulator::State treeBuilderState;
70 HTMLInputCheckpoint inputCheckpoint; 75 HTMLInputCheckpoint inputCheckpoint;
71 TokenPreloadScannerCheckpoint preloadScannerCheckpoint; 76 TokenPreloadScannerCheckpoint preloadScannerCheckpoint;
72 String unparsedInput; 77 String unparsedInput;
73 }; 78 };
74 79
75 void appendRawBytesFromParserThread(const char* data, int dataLength); 80 void appendRawBytesFromParserThread(const char* data, int dataLength);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 OwnPtr<TextResourceDecoder> m_decoder; 119 OwnPtr<TextResourceDecoder> m_decoder;
115 DocumentEncodingData m_lastSeenEncodingData; 120 DocumentEncodingData m_lastSeenEncodingData;
116 WebScheduler* m_scheduler; // NOT OWNED, scheduler will outlive BackgroundHT MLParser 121 WebScheduler* m_scheduler; // NOT OWNED, scheduler will outlive BackgroundHT MLParser
117 122
118 bool m_startingScript; 123 bool m_startingScript;
119 }; 124 };
120 125
121 } 126 }
122 127
123 #endif 128 #endif
OLDNEW
« no previous file with comments | « Source/core/html/parser/BackgroundHTMLInputStream.h ('k') | Source/core/html/parser/CSSPreloadScanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698