Index: components/web_cache/browser/web_cache_manager.cc |
diff --git a/chrome/browser/renderer_host/web_cache_manager.cc b/components/web_cache/browser/web_cache_manager.cc |
similarity index 95% |
rename from chrome/browser/renderer_host/web_cache_manager.cc |
rename to components/web_cache/browser/web_cache_manager.cc |
index a61a2c3eaaafc35043c5d938b1e5057d895b1fe5..c0a55f33ffbfc94ab51f9ac4c59627c43960563b 100644 |
--- a/chrome/browser/renderer_host/web_cache_manager.cc |
+++ b/components/web_cache/browser/web_cache_manager.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/renderer_host/web_cache_manager.h" |
+#include "components/web_cache/browser/web_cache_manager.h" |
#include <algorithm> |
@@ -15,18 +15,18 @@ |
#include "base/prefs/pref_service.h" |
#include "base/sys_info.h" |
#include "base/time/time.h" |
-#include "chrome/browser/browser_process.h" |
-#include "chrome/browser/chrome_notification_types.h" |
-#include "chrome/common/chrome_constants.h" |
-#include "chrome/common/pref_names.h" |
-#include "chrome/common/render_messages.h" |
+#include "components/web_cache/common/pref_names.h" |
+#include "components/web_cache/common/web_cache_messages.h" |
#include "content/public/browser/notification_service.h" |
+#include "content/public/browser/notification_types.h" |
#include "content/public/browser/render_process_host.h" |
using base::Time; |
using base::TimeDelta; |
using blink::WebCache; |
+namespace web_cache { |
+ |
static const int kReviseAllocationDelayMS = 200; |
// The default size limit of the in-memory cache is 8 MB |
@@ -183,10 +183,6 @@ void WebCacheManager::Observe(int type, |
// static |
size_t WebCacheManager::GetDefaultGlobalSizeLimit() { |
- PrefService* perf_service = g_browser_process->local_state(); |
- if (perf_service) |
- return perf_service->GetInteger(prefs::kMemoryCacheSize); |
- |
return GetDefaultCacheSize(); |
} |
@@ -326,9 +322,9 @@ void WebCacheManager::EnactStrategy(const AllocationStrategy& strategy) { |
max_dead_capacity = std::min(static_cast<size_t>(512 * 1024), |
max_dead_capacity); |
} |
- host->Send(new ChromeViewMsg_SetCacheCapacities(min_dead_capacity, |
- max_dead_capacity, |
- capacity)); |
+ host->Send(new WebCacheMsg_SetCacheCapacities(min_dead_capacity, |
+ max_dead_capacity, |
+ capacity)); |
} |
++allocation; |
} |
@@ -342,7 +338,7 @@ void WebCacheManager::ClearRendererCache( |
content::RenderProcessHost* host = |
content::RenderProcessHost::FromID(*iter); |
if (host) |
- host->Send(new ChromeViewMsg_ClearCache(occasion == ON_NAVIGATION)); |
+ host->Send(new WebCacheMsg_ClearCache(occasion == ON_NAVIGATION)); |
} |
} |
@@ -442,3 +438,5 @@ void WebCacheManager::FindInactiveRenderers() { |
++iter; |
} |
} |
+ |
+} // namespace web_cache |