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

Side by Side Diff: net/cookies/cookie_options.h

Issue 1258023002: Split 'CookieOptions' out into a .h/.cc file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NET_EXPORT Created 5 years, 4 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
« no previous file with comments | « no previous file | net/cookies/cookie_options.cc » ('j') | net/cookies/cookie_options.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Brought to you by number 42. 5 // Brought to you by number 42.
6 6
7 #ifndef NET_COOKIES_COOKIE_OPTIONS_H_ 7 #ifndef NET_COOKIES_COOKIE_OPTIONS_H_
8 #define NET_COOKIES_COOKIE_OPTIONS_H_ 8 #define NET_COOKIES_COOKIE_OPTIONS_H_
9 9
10 #include "base/time/time.h"
11 #include "net/base/net_export.h"
10 #include "url/gurl.h" 12 #include "url/gurl.h"
11 13
12 namespace net { 14 namespace net {
13 15
14 class CookieOptions { 16 class NET_EXPORT CookieOptions {
15 public: 17 public:
16 // Default is to exclude httponly completely, and exclude first-party from 18 // Default is to exclude httponly completely, and exclude first-party from
17 // being read, which means: 19 // being read, which means:
18 // - reading operations will not return httponly or first-party cookies. 20 // - reading operations will not return httponly or first-party cookies.
19 // - writing operations will not write httponly cookies (first-party will be 21 // - writing operations will not write httponly cookies (first-party will be
20 // written). 22 // written).
21 // 23 //
22 // If a first-party URL is set, then first-party cookies which match that URL 24 // If a first-party URL is set, then first-party cookies which match that URL
23 // will be returned. 25 // will be returned.
24 CookieOptions() 26 CookieOptions();
25 : exclude_httponly_(true),
26 include_first_party_only_(false),
27 server_time_() {}
28 27
29 void set_exclude_httponly() { exclude_httponly_ = true; } 28 void set_exclude_httponly() { exclude_httponly_ = true; }
30 void set_include_httponly() { exclude_httponly_ = false; } 29 void set_include_httponly() { exclude_httponly_ = false; }
31 bool exclude_httponly() const { return exclude_httponly_; } 30 bool exclude_httponly() const { return exclude_httponly_; }
32 31
33 void set_include_first_party_only() { include_first_party_only_ = true; } 32 void set_include_first_party_only() { include_first_party_only_ = true; }
34 bool include_first_party_only() const { return include_first_party_only_; } 33 bool include_first_party_only() const { return include_first_party_only_; }
35 34
36 void set_first_party_url(const GURL& url) { first_party_url_ = url; } 35 void set_first_party_url(const GURL& url) { first_party_url_ = url; }
37 GURL first_party_url() const { return first_party_url_; } 36 GURL first_party_url() const { return first_party_url_; }
(...skipping 10 matching lines...) Expand all
48 private: 47 private:
49 bool exclude_httponly_; 48 bool exclude_httponly_;
50 bool include_first_party_only_; 49 bool include_first_party_only_;
51 GURL first_party_url_; 50 GURL first_party_url_;
52 base::Time server_time_; 51 base::Time server_time_;
53 }; 52 };
54 53
55 } // namespace net 54 } // namespace net
56 55
57 #endif // NET_COOKIES_COOKIE_OPTIONS_H_ 56 #endif // NET_COOKIES_COOKIE_OPTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | net/cookies/cookie_options.cc » ('j') | net/cookies/cookie_options.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698