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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 2033993002: Don't call WebCacheManager::Remove(RPH_id) to clear webview's cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/common/cleardata_twice/guest.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/guest_view/web_view/web_view_guest.h" 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 return false; 743 return false;
744 744
745 if (removal_mask & webview::WEB_VIEW_REMOVE_DATA_MASK_CACHE) { 745 if (removal_mask & webview::WEB_VIEW_REMOVE_DATA_MASK_CACHE) {
746 // First clear http cache data and then clear the rest in 746 // First clear http cache data and then clear the rest in
747 // |ClearDataInternal|. 747 // |ClearDataInternal|.
748 int render_process_id = web_contents()->GetRenderProcessHost()->GetID(); 748 int render_process_id = web_contents()->GetRenderProcessHost()->GetID();
749 // We need to clear renderer cache separately for our process because 749 // We need to clear renderer cache separately for our process because
750 // StoragePartitionHttpCacheDataRemover::ClearData() does not clear that. 750 // StoragePartitionHttpCacheDataRemover::ClearData() does not clear that.
751 web_cache::WebCacheManager::GetInstance()->ClearCacheForProcess( 751 web_cache::WebCacheManager::GetInstance()->ClearCacheForProcess(
752 render_process_id); 752 render_process_id);
753 web_cache::WebCacheManager::GetInstance()->Remove(render_process_id);
754 753
755 base::Closure cache_removal_done_callback = base::Bind( 754 base::Closure cache_removal_done_callback = base::Bind(
756 &WebViewGuest::ClearDataInternal, weak_ptr_factory_.GetWeakPtr(), 755 &WebViewGuest::ClearDataInternal, weak_ptr_factory_.GetWeakPtr(),
757 remove_since, removal_mask, callback); 756 remove_since, removal_mask, callback);
758 // StoragePartitionHttpCacheDataRemover removes itself when it is done. 757 // StoragePartitionHttpCacheDataRemover removes itself when it is done.
759 // components/, move |ClearCache| to WebViewGuest: http//crbug.com/471287. 758 // components/, move |ClearCache| to WebViewGuest: http//crbug.com/471287.
760 browsing_data::StoragePartitionHttpCacheDataRemover::CreateForRange( 759 browsing_data::StoragePartitionHttpCacheDataRemover::CreateForRange(
761 partition, remove_since, base::Time::Now()) 760 partition, remove_since, base::Time::Now())
762 ->Remove(cache_removal_done_callback); 761 ->Remove(cache_removal_done_callback);
763 762
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 1497 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue());
1499 DispatchEventToView(base::WrapUnique( 1498 DispatchEventToView(base::WrapUnique(
1500 new GuestViewEvent(webview::kEventExitFullscreen, std::move(args)))); 1499 new GuestViewEvent(webview::kEventExitFullscreen, std::move(args))));
1501 } 1500 }
1502 // Since we changed fullscreen state, sending a Resize message ensures that 1501 // Since we changed fullscreen state, sending a Resize message ensures that
1503 // renderer/ sees the change. 1502 // renderer/ sees the change.
1504 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); 1503 web_contents()->GetRenderViewHost()->GetWidget()->WasResized();
1505 } 1504 }
1506 1505
1507 } // namespace extensions 1506 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/common/cleardata_twice/guest.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698