Chromium Code Reviews| Index: content/browser/web_contents/web_contents_impl.cc |
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
| index 9c40100612d6022542c28706a618ade5f8abd5e0..9a7bf5a39500eb4ffeb255b6d1a8e23cf8c914d2 100644 |
| --- a/content/browser/web_contents/web_contents_impl.cc |
| +++ b/content/browser/web_contents/web_contents_impl.cc |
| @@ -3626,15 +3626,25 @@ void WebContentsImpl::DidDeferAfterResponseStarted( |
| const scoped_refptr<net::HttpResponseHeaders>& headers, |
| const GURL& url) { |
| #if defined(OS_ANDROID) |
| - ContentViewCoreImpl::FromWebContents(this)->DidDeferAfterResponseStarted( |
| - headers, url); |
| + WebContentsAndroid* web_contents_android = |
| + static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey)); |
| + if (!web_contents_android) { |
| + web_contents_android = new WebContentsAndroid(this); |
| + SetUserData(kWebContentsAndroidKey, web_contents_android); |
| + } |
| + web_contents_android->DidDeferAfterResponseStarted(headers, url);; |
| #endif |
| } |
| bool WebContentsImpl::WillHandleDeferAfterResponseStarted() { |
| #if defined(OS_ANDROID) |
| - return ContentViewCoreImpl::FromWebContents(this)-> |
| - WillHandleDeferAfterResponseStarted(); |
| + WebContentsAndroid* web_contents_android = |
| + static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey)); |
| + if (!web_contents_android) { |
|
AKVT
2014/08/05 13:58:43
This part please correct if I added extra code.
|
| + web_contents_android = new WebContentsAndroid(this); |
| + SetUserData(kWebContentsAndroidKey, web_contents_android); |
| + } |
| + return web_contents_android->WillHandleDeferAfterResponseStarted(); |
| #else |
| return false; |
| #endif |