Fix crash due to race conditions in the way Browser unhooks its NotificationObserver for WebContents disconnection... not all codepaths would result in Browser being removed as an observer. This change simplifies things a bit by adding Browser as an observer for a TabContents whenever it is inserted into the Browser's tabstrip, and removing it whenever it's detached. These notifications are designed to be symmetrical and handle all use cases including create/destroy(close) and also tab dragging/detaching.
Fix crash due to race conditions in the way Browser unhooks its
NotificationObserver for WebContents disconnection... not all codepaths would
result in Browser being removed as an observer. This change simplifies things a
bit by adding Browser as an observer for a TabContents whenever it is inserted
into the Browser's tabstrip, and removing it whenever it's detached. These
notifications are designed to be symmetrical and handle all use cases including
create/destroy(close) and also tab dragging/detaching.

Thanks to Adam for helping diagnose this and suggesting this fix.

B=1307678

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@402 0039d316-1c4b-4281-b951-d872f2087c98

adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,adobe/chromium