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

Side by Side Diff: content/browser/appcache/appcache_service_impl.cc

Issue 1170623003: Revert "content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
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 "content/browser/appcache/appcache_service_impl.h" 5 #include "content/browser/appcache/appcache_service_impl.h"
6 6
7 #include <functional> 7 #include <functional>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/location.h"
12 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop/message_loop.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/stl_util.h" 14 #include "base/stl_util.h"
15 #include "base/thread_task_runner_handle.h"
16 #include "content/browser/appcache/appcache.h" 15 #include "content/browser/appcache/appcache.h"
17 #include "content/browser/appcache/appcache_backend_impl.h" 16 #include "content/browser/appcache/appcache_backend_impl.h"
18 #include "content/browser/appcache/appcache_entry.h" 17 #include "content/browser/appcache/appcache_entry.h"
19 #include "content/browser/appcache/appcache_executable_handler.h" 18 #include "content/browser/appcache/appcache_executable_handler.h"
20 #include "content/browser/appcache/appcache_histograms.h" 19 #include "content/browser/appcache/appcache_histograms.h"
21 #include "content/browser/appcache/appcache_policy.h" 20 #include "content/browser/appcache/appcache_policy.h"
22 #include "content/browser/appcache/appcache_quota_client.h" 21 #include "content/browser/appcache/appcache_quota_client.h"
23 #include "content/browser/appcache/appcache_response.h" 22 #include "content/browser/appcache/appcache_response.h"
24 #include "content/browser/appcache/appcache_service_impl.h" 23 #include "content/browser/appcache/appcache_service_impl.h"
25 #include "content/browser/appcache/appcache_storage_impl.h" 24 #include "content/browser/appcache/appcache_storage_impl.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 service_->pending_helpers_.erase(this); 56 service_->pending_helpers_.erase(this);
58 } 57 }
59 58
60 virtual void Start() = 0; 59 virtual void Start() = 0;
61 virtual void Cancel(); 60 virtual void Cancel();
62 61
63 protected: 62 protected:
64 void CallCallback(int rv) { 63 void CallCallback(int rv) {
65 if (!callback_.is_null()) { 64 if (!callback_.is_null()) {
66 // Defer to guarantee async completion. 65 // Defer to guarantee async completion.
67 base::ThreadTaskRunnerHandle::Get()->PostTask( 66 base::MessageLoop::current()->PostTask(
68 FROM_HERE, base::Bind(&DeferredCallback, callback_, rv)); 67 FROM_HERE, base::Bind(&DeferredCallback, callback_, rv));
69 } 68 }
70 callback_.Reset(); 69 callback_.Reset();
71 } 70 }
72 71
73 AppCacheServiceImpl* service_; 72 AppCacheServiceImpl* service_;
74 net::CompletionCallback callback_; 73 net::CompletionCallback callback_;
75 }; 74 };
76 75
77 void AppCacheServiceImpl::AsyncHelper::Cancel() { 76 void AppCacheServiceImpl::AsyncHelper::Cancel() {
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 backends_.insert( 571 backends_.insert(
573 BackendMap::value_type(backend_impl->process_id(), backend_impl)); 572 BackendMap::value_type(backend_impl->process_id(), backend_impl));
574 } 573 }
575 574
576 void AppCacheServiceImpl::UnregisterBackend( 575 void AppCacheServiceImpl::UnregisterBackend(
577 AppCacheBackendImpl* backend_impl) { 576 AppCacheBackendImpl* backend_impl) {
578 backends_.erase(backend_impl->process_id()); 577 backends_.erase(backend_impl->process_id());
579 } 578 }
580 579
581 } // namespace content 580 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_response_unittest.cc ('k') | content/browser/appcache/appcache_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698