Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: android_webview/browser/aw_cookie_access_policy.cc

Issue 1852513003: Convert //android_webview to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git is hard Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/aw_cookie_access_policy.h" 5 #include "android_webview/browser/aw_cookie_access_policy.h"
6 6
7 #include <memory>
8
7 #include "android_webview/browser/aw_contents_io_thread_client.h" 9 #include "android_webview/browser/aw_contents_io_thread_client.h"
8
9 #include "base/logging.h" 10 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
12 #include "content/public/browser/resource_request_info.h" 12 #include "content/public/browser/resource_request_info.h"
13 #include "net/base/net_errors.h" 13 #include "net/base/net_errors.h"
14 14
15 using base::AutoLock; 15 using base::AutoLock;
16 using content::BrowserThread; 16 using content::BrowserThread;
17 using content::ResourceRequestInfo; 17 using content::ResourceRequestInfo;
18 using net::StaticCookiePolicy; 18 using net::StaticCookiePolicy;
19 19
20 namespace android_webview { 20 namespace android_webview {
(...skipping 19 matching lines...) Expand all
40 } 40 }
41 41
42 void AwCookieAccessPolicy::SetShouldAcceptCookies(bool allow) { 42 void AwCookieAccessPolicy::SetShouldAcceptCookies(bool allow) {
43 AutoLock lock(lock_); 43 AutoLock lock(lock_);
44 accept_cookies_ = allow; 44 accept_cookies_ = allow;
45 } 45 }
46 46
47 bool AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies( 47 bool AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies(
48 int render_process_id, 48 int render_process_id,
49 int render_frame_id) { 49 int render_frame_id) {
50 scoped_ptr<AwContentsIoThreadClient> io_thread_client = 50 std::unique_ptr<AwContentsIoThreadClient> io_thread_client =
51 AwContentsIoThreadClient::FromID(render_process_id, render_frame_id); 51 AwContentsIoThreadClient::FromID(render_process_id, render_frame_id);
52 if (!io_thread_client) { 52 if (!io_thread_client) {
53 return false; 53 return false;
54 } 54 }
55 return io_thread_client->ShouldAcceptThirdPartyCookies(); 55 return io_thread_client->ShouldAcceptThirdPartyCookies();
56 } 56 }
57 57
58 bool AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies( 58 bool AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies(
59 const net::URLRequest& request) { 59 const net::URLRequest& request) {
60 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request); 60 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 net::OK; 136 net::OK;
137 } 137 }
138 138
139 bool AwStaticCookiePolicy::AllowGet(const GURL& url, 139 bool AwStaticCookiePolicy::AllowGet(const GURL& url,
140 const GURL& first_party) const { 140 const GURL& first_party) const {
141 return StaticCookiePolicy(GetPolicy(url)).CanGetCookies(url, first_party) == 141 return StaticCookiePolicy(GetPolicy(url)).CanGetCookies(url, first_party) ==
142 net::OK; 142 net::OK;
143 } 143 }
144 144
145 } // namespace android_webview 145 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_contents_io_thread_client.h ('k') | android_webview/browser/aw_dev_tools_discovery_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698