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

Side by Side Diff: blimp/engine/app/blimp_network_delegate.cc

Issue 2629743003: Remove all blimp engine code (Closed)
Patch Set: Use consistent comment style in //chrome Created 3 years, 11 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 | « blimp/engine/app/blimp_network_delegate.h ('k') | blimp/engine/app/blimp_permission_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 #include "blimp/engine/app/blimp_network_delegate.h"
6
7 #include "net/base/net_errors.h"
8 #include "net/base/static_cookie_policy.h"
9 #include "net/url_request/url_request.h"
10
11 namespace blimp {
12 namespace engine {
13
14 namespace {
15 bool g_accept_all_cookies = true;
16
17 net::StaticCookiePolicy::Type GetPolicyType() {
18 return g_accept_all_cookies
19 ? net::StaticCookiePolicy::ALLOW_ALL_COOKIES
20 : net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES;
21 }
22
23 } // namespace
24
25 BlimpNetworkDelegate::BlimpNetworkDelegate() {}
26
27 BlimpNetworkDelegate::~BlimpNetworkDelegate() {}
28
29 void BlimpNetworkDelegate::SetAcceptAllCookies(bool accept) {
30 g_accept_all_cookies = accept;
31 }
32
33 bool BlimpNetworkDelegate::OnCanGetCookies(const net::URLRequest& request,
34 const net::CookieList& cookie_list) {
35 net::StaticCookiePolicy policy(GetPolicyType());
36 int rv =
37 policy.CanGetCookies(request.url(), request.first_party_for_cookies());
38 return rv == net::OK;
39 }
40
41 bool BlimpNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
42 const std::string& cookie_line,
43 net::CookieOptions* options) {
44 net::StaticCookiePolicy policy(GetPolicyType());
45 int rv =
46 policy.CanSetCookie(request.url(), request.first_party_for_cookies());
47 return rv == net::OK;
48 }
49
50 } // namespace engine
51 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/engine/app/blimp_network_delegate.h ('k') | blimp/engine/app/blimp_permission_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698