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

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: fix compile error on mac/android: std::set initializer list makes them unhappy Created 5 years, 9 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 std::set<int> renderers;
329 renderers.insert(render_process_id);
330 ClearRendererCache(renderers, INSTANTLY);
331 }
332
327 void WebCacheManager::ClearRendererCache( 333 void WebCacheManager::ClearRendererCache(
328 const std::set<int>& renderers, 334 const std::set<int>& renderers,
329 WebCacheManager::ClearCacheOccasion occasion) { 335 WebCacheManager::ClearCacheOccasion occasion) {
330 std::set<int>::const_iterator iter = renderers.begin(); 336 std::set<int>::const_iterator iter = renderers.begin();
331 for (; iter != renderers.end(); ++iter) { 337 for (; iter != renderers.end(); ++iter) {
332 content::RenderProcessHost* host = 338 content::RenderProcessHost* host =
333 content::RenderProcessHost::FromID(*iter); 339 content::RenderProcessHost::FromID(*iter);
334 if (host) 340 if (host)
335 host->Send(new WebCacheMsg_ClearCache(occasion == ON_NAVIGATION)); 341 host->Send(new WebCacheMsg_ClearCache(occasion == ON_NAVIGATION));
336 } 342 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 inactive_renderers_.insert(*iter); 433 inactive_renderers_.insert(*iter);
428 active_renderers_.erase(*iter); 434 active_renderers_.erase(*iter);
429 iter = active_renderers_.begin(); 435 iter = active_renderers_.begin();
430 continue; 436 continue;
431 } 437 }
432 ++iter; 438 ++iter;
433 } 439 }
434 } 440 }
435 441
436 } // namespace web_cache 442 } // namespace web_cache
OLDNEW
« no previous file with comments | « components/web_cache/browser/web_cache_manager.h ('k') | extensions/browser/api/guest_view/web_view/web_view_internal_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698