| Index: chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
|
| diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
|
| index 7bdc6cdd4f9d455b9bfd006b155948ce2b32b4ba..9d3b30c483027332a1f2d6a9b65301311b52348f 100644
|
| --- a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
|
| +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
|
| @@ -7,8 +7,10 @@
|
| #include "chrome/browser/extensions/api/tab_capture/tab_capture_api.h"
|
|
|
| #include <algorithm>
|
| +#include <memory>
|
| #include <set>
|
| #include <string>
|
| +#include <utility>
|
| #include <vector>
|
|
|
| #include "base/command_line.h"
|
| @@ -257,18 +259,18 @@ bool TabCaptureCaptureFunction::RunSync() {
|
| // virtual audio/video capture devices and set up all the data flows. The
|
| // custom JS bindings can be found here:
|
| // chrome/renderer/resources/extensions/tab_capture_custom_bindings.js
|
| - base::DictionaryValue* result = new base::DictionaryValue();
|
| + std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
|
| result->MergeDictionary(params->options.ToValue().get());
|
| - SetResult(result);
|
| + SetResult(std::move(result));
|
| return true;
|
| }
|
|
|
| bool TabCaptureGetCapturedTabsFunction::RunSync() {
|
| TabCaptureRegistry* registry = TabCaptureRegistry::Get(GetProfile());
|
| - base::ListValue* const list = new base::ListValue();
|
| + std::unique_ptr<base::ListValue> list(new base::ListValue());
|
| if (registry)
|
| - registry->GetCapturedTabs(extension()->id(), list);
|
| - SetResult(list);
|
| + registry->GetCapturedTabs(extension()->id(), list.get());
|
| + SetResult(std::move(list));
|
| return true;
|
| }
|
|
|
| @@ -333,9 +335,9 @@ bool TabCaptureCaptureOffscreenTabFunction::RunSync() {
|
| // the custom JS bindings in the extension's render process to complete the
|
| // request. See the comment at end of TabCaptureCaptureFunction::RunSync()
|
| // for more details.
|
| - base::DictionaryValue* const result = new base::DictionaryValue();
|
| + std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
|
| result->MergeDictionary(params->options.ToValue().get());
|
| - SetResult(result);
|
| + SetResult(std::move(result));
|
| return true;
|
| }
|
|
|
|
|