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

Side by Side Diff: content/renderer/web_preferences.cc

Issue 375623002: Add a tracing line to ApplyWebPreferences. This is a potentially very expensive operation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/public/renderer/web_preferences.h" 5 #include "content/public/renderer/web_preferences.h"
6 6
7 #include "base/debug/trace_event.h"
7 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
8 #include "content/renderer/net_info_helper.h" 9 #include "content/renderer/net_info_helper.h"
9 #include "third_party/WebKit/public/platform/WebConnectionType.h" 10 #include "third_party/WebKit/public/platform/WebConnectionType.h"
10 #include "third_party/WebKit/public/platform/WebString.h" 11 #include "third_party/WebKit/public/platform/WebString.h"
11 #include "third_party/WebKit/public/platform/WebURL.h" 12 #include "third_party/WebKit/public/platform/WebURL.h"
12 #include "third_party/WebKit/public/web/WebKit.h" 13 #include "third_party/WebKit/public/web/WebKit.h"
13 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" 14 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h"
14 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 15 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
15 #include "third_party/WebKit/public/web/WebSettings.h" 16 #include "third_party/WebKit/public/web/WebSettings.h"
16 #include "third_party/WebKit/public/web/WebView.h" 17 #include "third_party/WebKit/public/web/WebView.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (script >= 0 && script < USCRIPT_CODE_LIMIT) { 108 if (script >= 0 && script < USCRIPT_CODE_LIMIT) {
108 UScriptCode code = static_cast<UScriptCode>(script); 109 UScriptCode code = static_cast<UScriptCode>(script);
109 (*setter)(settings, it->second, GetScriptForWebSettings(code)); 110 (*setter)(settings, it->second, GetScriptForWebSettings(code));
110 } 111 }
111 } 112 }
112 } 113 }
113 114
114 } // namespace 115 } // namespace
115 116
116 void ApplyWebPreferences(const WebPreferences& prefs, WebView* web_view) { 117 void ApplyWebPreferences(const WebPreferences& prefs, WebView* web_view) {
118 TRACE_EVENT0("renderer", "ApplyWebPreferences");
117 WebSettings* settings = web_view->settings(); 119 WebSettings* settings = web_view->settings();
118 ApplyFontsFromMap(prefs.standard_font_family_map, 120 ApplyFontsFromMap(prefs.standard_font_family_map,
119 setStandardFontFamilyWrapper, settings); 121 setStandardFontFamilyWrapper, settings);
120 ApplyFontsFromMap(prefs.fixed_font_family_map, 122 ApplyFontsFromMap(prefs.fixed_font_family_map,
121 setFixedFontFamilyWrapper, settings); 123 setFixedFontFamilyWrapper, settings);
122 ApplyFontsFromMap(prefs.serif_font_family_map, 124 ApplyFontsFromMap(prefs.serif_font_family_map,
123 setSerifFontFamilyWrapper, settings); 125 setSerifFontFamilyWrapper, settings);
124 ApplyFontsFromMap(prefs.sans_serif_font_family_map, 126 ApplyFontsFromMap(prefs.sans_serif_font_family_map,
125 setSansSerifFontFamilyWrapper, settings); 127 setSansSerifFontFamilyWrapper, settings);
126 ApplyFontsFromMap(prefs.cursive_font_family_map, 128 ApplyFontsFromMap(prefs.cursive_font_family_map,
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 settings->setPinchVirtualViewportEnabled( 333 settings->setPinchVirtualViewportEnabled(
332 prefs.pinch_virtual_viewport_enabled); 334 prefs.pinch_virtual_viewport_enabled);
333 335
334 settings->setPinchOverlayScrollbarThickness( 336 settings->setPinchOverlayScrollbarThickness(
335 prefs.pinch_overlay_scrollbar_thickness); 337 prefs.pinch_overlay_scrollbar_thickness);
336 settings->setUseSolidColorScrollbars(prefs.use_solid_color_scrollbars); 338 settings->setUseSolidColorScrollbars(prefs.use_solid_color_scrollbars);
337 settings->setCompositorTouchHitTesting(prefs.compositor_touch_hit_testing); 339 settings->setCompositorTouchHitTesting(prefs.compositor_touch_hit_testing);
338 } 340 }
339 341
340 } // namespace content 342 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698