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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp

Issue 2916283002: Revert of DevTools: require enabling CSS domain before running CSS.* commands. (Closed)
Patch Set: Created 3 years, 7 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 | « third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index eddcc1cc1440e6ab4311e0054587ed65907e2db9..77463d469bc253e681a467be6385e0a9ee633bc3 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -757,7 +757,6 @@
HeapVector<Member<Document>> documents = dom_agent_->Documents();
for (Document* document : documents)
UpdateActiveStyleSheets(document);
- was_enabled_ = true;
}
Response InspectorCSSAgent::disable() {
@@ -765,7 +764,6 @@
dom_agent_->SetDOMListener(nullptr);
instrumenting_agents_->removeInspectorCSSAgent(this);
state_->setBoolean(CSSAgentState::kCssAgentEnabled, false);
- was_enabled_ = false;
resource_content_loader_->Cancel(resource_content_loader_client_id_);
state_->setBoolean(CSSAgentState::kRuleRecordingEnabled, false);
SetCoverageEnabled(false);
@@ -917,12 +915,8 @@
inherited_entries,
Maybe<protocol::Array<protocol::CSS::CSSKeyframesRule>>*
css_keyframes_rules) {
- Response response = AssertEnabled();
- if (!response.isSuccess())
- return response;
-
Element* element = nullptr;
- response = dom_agent_->AssertElement(node_id, element);
+ Response response = dom_agent_->AssertElement(node_id, element);
if (!response.isSuccess())
return response;
@@ -1098,11 +1092,8 @@
int node_id,
Maybe<protocol::CSS::CSSStyle>* inline_style,
Maybe<protocol::CSS::CSSStyle>* attributes_style) {
- Response response = AssertEnabled();
- if (!response.isSuccess())
- return response;
Element* element = nullptr;
- response = dom_agent_->AssertElement(node_id, element);
+ Response response = dom_agent_->AssertElement(node_id, element);
if (!response.isSuccess())
return response;
@@ -1120,11 +1111,8 @@
int node_id,
std::unique_ptr<protocol::Array<protocol::CSS::CSSComputedStyleProperty>>*
style) {
- Response response = AssertEnabled();
- if (!response.isSuccess())
- return response;
Node* node = nullptr;
- response = dom_agent_->AssertNode(node_id, node);
+ Response response = dom_agent_->AssertNode(node_id, node);
if (!response.isSuccess())
return response;
@@ -1190,11 +1178,8 @@
int node_id,
std::unique_ptr<protocol::Array<protocol::CSS::PlatformFontUsage>>*
platform_fonts) {
- Response response = AssertEnabled();
- if (!response.isSuccess())
- return response;
Node* node = nullptr;
- response = dom_agent_->AssertNode(node_id, node);
+ Response response = dom_agent_->AssertNode(node_id, node);
if (!response.isSuccess())
return response;
@@ -1580,11 +1565,8 @@
Response InspectorCSSAgent::forcePseudoState(
int node_id,
std::unique_ptr<protocol::Array<String>> forced_pseudo_classes) {
- Response response = AssertEnabled();
- if (!response.isSuccess())
- return response;
Element* element = nullptr;
- response = dom_agent_->AssertElement(node_id, element);
+ Response response = dom_agent_->AssertElement(node_id, element);
if (!response.isSuccess())
return response;
@@ -1909,17 +1891,9 @@
return css_style_sheet_to_inspector_style_sheet_.at(&inspector_sheet);
}
-Response InspectorCSSAgent::AssertEnabled() {
- return was_enabled_ ? Response::OK()
- : Response::Error("CSS agent was not enabled");
-}
-
Response InspectorCSSAgent::AssertInspectorStyleSheetForId(
const String& style_sheet_id,
InspectorStyleSheet*& result) {
- Response response = AssertEnabled();
- if (!response.isSuccess())
- return response;
IdToInspectorStyleSheet::iterator it =
id_to_inspector_style_sheet_.find(style_sheet_id);
if (it == id_to_inspector_style_sheet_.end())
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698