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

Side by Side Diff: components/policy/core/common/cloud/device_management_service.cc

Issue 2458653003: Add "critical" parameter to DMServer requests. (Closed)
Patch Set: Created 4 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
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 "components/policy/core/common/cloud/device_management_service.h" 5 #include "components/policy/core/common/cloud/device_management_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 } 465 }
466 466
467 void DeviceManagementRequestJob::SetDMToken(const std::string& dm_token) { 467 void DeviceManagementRequestJob::SetDMToken(const std::string& dm_token) {
468 dm_token_ = dm_token; 468 dm_token_ = dm_token;
469 } 469 }
470 470
471 void DeviceManagementRequestJob::SetClientID(const std::string& client_id) { 471 void DeviceManagementRequestJob::SetClientID(const std::string& client_id) {
472 AddParameter(dm_protocol::kParamDeviceID, client_id); 472 AddParameter(dm_protocol::kParamDeviceID, client_id);
473 } 473 }
474 474
475 void DeviceManagementRequestJob::SetCritical(bool critical) {
476 if (critical)
477 AddParameter(dm_protocol::kParamCritical, "true");
478 }
479
475 em::DeviceManagementRequest* DeviceManagementRequestJob::GetRequest() { 480 em::DeviceManagementRequest* DeviceManagementRequestJob::GetRequest() {
476 return &request_; 481 return &request_;
477 } 482 }
478 483
479 DeviceManagementRequestJob::DeviceManagementRequestJob( 484 DeviceManagementRequestJob::DeviceManagementRequestJob(
480 JobType type, 485 JobType type,
481 const std::string& agent_parameter, 486 const std::string& agent_parameter,
482 const std::string& platform_parameter) 487 const std::string& platform_parameter)
483 : type_(type) { 488 : type_(type) {
484 AddParameter(dm_protocol::kParamRequest, JobTypeToRequestType(type)); 489 AddParameter(dm_protocol::kParamRequest, JobTypeToRequestType(type));
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 } 658 }
654 } 659 }
655 660
656 const JobQueue::iterator elem = 661 const JobQueue::iterator elem =
657 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); 662 std::find(queued_jobs_.begin(), queued_jobs_.end(), job);
658 if (elem != queued_jobs_.end()) 663 if (elem != queued_jobs_.end())
659 queued_jobs_.erase(elem); 664 queued_jobs_.erase(elem);
660 } 665 }
661 666
662 } // namespace policy 667 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698