| OLD | NEW |
| 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 #include "chrome/browser/net/chrome_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "net/base/net_errors.h" | 45 #include "net/base/net_errors.h" |
| 46 #include "net/base/net_log.h" | 46 #include "net/base/net_log.h" |
| 47 #include "net/cookies/canonical_cookie.h" | 47 #include "net/cookies/canonical_cookie.h" |
| 48 #include "net/cookies/cookie_options.h" | 48 #include "net/cookies/cookie_options.h" |
| 49 #include "net/http/http_request_headers.h" | 49 #include "net/http/http_request_headers.h" |
| 50 #include "net/http/http_response_headers.h" | 50 #include "net/http/http_response_headers.h" |
| 51 #include "net/socket_stream/socket_stream.h" | 51 #include "net/socket_stream/socket_stream.h" |
| 52 #include "net/url_request/url_request.h" | 52 #include "net/url_request/url_request.h" |
| 53 | 53 |
| 54 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
| 55 #include "base/chromeos/chromeos_version.h" | |
| 56 #include "base/command_line.h" | 55 #include "base/command_line.h" |
| 56 #include "base/sys_info.h" |
| 57 #include "chrome/common/chrome_switches.h" | 57 #include "chrome/common/chrome_switches.h" |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 #if defined(ENABLE_CONFIGURATION_POLICY) | 60 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 61 #include "chrome/browser/policy/url_blacklist_manager.h" | 61 #include "chrome/browser/policy/url_blacklist_manager.h" |
| 62 #endif | 62 #endif |
| 63 | 63 |
| 64 using content::BrowserThread; | 64 using content::BrowserThread; |
| 65 using content::RenderViewHost; | 65 using content::RenderViewHost; |
| 66 using content::ResourceRequestInfo; | 66 using content::ResourceRequestInfo; |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 const base::FilePath& path) const { | 842 const base::FilePath& path) const { |
| 843 if (g_allow_file_access_) | 843 if (g_allow_file_access_) |
| 844 return true; | 844 return true; |
| 845 | 845 |
| 846 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 846 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| 847 return true; | 847 return true; |
| 848 #else | 848 #else |
| 849 #if defined(OS_CHROMEOS) | 849 #if defined(OS_CHROMEOS) |
| 850 // If we're running Chrome for ChromeOS on Linux, we want to allow file | 850 // If we're running Chrome for ChromeOS on Linux, we want to allow file |
| 851 // access. | 851 // access. |
| 852 if (!base::chromeos::IsRunningOnChromeOS() || | 852 if (!base::SysInfo::IsRunningOnChromeOS() || |
| 853 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { | 853 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { |
| 854 return true; | 854 return true; |
| 855 } | 855 } |
| 856 | 856 |
| 857 // Use a whitelist to only allow access to files residing in the list of | 857 // Use a whitelist to only allow access to files residing in the list of |
| 858 // directories below. | 858 // directories below. |
| 859 static const char* const kLocalAccessWhiteList[] = { | 859 static const char* const kLocalAccessWhiteList[] = { |
| 860 "/home/chronos/user/Downloads", | 860 "/home/chronos/user/Downloads", |
| 861 "/home/chronos/user/log", | 861 "/home/chronos/user/log", |
| 862 "/media", | 862 "/media", |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 int64 received_content_length, int64 original_content_length, | 946 int64 received_content_length, int64 original_content_length, |
| 947 bool data_reduction_proxy_was_used) { | 947 bool data_reduction_proxy_was_used) { |
| 948 DCHECK_GE(received_content_length, 0); | 948 DCHECK_GE(received_content_length, 0); |
| 949 DCHECK_GE(original_content_length, 0); | 949 DCHECK_GE(original_content_length, 0); |
| 950 StoreAccumulatedContentLength(received_content_length, | 950 StoreAccumulatedContentLength(received_content_length, |
| 951 original_content_length, | 951 original_content_length, |
| 952 data_reduction_proxy_was_used); | 952 data_reduction_proxy_was_used); |
| 953 received_content_length_ += received_content_length; | 953 received_content_length_ += received_content_length; |
| 954 original_content_length_ += original_content_length; | 954 original_content_length_ += original_content_length; |
| 955 } | 955 } |
| OLD | NEW |