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

Unified Diff: content/browser/frame_host/render_frame_message_filter.cc

Issue 2211713002: Remove dependency of c/b/loader on c/b/host_zoom_map_impl.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/render_frame_message_filter.h ('k') | content/browser/host_zoom_map_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_message_filter.cc
diff --git a/content/browser/frame_host/render_frame_message_filter.cc b/content/browser/frame_host/render_frame_message_filter.cc
index 9776983665a13957b204f53c19fa4a090e58cacc..5db2491ae81b24e443cf333d83b4d0adb99dcfb9 100644
--- a/content/browser/frame_host/render_frame_message_filter.cc
+++ b/content/browser/frame_host/render_frame_message_filter.cc
@@ -15,6 +15,7 @@
#include "content/browser/download/download_stats.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
+#include "content/browser/host_zoom_map_impl.h"
#include "content/browser/renderer_host/render_widget_helper.h"
#include "content/browser/resource_context_impl.h"
#include "content/common/content_constants_internal.h"
@@ -25,6 +26,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_url_parameters.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "gpu/GLES2/gl2extchromium.h"
@@ -221,7 +223,13 @@ RenderFrameMessageFilter::RenderFrameMessageFilter(
resource_context_(browser_context->GetResourceContext()),
render_widget_helper_(render_widget_helper),
incognito_(browser_context->IsOffTheRecord()),
- render_process_id_(render_process_id) {
+ render_process_id_(render_process_id),
+ host_zoom_map_impl_(render_process_id
+ ? static_cast<const HostZoomMapImpl*>(
+ RenderProcessHost::FromID(render_process_id)
+ ->GetStoragePartition()
+ ->GetHostZoomMap())
+ : nullptr) {
}
RenderFrameMessageFilter::~RenderFrameMessageFilter() {
@@ -448,6 +456,19 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
render_frame_id, url, first_party_for_cookies, callback));
}
+void RenderFrameMessageFilter::GetHostZoomLevel(
+ int32_t render_frame_id,
+ const GURL& url,
+ const GetHostZoomLevelCallback& callback) {
+ // We need to make sure this is serviced directly on the IO thread so that it
+ // does not get out of order with the resource request in AsyncResourceHandler
+ // which lives on the IO thread.
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ double zoom_level = host_zoom_map_impl_->GetZoomLevelForView(
+ url, render_process_id_, render_frame_id);
+ callback.Run(zoom_level);
+}
+
#if defined(ENABLE_PLUGINS)
void RenderFrameMessageFilter::OnGetPlugins(
« no previous file with comments | « content/browser/frame_host/render_frame_message_filter.h ('k') | content/browser/host_zoom_map_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698