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

Unified Diff: chrome/browser/rlz/rlz.h

Issue 11412067: [rlz,cros] RLZ glue for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Always save RLZ enabled flag. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/rlz/rlz.h
diff --git a/chrome/browser/rlz/rlz.h b/chrome/browser/rlz/rlz.h
index 6a1d3c2310ff9dd3a32aaafb31c0753796ca7be8..aa02d497246749953ba1a885f0450534bf19f833 100644
--- a/chrome/browser/rlz/rlz.h
+++ b/chrome/browser/rlz/rlz.h
@@ -15,11 +15,12 @@
#include "base/basictypes.h"
#include "base/memory/singleton.h"
#include "base/string16.h"
-#include "base/threading/thread.h"
+#include "base/threading/sequenced_worker_pool.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "rlz/lib/rlz_lib.h"
+class Profile;
namespace net {
class URLRequestContextGetter;
}
@@ -41,11 +42,9 @@ class RLZTracker : public content::NotificationObserver {
// registers some events when 'first-run' is true.
//
// If the chrome brand is organic (no partners) then the pings don't occur.
- static bool InitRlzDelayed(bool first_run,
- int delay,
- bool is_google_default_search,
- bool is_google_homepage,
- bool is_google_in_startpages);
+ static bool InitRlzFromProfileDelayed(Profile* profile,
+ bool first_run,
+ int delay);
// Records an RLZ event. Some events can be access point independent.
// Returns false it the event could not be recorded. Requires write access
@@ -82,6 +81,13 @@ class RLZTracker : public content::NotificationObserver {
RLZTracker();
virtual ~RLZTracker();
+ // Called by InitRlzFromProfileDelayed with values taken from |profile|.
+ static bool InitRlzDelayed(bool first_run,
+ int delay,
+ bool is_google_default_search,
+ bool is_google_homepage,
+ bool is_google_in_startpages);
+
// Performs initialization of RLZ tracker that is purposefully delayed so
// that it does not interfere with chrome startup time.
virtual void DelayedInit();
@@ -113,10 +119,6 @@ class RLZTracker : public content::NotificationObserver {
bool google_default_homepage,
bool is_google_in_startpages);
- // Initializes task runners for tasks that access RlzValueStore and perform
- // disk I/O.
- virtual bool InitWorkers();
-
// Implementation called from RecordProductEvent() static method.
bool RecordProductEventImpl(rlz_lib::Product product,
rlz_lib::AccessPoint point,
@@ -169,12 +171,9 @@ class RLZTracker : public content::NotificationObserver {
bool is_google_homepage_;
bool is_google_in_startpages_;
- // Dedicated RLZ thread for accessing RlzValueStore and doing I/O.
- base::Thread rlz_thread_;
-
- // Sequenced task runner used to post blocking tasks that access
- // RlzValueStore.
- base::SequencedTaskRunner* blocking_task_runner_;
+ // Unique sequence token so that tasks posted by RLZTracker are executed
+ // sequentially in the blocking pool.
+ base::SequencedWorkerPool::SequenceToken worker_pool_token_;
// URLRequestContextGetter used by RLZ library.
net::URLRequestContextGetter* url_request_context_;
@@ -193,6 +192,10 @@ class RLZTracker : public content::NotificationObserver {
bool omnibox_used_;
bool homepage_used_;
+ // Main and (optionally) reactivation brand codes, assigned on UI thread.
+ std::string brand_;
+ std::string reactivation_brand_;
+
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(RLZTracker);

Powered by Google App Engine
This is Rietveld 408576698