Refactor LineBreaker::nextSegmentBreak and add a BreakingContext that holds all its state
Refactor LineBreaker::nextSegmentBreak and add a BreakingContext that holds all its state

LineBreaker::nextSegmentBreak was around 600 lines of code, including multiple
gotos and an enormous amount of state variables. In an effort to make it easier
to follow what's going on in this very hot and very important function, I've
attempted to refactor it into a series of inline functions representing how it
processes different types of inline content. To hold onto all the state, I've
added a BreakingContext. This let me get rid of the gotos and bring nextSegmentBreak
down to about 50 lines.

There's still a lot that can be done to make working with this code not awful.
I believe there's a lot of simplification that can continue to occur in handleText,
which is still pretty monolithic.

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

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@158487 bbb929c8-8fbe-4397-9dbb-9b2b20218538

Bysmyyr/blink-crosswalk,Bysmyyr/blink-crosswalk,XiaosongWei/blink-crosswalk,kurli/blink-crosswalk,hgl888/blink-crosswalk-efl,smishenk/blink-crosswalk,nwjs/blink,Bysmyyr/blink-crosswalk,kurli/blink-crosswalk,kurli/blink-crosswalk,XiaosongWei/blink-crosswalk,modulexcite/blink,smishenk/blink-crosswalk,nwjs/blink,jtg-gg/blink,jtg-gg/blink,ondra-novak/blink,modulexcite/blink,hgl888/blink-crosswalk-efl,Pluto-tv/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,XiaosongWei/blink-crosswalk,kurli/blink-crosswalk,modulexcite/blink,modulexcite/blink,kurli/blink-crosswalk,jtg-gg/blink,modulexcite/blink,smishenk/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,smishenk/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,crosswalk-project/blink-crosswalk-efl,nwjs/blink,jtg-gg/blink,XiaosongWei/blink-crosswalk,Bysmyyr/blink-crosswalk,PeterWangIntel/blink-crosswalk,PeterWangIntel/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,kurli/blink-crosswalk,Pluto-tv/blink-crosswalk,modulexcite/blink,hgl888/blink-crosswalk-efl,Bysmyyr/blink-crosswalk,modulexcite/blink,ondra-novak/blink,kurli/blink-crosswalk,hgl888/blink-crosswalk-efl,smishenk/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,Pluto-tv/blink-crosswalk,ondra-novak/blink,ondra-novak/blink,Pluto-tv/blink-crosswalk,Bysmyyr/blink-crosswalk,nwjs/blink,nwjs/blink,nwjs/blink,ondra-novak/blink,jtg-gg/blink,Pluto-tv/blink-crosswalk,jtg-gg/blink,jtg-gg/blink,XiaosongWei/blink-crosswalk,Bysmyyr/blink-crosswalk,hgl888/blink-crosswalk-efl,PeterWangIntel/blink-crosswalk,nwjs/blink,ondra-novak/blink,ondra-novak/blink,kurli/blink-crosswalk,hgl888/blink-crosswalk-efl,smishenk/blink-crosswalk,PeterWangIntel/blink-crosswalk,nwjs/blink,jtg-gg/blink,Pluto-tv/blink-crosswalk,Pluto-tv/blink-crosswalk,Bysmyyr/blink-crosswalk,jtg-gg/blink,hgl888/blink-crosswalk-efl,Bysmyyr/blink-crosswalk,smishenk/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,PeterWangIntel/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,ondra-novak/blink,modulexcite/blink,kurli/blink-crosswalk,XiaosongWei/blink-crosswalk,ondra-novak/blink,hgl888/blink-crosswalk-efl,Pluto-tv/blink-crosswalk,Pluto-tv/blink-crosswalk,modulexcite/blink,Pluto-tv/blink-crosswalk,PeterWangIntel/blink-crosswalk,Bysmyyr/blink-crosswalk,nwjs/blink,crosswalk-project/blink-crosswalk-efl,PeterWangIntel/blink-crosswalk,kurli/blink-crosswalk,XiaosongWei/blink-crosswalk,smishenk/blink-crosswalk,PeterWangIntel/blink-crosswalk,jtg-gg/blink,PeterWangIntel/blink-crosswalk,hgl888/blink-crosswalk-efl,modulexcite/blink,XiaosongWei/blink-crosswalk,smishenk/blink-crosswalk,nwjs/blink,XiaosongWei/blink-crosswalk,smishenk/blink-crosswalk