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

Side by Side Diff: extensions/browser/api/vpn_provider/vpn_provider_api.cc

Issue 2038613003: Revert of ExtensionFunction: don't pass ownership of base::Value by raw pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « extensions/browser/api/usb/usb_api.cc ('k') | extensions/browser/extension_function.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/api/vpn_provider/vpn_provider_api.h" 5 #include "extensions/browser/api/vpn_provider/vpn_provider_api.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/ptr_util.h"
13 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
14 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
15 #include "base/values.h" 14 #include "base/values.h"
16 #include "extensions/browser/api/vpn_provider/vpn_service.h" 15 #include "extensions/browser/api/vpn_provider/vpn_service.h"
17 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h" 16 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h"
18 #include "extensions/common/api/vpn_provider.h" 17 #include "extensions/common/api/vpn_provider.h"
19 #include "third_party/cros_system_api/dbus/service_constants.h" 18 #include "third_party/cros_system_api/dbus/service_constants.h"
20 19
21 namespace extensions { 20 namespace extensions {
22 21
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 155
157 VpnThreadExtensionFunction::~VpnThreadExtensionFunction() { 156 VpnThreadExtensionFunction::~VpnThreadExtensionFunction() {
158 } 157 }
159 158
160 void VpnThreadExtensionFunction::SignalCallCompletionSuccess() { 159 void VpnThreadExtensionFunction::SignalCallCompletionSuccess() {
161 Respond(NoArguments()); 160 Respond(NoArguments());
162 } 161 }
163 162
164 void VpnThreadExtensionFunction::SignalCallCompletionSuccessWithId( 163 void VpnThreadExtensionFunction::SignalCallCompletionSuccessWithId(
165 const std::string& configuration_id) { 164 const std::string& configuration_id) {
166 Respond(OneArgument(base::MakeUnique<base::StringValue>(configuration_id))); 165 Respond(OneArgument(new base::StringValue(configuration_id)));
167 } 166 }
168 167
169 void VpnThreadExtensionFunction::SignalCallCompletionSuccessWithWarning( 168 void VpnThreadExtensionFunction::SignalCallCompletionSuccessWithWarning(
170 const std::string& warning) { 169 const std::string& warning) {
171 if (!warning.empty()) { 170 if (!warning.empty()) {
172 WriteToConsole(content::CONSOLE_MESSAGE_LEVEL_WARNING, warning); 171 WriteToConsole(content::CONSOLE_MESSAGE_LEVEL_WARNING, warning);
173 } 172 }
174 Respond(NoArguments()); 173 Respond(NoArguments());
175 } 174 }
176 175
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 SignalCallCompletionSuccess, 328 SignalCallCompletionSuccess,
330 this), 329 this),
331 base::Bind(&VpnProviderNotifyConnectionStateChangedFunction:: 330 base::Bind(&VpnProviderNotifyConnectionStateChangedFunction::
332 SignalCallCompletionFailure, 331 SignalCallCompletionFailure,
333 this)); 332 this));
334 333
335 return RespondLater(); 334 return RespondLater();
336 } 335 }
337 336
338 } // namespace extensions 337 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/usb/usb_api.cc ('k') | extensions/browser/extension_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698