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

Side by Side Diff: mojo/shell/shell.cc

Issue 1824553004: Demote Mojo shell errors to warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/shell/shell.h" 5 #include "mojo/shell/shell.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 return true; 293 return true;
294 } 294 }
295 295
296 bool ValidateClientProcessConnection( 296 bool ValidateClientProcessConnection(
297 mojom::ClientProcessConnectionPtr* client_process_connection, 297 mojom::ClientProcessConnectionPtr* client_process_connection,
298 const Identity& target, 298 const Identity& target,
299 const ConnectCallback& callback) { 299 const ConnectCallback& callback) {
300 if (!client_process_connection->is_null()) { 300 if (!client_process_connection->is_null()) {
301 if (!HasClass(capability_spec_, kCapabilityClass_ClientProcess)) { 301 if (!HasClass(capability_spec_, kCapabilityClass_ClientProcess)) {
302 LOG(ERROR) << "Error: Instance: " << identity_.name() << " attempting " 302 LOG(WARNING) << "Instance: " << identity_.name() << " attempting "
303 << "to register an instance for a process it created for " 303 << "to register an instance for a process it created for "
304 << "target: " << target.name() << " without the " 304 << "target: " << target.name() << " without the "
305 << "mojo:shell{client_process} capability class."; 305 << "mojo:shell{client_process} capability class.";
306 callback.Run(mojom::ConnectResult::ACCESS_DENIED, 306 callback.Run(mojom::ConnectResult::ACCESS_DENIED,
307 mojom::kInheritUserID, mojom::kInvalidInstanceID); 307 mojom::kInheritUserID, mojom::kInvalidInstanceID);
308 return false; 308 return false;
309 } 309 }
310 310
311 if (!(*client_process_connection)->shell_client.is_valid() || 311 if (!(*client_process_connection)->shell_client.is_valid() ||
312 !(*client_process_connection)->pid_receiver_request.is_valid()) { 312 !(*client_process_connection)->pid_receiver_request.is_valid()) {
313 LOG(ERROR) << "Error: must supply both shell_client AND " 313 LOG(WARNING) << "Must supply both shell_client AND "
314 << "pid_receiver_request when sending " 314 << "pid_receiver_request when sending "
315 << "client_process_connection."; 315 << "client_process_connection.";
316 callback.Run(mojom::ConnectResult::INVALID_ARGUMENT, 316 callback.Run(mojom::ConnectResult::INVALID_ARGUMENT,
317 mojom::kInheritUserID, mojom::kInvalidInstanceID); 317 mojom::kInheritUserID, mojom::kInvalidInstanceID);
318 return false; 318 return false;
319 } 319 }
320 if (shell_->GetExistingInstance(target)) { 320 if (shell_->GetExistingInstance(target)) {
321 LOG(ERROR) << "Error: Cannot client process matching existing identity:" 321 LOG(WARNING) << "Cannot client process matching existing identity:"
322 << "Name: " << target.name() << " User: " << target.user_id() 322 << "Name: " << target.name() << " User: "
323 << " Instance: " << target.instance(); 323 << target.user_id() << " Instance: " << target.instance();
324 callback.Run(mojom::ConnectResult::INVALID_ARGUMENT, 324 callback.Run(mojom::ConnectResult::INVALID_ARGUMENT,
325 mojom::kInheritUserID, mojom::kInvalidInstanceID); 325 mojom::kInheritUserID, mojom::kInvalidInstanceID);
326 return false; 326 return false;
327 } 327 }
328 } 328 }
329 return true; 329 return true;
330 } 330 }
331 331
332 bool ValidateCapabilities(const Identity& target, 332 bool ValidateCapabilities(const Identity& target,
333 const ConnectCallback& callback) { 333 const ConnectCallback& callback) {
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 for (auto it = native_runners_.begin(); it != native_runners_.end(); ++it) { 779 for (auto it = native_runners_.begin(); it != native_runners_.end(); ++it) {
780 if (it->get() == runner) { 780 if (it->get() == runner) {
781 native_runners_.erase(it); 781 native_runners_.erase(it);
782 return; 782 return;
783 } 783 }
784 } 784 }
785 } 785 }
786 786
787 } // namespace shell 787 } // namespace shell
788 } // namespace mojo 788 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698