From a55fd06aa28c0cbf69e335bee649ee56afe9a263 Mon Sep 17 00:00:00 2001 From: shelley vohr Date: Tue, 13 Feb 2018 10:49:27 -0500 Subject: [PATCH] Revert "Merge pull request #11737 from kwonoj/feat-cache-capacity" (#11906) This reverts commit 181169b74313e280d1cd649f1e2054bfd7029e9c, reversing changes made to baced3152f38501fd735c48315914308a89df552. --- atom/renderer/api/atom_api_web_frame.cc | 10 ---------- atom/renderer/api/atom_api_web_frame.h | 1 - docs/api/web-frame.md | 9 --------- spec/api-web-frame-spec.js | 6 ------ 4 files changed, 26 deletions(-) diff --git a/atom/renderer/api/atom_api_web_frame.cc b/atom/renderer/api/atom_api_web_frame.cc index 7ce3466ae5..2d1ebd288d 100644 --- a/atom/renderer/api/atom_api_web_frame.cc +++ b/atom/renderer/api/atom_api_web_frame.cc @@ -368,15 +368,6 @@ void WebFrame::ClearCache(v8::Isolate* isolate) { base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL); } -void WebFrame::SetCacheCapacity(v8::Isolate* isolate, int capacity) { - if (capacity > 0) { - blink::WebCache::SetCapacity(capacity); - } else { - isolate->ThrowException(v8::Exception::TypeError( - mate::StringToV8(isolate, "Invalid cache capacity"))); - } -} - // static void WebFrame::BuildPrototype( v8::Isolate* isolate, v8::Local prototype) { @@ -417,7 +408,6 @@ void WebFrame::BuildPrototype( &WebFrame::SetIsolatedWorldHumanReadableName) .SetMethod("getResourceUsage", &WebFrame::GetResourceUsage) .SetMethod("clearCache", &WebFrame::ClearCache) - .SetMethod("setCacheCapacity", &WebFrame::SetCacheCapacity) // TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings .SetMethod("setZoomLevelLimits", &WebFrame::SetVisualZoomLevelLimits); } diff --git a/atom/renderer/api/atom_api_web_frame.h b/atom/renderer/api/atom_api_web_frame.h index cbc60d9b0b..7abf870e7a 100644 --- a/atom/renderer/api/atom_api_web_frame.h +++ b/atom/renderer/api/atom_api_web_frame.h @@ -92,7 +92,6 @@ class WebFrame : public mate::Wrappable { // Resource related methods blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate); void ClearCache(v8::Isolate* isolate); - void SetCacheCapacity(v8::Isolate* isolate, int capacity); std::unique_ptr spell_check_client_; diff --git a/docs/api/web-frame.md b/docs/api/web-frame.md index dabbad0431..577b45f35a 100644 --- a/docs/api/web-frame.md +++ b/docs/api/web-frame.md @@ -221,13 +221,4 @@ in your app has occurred that makes you think your page is actually using less memory (i.e. you have navigated from a super heavy page to a mostly empty one, and intend to stay there). -### `webFrame.setCacheCapacity(capacity)` - -* `capacity` Integer - -Attempt to set the capacity of resource cache for the renderer process in bytes - -Note if current cached resource size is larger than newly specified capacity, Electron -will schedule to prune cached resources until it reaches below new capacity. - [spellchecker]: https://github.com/atom/node-spellchecker diff --git a/spec/api-web-frame-spec.js b/spec/api-web-frame-spec.js index 178feb57d4..776b6efceb 100644 --- a/spec/api-web-frame-spec.js +++ b/spec/api-web-frame-spec.js @@ -139,10 +139,4 @@ describe('webFrame module', function () { webFrame.setLayoutZoomLevelLimits(0, 25) }) }) - - it('supports setting cache capacity', function () { - assert.doesNotThrow(function () { - webFrame.setCacheCapacity(1024) - }) - }) })