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

Side by Side Diff: rlz/lib/financial_ping.cc

Issue 14114002: Rewrite scoped_array<T> to scoped_ptr<T[]> in rlz. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | rlz/lib/rlz_lib_test.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 (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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 // Check the response status. 246 // Check the response status.
247 DWORD status; 247 DWORD status;
248 DWORD status_size = sizeof(status); 248 DWORD status_size = sizeof(status);
249 if (!HttpQueryInfo(http_handle, HTTP_QUERY_STATUS_CODE | 249 if (!HttpQueryInfo(http_handle, HTTP_QUERY_STATUS_CODE |
250 HTTP_QUERY_FLAG_NUMBER, &status, &status_size, NULL) || 250 HTTP_QUERY_FLAG_NUMBER, &status, &status_size, NULL) ||
251 200 != status) 251 200 != status)
252 return false; 252 return false;
253 253
254 // Get the response text. 254 // Get the response text.
255 scoped_array<char> buffer(new char[kMaxPingResponseLength]); 255 scoped_ptr<char[]> buffer(new char[kMaxPingResponseLength]);
256 if (buffer.get() == NULL) 256 if (buffer.get() == NULL)
257 return false; 257 return false;
258 258
259 DWORD bytes_read = 0; 259 DWORD bytes_read = 0;
260 while (InternetReadFile(http_handle, buffer.get(), kMaxPingResponseLength, 260 while (InternetReadFile(http_handle, buffer.get(), kMaxPingResponseLength,
261 &bytes_read) && bytes_read > 0) { 261 &bytes_read) && bytes_read > 0) {
262 response->append(buffer.get(), bytes_read); 262 response->append(buffer.get(), bytes_read);
263 bytes_read = 0; 263 bytes_read = 0;
264 }; 264 };
265 265
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | rlz/lib/rlz_lib_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698