| 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/extensions/api/web_request/web_request_api_helpers.h" | 5 #include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 16 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| 17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 18 #include "chrome/browser/renderer_host/web_cache_manager.h" | 18 #include "components/web_cache/browser/web_cache_manager.h" |
| 19 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 20 #include "content/public/browser/render_process_host.h" | 20 #include "content/public/browser/render_process_host.h" |
| 21 #include "extensions/browser/extension_system.h" | 21 #include "extensions/browser/extension_system.h" |
| 22 #include "extensions/browser/runtime_data.h" | 22 #include "extensions/browser/runtime_data.h" |
| 23 #include "extensions/browser/warning_set.h" | 23 #include "extensions/browser/warning_set.h" |
| 24 #include "net/base/net_log.h" | 24 #include "net/base/net_log.h" |
| 25 #include "net/cookies/cookie_util.h" | 25 #include "net/cookies/cookie_util.h" |
| 26 #include "net/cookies/parsed_cookie.h" | 26 #include "net/cookies/parsed_cookie.h" |
| 27 #include "net/http/http_util.h" | 27 #include "net/http/http_util.h" |
| 28 #include "net/url_request/url_request.h" | 28 #include "net/url_request/url_request.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // of gcc with this bug fixed, or the array is changed so this duplicate | 69 // of gcc with this bug fixed, or the array is changed so this duplicate |
| 70 // entry is no longer required, this should be removed. | 70 // entry is no longer required, this should be removed. |
| 71 content::RESOURCE_TYPE_LAST_TYPE, | 71 content::RESOURCE_TYPE_LAST_TYPE, |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 COMPILE_ASSERT( | 74 COMPILE_ASSERT( |
| 75 arraysize(kResourceTypeStrings) == arraysize(kResourceTypeValues), | 75 arraysize(kResourceTypeStrings) == arraysize(kResourceTypeValues), |
| 76 keep_resource_types_in_sync); | 76 keep_resource_types_in_sync); |
| 77 | 77 |
| 78 void ClearCacheOnNavigationOnUI() { | 78 void ClearCacheOnNavigationOnUI() { |
| 79 WebCacheManager::GetInstance()->ClearCacheOnNavigation(); | 79 web_cache::WebCacheManager::GetInstance()->ClearCacheOnNavigation(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool ParseCookieLifetime(net::ParsedCookie* cookie, | 82 bool ParseCookieLifetime(net::ParsedCookie* cookie, |
| 83 int64* seconds_till_expiry) { | 83 int64* seconds_till_expiry) { |
| 84 // 'Max-Age' is processed first because according to: | 84 // 'Max-Age' is processed first because according to: |
| 85 // http://tools.ietf.org/html/rfc6265#section-5.3 'Max-Age' attribute | 85 // http://tools.ietf.org/html/rfc6265#section-5.3 'Max-Age' attribute |
| 86 // overrides 'Expires' attribute. | 86 // overrides 'Expires' attribute. |
| 87 if (cookie->HasMaxAge() && | 87 if (cookie->HasMaxAge() && |
| 88 base::StringToInt64(cookie->MaxAge(), seconds_till_expiry)) { | 88 base::StringToInt64(cookie->MaxAge(), seconds_till_expiry)) { |
| 89 return true; | 89 return true; |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 for (content::RenderProcessHost::iterator it = | 1235 for (content::RenderProcessHost::iterator it = |
| 1236 content::RenderProcessHost::AllHostsIterator(); | 1236 content::RenderProcessHost::AllHostsIterator(); |
| 1237 !it.IsAtEnd(); it.Advance()) { | 1237 !it.IsAtEnd(); it.Advance()) { |
| 1238 content::RenderProcessHost* host = it.GetCurrentValue(); | 1238 content::RenderProcessHost* host = it.GetCurrentValue(); |
| 1239 if (host->GetBrowserContext() == browser_context) | 1239 if (host->GetBrowserContext() == browser_context) |
| 1240 SendExtensionWebRequestStatusToHost(host); | 1240 SendExtensionWebRequestStatusToHost(host); |
| 1241 } | 1241 } |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 } // namespace extension_web_request_api_helpers | 1244 } // namespace extension_web_request_api_helpers |
| OLD | NEW |