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

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

Issue 2703603003: [Devtools] Changed protocol to use setBlockedURLs instead of add/remove (Closed)
Patch Set: changes Created 3 years, 10 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
Index: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
index 0283eac5e56026ed31cb74c1e48c22bb13dd0f1a..3470f110636c74b69a49fb6f3c5a4533fb3b20cb 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
@@ -1347,24 +1347,13 @@ void InspectorNetworkAgent::getResponseBody(
Response::Error("No data found for resource with given identifier"));
}
-Response InspectorNetworkAgent::addBlockedURL(const String& url) {
- protocol::DictionaryValue* blockedURLs =
- m_state->getObject(NetworkAgentState::blockedURLs);
- if (!blockedURLs) {
- std::unique_ptr<protocol::DictionaryValue> newList =
- protocol::DictionaryValue::create();
- blockedURLs = newList.get();
- m_state->setObject(NetworkAgentState::blockedURLs, std::move(newList));
- }
- blockedURLs->setBoolean(url, true);
- return Response::OK();
-}
-
-Response InspectorNetworkAgent::removeBlockedURL(const String& url) {
- protocol::DictionaryValue* blockedURLs =
- m_state->getObject(NetworkAgentState::blockedURLs);
- if (blockedURLs)
- blockedURLs->remove(url);
+Response InspectorNetworkAgent::setBlockedURLs(
+ std::unique_ptr<protocol::Array<String>> urls) {
+ std::unique_ptr<protocol::DictionaryValue> newList =
+ protocol::DictionaryValue::create();
+ for (size_t i = 0; i < urls->length(); i++)
+ newList->setBoolean(urls->get(i), true);
+ m_state->setObject(NetworkAgentState::blockedURLs, std::move(newList));
return Response::OK();
}

Powered by Google App Engine
This is Rietveld 408576698