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

Side by Side Diff: content/common/cookie_service_impl.h

Issue 2908443002: Initial implementation of Cookie service.
Patch Set: Got initial implementation compiling. Created 3 years, 6 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_COOKIE_SERVICE_H_
yzshen1 2017/06/20 18:33:16 Please match the file path exactly.
6 #define CONTENT_COMMON_COOKIE_SERVICE_H_
7
8 #include <string>
9
10 #include "content/common/cookies.mojom.h"
11 #include "mojo/public/cpp/bindings/binding_set.h"
12
13 class GURL;
14
15 namespace net {
16 class CookieStore;
17 }
18
19 namespace content {
20
21 // Wrap a cookie store in an implementation of the mojo cookie interface.
22
23 // This is an IO thread object; all methods on this object must be called on
24 // the IO thread. Note that this does not restrict the locations from which
25 // mojo messages may be sent to the object.
26 class CookieServiceImpl : public content::mojom::CookieService {
27 // Construct a CookieService that can serve mojo requests for the underlying
28 // cookie store. |*cookie_store| must outlive this object.
29 CookieServiceImpl(net::CookieStore* cookie_store);
30
31 ~CookieServiceImpl() override;
32
33 // Associated a cookie request pointer with this object. Mojo messages
yzshen1 2017/06/20 18:33:17 It would be nice to use "bind...to" instead of "as
34 // coming through the associated pipe will be served by this object.
35 void AddRequest(content::mojom::CookieServiceRequest request);
36
37 // TODO(rdsmith): Add a verion of AddRequest that does renderer-appropriate
38 // security checks on bindings coming through that interface.
39
40 private:
41 // content::mojom::Cookies
42 void GetAllCookies(GetAllCookiesCallback callback) override;
43 void GetCookieList(const GURL& url,
44 const net::CookieOptions& cookie_options,
45 GetCookieListCallback callback) override;
46 void SetCanonicalCookie(const net::CanonicalCookie& cookie,
47 bool secure_source,
48 bool modify_http_only,
49 SetCanonicalCookieCallback callback) override;
50 void DeleteCookies(content::mojom::CookieDeletionFilterPtr filter,
51 DeleteCookiesCallback callback) override;
52 void RequestNotification(
53 const GURL& url,
54 const std::string& name,
55 content::mojom::CookieChangeNotificationRequest notification_interface,
56 RequestNotificationCallback callback) override;
57 void CloneInterface(
58 content::mojom::CookieServiceRequest new_interface) override;
59
60 net::CookieStore* cookie_store_;
61 mojo::BindingSet<content::mojom::CookieService> bindings_;
62
63 DISALLOW_COPY_AND_ASSIGN(CookieServiceImpl);
64 };
65
66 } // namespace content
67
68 #endif // CONTENT_COMMON_COOKIE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698