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

Side by Side Diff: components/proximity_auth/webui/proximity_auth_webui_handler.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/proximity_auth/webui/proximity_auth_webui_handler.h" 5 #include "components/proximity_auth/webui/proximity_auth_webui_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base64url.h" 10 #include "base/base64url.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 LogBuffer::GetInstance()->AddObserver(this); 231 LogBuffer::GetInstance()->AddObserver(this);
232 232
233 web_contents_initialized_ = true; 233 web_contents_initialized_ = true;
234 } 234 }
235 } 235 }
236 236
237 void ProximityAuthWebUIHandler::GetLogMessages(const base::ListValue* args) { 237 void ProximityAuthWebUIHandler::GetLogMessages(const base::ListValue* args) {
238 base::ListValue json_logs; 238 base::ListValue json_logs;
239 for (const auto& log : *LogBuffer::GetInstance()->logs()) { 239 for (const auto& log : *LogBuffer::GetInstance()->logs()) {
240 json_logs.Append(LogMessageToDictionary(log).release()); 240 json_logs.Append(LogMessageToDictionary(log));
241 } 241 }
242 web_ui()->CallJavascriptFunctionUnsafe("LogBufferInterface.onGotLogMessages", 242 web_ui()->CallJavascriptFunctionUnsafe("LogBufferInterface.onGotLogMessages",
243 json_logs); 243 json_logs);
244 } 244 }
245 245
246 void ProximityAuthWebUIHandler::ClearLogBuffer(const base::ListValue* args) { 246 void ProximityAuthWebUIHandler::ClearLogBuffer(const base::ListValue* args) {
247 // The OnLogBufferCleared() observer function will be called after the buffer 247 // The OnLogBufferCleared() observer function will be called after the buffer
248 // is cleared. 248 // is cleared.
249 LogBuffer::GetInstance()->Clear(); 249 LogBuffer::GetInstance()->Clear();
250 } 250 }
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 << "\n trust_agent_state: " 609 << "\n trust_agent_state: "
610 << static_cast<int>(status_update.trust_agent_state); 610 << static_cast<int>(status_update.trust_agent_state);
611 611
612 last_remote_status_update_.reset(new RemoteStatusUpdate(status_update)); 612 last_remote_status_update_.reset(new RemoteStatusUpdate(status_update));
613 std::unique_ptr<base::ListValue> unlock_keys = GetUnlockKeysList(); 613 std::unique_ptr<base::ListValue> unlock_keys = GetUnlockKeysList();
614 web_ui()->CallJavascriptFunctionUnsafe( 614 web_ui()->CallJavascriptFunctionUnsafe(
615 "LocalStateInterface.onUnlockKeysChanged", *unlock_keys); 615 "LocalStateInterface.onUnlockKeysChanged", *unlock_keys);
616 } 616 }
617 617
618 } // namespace proximity_auth 618 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698