Chromium Code Reviews| 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 // A library to manage RLZ information for access-points shared | 5 // A library to manage RLZ information for access-points shared |
| 6 // across different client applications. | 6 // across different client applications. |
| 7 // | 7 // |
| 8 // All functions return true on success and false on error. | 8 // All functions return true on success and false on error. |
| 9 // This implemenation is thread safe. | 9 // This implemenation is thread safe. |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 #if !defined(RLZ_NETWORK_IMPLEMENTATION_WIN_INET) && \ | 38 #if !defined(RLZ_NETWORK_IMPLEMENTATION_WIN_INET) && \ |
| 39 !defined(RLZ_NETWORK_IMPLEMENTATION_CHROME_NET) | 39 !defined(RLZ_NETWORK_IMPLEMENTATION_CHROME_NET) |
| 40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
| 41 #define RLZ_NETWORK_IMPLEMENTATION_WIN_INET | 41 #define RLZ_NETWORK_IMPLEMENTATION_WIN_INET |
| 42 #else | 42 #else |
| 43 #define RLZ_NETWORK_IMPLEMENTATION_CHROME_NET | 43 #define RLZ_NETWORK_IMPLEMENTATION_CHROME_NET |
| 44 #endif | 44 #endif |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 #if defined(RLZ_NETWORK_IMPLEMENTATION_CHROME_NET) | 47 #if defined(RLZ_NETWORK_IMPLEMENTATION_CHROME_NET) |
| 48 namespace base { | |
| 49 class MessageLoopProxy; | |
| 50 } // namespace base | |
|
Roger Tawa OOO till Jul 10th
2012/11/06 20:55:11
ifdef this for chromeos?
Ivan Korotkov
2012/11/07 10:49:12
Oops, right.
| |
| 48 namespace net { | 51 namespace net { |
| 49 class URLRequestContextGetter; | 52 class URLRequestContextGetter; |
| 50 } // namespace net | 53 } // namespace net |
| 51 #endif | 54 #endif |
| 52 | 55 |
| 53 namespace rlz_lib { | 56 namespace rlz_lib { |
| 54 | 57 |
| 55 class ScopedRlzValueStoreLock; | 58 class ScopedRlzValueStoreLock; |
| 56 | 59 |
| 57 // The maximum length of an access points RLZ in bytes. | 60 // The maximum length of an access points RLZ in bytes. |
| 58 const size_t kMaxRlzLength = 64; | 61 const size_t kMaxRlzLength = 64; |
| 59 // The maximum length of an access points RLZ in bytes. | 62 // The maximum length of an access points RLZ in bytes. |
| 60 const size_t kMaxDccLength = 128; | 63 const size_t kMaxDccLength = 128; |
| 61 // The maximum length of a CGI string in bytes. | 64 // The maximum length of a CGI string in bytes. |
| 62 const size_t kMaxCgiLength = 2048; | 65 const size_t kMaxCgiLength = 2048; |
| 63 // The maximum length of a ping response we will parse in bytes. If the response | 66 // The maximum length of a ping response we will parse in bytes. If the response |
| 64 // is bigger, please break it up into separate calls. | 67 // is bigger, please break it up into separate calls. |
| 65 const size_t kMaxPingResponseLength = 0x4000; // 16K | 68 const size_t kMaxPingResponseLength = 0x4000; // 16K |
| 66 | 69 |
| 67 #if defined(RLZ_NETWORK_IMPLEMENTATION_CHROME_NET) | 70 #if defined(RLZ_NETWORK_IMPLEMENTATION_CHROME_NET) |
| 68 // Set the URLRequestContextGetter used by SendFinancialPing(). The IO message | 71 // Set the URLRequestContextGetter used by SendFinancialPing(). The IO message |
| 69 // loop returned by this context will be used for the IO done by | 72 // loop returned by this context will be used for the IO done by |
| 70 // SendFinancialPing(). | 73 // SendFinancialPing(). |
| 71 bool RLZ_LIB_API SetURLRequestContext(net::URLRequestContextGetter* context); | 74 bool RLZ_LIB_API SetURLRequestContext(net::URLRequestContextGetter* context); |
| 72 #endif | 75 #endif |
| 73 | 76 |
| 77 #if defined(OS_CHROMEOS) | |
| 78 // Set that MessageLoopProxy used by RLZ store to run I/O tasks on. | |
|
Roger Tawa OOO till Jul 10th
2012/11/06 20:55:11
that --> the ?
Ivan Korotkov
2012/11/07 10:49:12
Done.
| |
| 79 void RLZ_LIB_API SetIOTaskRunner(base::MessageLoopProxy* io_task_runner); | |
|
Roger Tawa OOO till Jul 10th
2012/11/06 20:55:11
Add a comment that this should be called before an
Ivan Korotkov
2012/11/07 10:49:12
Done.
| |
| 80 #endif | |
| 81 | |
| 74 // RLZ storage functions. | 82 // RLZ storage functions. |
| 75 | 83 |
| 76 // Get all the events reported by this product as a CGI string to append to | 84 // Get all the events reported by this product as a CGI string to append to |
| 77 // the daily ping. | 85 // the daily ping. |
| 78 // Access: HKCU read. | 86 // Access: HKCU read. |
| 79 bool RLZ_LIB_API GetProductEventsAsCgi(Product product, char* unescaped_cgi, | 87 bool RLZ_LIB_API GetProductEventsAsCgi(Product product, char* unescaped_cgi, |
| 80 size_t unescaped_cgi_size); | 88 size_t unescaped_cgi_size); |
| 81 | 89 |
| 82 // Records an RLZ event. | 90 // Records an RLZ event. |
| 83 // Some events can be product-independent (e.g: First search from home page), | 91 // Some events can be product-independent (e.g: First search from home page), |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 | 334 |
| 327 static const std::string& GetBrand(); | 335 static const std::string& GetBrand(); |
| 328 | 336 |
| 329 private: | 337 private: |
| 330 ScopedRlzValueStoreLock* lock_; | 338 ScopedRlzValueStoreLock* lock_; |
| 331 }; | 339 }; |
| 332 | 340 |
| 333 } // namespace rlz_lib | 341 } // namespace rlz_lib |
| 334 | 342 |
| 335 #endif // RLZ_LIB_RLZ_LIB_H_ | 343 #endif // RLZ_LIB_RLZ_LIB_H_ |
| OLD | NEW |