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

Side by Side Diff: Source/core/testing/InternalSettings.cpp

Issue 106353005: Expose performance.memory in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Perf-Memory-SharedWorker
Patch Set: Created 6 years, 8 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 , m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled()) 71 , m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled())
72 , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttri buteAwareFormControlUIEnabled()) 72 , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttri buteAwareFormControlUIEnabled())
73 , m_imagesEnabled(settings->imagesEnabled()) 73 , m_imagesEnabled(settings->imagesEnabled())
74 , m_shouldDisplaySubtitles(settings->shouldDisplaySubtitles()) 74 , m_shouldDisplaySubtitles(settings->shouldDisplaySubtitles())
75 , m_shouldDisplayCaptions(settings->shouldDisplayCaptions()) 75 , m_shouldDisplayCaptions(settings->shouldDisplayCaptions())
76 , m_shouldDisplayTextDescriptions(settings->shouldDisplayTextDescriptions()) 76 , m_shouldDisplayTextDescriptions(settings->shouldDisplayTextDescriptions())
77 , m_defaultVideoPosterURL(settings->defaultVideoPosterURL()) 77 , m_defaultVideoPosterURL(settings->defaultVideoPosterURL())
78 , m_originalCompositorDrivenAcceleratedScrollEnabled(settings->compositorDri venAcceleratedScrollingEnabled()) 78 , m_originalCompositorDrivenAcceleratedScrollEnabled(settings->compositorDri venAcceleratedScrollingEnabled())
79 , m_originalLayerSquashingEnabled(settings->layerSquashingEnabled()) 79 , m_originalLayerSquashingEnabled(settings->layerSquashingEnabled())
80 , m_originalPasswordGenerationDecorationEnabled(settings->passwordGeneration DecorationEnabled()) 80 , m_originalPasswordGenerationDecorationEnabled(settings->passwordGeneration DecorationEnabled())
81 , m_originalPreciseMemoryInfoEnabled(settings->preciseMemoryInfoEnabled())
81 { 82 {
82 } 83 }
83 84
84 void InternalSettings::Backup::restoreTo(Settings* settings) 85 void InternalSettings::Backup::restoreTo(Settings* settings)
85 { 86 {
86 RuntimeEnabledFeatures::setCSSExclusionsEnabled(m_originalCSSExclusionsEnabl ed); 87 RuntimeEnabledFeatures::setCSSExclusionsEnabled(m_originalCSSExclusionsEnabl ed);
87 RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAut horShadowDOMForAnyElementEnabled); 88 RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAut horShadowDOMForAnyElementEnabled);
88 RuntimeEnabledFeatures::setStyleScopedEnabled(m_originalStyleScoped); 89 RuntimeEnabledFeatures::setStyleScopedEnabled(m_originalStyleScoped);
89 RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled( m_originalCSP); 90 RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled( m_originalCSP);
90 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_originalOverlayScrollb arsEnabled); 91 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_originalOverlayScrollb arsEnabled);
91 settings->setEditingBehaviorType(m_originalEditingBehavior); 92 settings->setEditingBehaviorType(m_originalEditingBehavior);
92 settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled); 93 settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
93 settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindow SizeOverride); 94 settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindow SizeOverride);
94 settings->setAccessibilityFontScaleFactor(m_originalAccessibilityFontScaleFa ctor); 95 settings->setAccessibilityFontScaleFactor(m_originalAccessibilityFontScaleFa ctor);
95 settings->setMediaTypeOverride(m_originalMediaTypeOverride); 96 settings->setMediaTypeOverride(m_originalMediaTypeOverride);
96 settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled); 97 settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled);
97 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttr ibuteAwareFormControlUIEnabled); 98 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttr ibuteAwareFormControlUIEnabled);
98 settings->setImagesEnabled(m_imagesEnabled); 99 settings->setImagesEnabled(m_imagesEnabled);
99 settings->setShouldDisplaySubtitles(m_shouldDisplaySubtitles); 100 settings->setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
100 settings->setShouldDisplayCaptions(m_shouldDisplayCaptions); 101 settings->setShouldDisplayCaptions(m_shouldDisplayCaptions);
101 settings->setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions); 102 settings->setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions);
102 settings->setDefaultVideoPosterURL(m_defaultVideoPosterURL); 103 settings->setDefaultVideoPosterURL(m_defaultVideoPosterURL);
103 settings->setCompositorDrivenAcceleratedScrollingEnabled(m_originalComposito rDrivenAcceleratedScrollEnabled); 104 settings->setCompositorDrivenAcceleratedScrollingEnabled(m_originalComposito rDrivenAcceleratedScrollEnabled);
104 settings->setLayerSquashingEnabled(m_originalLayerSquashingEnabled); 105 settings->setLayerSquashingEnabled(m_originalLayerSquashingEnabled);
105 settings->setPasswordGenerationDecorationEnabled(m_originalPasswordGeneratio nDecorationEnabled); 106 settings->setPasswordGenerationDecorationEnabled(m_originalPasswordGeneratio nDecorationEnabled);
107 settings->setPreciseMemoryInfoEnabled(m_originalPreciseMemoryInfoEnabled);
106 settings->genericFontFamilySettings().reset(); 108 settings->genericFontFamilySettings().reset();
107 } 109 }
108 110
109 // We can't use RefCountedSupplement because that would try to make InternalSett ings RefCounted 111 // We can't use RefCountedSupplement because that would try to make InternalSett ings RefCounted
110 // and InternalSettings is already RefCounted via its base class, InternalSettin gsGenerated. 112 // and InternalSettings is already RefCounted via its base class, InternalSettin gsGenerated.
111 // Instead, we manually make InternalSettings supplement Page. 113 // Instead, we manually make InternalSettings supplement Page.
112 class InternalSettingsWrapper : public Supplement<Page> { 114 class InternalSettingsWrapper : public Supplement<Page> {
113 public: 115 public:
114 explicit InternalSettingsWrapper(Page& page) 116 explicit InternalSettingsWrapper(Page& page)
115 : m_internalSettings(InternalSettings::create(page)) { } 117 : m_internalSettings(InternalSettings::create(page)) { }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 void InternalSettings::setPictographFontFamily(const AtomicString& family, const String& script, ExceptionState& exceptionState) 288 void InternalSettings::setPictographFontFamily(const AtomicString& family, const String& script, ExceptionState& exceptionState)
287 { 289 {
288 InternalSettingsGuardForSettings(); 290 InternalSettingsGuardForSettings();
289 UScriptCode code = scriptNameToCode(script); 291 UScriptCode code = scriptNameToCode(script);
290 if (code == USCRIPT_INVALID_CODE) 292 if (code == USCRIPT_INVALID_CODE)
291 return; 293 return;
292 settings()->genericFontFamilySettings().setPictograph(family, code); 294 settings()->genericFontFamilySettings().setPictograph(family, code);
293 settings()->notifyGenericFontFamilyChange(); 295 settings()->notifyGenericFontFamilyChange();
294 } 296 }
295 297
298 void InternalSettings::setPreciseMemoryInfoEnabled(bool enabled, ExceptionState& exceptionState)
299 {
300 InternalSettingsGuardForSettings();
301 settings()->setPreciseMemoryInfoEnabled(enabled);
302 }
303
296 void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionState& ex ceptionState) 304 void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionState& ex ceptionState)
297 { 305 {
298 InternalSettingsGuardForSettings(); 306 InternalSettingsGuardForSettings();
299 settings()->setTextAutosizingEnabled(enabled); 307 settings()->setTextAutosizingEnabled(enabled);
300 m_page->inspectorController().setTextAutosizingEnabled(enabled); 308 m_page->inspectorController().setTextAutosizingEnabled(enabled);
301 } 309 }
302 310
303 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height , ExceptionState& exceptionState) 311 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height , ExceptionState& exceptionState)
304 { 312 {
305 InternalSettingsGuardForSettings(); 313 InternalSettingsGuardForSettings();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 settings()->setDefaultVideoPosterURL(url); 363 settings()->setDefaultVideoPosterURL(url);
356 } 364 }
357 365
358 void InternalSettings::setPasswordGenerationDecorationEnabled(bool enabled, Exce ptionState& exceptionState) 366 void InternalSettings::setPasswordGenerationDecorationEnabled(bool enabled, Exce ptionState& exceptionState)
359 { 367 {
360 InternalSettingsGuardForSettings(); 368 InternalSettingsGuardForSettings();
361 settings()->setPasswordGenerationDecorationEnabled(enabled); 369 settings()->setPasswordGenerationDecorationEnabled(enabled);
362 } 370 }
363 371
364 } 372 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698