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

Unified Diff: content/browser/appcache/appcache_update_job.cc

Issue 949293002: Implement a poor man's PostAfterStartupTask() function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/appcache/appcache_update_job.cc
diff --git a/content/browser/appcache/appcache_update_job.cc b/content/browser/appcache/appcache_update_job.cc
index 4848c9a5f15019ae07ff5a5c0dc7d26e7239e3b0..a31f3e60586e4dc9fcb97d83368b95cda0de7e33 100644
--- a/content/browser/appcache/appcache_update_job.cc
+++ b/content/browser/appcache/appcache_update_job.cc
@@ -13,6 +13,7 @@
#include "base/strings/stringprintf.h"
#include "content/browser/appcache/appcache_group.h"
#include "content/browser/appcache/appcache_histograms.h"
+#include "content/public/browser/browser_thread.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -371,7 +372,8 @@ AppCacheUpdateJob::AppCacheUpdateJob(AppCacheServiceImpl* service,
manifest_fetcher_(NULL),
manifest_has_valid_mime_type_(false),
stored_state_(UNSTORED),
- storage_(service->storage()) {
+ storage_(service->storage()),
+ weak_factory_(this) {
service_->AddObserver(this);
}
@@ -451,7 +453,12 @@ void AppCacheUpdateJob::StartUpdate(AppCacheHost* host,
is_new_pending_master_entry);
}
- FetchManifest(true);
+ BrowserThread::PostAfterStartupTask(
+ FROM_HERE,
+ base::MessageLoop::current()->task_runner(),
+ base::Bind(&AppCacheUpdateJob::FetchManifest,
+ weak_factory_.GetWeakPtr(),
+ true));
}
AppCacheResponseWriter* AppCacheUpdateJob::CreateResponseWriter() {

Powered by Google App Engine
This is Rietveld 408576698