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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/developer_private/developer_private_api. h" 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api. h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 file_type_index)) { 1135 file_type_index)) {
1136 return RespondNow(Error(kCouldNotShowSelectFileDialogError)); 1136 return RespondNow(Error(kCouldNotShowSelectFileDialogError));
1137 } 1137 }
1138 1138
1139 AddRef(); // Balanced by FileSelected / FileSelectionCanceled. 1139 AddRef(); // Balanced by FileSelected / FileSelectionCanceled.
1140 return RespondLater(); 1140 return RespondLater();
1141 } 1141 }
1142 1142
1143 void DeveloperPrivateChoosePathFunction::FileSelected( 1143 void DeveloperPrivateChoosePathFunction::FileSelected(
1144 const base::FilePath& path) { 1144 const base::FilePath& path) {
1145 Respond(OneArgument( 1145 Respond(OneArgument(new base::StringValue(path.LossyDisplayName())));
1146 base::MakeUnique<base::StringValue>(path.LossyDisplayName())));
1147 Release(); 1146 Release();
1148 } 1147 }
1149 1148
1150 void DeveloperPrivateChoosePathFunction::FileSelectionCanceled() { 1149 void DeveloperPrivateChoosePathFunction::FileSelectionCanceled() {
1151 // This isn't really an error, but we should keep it like this for 1150 // This isn't really an error, but we should keep it like this for
1152 // backward compatability. 1151 // backward compatability.
1153 Respond(Error(kFileSelectionCanceled)); 1152 Respond(Error(kFileSelectionCanceled));
1154 Release(); 1153 Release();
1155 } 1154 }
1156 1155
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 update.extension_id, update.command_name, *update.keybinding); 1445 update.extension_id, update.command_name, *update.keybinding);
1447 } 1446 }
1448 1447
1449 return RespondNow(NoArguments()); 1448 return RespondNow(NoArguments());
1450 } 1449 }
1451 1450
1452 1451
1453 } // namespace api 1452 } // namespace api
1454 1453
1455 } // namespace extensions 1454 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698