Skip to content

Commit a55fd06

Browse files
authored
Revert "Merge pull request electron#11737 from kwonoj/feat-cache-capacity" (electron#11906)
This reverts commit 181169b, reversing changes made to baced31.
1 parent eba9abd commit a55fd06

File tree

4 files changed

+0
-26
lines changed

4 files changed

+0
-26
lines changed

atom/renderer/api/atom_api_web_frame.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,6 @@ void WebFrame::ClearCache(v8::Isolate* isolate) {
368368
base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL);
369369
}
370370

371-
void WebFrame::SetCacheCapacity(v8::Isolate* isolate, int capacity) {
372-
if (capacity > 0) {
373-
blink::WebCache::SetCapacity(capacity);
374-
} else {
375-
isolate->ThrowException(v8::Exception::TypeError(
376-
mate::StringToV8(isolate, "Invalid cache capacity")));
377-
}
378-
}
379-
380371
// static
381372
void WebFrame::BuildPrototype(
382373
v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
@@ -417,7 +408,6 @@ void WebFrame::BuildPrototype(
417408
&WebFrame::SetIsolatedWorldHumanReadableName)
418409
.SetMethod("getResourceUsage", &WebFrame::GetResourceUsage)
419410
.SetMethod("clearCache", &WebFrame::ClearCache)
420-
.SetMethod("setCacheCapacity", &WebFrame::SetCacheCapacity)
421411
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
422412
.SetMethod("setZoomLevelLimits", &WebFrame::SetVisualZoomLevelLimits);
423413
}

atom/renderer/api/atom_api_web_frame.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ class WebFrame : public mate::Wrappable<WebFrame> {
9292
// Resource related methods
9393
blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate);
9494
void ClearCache(v8::Isolate* isolate);
95-
void SetCacheCapacity(v8::Isolate* isolate, int capacity);
9695

9796
std::unique_ptr<SpellCheckClient> spell_check_client_;
9897

docs/api/web-frame.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,4 @@ in your app has occurred that makes you think your page is actually using less
221221
memory (i.e. you have navigated from a super heavy page to a mostly empty one,
222222
and intend to stay there).
223223

224-
### `webFrame.setCacheCapacity(capacity)`
225-
226-
* `capacity` Integer
227-
228-
Attempt to set the capacity of resource cache for the renderer process in bytes
229-
230-
Note if current cached resource size is larger than newly specified capacity, Electron
231-
will schedule to prune cached resources until it reaches below new capacity.
232-
233224
[spellchecker]: https://github.com/atom/node-spellchecker

spec/api-web-frame-spec.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,4 @@ describe('webFrame module', function () {
139139
webFrame.setLayoutZoomLevelLimits(0, 25)
140140
})
141141
})
142-
143-
it('supports setting cache capacity', function () {
144-
assert.doesNotThrow(function () {
145-
webFrame.setCacheCapacity(1024)
146-
})
147-
})
148142
})

0 commit comments

Comments
 (0)