Guest User

Untitled

a guest
May 29th, 2018
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.93 KB | None | 0 0
  1. Index: WebKit/chromium/src/WebEntities.cpp
  2. ===================================================================
  3. --- WebKit/chromium/src/WebEntities.cpp (revision 61693)
  4. +++ WebKit/chromium/src/WebEntities.cpp (working copy)
  5. @@ -31,9 +31,9 @@
  6. #include "config.h"
  7. #include "WebEntities.h"
  8.  
  9. -#include <string.h>
  10. -
  11. +#include "HashTools.h"
  12. #include "PlatformString.h"
  13. +#include <string.h>
  14. #include "StringBuilder.h"
  15. #include <wtf/HashMap.h>
  16.  
  17. @@ -41,15 +41,6 @@
  18.  
  19. using namespace WebCore;
  20.  
  21. -namespace {
  22. -// Note that this file is also included by LegacyHTMLDocumentParser.cpp so we are getting
  23. -// two copies of the data in memory. We can fix this by changing the script
  24. -// that generated the array to create a static const that is its length, but
  25. -// this is low priority since the data is less than 4K. We use anonymous
  26. -// namespace to prevent name collisions.
  27. -#include "HTMLEntityNames.cpp" // NOLINT
  28. -}
  29. -
  30. namespace WebKit {
  31.  
  32. void populateMap(WTF::HashMap<int, WebCore::String>& map,
  33. @@ -91,8 +82,8 @@
  34. false);
  35. else
  36. populateMap(m_entitiesMap,
  37. - wordlist,
  38. - sizeof(wordlist) / sizeof(Entity),
  39. + wordList(),
  40. + wordListSize(),
  41. true);
  42. }
  43.  
  44. Index: WebKit/chromium/ChangeLog
  45. ===================================================================
  46. --- WebKit/chromium/ChangeLog (revision 61693)
  47. +++ WebKit/chromium/ChangeLog (working copy)
  48. @@ -1,3 +1,21 @@
  49. +2010-06-23 Andras Becsi <abecsi@webkit.org>
  50. +
  51. + Reviewed by NOBODY (OOPS!).
  52. +
  53. + Undefined reference errors when linking due to gperf and inlining.
  54. + webkit.org/b/29244
  55. +
  56. + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
  57. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
  58. + to access the functionality provided. This resulted in debug build failure with newer gcc versions
  59. + because of a behaviour change of gcc, which disables C style inlining in debug mode.
  60. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
  61. + in their own compilation unit.
  62. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
  63. + for multiple inclusions of generated C files to access these functions.
  64. +
  65. + * src/WebEntities.cpp:
  66. +
  67. 2010-06-23 Yuzo Fujishima <yuzo@google.com>
  68.  
  69. Reviewed by Shinichiro Hamaji.
  70. Index: WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
  71. ===================================================================
  72. --- WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (revision 61693)
  73. +++ WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (working copy)
  74. @@ -1322,7 +1322,7 @@
  75. for (unsigned i = 0; i < numqStyleSheetProperties; ++i) {
  76. CSSPropertyID property = qstyleSheetProperties[i];
  77.  
  78. - styleSheet += QString::fromLatin1(::getPropertyName(property));
  79. + styleSheet += QString::fromLatin1(getPropertyName(property));
  80. styleSheet += QLatin1Char(':');
  81. styleSheet += computedStyle(element)->getPropertyValue(property);
  82. styleSheet += QLatin1Char(';');
  83. Index: WebKit/qt/ChangeLog
  84. ===================================================================
  85. --- WebKit/qt/ChangeLog (revision 61693)
  86. +++ WebKit/qt/ChangeLog (working copy)
  87. @@ -1,3 +1,22 @@
  88. +2010-06-23 Andras Becsi <abecsi@webkit.org>
  89. +
  90. + Reviewed by NOBODY (OOPS!).
  91. +
  92. + Undefined reference errors when linking due to gperf and inlining.
  93. + webkit.org/b/29244
  94. +
  95. + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
  96. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
  97. + to access the functionality provided. This resulted in debug build failure with newer gcc versions
  98. + because of a behaviour change of gcc, which disables C style inlining in debug mode.
  99. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
  100. + in their own compilation unit.
  101. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
  102. + for multiple inclusions of generated C files to access these functions.
  103. +
  104. + * WebCoreSupport/FrameLoaderClientQt.cpp:
  105. + (WebCore::FrameLoaderClientQt::createPlugin):
  106. +
  107. 2010-06-23 David Boddie <dboddie@trolltech.com>
  108.  
  109. Reviewed by Simon Hausmann.
  110. Index: WebCore/WebCore.pri
  111. ===================================================================
  112. --- WebCore/WebCore.pri (revision 61693)
  113. +++ WebCore/WebCore.pri (working copy)
  114. @@ -682,7 +682,7 @@
  115. cssprops.output = $${WC_GENERATED_SOURCES_DIR}/CSSPropertyNames.cpp
  116. cssprops.input = WALDOCSSPROPS
  117. cssprops.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssprops.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
  118. -cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES}
  119. +cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} $$cssprops.wkScript
  120. addExtraCompiler(cssprops)
  121.  
  122. # GENERATOR 6-B:
  123. @@ -690,7 +690,7 @@
  124. cssvalues.output = $${WC_GENERATED_SOURCES_DIR}/CSSValueKeywords.cpp
  125. cssvalues.input = WALDOCSSVALUES
  126. cssvalues.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $$EXTRACSSVALUES > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssvalues.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
  127. -cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES}
  128. +cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES} $$cssvalues.wkScript
  129. cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.h
  130. addExtraCompiler(cssvalues)
  131.  
  132. Index: WebCore/ChangeLog
  133. ===================================================================
  134. --- WebCore/ChangeLog (revision 61693)
  135. +++ WebCore/ChangeLog (working copy)
  136. @@ -1,3 +1,37 @@
  137. +2010-06-23 Andras Becsi <abecsi@webkit.org>
  138. +
  139. + Reviewed by NOBODY (OOPS!).
  140. +
  141. + Undefined reference errors when linking due to gperf and inlining.
  142. + webkit.org/b/29244
  143. +
  144. + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
  145. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
  146. + to access the functionality provided. This resulted in debug build failure with newer gcc versions
  147. + because of a behaviour change of gcc, which disables C style inlining in debug mode.
  148. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
  149. + in their own compilation unit.
  150. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
  151. + for multiple inclusions of generated C files to access these functions.
  152. +
  153. + No new functionality added, no new tests needed.
  154. +
  155. + * CMakeLists.txt:
  156. + * WebCore.gyp/WebCore.gyp:
  157. + * WebCore.pri:
  158. + * WebCore.xcodeproj/project.pbxproj:
  159. + * css/CSSParser.cpp:
  160. + * css/makeprop.pl:
  161. + * css/makevalues.pl:
  162. + * html/DocTypeStrings.gperf:
  163. + * html/HTMLDocument.cpp:
  164. + * html/HTMLEntityNames.gperf:
  165. + * html/HTMLEntityParser.cpp:
  166. + * html/LegacyPreloadScanner.cpp:
  167. + * make-hash-tools.pl:
  168. + * platform/ColorData.gperf:
  169. + * platform/graphics/Color.cpp:
  170. +
  171. 2010-06-23 James Robinson <jamesr@chromium.org>
  172.  
  173. Reviewed by Dan Bernstein.
  174. Index: WebCore/platform/graphics/Color.cpp
  175. ===================================================================
  176. --- WebCore/platform/graphics/Color.cpp (revision 61693)
  177. +++ WebCore/platform/graphics/Color.cpp (working copy)
  178. @@ -26,13 +26,12 @@
  179. #include "config.h"
  180. #include "Color.h"
  181.  
  182. +#include "HashTools.h"
  183. #include "PlatformString.h"
  184. #include <math.h>
  185. #include <wtf/Assertions.h>
  186. #include <wtf/MathExtras.h>
  187.  
  188. -#include "ColorData.cpp"
  189. -
  190. using namespace std;
  191. using namespace WTF;
  192.  
  193. Index: WebCore/platform/ColorData.gperf
  194. ===================================================================
  195. --- WebCore/platform/ColorData.gperf (revision 61693)
  196. +++ WebCore/platform/ColorData.gperf (working copy)
  197. @@ -1,13 +1,12 @@
  198. %struct-type
  199. -struct NamedColor {
  200. - const char *name;
  201. - int RGBValue;
  202. -};
  203. -%language=ANSI-C
  204. +struct NamedColor;
  205. +%omit-struct-type
  206. +%language=C++
  207. %readonly-tables
  208. %global-table
  209. %compare-strncmp
  210. -%define lookup-function-name findColor
  211. +%define class-name ColorDataHash
  212. +%define lookup-function-name findColorImpl
  213. %define hash-function-name colordata_hash_function
  214. %includes
  215. %enum
  216. Index: WebCore/WebCore.gyp/WebCore.gyp
  217. ===================================================================
  218. --- WebCore/WebCore.gyp/WebCore.gyp (revision 61693)
  219. +++ WebCore/WebCore.gyp/WebCore.gyp (working copy)
  220. @@ -546,7 +546,6 @@
  221. '<(SHARED_INTERMEDIATE_DIR)/webkit',
  222. '<(RULE_INPUT_PATH)',
  223. ],
  224. - 'process_outputs_as_sources': 0,
  225. },
  226. # Rule to build generated JavaScript (V8) bindings from .idl source.
  227. {
  228. @@ -653,6 +652,13 @@
  229. # Additional .cpp files from the webcore_bindings_sources rules.
  230. '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSGrammar.cpp',
  231. '<(SHARED_INTERMEDIATE_DIR)/webkit/XPathGrammar.cpp',
  232. +
  233. + # Additional .cpp files for HashTools.h
  234. + '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityNames.cpp',
  235. + '<(SHARED_INTERMEDIATE_DIR)/webkit/DocTypeStrings.cpp',
  236. + '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorData.cpp',
  237. + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
  238. + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
  239. ],
  240. 'conditions': [
  241. ['javascript_engine=="v8"', {
  242. Index: WebCore/html/HTMLEntityNames.gperf
  243. ===================================================================
  244. --- WebCore/html/HTMLEntityNames.gperf (revision 61693)
  245. +++ WebCore/html/HTMLEntityNames.gperf (working copy)
  246. @@ -25,16 +25,16 @@
  247. */
  248. %}
  249. %struct-type
  250. -struct Entity {
  251. - const char *name;
  252. - int code;
  253. -};
  254. -%language=ANSI-C
  255. +struct Entity;
  256. +%language=C++
  257. +%omit-struct-type
  258. %readonly-tables
  259. %global-table
  260. %compare-strncmp
  261. -%define lookup-function-name findEntity
  262. +%define class-name HTMLEntityHash
  263. +%define lookup-function-name findEntityImpl
  264. %define hash-function-name entity_hash_function
  265. +%define word-array-name entity_wordlist
  266. %includes
  267. %enum
  268. %%
  269. Index: WebCore/html/LegacyPreloadScanner.cpp
  270. ===================================================================
  271. --- WebCore/html/LegacyPreloadScanner.cpp (revision 61693)
  272. +++ WebCore/html/LegacyPreloadScanner.cpp (working copy)
  273. @@ -38,25 +38,13 @@
  274. #include "Document.h"
  275. #include "Frame.h"
  276. #include "FrameLoader.h"
  277. +#include "HashTools.h"
  278. #include "HTMLLinkElement.h"
  279. #include "HTMLNames.h"
  280. #include <wtf/text/CString.h>
  281. #include <wtf/CurrentTime.h>
  282. #include <wtf/unicode/Unicode.h>
  283.  
  284. -// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
  285. -#ifdef __GNUC__
  286. -// The main tokenizer includes this too so we are getting two copies of the data. However, this way the code gets inlined.
  287. -#include "HTMLEntityNames.cpp"
  288. -#else
  289. -// Not inlined for non-GCC compilers
  290. -struct Entity {
  291. - const char* name;
  292. - int code;
  293. -};
  294. -const struct Entity* findEntity(register const char* str, register unsigned int len);
  295. -#endif
  296. -
  297. #define PRELOAD_DEBUG 0
  298.  
  299. using namespace WTF;
  300. Index: WebCore/html/HTMLEntityParser.cpp
  301. ===================================================================
  302. --- WebCore/html/HTMLEntityParser.cpp (revision 61693)
  303. +++ WebCore/html/HTMLEntityParser.cpp (working copy)
  304. @@ -28,21 +28,9 @@
  305. #include "config.h"
  306. #include "HTMLEntityParser.h"
  307.  
  308. +#include "HashTools.h"
  309. #include <wtf/Vector.h>
  310.  
  311. -// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
  312. -#ifdef __GNUC__
  313. -// The main parser includes this too so we are getting two copies of the data. However, this way the code gets inlined.
  314. -#include "HTMLEntityNames.cpp"
  315. -#else
  316. -// Not inlined for non-GCC compilers
  317. -struct Entity {
  318. - const char* name;
  319. - int code;
  320. -};
  321. -const struct Entity* findEntity(register const char* str, register unsigned int len);
  322. -#endif
  323. -
  324. using namespace WTF;
  325.  
  326. namespace WebCore {
  327. Index: WebCore/html/DocTypeStrings.gperf
  328. ===================================================================
  329. --- WebCore/html/DocTypeStrings.gperf (revision 61693)
  330. +++ WebCore/html/DocTypeStrings.gperf (working copy)
  331. @@ -1,21 +1,13 @@
  332. %struct-type
  333. -struct PubIDInfo {
  334. - enum eMode {
  335. - eQuirks,
  336. - eQuirks3,
  337. - eAlmostStandards
  338. - };
  339. -
  340. - const char* name;
  341. - eMode mode_if_no_sysid;
  342. - eMode mode_if_sysid;
  343. -}
  344. -%language=ANSI-C
  345. +struct PubIDInfo;
  346. +%omit-struct-type
  347. +%language=C++
  348. %readonly-tables
  349. %global-table
  350. %compare-strncmp
  351. +%define class-name DocTypeStringsHash
  352. %define initializer-suffix ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards
  353. -%define lookup-function-name findDoctypeEntry
  354. +%define lookup-function-name findDoctypeEntryImpl
  355. %define hash-function-name doctype_hash_function
  356. %includes
  357. %enum
  358. Index: WebCore/html/HTMLDocument.cpp
  359. ===================================================================
  360. --- WebCore/html/HTMLDocument.cpp (revision 61693)
  361. +++ WebCore/html/HTMLDocument.cpp (working copy)
  362. @@ -64,6 +64,7 @@
  363. #include "FrameLoader.h"
  364. #include "FrameTree.h"
  365. #include "FrameView.h"
  366. +#include "HashTools.h"
  367. #include "HTMLDocumentParser.h"
  368. #include "HTMLBodyElement.h"
  369. #include "HTMLElementFactory.h"
  370. @@ -75,8 +76,6 @@
  371. #include "Settings.h"
  372. #include <wtf/text/CString.h>
  373.  
  374. -#include "DocTypeStrings.cpp"
  375. -
  376. namespace WebCore {
  377.  
  378. using namespace HTMLNames;
  379. Index: WebCore/make-hash-tools.pl
  380. ===================================================================
  381. --- WebCore/make-hash-tools.pl (revision 61693)
  382. +++ WebCore/make-hash-tools.pl (working copy)
  383. @@ -26,35 +26,175 @@
  384. my $outdir = $ARGV[0];
  385. shift;
  386. my $option = basename($ARGV[0],".gperf");
  387. +my $hashToolsHeader = "$outdir/HashTools.h";
  388.  
  389. +sub createHashToolsHeader() {
  390. +
  391. +open HEADER, ">$hashToolsHeader" || die "Could not open $hashToolsHeader for writing";
  392. +print HEADER << "EOF";
  393. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  394. +
  395. +#ifndef HashTools_h
  396. +#define HashTools_h
  397. +
  398. +namespace WebCore {
  399. +
  400. +struct Entity {
  401. + const char* name;
  402. + int code;
  403. +};
  404. +
  405. +struct PubIDInfo {
  406. + enum eMode {
  407. + eQuirks,
  408. + eQuirks3,
  409. + eAlmostStandards
  410. + };
  411. +
  412. + const char* name;
  413. + eMode mode_if_no_sysid;
  414. + eMode mode_if_sysid;
  415. +};
  416. +
  417. +struct NamedColor {
  418. + const char* name;
  419. + int RGBValue;
  420. +};
  421. +
  422. +struct Property {
  423. + const char* name;
  424. + int id;
  425. +};
  426. +
  427. +struct Value {
  428. + const char* name;
  429. + int id;
  430. +};
  431. +
  432. +const Entity* findEntity(register const char* str, register unsigned int len);
  433. +const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len);
  434. +const NamedColor* findColor(register const char* str, register unsigned int len);
  435. +const Property* findProperty(register const char* str, register unsigned int len);
  436. +const Value* findValue(register const char* str, register unsigned int len);
  437. +
  438. +#if PLATFORM(CHROMIUM)
  439. +const Entity* wordList();
  440. +const int wordListSize();
  441. +#endif
  442. +
  443. +}
  444. +
  445. +#endif // HashTools_h
  446. +
  447. +EOF
  448. +close HEADER;
  449. +
  450. +}
  451. +
  452. +
  453. +
  454. switch ($option) {
  455.  
  456. case "HTMLEntityNames" {
  457.  
  458. - my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNames.cpp";
  459. + createHashToolsHeader();
  460. +
  461. + my $htmlEntityNamesImpl = "$outdir/HTMLEntityNames.cpp";
  462. + my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNamesHash.h";
  463. my $htmlEntityNamesGperf = $ARGV[0];
  464. shift;
  465.  
  466. + open ENTITIES, ">$htmlEntityNamesImpl" || die "Could not open $htmlEntityNamesImpl for writing";
  467. + print ENTITIES << "EOF";
  468. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  469. +
  470. +#include "HashTools.h"
  471. +
  472. +namespace WebCore {
  473. +#include "HTMLEntityNamesHash.h"
  474. +
  475. +const Entity* findEntity(register const char* str, register unsigned int len)
  476. +{
  477. + return HTMLEntityHash::findEntityImpl(str, len);
  478. +}
  479. +
  480. +#if PLATFORM(CHROMIUM)
  481. +const Entity* wordList()
  482. +{
  483. + return WebCore::entity_wordlist;
  484. +}
  485. +
  486. +const int wordListSize()
  487. +{
  488. + return sizeof(WebCore::entity_wordlist) / sizeof(Entity);
  489. +}
  490. +#endif // PLATFORM(CHROMIUM)
  491. +
  492. +} // namespace WebCore
  493. +
  494. +EOF
  495. + close ENTITIES;
  496. +
  497. system("gperf --key-positions=\"*\" -D -s 2 $htmlEntityNamesGperf > $htmlEntityNamesGenerated") == 0 || die "calling gperf failed: $?";
  498.  
  499. } # case "HTMLEntityNames"
  500.  
  501. case "DocTypeStrings" {
  502.  
  503. - my $docTypeStringsGenerated = "$outdir/DocTypeStrings.cpp";
  504. + my $docTypeStringsImpl = "$outdir/DocTypeStrings.cpp";
  505. + my $docTypeStringsGenerated = "$outdir/DocTypeStringsHash.h";
  506. my $docTypeStringsGperf = $ARGV[0];
  507. shift;
  508.  
  509. + open DOCTYPESTRINGS, ">$docTypeStringsImpl" || die "Could not open $docTypeStringsImpl for writing";
  510. + print DOCTYPESTRINGS << "EOF";
  511. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  512. +
  513. +#include "HashTools.h"
  514. +
  515. +namespace WebCore {
  516. +#include "DocTypeStringsHash.h"
  517. +
  518. +const PubIDInfo* findDoctypeEntry (register const char* str, register unsigned int len)
  519. +{
  520. + return DocTypeStringsHash::findDoctypeEntryImpl(str, len);
  521. +}
  522. +
  523. +}
  524. +
  525. +EOF
  526. + close DOCTYPESTRINGS;
  527. +
  528. system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?";
  529.  
  530. } # case "DocTypeStrings"
  531.  
  532. case "ColorData" {
  533.  
  534. - my $colorDataGenerated = "$outdir/ColorData.cpp";
  535. - my $colorDataGperf = $ARGV[0];
  536. + my $colorDataImpl = "$outdir/ColorData.cpp";
  537. + my $colorDataGenerated = "$outdir/ColorDataHash.h";
  538. + my $colorDataGperf = $ARGV[0];
  539. shift;
  540.  
  541. + open COLORDATA, ">$colorDataImpl" || die "Could not open $colorDataImpl for writing";
  542. + print COLORDATA << "EOF";
  543. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  544. +
  545. +#include "HashTools.h"
  546. +
  547. +namespace WebCore {
  548. +#include "ColorDataHash.h"
  549. +
  550. +const struct NamedColor* findColor (register const char* str, register unsigned int len)
  551. +{
  552. + return ColorDataHash::findColorImpl(str, len);
  553. +}
  554. +
  555. +}
  556. +
  557. +EOF
  558. + close COLORDATA;
  559. +
  560. system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?";
  561.  
  562. } # case "ColorData"
  563. Index: WebCore/CMakeLists.txt
  564. ===================================================================
  565. --- WebCore/CMakeLists.txt (revision 61693)
  566. +++ WebCore/CMakeLists.txt (working copy)
  567. @@ -516,6 +516,10 @@
  568. ${DERIVED_SOURCES_DIR}/CSSGrammar.cpp
  569. ${DERIVED_SOURCES_DIR}/HTMLElementFactory.cpp
  570. ${DERIVED_SOURCES_DIR}/HTMLEntityNames.cpp
  571. + ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp
  572. + ${DERIVED_SOURCES_DIR}/CSSValueKeywords.cpp
  573. + ${DERIVED_SOURCES_DIR}/CSSPropertyNames.cpp
  574. + ${DERIVED_SOURCES_DIR}/ColorData.cpp
  575. ${DERIVED_SOURCES_DIR}/HTMLNames.cpp
  576. ${DERIVED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp
  577. ${DERIVED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp
  578. Index: WebCore/WebCore.xcodeproj/project.pbxproj
  579. ===================================================================
  580. --- WebCore/WebCore.xcodeproj/project.pbxproj (revision 61693)
  581. +++ WebCore/WebCore.xcodeproj/project.pbxproj (working copy)
  582. @@ -458,6 +458,11 @@
  583. 1AB7FC860A8B92EC00D9D37B /* XPathValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC650A8B92EC00D9D37B /* XPathValue.h */; };
  584. 1AB7FC870A8B92EC00D9D37B /* XPathVariableReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC660A8B92EC00D9D37B /* XPathVariableReference.cpp */; };
  585. 1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC670A8B92EC00D9D37B /* XPathVariableReference.h */; };
  586. + 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FB1198307D009D59D6 /* ColorData.cpp */; };
  587. + 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */; };
  588. + 1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */; };
  589. + 1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */; };
  590. + 1ABA77FD11D21031004C201C /* HTMLEntityNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F4021198329A009D59D6 /* HTMLEntityNames.cpp */; };
  591. 1ABFE7530CD968D000FE4834 /* SQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABFE7520CD968D000FE4834 /* SQLTransaction.cpp */; };
  592. 1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC2260A0DB69F190089B669 /* JSDOMApplicationCache.cpp */; };
  593. 1AC2260D0DB69F190089B669 /* JSDOMApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC2260B0DB69F190089B669 /* JSDOMApplicationCache.h */; };
  594. @@ -21845,6 +21850,11 @@
  595. 1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */,
  596. B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */,
  597. A8E6A78211D1661B00311F4A /* HTMLParserScheduler.cpp in Sources */,
  598. + 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
  599. + 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
  600. + 1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */,
  601. + 1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */,
  602. + 1ABA77FD11D21031004C201C /* HTMLEntityNames.cpp in Sources */,
  603. );
  604. runOnlyForDeploymentPostprocessing = 0;
  605. };
  606. Index: WebCore/css/CSSParser.cpp
  607. ===================================================================
  608. --- WebCore/css/CSSParser.cpp (revision 61693)
  609. +++ WebCore/css/CSSParser.cpp (working copy)
  610. @@ -61,6 +61,7 @@
  611. #include "FloatConversion.h"
  612. #include "FontFamilyValue.h"
  613. #include "FontValue.h"
  614. +#include "HashTools.h"
  615. #include "MediaList.h"
  616. #include "MediaQueryExp.h"
  617. #include "Pair.h"
  618. @@ -88,9 +89,6 @@
  619. using namespace std;
  620. using namespace WTF;
  621.  
  622. -#include "CSSPropertyNames.cpp"
  623. -#include "CSSValueKeywords.cpp"
  624. -
  625. namespace WebCore {
  626.  
  627. static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
  628. Index: WebCore/css/makeprop.pl
  629. ===================================================================
  630. --- WebCore/css/makeprop.pl (revision 61693)
  631. +++ WebCore/css/makeprop.pl (working copy)
  632. @@ -41,15 +41,14 @@
  633. #include \"CSSPropertyNames.h\"
  634. %}
  635. %struct-type
  636. -struct Property {
  637. - const char* name;
  638. - int id;
  639. -};
  640. -%language=ANSI-C
  641. +struct Property;
  642. +%omit-struct-type
  643. +%language=C++
  644. %readonly-tables
  645. %global-table
  646. %compare-strncmp
  647. -%define lookup-function-name findProperty
  648. +%define class-name CSSPropertyNamesHash
  649. +%define lookup-function-name findPropertyImpl
  650. %define hash-function-name propery_hash_function
  651. %define word-array-name property_wordlist
  652. %includes
  653. @@ -72,6 +71,10 @@
  654. #ifndef CSSPropertyNames_h
  655. #define CSSPropertyNames_h
  656.  
  657. +#include <string.h>
  658. +
  659. +namespace WebCore {
  660. +
  661. enum CSSPropertyID {
  662. CSSPropertyInvalid = 0,
  663. EOF
  664. @@ -99,15 +102,17 @@
  665.  
  666. const char* getPropertyName(CSSPropertyID);
  667.  
  668. +} // namespace WebCore
  669. +
  670. #endif // CSSPropertyNames_h
  671.  
  672. EOF
  673.  
  674. close HEADER;
  675.  
  676. -system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
  677. +system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.hpp") == 0 || die "calling gperf failed: $?";
  678.  
  679. -open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing";
  680. +open C, ">>CSSPropertyNamesHash.hpp" || die "Could not open CSSPropertyNamesHash.hpp for writing";
  681. print C "static const char * const propertyNameStrings[$num] = {\n";
  682.  
  683. foreach my $name (@names) {
  684. @@ -116,6 +121,29 @@
  685.  
  686. print C << "EOF";
  687. };
  688. +
  689. +EOF
  690. +
  691. +close C;
  692. +
  693. +my $propertyNamesImpl = "CSSPropertyNames.cpp";
  694. +
  695. +open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing";
  696. +print PROPERTYNAMES << "EOF";
  697. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  698. +
  699. +
  700. +#include "CSSPropertyNames.h"
  701. +#include "HashTools.h"
  702. +
  703. +namespace WebCore {
  704. +#include "CSSPropertyNamesHash.hpp"
  705. +
  706. +const Property* findProperty (register const char* str, register unsigned int len)
  707. +{
  708. + return CSSPropertyNamesHash::findPropertyImpl(str, len);
  709. +}
  710. +
  711. const char* getPropertyName(CSSPropertyID id)
  712. {
  713. if (id < firstCSSProperty)
  714. @@ -125,7 +153,10 @@
  715. return 0;
  716. return propertyNameStrings[index];
  717. }
  718. +
  719. +} // namespace WebCore
  720. +
  721. EOF
  722.  
  723. -close C;
  724. +close PROPERTYNAMES;
  725.  
  726. Index: WebCore/css/makevalues.pl
  727. ===================================================================
  728. --- WebCore/css/makevalues.pl (revision 61693)
  729. +++ WebCore/css/makevalues.pl (working copy)
  730. @@ -42,14 +42,13 @@
  731. #include \"CSSValueKeywords.h\"
  732. %}
  733. %struct-type
  734. -struct Value {
  735. - const char* name;
  736. - int id;
  737. -};
  738. -%language=ANSI-C
  739. +struct Value;
  740. +%omit-struct-type
  741. +%language=C++
  742. %readonly-tables
  743. %compare-strncmp
  744. -%define lookup-function-name findValue
  745. +%define class-name CSSValueKeywordsHash
  746. +%define lookup-function-name findValueImpl
  747. %define hash-function-name value_hash_function
  748. %define word-array-name value_word_list
  749. %includes
  750. @@ -72,6 +71,10 @@
  751. #ifndef CSSValueKeywords_h
  752. #define CSSValueKeywords_h
  753.  
  754. +#include <string.h>
  755. +
  756. +namespace WebCore {
  757. +
  758. const int CSSValueInvalid = 0;
  759. EOF
  760.  
  761. @@ -92,13 +95,16 @@
  762.  
  763. const char* getValueName(unsigned short id);
  764.  
  765. +} // namespace WebCore
  766. +
  767. #endif // CSSValueKeywords_h
  768. +
  769. EOF
  770. close HEADER;
  771.  
  772. -system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
  773. +system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.hpp") == 0 || die "calling gperf failed: $?";
  774.  
  775. -open C, ">>CSSValueKeywords.cpp" || die "Could not open CSSValueKeywords.cpp for writing";
  776. +open C, ">>CSSValueKeywordsHash.hpp" || die "Could not open CSSValueKeywordsHash.hpp for writing";
  777. print C "static const char * const valueList[] = {\n";
  778. print C "\"\",\n";
  779. foreach my $name (@names) {
  780. @@ -107,12 +113,38 @@
  781. print C << "EOF";
  782. 0
  783. };
  784. +
  785. +EOF
  786. +
  787. +close C;
  788. +
  789. +my $valueKeywordsImpl = "CSSValueKeywords.cpp";
  790. +
  791. +open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing";
  792. +print VALUEKEYWORDS << "EOF";
  793. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  794. +
  795. +#include "CSSValueKeywords.h"
  796. +#include "HashTools.h"
  797. +
  798. +namespace WebCore {
  799. +#include "CSSValueKeywordsHash.hpp"
  800. +
  801. +const Value* findValue (register const char* str, register unsigned int len)
  802. +{
  803. + return CSSValueKeywordsHash::findValueImpl(str, len);
  804. +}
  805. +
  806. const char* getValueName(unsigned short id)
  807. {
  808. if (id >= numCSSValueKeywords || id <= 0)
  809. return 0;
  810. return valueList[id];
  811. }
  812. +
  813. +} // namespace WebCore
  814. +
  815. EOF
  816.  
  817. -close C;
  818. +close VALUEKEYWORDS;
  819. +
Add Comment
Please, Sign In to add comment