Speed improvements to SubstringSetMatcher 

This is a 2nd attempt to reland https://codereview.chromium.org/14780003/ which was reverted as https://codereview.chromium.org/15045002/, relanded as https://codereview.chromium.org/15059003 and reverted again as https://codereview.chromium.org/15027007/.

Patch set 1 here is identical with p.s. 2 in https://codereview.chromium.org/15059003.

This time it failed on Win XP debug bot's unit_tests, throwing assertions related to sorting patterns in the SubstringSetMatcher:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\algorithm(3657) : Assertion failed: invalid operator<
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstring(78) : Assertion failed: string iterator not dereferencable
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstring(79) : Assertion failed: "Standard C++ Libraries Out of Range" && 0

Affected unit tests: SubstringSetMatcherTest.TestMatcher and WebRequestRulesRegistryTest.GetMatchesCheckFulfilled



History of previous descriptions:

This is an attempt to reland https://codereview.chromium.org/14780003/ which was reverted as https://codereview.chromium.org/15045002/. 
Patch set 1 here is identical with p.s. 7 in https://codereview.chromium.org/14780003/. The failing buildbot was linux compile (dbg), so trying it here explicitly. 

Original description: 

The main one is coputing the Aho-Corasick tree size in advance. 

Also contained are code clean-ups and minor optimisations, like removing HasEdge/GetEdge sequences, or adding const to aid compiler optimisations. 

This was tested on a benchmark adding 20k+ patterns. It showed a reduction of the running time by 30%. 

BUG=236368

Review URL: https://chromiumcodereview.appspot.com/15027008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200253 0039d316-1c4b-4281-b951-d872f2087c98
2 files changed