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

Unified Diff: Source/core/inspector/InspectorStyleSheet.cpp

Issue 24469004: Amusingly deprecate the generic version of 'ExceptionState::throwDOMException'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « Source/core/html/track/TextTrackRegion.cpp ('k') | Source/core/platform/chromium/ChromiumDataObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorStyleSheet.cpp
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp
index 22ceb8d277c1596d2f43bf2e873fe5ae2ebb827c..54e9ee3ce27c014779269cdb57dda7b709e6dcad 100644
--- a/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/Source/core/inspector/InspectorStyleSheet.cpp
@@ -555,7 +555,7 @@ bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText,
DEFINE_STATIC_LOCAL(String, bogusPropertyName, ("-webkit-boguz-propertee"));
if (!m_parentStyleSheet->ensureParsedDataReady()) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
@@ -570,27 +570,27 @@ bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText,
// At least one property + the bogus property added just above should be present.
if (propertyCount < 2) {
- es.throwDOMException(SyntaxError);
+ es.throwUninformativeAndGenericDOMException(SyntaxError);
return false;
}
// Check for the proper propertyText termination (the parser could at least restore to the PROPERTY_NAME state).
if (propertyData.at(propertyCount - 1).name != bogusPropertyName) {
- es.throwDOMException(SyntaxError);
+ es.throwUninformativeAndGenericDOMException(SyntaxError);
return false;
}
}
RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
if (!sourceData) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
String text;
bool success = styleText(&text);
if (!success) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
@@ -600,7 +600,7 @@ bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText,
InspectorStyleTextEditor editor(&allProperties, text, newLineAndWhitespaceDelimiters());
if (overwrite) {
if (index >= allProperties.size()) {
- es.throwDOMException(IndexSizeError);
+ es.throwUninformativeAndGenericDOMException(IndexSizeError);
return false;
}
*oldText = allProperties.at(index).rawText;
@@ -615,27 +615,27 @@ bool InspectorStyle::toggleProperty(unsigned index, bool disable, ExceptionState
{
ASSERT(m_parentStyleSheet);
if (!m_parentStyleSheet->ensureParsedDataReady()) {
- es.throwDOMException(NoModificationAllowedError);
+ es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
return false;
}
RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
if (!sourceData) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
String text;
bool success = styleText(&text);
if (!success) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
Vector<InspectorStyleProperty> allProperties;
populateAllProperties(allProperties);
if (index >= allProperties.size()) {
- es.throwDOMException(IndexSizeError);
+ es.throwUninformativeAndGenericDOMException(IndexSizeError);
return false;
}
@@ -1050,7 +1050,7 @@ String InspectorStyleSheet::ruleSelector(const InspectorCSSId& id, ExceptionStat
{
CSSStyleRule* rule = ruleForId(id);
if (!rule) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return "";
}
return rule->selectorText();
@@ -1062,19 +1062,19 @@ bool InspectorStyleSheet::setRuleSelector(const InspectorCSSId& id, const String
return false;
CSSStyleRule* rule = ruleForId(id);
if (!rule) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
CSSStyleSheet* styleSheet = rule->parentStyleSheet();
if (!styleSheet || !ensureParsedDataReady()) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
rule->setSelectorText(selector);
RefPtr<CSSRuleSourceData> sourceData = ruleSourceDataFor(rule->style());
if (!sourceData) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
@@ -1097,14 +1097,14 @@ CSSStyleRule* InspectorStyleSheet::addRule(const String& selector, ExceptionStat
if (!checkPageStyleSheet(es))
return 0;
if (!checkStyleRuleSelector(m_pageStyleSheet->ownerDocument(), selector)) {
- es.throwDOMException(SyntaxError);
+ es.throwUninformativeAndGenericDOMException(SyntaxError);
return 0;
}
String text;
bool success = getText(&text);
if (!success) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return 0;
}
StringBuilder styleSheetText;
@@ -1123,7 +1123,7 @@ CSSStyleRule* InspectorStyleSheet::addRule(const String& selector, ExceptionStat
// What we just added has to be a CSSStyleRule - we cannot handle other types of rules yet.
// If it is not a style rule, pretend we never touched the stylesheet.
m_pageStyleSheet->deleteRule(lastRuleIndex, ASSERT_NO_EXCEPTION);
- es.throwDOMException(SyntaxError);
+ es.throwUninformativeAndGenericDOMException(SyntaxError);
return 0;
}
@@ -1146,18 +1146,18 @@ bool InspectorStyleSheet::deleteRule(const InspectorCSSId& id, ExceptionState& e
return false;
RefPtr<CSSStyleRule> rule = ruleForId(id);
if (!rule) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
CSSStyleSheet* styleSheet = rule->parentStyleSheet();
if (!styleSheet || !ensureParsedDataReady()) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
RefPtr<CSSRuleSourceData> sourceData = ruleSourceDataFor(rule->style());
if (!sourceData) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
@@ -1337,13 +1337,13 @@ bool InspectorStyleSheet::setStyleText(const InspectorCSSId& id, const String& t
{
RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
if (!inspectorStyle || !inspectorStyle->cssStyle()) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
bool success = inspectorStyle->styleText(oldText);
if (!success) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
@@ -1351,7 +1351,7 @@ bool InspectorStyleSheet::setStyleText(const InspectorCSSId& id, const String& t
if (success)
fireStyleSheetChanged();
else
- es.throwDOMException(SyntaxError);
+ es.throwUninformativeAndGenericDOMException(SyntaxError);
return success;
}
@@ -1359,7 +1359,7 @@ bool InspectorStyleSheet::setPropertyText(const InspectorCSSId& id, unsigned pro
{
RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
if (!inspectorStyle) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
@@ -1373,7 +1373,7 @@ bool InspectorStyleSheet::toggleProperty(const InspectorCSSId& id, unsigned prop
{
RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
if (!inspectorStyle) {
- es.throwDOMException(NotFoundError);
+ es.throwUninformativeAndGenericDOMException(NotFoundError);
return false;
}
@@ -1547,7 +1547,7 @@ unsigned InspectorStyleSheet::ruleIndexByRule(const CSSRule* rule) const
bool InspectorStyleSheet::checkPageStyleSheet(ExceptionState& es) const
{
if (!m_pageStyleSheet) {
- es.throwDOMException(NotSupportedError);
+ es.throwUninformativeAndGenericDOMException(NotSupportedError);
return false;
}
return true;
« no previous file with comments | « Source/core/html/track/TextTrackRegion.cpp ('k') | Source/core/platform/chromium/ChromiumDataObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698