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 "content/browser/storage_partition_impl.h" | 5 #include "content/browser/storage_partition_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "content/public/browser/dom_storage_context.h" | 25 #include "content/public/browser/dom_storage_context.h" |
26 #include "content/public/browser/indexed_db_context.h" | 26 #include "content/public/browser/indexed_db_context.h" |
27 #include "content/public/browser/local_storage_usage_info.h" | 27 #include "content/public/browser/local_storage_usage_info.h" |
28 #include "content/public/browser/session_storage_usage_info.h" | 28 #include "content/public/browser/session_storage_usage_info.h" |
29 #include "net/base/completion_callback.h" | 29 #include "net/base/completion_callback.h" |
30 #include "net/base/net_errors.h" | 30 #include "net/base/net_errors.h" |
31 #include "net/cookies/canonical_cookie.h" | 31 #include "net/cookies/canonical_cookie.h" |
32 #include "net/cookies/cookie_monster.h" | 32 #include "net/cookies/cookie_monster.h" |
33 #include "net/url_request/url_request_context.h" | 33 #include "net/url_request/url_request_context.h" |
34 #include "net/url_request/url_request_context_getter.h" | 34 #include "net/url_request/url_request_context_getter.h" |
| 35 #include "ppapi/features/features.h" |
35 #include "storage/browser/database/database_tracker.h" | 36 #include "storage/browser/database/database_tracker.h" |
36 #include "storage/browser/quota/quota_manager.h" | 37 #include "storage/browser/quota/quota_manager.h" |
37 | 38 |
38 #if defined(ENABLE_PLUGINS) | 39 #if BUILDFLAG(ENABLE_PLUGINS) |
39 #include "content/browser/plugin_private_storage_helper.h" | 40 #include "content/browser/plugin_private_storage_helper.h" |
40 #endif // defined(ENABLE_PLUGINS) | 41 #endif // BUILDFLAG(ENABLE_PLUGINS) |
41 | 42 |
42 namespace content { | 43 namespace content { |
43 | 44 |
44 namespace { | 45 namespace { |
45 | 46 |
46 bool DoesCookieMatchHost(const std::string& host, | 47 bool DoesCookieMatchHost(const std::string& host, |
47 const net::CanonicalCookie& cookie) { | 48 const net::CanonicalCookie& cookie) { |
48 return cookie.IsHostCookie() && cookie.IsDomainMatch(host); | 49 return cookie.IsHostCookie() && cookie.IsDomainMatch(host); |
49 } | 50 } |
50 | 51 |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 } | 841 } |
841 | 842 |
842 if (remove_mask & REMOVE_DATA_MASK_SHADER_CACHE) { | 843 if (remove_mask & REMOVE_DATA_MASK_SHADER_CACHE) { |
843 IncrementTaskCountOnUI(); | 844 IncrementTaskCountOnUI(); |
844 BrowserThread::PostTask( | 845 BrowserThread::PostTask( |
845 BrowserThread::IO, FROM_HERE, | 846 BrowserThread::IO, FROM_HERE, |
846 base::Bind(&ClearShaderCacheOnIOThread, | 847 base::Bind(&ClearShaderCacheOnIOThread, |
847 path, begin, end, decrement_callback)); | 848 path, begin, end, decrement_callback)); |
848 } | 849 } |
849 | 850 |
850 #if defined(ENABLE_PLUGINS) | 851 #if BUILDFLAG(ENABLE_PLUGINS) |
851 if (remove_mask & REMOVE_DATA_MASK_PLUGIN_PRIVATE_DATA) { | 852 if (remove_mask & REMOVE_DATA_MASK_PLUGIN_PRIVATE_DATA) { |
852 IncrementTaskCountOnUI(); | 853 IncrementTaskCountOnUI(); |
853 filesystem_context->default_file_task_runner()->PostTask( | 854 filesystem_context->default_file_task_runner()->PostTask( |
854 FROM_HERE, base::Bind(&ClearPluginPrivateDataOnFileTaskRunner, | 855 FROM_HERE, base::Bind(&ClearPluginPrivateDataOnFileTaskRunner, |
855 make_scoped_refptr(filesystem_context), | 856 make_scoped_refptr(filesystem_context), |
856 storage_origin, begin, end, decrement_callback)); | 857 storage_origin, begin, end, decrement_callback)); |
857 } | 858 } |
858 #endif // defined(ENABLE_PLUGINS) | 859 #endif // BUILDFLAG(ENABLE_PLUGINS) |
859 | 860 |
860 DecrementTaskCountOnUI(); | 861 DecrementTaskCountOnUI(); |
861 } | 862 } |
862 | 863 |
863 void StoragePartitionImpl::ClearDataForOrigin( | 864 void StoragePartitionImpl::ClearDataForOrigin( |
864 uint32_t remove_mask, | 865 uint32_t remove_mask, |
865 uint32_t quota_storage_remove_mask, | 866 uint32_t quota_storage_remove_mask, |
866 const GURL& storage_origin, | 867 const GURL& storage_origin, |
867 net::URLRequestContextGetter* request_context_getter, | 868 net::URLRequestContextGetter* request_context_getter, |
868 const base::Closure& callback) { | 869 const base::Closure& callback) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 net::URLRequestContextGetter* url_request_context) { | 928 net::URLRequestContextGetter* url_request_context) { |
928 url_request_context_ = url_request_context; | 929 url_request_context_ = url_request_context; |
929 } | 930 } |
930 | 931 |
931 void StoragePartitionImpl::SetMediaURLRequestContext( | 932 void StoragePartitionImpl::SetMediaURLRequestContext( |
932 net::URLRequestContextGetter* media_url_request_context) { | 933 net::URLRequestContextGetter* media_url_request_context) { |
933 media_url_request_context_ = media_url_request_context; | 934 media_url_request_context_ = media_url_request_context; |
934 } | 935 } |
935 | 936 |
936 } // namespace content | 937 } // namespace content |
OLD | NEW |