Index: chrome/browser/ui/webui/net_internals/net_internals_ui.cc |
diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc |
index f5400a74808d8aba489717c9c3794697340cc25c..d176b227d06c9e4c8cdb990e696725f37a7352ca 100644 |
--- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc |
+++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc |
@@ -327,7 +327,7 @@ class NetInternalsMessageHandler::IOThreadImpl |
// Adds |entry| to the queue of pending log entries to be sent to the page via |
// Javascript. Must be called on the IO Thread. Also creates a delayed task |
// that will call PostPendingEntries, if there isn't one already. |
- void AddEntryToQueue(base::Value* entry); |
+ void AddEntryToQueue(std::unique_ptr<base::Value> entry); |
// Sends all pending entries to the page via Javascript, and clears the list |
// of pending entries. Sending multiple entries at once results in a |
@@ -587,10 +587,12 @@ void NetInternalsMessageHandler::OnGetExtensionInfo( |
->GenerateInstalledExtensionsSet()); |
for (extensions::ExtensionSet::const_iterator it = extensions->begin(); |
it != extensions->end(); ++it) { |
- base::DictionaryValue* extension_info = new base::DictionaryValue(); |
+ std::unique_ptr<base::DictionaryValue> extension_info( |
+ new base::DictionaryValue()); |
bool enabled = extension_service->IsExtensionEnabled((*it)->id()); |
- extensions::GetExtensionBasicInfo(it->get(), enabled, extension_info); |
- extension_list->Append(extension_info); |
+ extensions::GetExtensionBasicInfo(it->get(), enabled, |
+ extension_info.get()); |
+ extension_list->Append(std::move(extension_info)); |
} |
} |
} |
@@ -1101,9 +1103,9 @@ void NetInternalsMessageHandler::IOThreadImpl::OnSetCaptureMode( |
// can be called from ANY THREAD. |
void NetInternalsMessageHandler::IOThreadImpl::OnAddEntry( |
const net::NetLog::Entry& entry) { |
- BrowserThread::PostTask( |
- BrowserThread::IO, FROM_HERE, |
- base::Bind(&IOThreadImpl::AddEntryToQueue, this, entry.ToValue())); |
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
+ base::Bind(&IOThreadImpl::AddEntryToQueue, this, |
+ base::Passed(entry.ToValue()))); |
} |
// Note that this can be called from ANY THREAD. |
@@ -1130,7 +1132,7 @@ void NetInternalsMessageHandler::IOThreadImpl::SendJavascriptCommand( |
} |
void NetInternalsMessageHandler::IOThreadImpl::AddEntryToQueue( |
- base::Value* entry) { |
+ std::unique_ptr<base::Value> entry) { |
DCHECK_CURRENTLY_ON(BrowserThread::IO); |
if (!pending_entries_.get()) { |
pending_entries_.reset(new base::ListValue()); |
@@ -1139,7 +1141,7 @@ void NetInternalsMessageHandler::IOThreadImpl::AddEntryToQueue( |
base::Bind(&IOThreadImpl::PostPendingEntries, this), |
base::TimeDelta::FromMilliseconds(kNetLogEventDelayMilliseconds)); |
} |
- pending_entries_->Append(entry); |
+ pending_entries_->Append(std::move(entry)); |
} |
void NetInternalsMessageHandler::IOThreadImpl::PostPendingEntries() { |