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

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

Issue 2757923002: Move StoragePartitionHttpCacheDataRemover to content/ (Closed)
Patch Set: git cl format Created 3 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 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
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "components/browsing_data/content/storage_partition_http_cache_data_rem over.h"
17 #include "components/guest_view/browser/guest_view_event.h" 16 #include "components/guest_view/browser/guest_view_event.h"
18 #include "components/guest_view/browser/guest_view_manager.h" 17 #include "components/guest_view/browser/guest_view_manager.h"
19 #include "components/guest_view/common/guest_view_constants.h" 18 #include "components/guest_view/common/guest_view_constants.h"
20 #include "components/web_cache/browser/web_cache_manager.h" 19 #include "components/web_cache/browser/web_cache_manager.h"
21 #include "content/public/browser/browser_context.h" 20 #include "content/public/browser/browser_context.h"
22 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
23 #include "content/public/browser/child_process_security_policy.h" 22 #include "content/public/browser/child_process_security_policy.h"
24 #include "content/public/browser/native_web_keyboard_event.h" 23 #include "content/public/browser/native_web_keyboard_event.h"
25 #include "content/public/browser/navigation_entry.h" 24 #include "content/public/browser/navigation_entry.h"
26 #include "content/public/browser/navigation_handle.h" 25 #include "content/public/browser/navigation_handle.h"
27 #include "content/public/browser/notification_details.h" 26 #include "content/public/browser/notification_details.h"
28 #include "content/public/browser/notification_service.h" 27 #include "content/public/browser/notification_service.h"
29 #include "content/public/browser/notification_source.h" 28 #include "content/public/browser/notification_source.h"
30 #include "content/public/browser/notification_types.h" 29 #include "content/public/browser/notification_types.h"
31 #include "content/public/browser/render_process_host.h" 30 #include "content/public/browser/render_process_host.h"
32 #include "content/public/browser/render_view_host.h" 31 #include "content/public/browser/render_view_host.h"
33 #include "content/public/browser/render_widget_host.h" 32 #include "content/public/browser/render_widget_host.h"
34 #include "content/public/browser/render_widget_host_view.h" 33 #include "content/public/browser/render_widget_host_view.h"
35 #include "content/public/browser/resource_request_details.h" 34 #include "content/public/browser/resource_request_details.h"
36 #include "content/public/browser/site_instance.h" 35 #include "content/public/browser/site_instance.h"
37 #include "content/public/browser/storage_partition.h" 36 #include "content/public/browser/storage_partition.h"
37 #include "content/public/browser/storage_partition_http_cache_data_remover.h"
38 #include "content/public/browser/user_metrics.h" 38 #include "content/public/browser/user_metrics.h"
39 #include "content/public/browser/web_contents.h" 39 #include "content/public/browser/web_contents.h"
40 #include "content/public/browser/web_contents_delegate.h" 40 #include "content/public/browser/web_contents_delegate.h"
41 #include "content/public/common/browser_side_navigation_policy.h" 41 #include "content/public/common/browser_side_navigation_policy.h"
42 #include "content/public/common/media_stream_request.h" 42 #include "content/public/common/media_stream_request.h"
43 #include "content/public/common/page_zoom.h" 43 #include "content/public/common/page_zoom.h"
44 #include "content/public/common/result_codes.h" 44 #include "content/public/common/result_codes.h"
45 #include "content/public/common/stop_find_action.h" 45 #include "content/public/common/stop_find_action.h"
46 #include "content/public/common/url_constants.h" 46 #include "content/public/common/url_constants.h"
47 #include "extensions/browser/api/declarative/rules_registry_service.h" 47 #include "extensions/browser/api/declarative/rules_registry_service.h"
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 // We need to clear renderer cache separately for our process because 799 // We need to clear renderer cache separately for our process because
800 // StoragePartitionHttpCacheDataRemover::ClearData() does not clear that. 800 // StoragePartitionHttpCacheDataRemover::ClearData() does not clear that.
801 web_cache::WebCacheManager::GetInstance()->ClearCacheForProcess( 801 web_cache::WebCacheManager::GetInstance()->ClearCacheForProcess(
802 render_process_id); 802 render_process_id);
803 803
804 base::Closure cache_removal_done_callback = base::Bind( 804 base::Closure cache_removal_done_callback = base::Bind(
805 &WebViewGuest::ClearDataInternal, weak_ptr_factory_.GetWeakPtr(), 805 &WebViewGuest::ClearDataInternal, weak_ptr_factory_.GetWeakPtr(),
806 remove_since, removal_mask, callback); 806 remove_since, removal_mask, callback);
807 // StoragePartitionHttpCacheDataRemover removes itself when it is done. 807 // StoragePartitionHttpCacheDataRemover removes itself when it is done.
808 // components/, move |ClearCache| to WebViewGuest: http//crbug.com/471287. 808 // components/, move |ClearCache| to WebViewGuest: http//crbug.com/471287.
809 browsing_data::StoragePartitionHttpCacheDataRemover::CreateForRange( 809 content::StoragePartitionHttpCacheDataRemover::CreateForRange(
810 partition, remove_since, base::Time::Now()) 810 partition, remove_since, base::Time::Now())
811 ->Remove(cache_removal_done_callback); 811 ->Remove(cache_removal_done_callback);
812 812
813 return true; 813 return true;
814 } 814 }
815 815
816 ClearDataInternal(remove_since, removal_mask, callback); 816 ClearDataInternal(remove_since, removal_mask, callback);
817 return true; 817 return true;
818 } 818 }
819 819
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 1558 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue());
1559 DispatchEventToView(base::MakeUnique<GuestViewEvent>( 1559 DispatchEventToView(base::MakeUnique<GuestViewEvent>(
1560 webview::kEventExitFullscreen, std::move(args))); 1560 webview::kEventExitFullscreen, std::move(args)));
1561 } 1561 }
1562 // Since we changed fullscreen state, sending a Resize message ensures that 1562 // Since we changed fullscreen state, sending a Resize message ensures that
1563 // renderer/ sees the change. 1563 // renderer/ sees the change.
1564 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); 1564 web_contents()->GetRenderViewHost()->GetWidget()->WasResized();
1565 } 1565 }
1566 1566
1567 } // namespace extensions 1567 } // namespace extensions
OLDNEW
« content/public/browser/storage_partition_http_cache_data_remover.h ('K') | « content/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698