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

Unified Diff: ios/web/shell/shell_network_delegate.cc

Issue 1149323004: Upstream the iOS web_shell and supporting code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-thread-impl
Patch Set: Address review comments Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/shell/shell_network_delegate.h ('k') | ios/web/shell/shell_url_request_context_getter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/shell/shell_network_delegate.cc
diff --git a/content/shell/browser/shell_network_delegate.cc b/ios/web/shell/shell_network_delegate.cc
similarity index 65%
copy from content/shell/browser/shell_network_delegate.cc
copy to ios/web/shell/shell_network_delegate.cc
index 135bba36d0e302d0a7fc6aaeb3ff57246304acb9..a973f4c7e9131ee82c50e76f86cf51b355c38b84 100644
--- a/content/shell/browser/shell_network_delegate.cc
+++ b/ios/web/shell/shell_network_delegate.cc
@@ -1,20 +1,12 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/browser/shell_network_delegate.h"
+#include "ios/web/shell/shell_network_delegate.h"
-#include "base/command_line.h"
-#include "content/public/common/content_switches.h"
#include "net/base/net_errors.h"
-#include "net/base/static_cookie_policy.h"
-#include "net/url_request/url_request.h"
-namespace content {
-
-namespace {
-bool g_accept_all_cookies = true;
-}
+namespace web {
ShellNetworkDelegate::ShellNetworkDelegate() {
}
@@ -22,10 +14,6 @@ ShellNetworkDelegate::ShellNetworkDelegate() {
ShellNetworkDelegate::~ShellNetworkDelegate() {
}
-void ShellNetworkDelegate::SetAcceptAllCookies(bool accept) {
- g_accept_all_cookies = accept;
-}
-
int ShellNetworkDelegate::OnBeforeURLRequest(
net::URLRequest* request,
const net::CompletionCallback& callback,
@@ -85,25 +73,13 @@ ShellNetworkDelegate::AuthRequiredResponse ShellNetworkDelegate::OnAuthRequired(
bool ShellNetworkDelegate::OnCanGetCookies(const net::URLRequest& request,
const net::CookieList& cookie_list) {
- net::StaticCookiePolicy::Type policy_type = g_accept_all_cookies ?
- net::StaticCookiePolicy::ALLOW_ALL_COOKIES :
- net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES;
- net::StaticCookiePolicy policy(policy_type);
- int rv = policy.CanGetCookies(
- request.url(), request.first_party_for_cookies());
- return rv == net::OK;
+ return true;
}
bool ShellNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
const std::string& cookie_line,
net::CookieOptions* options) {
- net::StaticCookiePolicy::Type policy_type = g_accept_all_cookies ?
- net::StaticCookiePolicy::ALLOW_ALL_COOKIES :
- net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES;
- net::StaticCookiePolicy policy(policy_type);
- int rv = policy.CanSetCookie(
- request.url(), request.first_party_for_cookies());
- return rv == net::OK;
+ return true;
}
bool ShellNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
@@ -116,9 +92,4 @@ bool ShellNetworkDelegate::OnCanThrottleRequest(
return false;
}
-bool ShellNetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabled() const {
- return base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableExperimentalWebPlatformFeatures);
-}
-
-} // namespace content
+} // namespace web
« no previous file with comments | « ios/web/shell/shell_network_delegate.h ('k') | ios/web/shell/shell_url_request_context_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698