back port upstream patch
back port upstream patch

This patch is from Chromium project. It's used to handle potential issue
in scoped_refptr.

This is upstream patch porting and the original link is:
http://codereview.chromium.org/9021020/
unittest change was not included.

Change-Id: I14ce3df0653ff29713f38eceaf07e9b409cfaedc
Author: Fengwei Yin <a85b841abe032a0ae4abc495363cffc602e5cf0c@intel.com>
Singed-off-by: Shuo Gao <41a290aaca72e227baea3277f9bb5e161fa18832@intel.com>
Signed-off-by: Bruce Beare <59fda544ce74eec5943b18fdd05e82f743b9b114@intel.com>
Signed-off-by: Jack Ren <167cc1f7c253fed81a725ec35bcd442aa9b4f515@intel.com>
Author-tracking-BZ: 37500

android-ia/platform_external_chromium,CyanogenMod/android_external_chromium,omapzoom/platform-external-chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,timduru/platform_external_chromium,spezi77/android_external_chromium,timduru/platform_external_chromium,ModdedPA/android_external_chromium,TheGNOMEProject/platform_external_chromium,ParanoidAndroid/android_external_chromium,SlimSaber/android_external_chromium,Root-Box/external_chromium,SlimSaber/android_external_chromium,AOKPSaber/android_external_chromium,xhteam/external-chromium,opensourcechipspark/platform_external_chromium,brothaedhung/external_chromium,p990-slimrom/platform_external_chromium,Nico60/external_chromium,CyanogenMod/android_external_chromium,Evervolv/android_external_chromium,TEAM-Gummy/platform_external_chromium,ParanoidAndroid/android_external_chromium,AOKPSaber/android_external_chromium,SlimSaber/android_external_chromium,p990-slimrom/platform_external_chromium,timduru/platform_external_chromium,ModdedPA/android_external_chromium,CyanogenMod/android_external_chromium,p990-slimrom/platform_external_chromium,android-ia/platform_external_chromium,MyAOSP/external_chromium,omapzoom/platform-external-chromium,Root-Box/external_chromium,SaleJumper/android-source-browsing.platform--external--chromium,Evervolv/android_external_chromium,TheGNOMEProject/platform_external_chromium,spezi77/android_external_chromium,android-ia/platform_external_chromium,TEAM-Gummy/platform_external_chromium,Nico60/external_chromium,AOKPSaber/android_external_chromium,omapzoom/platform-external-chromium,omapzoom/platform-external-chromium,opensourcechipspark/platform_external_chromium,aospX/platform_external_chromium,rcoscali/external-chromium,ModdedPA/android_external_chromium,IllusionRom-deprecated/android_platform_external_chromium,SlimSaber/android_external_chromium,android-ia/platform_external_chromium,CyanogenMod/android_external_chromium,spezi77/android_external_chromium,AOKPSaber/android_external_chromium,rcoscali/external-chromium,Evervolv/android_external_chromium,opensourcechipspark/platform_external_chromium,ParanoidAndroid/android_external_chromium,MyAOSP/external_chromium,TheGNOMEProject/platform_external_chromium,TheGNOMEProject/platform_external_chromium,opensourcechipspark/platform_external_chromium,android-ia/platform_external_chromium,xhteam/external-chromium,Root-Box/external_chromium,spezi77/android_external_chromium,p990-slimrom/platform_external_chromium,Root-Box/external_chromium,IllusionRom-deprecated/android_platform_external_chromium,opensourcechipspark/platform_external_chromium,yinquan529/platform-external-chromium,p990-slimrom/platform_external_chromium,timduru/platform_external_chromium,rcoscali/external-chromium,p990-slimrom/platform_external_chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,SaleJumper/android-source-browsing.platform--external--chromium,xhteam/external-chromium,omapzoom/platform-external-chromium,aospX/platform_external_chromium,aospX/platform_external_chromium,omapzoom/platform-external-chromium,Root-Box/external_chromium,rcoscali/external-chromium,aospX/platform_external_chromium,Evervolv/android_external_chromium,androidarmv6/android_external_chromium,MyAOSP/external_chromium,Nico60/external_chromium,SaleJumper/android-source-browsing.platform--external--chromium,ParanoidAndroid/android_external_chromium,spezi77/android_external_chromium,SaleJumper/android-source-browsing.platform--external--chromium,timduru/platform_external_chromium,TheGNOMEProject/platform_external_chromium,ThangBK2009/android-source-browsing.platform--external--chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,TEAM-Gummy/platform_external_chromium,opensourcechipspark/platform_external_chromium,androidarmv6/android_external_chromium,SaleJumper/android-source-browsing.platform--external--chromium,TheGNOMEProject/platform_external_chromium,androidarmv6/android_external_chromium,ThangBK2009/android-source-browsing.platform--external--chromium,yinquan529/platform-external-chromium,Evervolv/android_external_chromium,xhteam/external-chromium,Nico60/external_chromium,MyAOSP/external_chromium,SlimSaber/android_external_chromium,yinquan529/platform-external-chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,IllusionRom-deprecated/android_platform_external_chromium,xhteam/external-chromium,brothaedhung/external_chromium,ParanoidAndroid/android_external_chromium,Evervolv/android_external_chromium,TheGNOMEProject/platform_external_chromium,aospX/platform_external_chromium,ThangBK2009/android-source-browsing.platform--external--chromium,opensourcechipspark/platform_external_chromium,timduru/platform_external_chromium,Nico60/external_chromium,SaleJumper/android-source-browsing.platform--external--chromium,Nico60/external_chromium,androidarmv6/android_external_chromium,TEAM-Gummy/platform_external_chromium,android-ia/platform_external_chromium,aospX/platform_external_chromium,ModdedPA/android_external_chromium,ModdedPA/android_external_chromium,rcoscali/external-chromium,rcoscali/external-chromium,AOKPSaber/android_external_chromium,IllusionRom-deprecated/android_platform_external_chromium,spezi77/android_external_chromium,spezi77/android_external_chromium,SaleJumper/android-source-browsing.platform--external--chromium,IllusionRom-deprecated/android_platform_external_chromium,xhteam/external-chromium,Evervolv/android_external_chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,yinquan529/platform-external-chromium,ModdedPA/android_external_chromium,MyAOSP/external_chromium,p990-slimrom/platform_external_chromium,MyAOSP/external_chromium,TEAM-Gummy/platform_external_chromium,Root-Box/external_chromium,SlimSaber/android_external_chromium,ThangBK2009/android-source-browsing.platform--external--chromium,CyanogenMod/android_external_chromium,MyAOSP/external_chromium,yinquan529/platform-external-chromium,android-ia/platform_external_chromium,timduru/platform_external_chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,brothaedhung/external_chromium,p990-slimrom/platform_external_chromium,Nico60/external_chromium,Root-Box/external_chromium,TheGNOMEProject/platform_external_chromium,aospX/platform_external_chromium,ThangBK2009/android-source-browsing.platform--external--chromium,Root-Box/external_chromium,opensourcechipspark/platform_external_chromium,xhteam/external-chromium,yinquan529/platform-external-chromium,android-ia/platform_external_chromium,aospX/platform_external_chromium,androidarmv6/android_external_chromium,p990-slimrom/platform_external_chromium,androidarmv6/android_external_chromium,rcoscali/external-chromium,brothaedhung/external_chromium,rcoscali/external-chromium,spezi77/android_external_chromium,yinquan529/platform-external-chromium,ThangBK2009/android-source-browsing.platform--external--chromium,yinquan529/platform-external-chromium,spezi77/android_external_chromium,Root-Box/external_chromium,IllusionRom-deprecated/android_platform_external_chromium,androidarmv6/android_external_chromium,CyanogenMod/android_external_chromium,opensourcechipspark/platform_external_chromium,xhteam/external-chromium,opensourcechipspark/platform_external_chromium,ModdedPA/android_external_chromium,Nico60/external_chromium,MyAOSP/external_chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,ParanoidAndroid/android_external_chromium,ParanoidAndroid/android_external_chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,omapzoom/platform-external-chromium,ThangBK2009/android-source-browsing.platform--external--chromium,ThangBK2009/android-source-browsing.platform--external--chromium,brothaedhung/external_chromium,android-ia/platform_external_chromium,ThangBK2009/android-source-browsing.platform--external--chromium,AOKPSaber/android_external_chromium,brothaedhung/external_chromium,SaleJumper/android-source-browsing.platform--external--chromium,SaleJumper/android-source-browsing.platform--external--chromium,TEAM-Gummy/platform_external_chromium,brothaedhung/external_chromium,androidarmv6/android_external_chromium,SlimSaber/android_external_chromium,yinquan529/platform-external-chromium,brothaedhung/external_chromium,yinquan529/platform-external-chromium,rcoscali/external-chromium,SlimSaber/android_external_chromium,TEAM-Gummy/platform_external_chromium,Evervolv/android_external_chromium,ModdedPA/android_external_chromium,aospX/platform_external_chromium,CyanogenMod/android_external_chromium,IllusionRom-deprecated/android_platform_external_chromium,IllusionRom-deprecated/android_platform_external_chromium,CyanogenMod/android_external_chromium,AOKPSaber/android_external_chromium,androidarmv6/android_external_chromium,ThangBK2009/android-source-browsing.platform--external--chromium,omapzoom/platform-external-chromium,xhteam/external-chromium,brothaedhung/external_chromium,omapzoom/platform-external-chromium,spezi77/android_external_chromium,ModdedPA/android_external_chromium,Nico60/external_chromium,TheGNOMEProject/platform_external_chromium,SlimSaber/android_external_chromium,Evervolv/android_external_chromium,MyAOSP/external_chromium,timduru/platform_external_chromium,IllusionRom-deprecated/android_platform_external_chromium,TEAM-Gummy/platform_external_chromium,SaleJumper/android-source-browsing.platform--external--chromium,ParanoidAndroid/android_external_chromium,omapzoom/platform-external-chromium,bhargavkumar040/android-source-browsing.platform--external--chromium,AOKPSaber/android_external_chromium,TEAM-Gummy/platform_external_chromium,timduru/platform_external_chromium,CyanogenMod/android_external_chromium,ParanoidAndroid/android_external_chromium,AOKPSaber/android_external_chromium