Chromium Code Reviews| Index: android_webview/browser/aw_cookie_access_policy.cc |
| diff --git a/android_webview/browser/aw_cookie_access_policy.cc b/android_webview/browser/aw_cookie_access_policy.cc |
| index 1dc3ba979a8d3cc3630ba83094c3a5f5fb291ad4..60fb9cb7057153caf05baec08f395512360d2f4f 100644 |
| --- a/android_webview/browser/aw_cookie_access_policy.cc |
| +++ b/android_webview/browser/aw_cookie_access_policy.cc |
| @@ -10,11 +10,13 @@ |
| #include "base/logging.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/resource_request_info.h" |
| +#include "content/public/browser/websocket_handshake_request_info.h" |
| #include "net/base/net_errors.h" |
| using base::AutoLock; |
| using content::BrowserThread; |
| using content::ResourceRequestInfo; |
| +using content::WebSocketHandshakeRequestInfo; |
| using net::StaticCookiePolicy; |
| namespace android_webview { |
| @@ -57,12 +59,21 @@ bool AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies( |
| bool AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies( |
| const net::URLRequest& request) { |
| + int child_id = 0; |
| + int frame_id = 0; |
| const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request); |
| - if (!info) { |
| - return false; |
| + if (info) { |
| + child_id = info->GetChildID(); |
| + frame_id = info->GetRenderFrameID(); |
| + } else { |
| + const WebSocketHandshakeRequestInfo* websocket_info = |
| + WebSocketHandshakeRequestInfo::ForRequest(&request); |
| + if (!websocket_info) |
| + return false; |
|
Torne
2016/10/12 12:16:30
Do you happen to know if there's any other case wh
yhirano
2016/10/12 12:36:55
Sorry, I don't know. If it should be done, it shou
|
| + child_id = websocket_info->GetChildId(); |
| + frame_id = websocket_info->GetFrameId(); |
| } |
| - return GetShouldAcceptThirdPartyCookies(info->GetChildID(), |
| - info->GetRenderFrameID()); |
| + return GetShouldAcceptThirdPartyCookies(child_id, frame_id); |
| } |
| bool AwCookieAccessPolicy::OnCanGetCookies(const net::URLRequest& request, |