Index: headless/lib/browser/headless_network_delegate.cc |
diff --git a/content/shell/browser/shell_network_delegate.cc b/headless/lib/browser/headless_network_delegate.cc |
similarity index 65% |
copy from content/shell/browser/shell_network_delegate.cc |
copy to headless/lib/browser/headless_network_delegate.cc |
index c4cd0da3416528a473808d6e4365638f57d7c3ce..f2a9fae59583a3253fa7b860d6f3042eed5ef714 100644 |
--- a/content/shell/browser/shell_network_delegate.cc |
+++ b/headless/lib/browser/headless_network_delegate.cc |
@@ -1,8 +1,8 @@ |
-// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Copyright 2015 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 "headless/lib/browser/headless_network_delegate.h" |
#include "base/command_line.h" |
#include "content/public/common/content_switches.h" |
@@ -10,42 +10,42 @@ |
#include "net/base/static_cookie_policy.h" |
#include "net/url_request/url_request.h" |
-namespace content { |
+namespace headless { |
namespace { |
bool g_accept_all_cookies = true; |
} |
-ShellNetworkDelegate::ShellNetworkDelegate() { |
+HeadlessNetworkDelegate::HeadlessNetworkDelegate() { |
} |
-ShellNetworkDelegate::~ShellNetworkDelegate() { |
+HeadlessNetworkDelegate::~HeadlessNetworkDelegate() { |
} |
-void ShellNetworkDelegate::SetAcceptAllCookies(bool accept) { |
+void HeadlessNetworkDelegate::SetAcceptAllCookies(bool accept) { |
g_accept_all_cookies = accept; |
} |
-int ShellNetworkDelegate::OnBeforeURLRequest( |
+int HeadlessNetworkDelegate::OnBeforeURLRequest( |
net::URLRequest* request, |
const net::CompletionCallback& callback, |
GURL* new_url) { |
return net::OK; |
} |
-int ShellNetworkDelegate::OnBeforeSendHeaders( |
+int HeadlessNetworkDelegate::OnBeforeSendHeaders( |
net::URLRequest* request, |
const net::CompletionCallback& callback, |
net::HttpRequestHeaders* headers) { |
return net::OK; |
} |
-void ShellNetworkDelegate::OnSendHeaders( |
+void HeadlessNetworkDelegate::OnSendHeaders( |
net::URLRequest* request, |
const net::HttpRequestHeaders& headers) { |
} |
-int ShellNetworkDelegate::OnHeadersReceived( |
+int HeadlessNetworkDelegate::OnHeadersReceived( |
net::URLRequest* request, |
const net::CompletionCallback& callback, |
const net::HttpResponseHeaders* original_response_headers, |
@@ -54,24 +54,24 @@ int ShellNetworkDelegate::OnHeadersReceived( |
return net::OK; |
} |
-void ShellNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, |
+void HeadlessNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, |
const GURL& new_location) { |
} |
-void ShellNetworkDelegate::OnResponseStarted(net::URLRequest* request) { |
+void HeadlessNetworkDelegate::OnResponseStarted(net::URLRequest* request) { |
} |
-void ShellNetworkDelegate::OnCompleted(net::URLRequest* request, bool started) { |
+void HeadlessNetworkDelegate::OnCompleted(net::URLRequest* request, bool started) { |
} |
-void ShellNetworkDelegate::OnURLRequestDestroyed(net::URLRequest* request) { |
+void HeadlessNetworkDelegate::OnURLRequestDestroyed(net::URLRequest* request) { |
} |
-void ShellNetworkDelegate::OnPACScriptError(int line_number, |
+void HeadlessNetworkDelegate::OnPACScriptError(int line_number, |
const base::string16& error) { |
} |
-ShellNetworkDelegate::AuthRequiredResponse ShellNetworkDelegate::OnAuthRequired( |
+HeadlessNetworkDelegate::AuthRequiredResponse HeadlessNetworkDelegate::OnAuthRequired( |
net::URLRequest* request, |
const net::AuthChallengeInfo& auth_info, |
const AuthCallback& callback, |
@@ -79,7 +79,7 @@ ShellNetworkDelegate::AuthRequiredResponse ShellNetworkDelegate::OnAuthRequired( |
return AUTH_REQUIRED_RESPONSE_NO_ACTION; |
} |
-bool ShellNetworkDelegate::OnCanGetCookies(const net::URLRequest& request, |
+bool HeadlessNetworkDelegate::OnCanGetCookies(const net::URLRequest& request, |
const net::CookieList& cookie_list) { |
net::StaticCookiePolicy::Type policy_type = g_accept_all_cookies ? |
net::StaticCookiePolicy::ALLOW_ALL_COOKIES : |
@@ -90,7 +90,7 @@ bool ShellNetworkDelegate::OnCanGetCookies(const net::URLRequest& request, |
return rv == net::OK; |
} |
-bool ShellNetworkDelegate::OnCanSetCookie(const net::URLRequest& request, |
+bool HeadlessNetworkDelegate::OnCanSetCookie(const net::URLRequest& request, |
const std::string& cookie_line, |
net::CookieOptions* options) { |
net::StaticCookiePolicy::Type policy_type = g_accept_all_cookies ? |
@@ -102,14 +102,14 @@ bool ShellNetworkDelegate::OnCanSetCookie(const net::URLRequest& request, |
return rv == net::OK; |
} |
-bool ShellNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, |
+bool HeadlessNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, |
const base::FilePath& path) const { |
return true; |
} |
-bool ShellNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { |
+bool HeadlessNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { |
return base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kEnableExperimentalWebPlatformFeatures); |
} |
-} // namespace content |
+} // namespace headless |