| OLD | NEW |
| 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 // Library functions related to the Financial Server ping. | 5 // Library functions related to the Financial Server ping. |
| 6 | 6 |
| 7 #include "rlz/lib/financial_ping.h" | 7 #include "rlz/lib/financial_ping.h" |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 bool FinancialPing::SetURLRequestContext( | 183 bool FinancialPing::SetURLRequestContext( |
| 184 net::URLRequestContextGetter* context) { | 184 net::URLRequestContextGetter* context) { |
| 185 g_context = context; | 185 g_context = context; |
| 186 return true; | 186 return true; |
| 187 } | 187 } |
| 188 | 188 |
| 189 namespace { | 189 namespace { |
| 190 | 190 |
| 191 class FinancialPingUrlFetcherDelegate : public net::URLFetcherDelegate { | 191 class FinancialPingUrlFetcherDelegate : public net::URLFetcherDelegate { |
| 192 public: | 192 public: |
| 193 FinancialPingUrlFetcherDelegate(const base::Closure& callback) | 193 explicit FinancialPingUrlFetcherDelegate(const base::Closure& callback) |
| 194 : callback_(callback) { | 194 : callback_(callback) { |
| 195 } | 195 } |
| 196 virtual void OnURLFetchComplete(const net::URLFetcher* source); | 196 virtual void OnURLFetchComplete(const net::URLFetcher* source); |
| 197 | 197 |
| 198 private: | 198 private: |
| 199 base::Closure callback_; | 199 base::Closure callback_; |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 void FinancialPingUrlFetcherDelegate::OnURLFetchComplete( | 202 void FinancialPingUrlFetcherDelegate::OnURLFetchComplete( |
| 203 const net::URLFetcher* source) { | 203 const net::URLFetcher* source) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 349 |
| 350 bool FinancialPing::ClearLastPingTime(Product product) { | 350 bool FinancialPing::ClearLastPingTime(Product product) { |
| 351 ScopedRlzValueStoreLock lock; | 351 ScopedRlzValueStoreLock lock; |
| 352 RlzValueStore* store = lock.GetStore(); | 352 RlzValueStore* store = lock.GetStore(); |
| 353 if (!store || !store->HasAccess(RlzValueStore::kWriteAccess)) | 353 if (!store || !store->HasAccess(RlzValueStore::kWriteAccess)) |
| 354 return false; | 354 return false; |
| 355 return store->ClearPingTime(product); | 355 return store->ClearPingTime(product); |
| 356 } | 356 } |
| 357 | 357 |
| 358 } // namespace | 358 } // namespace |
| OLD | NEW |