Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/AdblockPlusClient.cpp

Issue 4806567450902528: Issue 1794 - add handling of std::vector<std::string> by Communication::{Input,Output}Buffer (Closed)
Patch Set: remove WriteStrings and ReadStrings Created Feb. 9, 2015, 2:04 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/plugin/AdblockPlusClient.cpp
diff --git a/src/plugin/AdblockPlusClient.cpp b/src/plugin/AdblockPlusClient.cpp
index 922f3451e6979f4e60d3fdc6d4df02762465d28c..8f89c161641db37545ce082c6e50d8431c1b7847 100644
--- a/src/plugin/AdblockPlusClient.cpp
+++ b/src/plugin/AdblockPlusClient.cpp
@@ -108,21 +108,6 @@ namespace
}
}
- std::vector<std::wstring> ReadStrings(Communication::InputBuffer& message)
- {
- int32_t count;
- message >> count;
-
- std::vector<std::wstring> result;
- for (int32_t i = 0; i < count; i++)
- {
- std::string str;
- message >> str;
- result.push_back(ToUtf16String(str));
- }
- return result;
- }
-
std::vector<SubscriptionDescription> ReadSubscriptions(Communication::InputBuffer& message)
{
int32_t count;
@@ -309,7 +294,10 @@ std::vector<std::wstring> CAdblockPlusClient::GetElementHidingSelectors(const st
Communication::InputBuffer response;
if (!CallEngine(request, response))
return std::vector<std::wstring>();
- return ReadStrings(response);
+
+ std::vector<std::string> selectors;
+ response >> selectors;
+ return ToUtf16Strings(selectors);
Eric 2015/02/09 16:18:57 Here and below, you're following a call to operato
}
std::vector<SubscriptionDescription> CAdblockPlusClient::FetchAvailableSubscriptions()
@@ -375,7 +363,10 @@ std::vector<std::wstring> CAdblockPlusClient::GetExceptionDomains()
Communication::InputBuffer response;
if (!CallEngine(Communication::PROC_GET_EXCEPTION_DOMAINS, response))
return std::vector<std::wstring>();
- return ReadStrings(response);
+
+ std::vector<std::string> domains;
+ response >> domains;
+ return ToUtf16Strings(domains);
Eric 2015/02/09 16:18:57 Second pair of calls: operator>>, ToUtf16Strings
}
bool CAdblockPlusClient::IsFirstRun()
« no previous file with comments | « src/engine/Main.cpp ('k') | src/shared/Communication.h » ('j') | src/shared/Communication.h » ('J')

Powered by Google App Engine
This is Rietveld