summaryrefslogtreecommitdiffstats
path: root/extensions/browser
diff options
context:
space:
mode:
authorkaliamoorthi <kaliamoorthi@chromium.org>2014-11-28 10:52:52 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-28 18:53:14 +0000
commitc6ee48e0fb82f8fef06a2e0e9cd107a077eafc7e (patch)
tree81394b28b9217a31d535e4930486eafb30370d82 /extensions/browser
parentc282ba091614064fc5b7d923c1eeb04e6f4d88bc (diff)
downloadchromium_src-c6ee48e0fb82f8fef06a2e0e9cd107a077eafc7e.zip
chromium_src-c6ee48e0fb82f8fef06a2e0e9cd107a077eafc7e.tar.gz
chromium_src-c6ee48e0fb82f8fef06a2e0e9cd107a077eafc7e.tar.bz2
Cleanup VpnServices interface with shill client
This CL replaces an argument from brittle pointer and length to a string. TBR=stevenjb@chromium.org BUG=407541 Review URL: https://codereview.chromium.org/768723003 Cr-Commit-Position: refs/heads/master@{#306106}
Diffstat (limited to 'extensions/browser')
-rw-r--r--extensions/browser/api/vpn_provider/vpn_service.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/extensions/browser/api/vpn_provider/vpn_service.cc b/extensions/browser/api/vpn_provider/vpn_service.cc
index 65be2e3..1a618d6 100644
--- a/extensions/browser/api/vpn_provider/vpn_service.cc
+++ b/extensions/browser/api/vpn_provider/vpn_service.cc
@@ -71,8 +71,7 @@ class VpnService::VpnConfiguration : public ShillThirdPartyVpnObserver {
const std::string& object_path() const { return object_path_; }
// ShillThirdPartyVpnObserver:
- // TODO(kaliamoorthi): Replace |data| and |length| with a string value.
- void OnPacketReceived(const uint8_t* data, size_t length) override;
+ void OnPacketReceived(const std::string& data) override;
void OnPlatformMessage(uint32_t message) override;
private:
@@ -103,13 +102,12 @@ VpnService::VpnConfiguration::VpnConfiguration(
VpnService::VpnConfiguration::~VpnConfiguration() {
}
-void VpnService::VpnConfiguration::OnPacketReceived(const uint8_t* data,
- size_t length) {
+void VpnService::VpnConfiguration::OnPacketReceived(const std::string& data) {
if (!vpn_service_) {
return;
}
- scoped_ptr<base::ListValue> event_args = api_vpn::OnPacketReceived::Create(
- std::string(reinterpret_cast<const char*>(data), length));
+ scoped_ptr<base::ListValue> event_args =
+ api_vpn::OnPacketReceived::Create(data);
vpn_service_->SendSignalToExtension(
extension_id_, api_vpn::OnPacketReceived::kEventName, event_args.Pass());
}