Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: components/web_cache/browser/web_cache_manager.cc

Issue 1021073002: <webview> Implement clear http cache API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync after http://crrev.com/1033013003 Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/web_cache/browser/web_cache_manager.h" 5 #include "components/web_cache/browser/web_cache_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 max_dead_capacity); 317 max_dead_capacity);
318 } 318 }
319 host->Send(new WebCacheMsg_SetCacheCapacities(min_dead_capacity, 319 host->Send(new WebCacheMsg_SetCacheCapacities(min_dead_capacity,
320 max_dead_capacity, 320 max_dead_capacity,
321 capacity)); 321 capacity));
322 } 322 }
323 ++allocation; 323 ++allocation;
324 } 324 }
325 } 325 }
326 326
327 void WebCacheManager::ClearCacheForProcess(int render_process_id) {
328 ClearRendererCache(std::set<int>({render_process_id}), INSTANTLY);
329 }
330
327 void WebCacheManager::ClearRendererCache( 331 void WebCacheManager::ClearRendererCache(
328 const std::set<int>& renderers, 332 const std::set<int>& renderers,
329 WebCacheManager::ClearCacheOccasion occasion) { 333 WebCacheManager::ClearCacheOccasion occasion) {
330 std::set<int>::const_iterator iter = renderers.begin(); 334 std::set<int>::const_iterator iter = renderers.begin();
331 for (; iter != renderers.end(); ++iter) { 335 for (; iter != renderers.end(); ++iter) {
332 content::RenderProcessHost* host = 336 content::RenderProcessHost* host =
333 content::RenderProcessHost::FromID(*iter); 337 content::RenderProcessHost::FromID(*iter);
334 if (host) 338 if (host)
335 host->Send(new WebCacheMsg_ClearCache(occasion == ON_NAVIGATION)); 339 host->Send(new WebCacheMsg_ClearCache(occasion == ON_NAVIGATION));
336 } 340 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 inactive_renderers_.insert(*iter); 431 inactive_renderers_.insert(*iter);
428 active_renderers_.erase(*iter); 432 active_renderers_.erase(*iter);
429 iter = active_renderers_.begin(); 433 iter = active_renderers_.begin();
430 continue; 434 continue;
431 } 435 }
432 ++iter; 436 ++iter;
433 } 437 }
434 } 438 }
435 439
436 } // namespace web_cache 440 } // namespace web_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698