Changeset 139944 in webkit


Ignore:
Timestamp:
Jan 16, 2013 6:05:33 PM (11 years ago)
Author:
abarth@webkit.org
Message:

Introduce HTMLParserThread to be able to parse on a background thread
https://bugs.webkit.org/show_bug.cgi?id=107071

Reviewed by Tony Gentilcore.

This patch introduces a simple thread class that we can use to parse
HTML. This patch is unlikely to be the final design because we'll
likely want to use libdispatch or some other platform-specific thread
pool. However, this implementation is enough to let us work on the
parser-specific aspects of this feature.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • html/parser/HTMLParserThread.cpp: Added.

(WebCore):
(WebCore::HTMLParserThread::HTMLParserThread):
(WebCore::HTMLParserThread::~HTMLParserThread):
(WebCore::HTMLParserThread::start):
(WebCore::HTMLParserThread::stop):
(WebCore::HTMLParserThread::shared):
(WebCore::HTMLParserThread::postTask):
(WebCore::HTMLParserThread::threadStart):
(WebCore::HTMLParserThread::runLoop):

  • html/parser/HTMLParserThread.h: Added.

(WebCore):
(HTMLParserThread):
(WebCore::HTMLParserThread::create):
(WebCore::HTMLParserThread::threadId):

Location:
trunk/Source/WebCore
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r139866 r139944  
    15361536    html/parser/HTMLParserOptions.cpp
    15371537    html/parser/HTMLParserScheduler.cpp
     1538    html/parser/HTMLParserThread.cpp
    15381539    html/parser/HTMLFormattingElementList.cpp
    15391540    html/parser/HTMLMetaCharsetParser.cpp
  • trunk/Source/WebCore/ChangeLog

    r139942 r139944  
     12013-01-16  Adam Barth  <abarth@webkit.org>
     2
     3        Introduce HTMLParserThread to be able to parse on a background thread
     4        https://bugs.webkit.org/show_bug.cgi?id=107071
     5
     6        Reviewed by Tony Gentilcore.
     7
     8        This patch introduces a simple thread class that we can use to parse
     9        HTML. This patch is unlikely to be the final design because we'll
     10        likely want to use libdispatch or some other platform-specific thread
     11        pool. However, this implementation is enough to let us work on the
     12        parser-specific aspects of this feature.
     13
     14        * CMakeLists.txt:
     15        * GNUmakefile.list.am:
     16        * Target.pri:
     17        * WebCore.gypi:
     18        * WebCore.vcproj/WebCore.vcproj:
     19        * WebCore.xcodeproj/project.pbxproj:
     20        * html/parser/HTMLParserThread.cpp: Added.
     21        (WebCore):
     22        (WebCore::HTMLParserThread::HTMLParserThread):
     23        (WebCore::HTMLParserThread::~HTMLParserThread):
     24        (WebCore::HTMLParserThread::start):
     25        (WebCore::HTMLParserThread::stop):
     26        (WebCore::HTMLParserThread::shared):
     27        (WebCore::HTMLParserThread::postTask):
     28        (WebCore::HTMLParserThread::threadStart):
     29        (WebCore::HTMLParserThread::runLoop):
     30        * html/parser/HTMLParserThread.h: Added.
     31        (WebCore):
     32        (HTMLParserThread):
     33        (WebCore::HTMLParserThread::create):
     34        (WebCore::HTMLParserThread::threadId):
     35
    1362013-01-16  MORITA Hajime  <morrita@google.com>
    237
  • trunk/Source/WebCore/GNUmakefile.list.am

    r139935 r139944  
    35553555        Source/WebCore/html/parser/HTMLParserScheduler.cpp \
    35563556        Source/WebCore/html/parser/HTMLParserScheduler.h \
     3557        Source/WebCore/html/parser/HTMLParserThread.cpp \
     3558        Source/WebCore/html/parser/HTMLParserThread.h \
    35573559        Source/WebCore/html/parser/HTMLPreloadScanner.cpp \
    35583560        Source/WebCore/html/parser/HTMLPreloadScanner.h \
  • trunk/Source/WebCore/Target.pri

    r139935 r139944  
    719719    html/parser/HTMLParserOptions.cpp \
    720720    html/parser/HTMLParserScheduler.cpp \
     721    html/parser/HTMLParserThread.cpp \
    721722    html/parser/HTMLPreloadScanner.cpp \
    722723    html/parser/HTMLScriptRunner.cpp \
  • trunk/Source/WebCore/WebCore.gypi

    r139866 r139944  
    33573357            'html/parser/HTMLParserScheduler.cpp',
    33583358            'html/parser/HTMLParserScheduler.h',
     3359            'html/parser/HTMLParserThread.cpp',
     3360            'html/parser/HTMLParserThread.h',
    33593361            'html/parser/HTMLPreloadScanner.cpp',
    33603362            'html/parser/HTMLPreloadScanner.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r139935 r139944  
    6463064630                                </File>
    6463164631                                <File
     64632                                        RelativePath="..\html\parser\HTMLParserThread.cpp"
     64633                                        >
     64634                                </File>
     64635                                <File
     64636                                        RelativePath="..\html\parser\HTMLParserThread.h"
     64637                                        >
     64638                                </File>
     64639                                <File
    6463264640                                        RelativePath="..\html\parser\HTMLPreloadScanner.cpp"
    6463364641                                        >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r139941 r139944  
    35573557                973F418A169B95FF0006BF60 /* HTMLParserOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 973F4188169B95EF0006BF60 /* HTMLParserOptions.h */; };
    35583558                973F418B169B96030006BF60 /* HTMLParserOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 973F4187169B95EF0006BF60 /* HTMLParserOptions.cpp */; };
     3559                974187D316A7932700FA77A7 /* HTMLParserThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 974187D016A7932200FA77A7 /* HTMLParserThread.cpp */; };
     3560                974187D416A7932900FA77A7 /* HTMLParserThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 974187D116A7932200FA77A7 /* HTMLParserThread.h */; };
    35593561                9746AF2314F4DDE6003E7A70 /* Geolocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9746AF1314F4DDE6003E7A70 /* Geolocation.cpp */; };
    35603562                9746AF2414F4DDE6003E7A70 /* Geolocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9746AF1414F4DDE6003E7A70 /* Geolocation.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1092210924                973F4187169B95EF0006BF60 /* HTMLParserOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLParserOptions.cpp; path = parser/HTMLParserOptions.cpp; sourceTree = "<group>"; };
    1092310925                973F4188169B95EF0006BF60 /* HTMLParserOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLParserOptions.h; path = parser/HTMLParserOptions.h; sourceTree = "<group>"; };
     10926                974187D016A7932200FA77A7 /* HTMLParserThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLParserThread.cpp; path = parser/HTMLParserThread.cpp; sourceTree = "<group>"; };
     10927                974187D116A7932200FA77A7 /* HTMLParserThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLParserThread.h; path = parser/HTMLParserThread.h; sourceTree = "<group>"; };
    1092410928                9746AF1314F4DDE6003E7A70 /* Geolocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Geolocation.cpp; path = Modules/geolocation/Geolocation.cpp; sourceTree = "<group>"; };
    1092510929                9746AF1414F4DDE6003E7A70 /* Geolocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Geolocation.h; path = Modules/geolocation/Geolocation.h; sourceTree = "<group>"; };
     
    1473514739                                89F60B17157F6A020075E157 /* Quota */,
    1473614740                                BC9854460CD3DA5F00069BC1 /* Ranges */,
     14741                                AA7FEE9B16A491A1004C0C33 /* Speech */,
    1473714742                                A83B79150CCB0078000B0825 /* Storage */,
    1473814743                                A83B790A0CCAFF47000B0825 /* SVG */,
     
    1474014745                                E1C8BE4B0E8BD0D10064CB7D /* Threads */,
    1474114746                                BC9854530CD3DA8F00069BC1 /* Traversal */,
    14742                                 AA7FEE9B16A491A1004C0C33 /* Speech */,
    1474314747                                FDA15E7B12B03E04003A583A /* WebAudio */,
    1474414748                                5DA5E0F9102B950400088CF9 /* WebSockets */,
     
    1621916223                                BCE1C4190D982980003B02F2 /* Location.h */,
    1622016224                                BCE1C4220D9829F2003B02F2 /* Location.idl */,
     16225                                BC59DEFA169DEDD80016AC34 /* make_settings.pl */,
    1622116226                                931BCC601124DFCB00BE70DD /* MediaCanStartListener.h */,
    1622216227                                9FFE3E7811B59C5D0037874E /* MemoryInfo.cpp */,
     
    1628016285                                F587863A02DE3A1401EA4122 /* Settings.h */,
    1628116286                                BC59DEF8169DEDC30016AC34 /* Settings.in */,
    16282                                 BC59DEFA169DEDD80016AC34 /* make_settings.pl */,
    1628316287                                626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */,
    1628416288                                626CDE0D1140424C001E5A68 /* SpatialNavigation.h */,
     
    1855118555                                977B3857122883E900B81FF8 /* HTMLParserScheduler.cpp */,
    1855218556                                977B3858122883E900B81FF8 /* HTMLParserScheduler.h */,
     18557                                974187D016A7932200FA77A7 /* HTMLParserThread.cpp */,
     18558                                974187D116A7932200FA77A7 /* HTMLParserThread.h */,
    1855318559                                977B3859122883E900B81FF8 /* HTMLPreloadScanner.cpp */,
    1855418560                                977B385A122883E900B81FF8 /* HTMLPreloadScanner.h */,
     
    1856018566                                97C1F552122855CB00EDE615 /* HTMLStackItem.h */,
    1856118567                                97C1F552122855CB00EDE616 /* HTMLToken.h */,
    18562                                 97C1F552122855CB00EDE617 /* HTMLTokenTypes.h */,
    1856318568                                977B385E122883E900B81FF8 /* HTMLTokenizer.cpp */,
    1856418569                                977B385F122883E900B81FF8 /* HTMLTokenizer.h */,
     18570                                97C1F552122855CB00EDE617 /* HTMLTokenTypes.h */,
    1856518571                                977B37211228721700B81FF8 /* HTMLTreeBuilder.cpp */,
    1856618572                                977B37221228721700B81FF8 /* HTMLTreeBuilder.h */,
     
    2165121657                                FCEBCD711623A7910029965E /* CSSGrammar.y.in */,
    2165221658                                FCEBCD721623A7910029965E /* CSSGrammar.y.includes */,
     21659                                FBF89044169E9F1F0052D86E /* CSSGroupingRule.cpp */,
    2165321660                                FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */,
    21654                                 FBF89044169E9F1F0052D86E /* CSSGroupingRule.cpp */,
    2165521661                                BC772B360C4EA91E0083285F /* CSSHelper.h */,
    2165621662                                BC23E76B0DAE88A9009FDC91 /* CSSImageGeneratorValue.cpp */,
     
    2391223918                                97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */,
    2391323919                                97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */,
     23920                                89F60B11157F686E0075E157 /* DOMWindowQuota.h in Headers */,
    2391423921                                AA2A5AD616A4861600975A25 /* DOMWindowSpeechSynthesis.h in Headers */,
    23915                                 89F60B11157F686E0075E157 /* DOMWindowQuota.h in Headers */,
    2391623922                                A8CCBB49151F831600AB7CE9 /* DOMWindowWebDatabase.h in Headers */,
    2391723923                                BC53DA2E1143121E000D817E /* DOMWrapperWorld.h in Headers */,
     
    2425024256                                449B19F50FA72ECE0015CA4A /* HTMLParserQuirks.h in Headers */,
    2425124257                                977B3871122883E900B81FF8 /* HTMLParserScheduler.h in Headers */,
     24258                                974187D416A7932900FA77A7 /* HTMLParserThread.h in Headers */,
    2425224259                                A871D4560A127CBC00B12A68 /* HTMLPlugInElement.h in Headers */,
    2425324260                                4415292E0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h in Headers */,
     
    2545425461                                514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
    2545525462                                514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,
     25463                                51E4143416A6596300C633C7 /* ResourceHandleTypes.h in Headers */,
    2545625464                                656D373F0ADBA5DE00A4554D /* ResourceLoader.h in Headers */,
    2545725465                                D0A3A7311405A39800FB8ED3 /* ResourceLoaderOptions.h in Headers */,
     
    2623226240                                977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
    2623326241                                FD537353137B651800008DCE /* ZeroPole.h in Headers */,
    26234                                 51E4143416A6596300C633C7 /* ResourceHandleTypes.h in Headers */,
    2623526242                        );
    2623626243                        runOnlyForDeploymentPostprocessing = 0;
     
    2679626803                                BC23E4E10DAACE0F009FDC91 /* CSSGradientValue.cpp in Sources */,
    2679726804                                650F53DD09D15DDF00C9B0C8 /* CSSGrammar.cpp in Sources */,
     26805                                FBF89045169E9F1F0052D86E /* CSSGroupingRule.cpp in Sources */,
    2679826806                                BC23E76C0DAE88A9009FDC91 /* CSSImageGeneratorValue.cpp in Sources */,
    2679926807                                9393E5FF151A99F200066F06 /* CSSImageSetValue.cpp in Sources */,
     
    2752327531                                973F418B169B96030006BF60 /* HTMLParserOptions.cpp in Sources */,
    2752427532                                977B3870122883E900B81FF8 /* HTMLParserScheduler.cpp in Sources */,
     27533                                974187D316A7932700FA77A7 /* HTMLParserThread.cpp in Sources */,
    2752527534                                A871D4570A127CBC00B12A68 /* HTMLPlugInElement.cpp in Sources */,
    2752627535                                4415292F0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp in Sources */,
     
    2937729386                                977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
    2937829387                                FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
    29379                                 FBF89045169E9F1F0052D86E /* CSSGroupingRule.cpp in Sources */,
    2938029388                        );
    2938129389                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.