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

Side by Side Diff: chrome/browser/feedback/feedback_profile_observer.cc

Issue 186903003: Merge 254314 "Fix race condition in uploading feedback reports." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: Created 6 years, 9 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 | chrome/browser/feedback/feedback_report.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/feedback/feedback_profile_observer.h" 5 #include "chrome/browser/feedback/feedback_profile_observer.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/feedback/feedback_report.h" 9 #include "chrome/browser/feedback/feedback_report.h"
10 #include "chrome/browser/feedback/feedback_uploader.h" 10 #include "chrome/browser/feedback/feedback_uploader.h"
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 void FeedbackProfileObserver::Observe( 38 void FeedbackProfileObserver::Observe(
39 int type, 39 int type,
40 const content::NotificationSource& source, 40 const content::NotificationSource& source,
41 const content::NotificationDetails& details) { 41 const content::NotificationDetails& details) {
42 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 42 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
43 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CREATED, type); 43 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CREATED, type);
44 44
45 Profile* profile = content::Source<Profile>(source).ptr(); 45 Profile* profile = content::Source<Profile>(source).ptr();
46 if (!profile->IsOffTheRecord()) 46 if (profile && !profile->IsOffTheRecord())
47 QueueUnsentReports(profile); 47 QueueUnsentReports(profile);
48 } 48 }
49 49
50 void FeedbackProfileObserver::QueueUnsentReports( 50 void FeedbackProfileObserver::QueueUnsentReports(
51 content::BrowserContext* context) { 51 content::BrowserContext* context) {
52 feedback::FeedbackUploader* uploader = 52 feedback::FeedbackUploader* uploader =
53 feedback::FeedbackUploaderFactory::GetForBrowserContext(context); 53 feedback::FeedbackUploaderFactory::GetForBrowserContext(context);
54 BrowserThread::PostBlockingPoolTask(FROM_HERE, 54 BrowserThread::PostBlockingPoolTask(FROM_HERE,
55 base::Bind( 55 base::Bind(&FeedbackReport::LoadReportsAndQueue,
56 &FeedbackReport::LoadReportsAndQueue, context, base::Bind( 56 context->GetPath(),
57 &FeedbackUploader::QueueReport, uploader->AsWeakPtr()))); 57 base::Bind(&FeedbackUploader::QueueReport,
58 uploader->AsWeakPtr())));
58 } 59 }
59 60
60 } // namespace feedback 61 } // namespace feedback
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/feedback/feedback_report.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698