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

Side by Side Diff: chrome/browser/extensions/api/terminal/terminal_private_api.cc

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: MakeUnique Created 4 years, 2 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/terminal/terminal_private_api.h" 5 #include "chrome/browser/extensions/api/terminal/terminal_private_api.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 const std::string& output) { 62 const std::string& output) {
63 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { 63 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
64 content::BrowserThread::PostTask( 64 content::BrowserThread::PostTask(
65 content::BrowserThread::UI, FROM_HERE, 65 content::BrowserThread::UI, FROM_HERE,
66 base::Bind(&NotifyProcessOutput, browser_context, extension_id, tab_id, 66 base::Bind(&NotifyProcessOutput, browser_context, extension_id, tab_id,
67 terminal_id, output_type, output)); 67 terminal_id, output_type, output));
68 return; 68 return;
69 } 69 }
70 70
71 std::unique_ptr<base::ListValue> args(new base::ListValue()); 71 std::unique_ptr<base::ListValue> args(new base::ListValue());
72 args->Append(new base::FundamentalValue(tab_id)); 72 args->AppendInteger(tab_id);
73 args->Append(new base::FundamentalValue(terminal_id)); 73 args->AppendInteger(terminal_id);
74 args->Append(new base::StringValue(output_type)); 74 args->AppendString(output_type);
75 args->Append(new base::StringValue(output)); 75 args->AppendString(output);
76 76
77 extensions::EventRouter* event_router = 77 extensions::EventRouter* event_router =
78 extensions::EventRouter::Get(browser_context); 78 extensions::EventRouter::Get(browser_context);
79 if (event_router) { 79 if (event_router) {
80 std::unique_ptr<extensions::Event> event(new extensions::Event( 80 std::unique_ptr<extensions::Event> event(new extensions::Event(
81 extensions::events::TERMINAL_PRIVATE_ON_PROCESS_OUTPUT, 81 extensions::events::TERMINAL_PRIVATE_ON_PROCESS_OUTPUT,
82 terminal_private::OnProcessOutput::kEventName, std::move(args))); 82 terminal_private::OnProcessOutput::kEventName, std::move(args)));
83 event_router->DispatchEventToExtension(extension_id, std::move(event)); 83 event_router->DispatchEventToExtension(extension_id, std::move(event));
84 } 84 }
85 } 85 }
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 params->pid)); 290 params->pid));
291 291
292 return RespondNow(NoArguments()); 292 return RespondNow(NoArguments());
293 } 293 }
294 294
295 void TerminalPrivateAckOutputFunction::AckOutputOnFileThread(int terminal_id) { 295 void TerminalPrivateAckOutputFunction::AckOutputOnFileThread(int terminal_id) {
296 chromeos::ProcessProxyRegistry::Get()->AckOutput(terminal_id); 296 chromeos::ProcessProxyRegistry::Get()->AckOutput(terminal_id);
297 } 297 }
298 298
299 } // namespace extensions 299 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698