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

Side by Side Diff: mojo/public/cpp/bindings/tests/versioning_test_service.cc

Issue 1459033002: Replace (most) occurrences of mojo::Array<T>() with nullptr. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « apps/moterm/moterm_driver.cc ('k') | mojo/services/files/cpp/lib/input_stream_file.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <map> 5 #include <map>
6 6
7 #include "mojo/public/c/system/main.h" 7 #include "mojo/public/c/system/main.h"
8 #include "mojo/public/cpp/application/application_connection.h" 8 #include "mojo/public/cpp/application/application_connection.h"
9 #include "mojo/public/cpp/application/application_delegate.h" 9 #include "mojo/public/cpp/application/application_delegate.h"
10 #include "mojo/public/cpp/application/application_runner.h" 10 #include "mojo/public/cpp/application/application_runner.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if (employees_.find(id) == employees_.end()) 60 if (employees_.find(id) == employees_.end())
61 employees_[id] = new EmployeeInfo(); 61 employees_[id] = new EmployeeInfo();
62 employees_[id]->employee = employee.Pass(); 62 employees_[id]->employee = employee.Pass();
63 callback.Run(true); 63 callback.Run(true);
64 } 64 }
65 65
66 void QueryEmployee(uint64_t id, 66 void QueryEmployee(uint64_t id,
67 bool retrieve_finger_print, 67 bool retrieve_finger_print,
68 const QueryEmployeeCallback& callback) override { 68 const QueryEmployeeCallback& callback) override {
69 if (employees_.find(id) == employees_.end()) { 69 if (employees_.find(id) == employees_.end()) {
70 callback.Run(nullptr, Array<uint8_t>()); 70 callback.Run(nullptr, nullptr);
71 return; 71 return;
72 } 72 }
73 callback.Run(employees_[id]->employee.Clone(), 73 callback.Run(
74 retrieve_finger_print ? employees_[id]->finger_print.Clone() 74 employees_[id]->employee.Clone(),
75 : Array<uint8_t>()); 75 retrieve_finger_print ? employees_[id]->finger_print.Clone() : nullptr);
76 } 76 }
77 77
78 void AttachFingerPrint(uint64_t id, 78 void AttachFingerPrint(uint64_t id,
79 Array<uint8_t> finger_print, 79 Array<uint8_t> finger_print,
80 const AttachFingerPrintCallback& callback) override { 80 const AttachFingerPrintCallback& callback) override {
81 if (employees_.find(id) == employees_.end()) { 81 if (employees_.find(id) == employees_.end()) {
82 callback.Run(false); 82 callback.Run(false);
83 return; 83 return;
84 } 84 }
85 employees_[id]->finger_print = finger_print.Pass(); 85 employees_[id]->finger_print = finger_print.Pass();
(...skipping 30 matching lines...) Expand all
116 } // namespace versioning 116 } // namespace versioning
117 } // namespace test 117 } // namespace test
118 } // namespace mojo 118 } // namespace mojo
119 119
120 MojoResult MojoMain(MojoHandle application_request) { 120 MojoResult MojoMain(MojoHandle application_request) {
121 mojo::ApplicationRunner runner( 121 mojo::ApplicationRunner runner(
122 new mojo::test::versioning::HumanResourceSystemServer()); 122 new mojo::test::versioning::HumanResourceSystemServer());
123 123
124 return runner.Run(application_request); 124 return runner.Run(application_request);
125 } 125 }
OLDNEW
« no previous file with comments | « apps/moterm/moterm_driver.cc ('k') | mojo/services/files/cpp/lib/input_stream_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698