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

Side by Side Diff: chrome/browser/chromeos/extensions/echo_private_api.cc

Issue 2017113002: [Extensions] DCHECK that ExtensionFunctions respond (and only once) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 (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/chromeos/extensions/echo_private_api.h" 5 #include "chrome/browser/chromeos/extensions/echo_private_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 std::string result; 71 std::string result;
72 if (type == kCouponType) { 72 if (type == kCouponType) {
73 provider->GetMachineStatistic(chromeos::system::kOffersCouponCodeKey, 73 provider->GetMachineStatistic(chromeos::system::kOffersCouponCodeKey,
74 &result); 74 &result);
75 } else if (type == kGroupType) { 75 } else if (type == kGroupType) {
76 provider->GetMachineStatistic(chromeos::system::kOffersGroupCodeKey, 76 provider->GetMachineStatistic(chromeos::system::kOffersGroupCodeKey,
77 &result); 77 &result);
78 } 78 }
79 79
80 results_ = echo_api::GetRegistrationCode::Results::Create(result); 80 results_ = echo_api::GetRegistrationCode::Results::Create(result);
81 SendResponse(true);
82 } 81 }
83 82
84 bool EchoPrivateGetRegistrationCodeFunction::RunSync() { 83 bool EchoPrivateGetRegistrationCodeFunction::RunSync() {
85 std::unique_ptr<echo_api::GetRegistrationCode::Params> params = 84 std::unique_ptr<echo_api::GetRegistrationCode::Params> params =
86 echo_api::GetRegistrationCode::Params::Create(*args_); 85 echo_api::GetRegistrationCode::Params::Create(*args_);
87 EXTENSION_FUNCTION_VALIDATE(params); 86 EXTENSION_FUNCTION_VALIDATE(params);
88 GetRegistrationCode(params->type); 87 GetRegistrationCode(params->type);
89 return true; 88 return true;
90 } 89 }
91 90
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 void EchoPrivateGetUserConsentFunction::Finalize(bool consent) { 271 void EchoPrivateGetUserConsentFunction::Finalize(bool consent) {
273 // Consent should not be true if offers redeeming is disabled. 272 // Consent should not be true if offers redeeming is disabled.
274 CHECK(redeem_offers_allowed_ || !consent); 273 CHECK(redeem_offers_allowed_ || !consent);
275 results_ = echo_api::GetUserConsent::Results::Create(consent); 274 results_ = echo_api::GetUserConsent::Results::Create(consent);
276 SendResponse(true); 275 SendResponse(true);
277 276
278 // Release the reference added in |OnRedeemOffersAllowedChecked|, before 277 // Release the reference added in |OnRedeemOffersAllowedChecked|, before
279 // showing the dialog. 278 // showing the dialog.
280 Release(); 279 Release();
281 } 280 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698