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

Side by Side Diff: content/browser/background_fetch/background_fetch_service_impl.cc

Issue 2762663002: BackgroundFetchRegistration.abort() should return a Promise. (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/background_fetch/background_fetch_service_impl.h" 5 #include "content/browser/background_fetch/background_fetch_service_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "content/browser/background_fetch/background_fetch_context.h" 9 #include "content/browser/background_fetch/background_fetch_context.h"
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" 10 #include "content/browser/service_worker/service_worker_context_wrapper.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 const UpdateUICallback& callback) { 43 const UpdateUICallback& callback) {
44 DCHECK_CURRENTLY_ON(BrowserThread::IO); 44 DCHECK_CURRENTLY_ON(BrowserThread::IO);
45 45
46 // TODO(peter): Get the BackgroundFetchJobController for the 46 // TODO(peter): Get the BackgroundFetchJobController for the
47 // {service_worker_registration_id, tag} pair and call UpdateUI() on it. 47 // {service_worker_registration_id, tag} pair and call UpdateUI() on it.
48 48
49 callback.Run(blink::mojom::BackgroundFetchError::NONE); 49 callback.Run(blink::mojom::BackgroundFetchError::NONE);
50 } 50 }
51 51
52 void BackgroundFetchServiceImpl::Abort(int64_t service_worker_registration_id, 52 void BackgroundFetchServiceImpl::Abort(int64_t service_worker_registration_id,
53 const std::string& tag) { 53 const std::string& tag,
54 const AbortCallback& callback) {
54 DCHECK_CURRENTLY_ON(BrowserThread::IO); 55 DCHECK_CURRENTLY_ON(BrowserThread::IO);
55 56
56 // TODO(peter): Get the BackgroundFetchJobController for the 57 // TODO(peter): Get the BackgroundFetchJobController for the
57 // {service_worker_registration_id, tag} pair and call Abort() on it. 58 // {service_worker_registration_id, tag} pair and call Abort() on it.
59
60 callback.Run(blink::mojom::BackgroundFetchError::NONE);
58 } 61 }
59 62
60 void BackgroundFetchServiceImpl::GetRegistration( 63 void BackgroundFetchServiceImpl::GetRegistration(
61 int64_t service_worker_registration_id, 64 int64_t service_worker_registration_id,
62 const std::string& tag, 65 const std::string& tag,
63 const GetRegistrationCallback& callback) { 66 const GetRegistrationCallback& callback) {
64 DCHECK_CURRENTLY_ON(BrowserThread::IO); 67 DCHECK_CURRENTLY_ON(BrowserThread::IO);
65 68
66 // TODO(peter): Get the registration for {service_worker_registration_id, tag} 69 // TODO(peter): Get the registration for {service_worker_registration_id, tag}
67 // and construct a BackgroundFetchRegistrationPtr for it. 70 // and construct a BackgroundFetchRegistrationPtr for it.
68 71
69 callback.Run(blink::mojom::BackgroundFetchError::NONE, 72 callback.Run(blink::mojom::BackgroundFetchError::NONE,
70 nullptr /* registration */); 73 nullptr /* registration */);
71 } 74 }
72 75
73 void BackgroundFetchServiceImpl::GetTags(int64_t service_worker_registration_id, 76 void BackgroundFetchServiceImpl::GetTags(int64_t service_worker_registration_id,
74 const GetTagsCallback& callback) { 77 const GetTagsCallback& callback) {
75 DCHECK_CURRENTLY_ON(BrowserThread::IO); 78 DCHECK_CURRENTLY_ON(BrowserThread::IO);
76 79
77 // TODO(peter): Get the list of active Background Fetches associated with 80 // TODO(peter): Get the list of active Background Fetches associated with
78 // service_worker_registration_id and share their tags. 81 // service_worker_registration_id and share their tags.
79 82
80 callback.Run(blink::mojom::BackgroundFetchError::NONE, 83 callback.Run(blink::mojom::BackgroundFetchError::NONE,
81 std::vector<std::string>()); 84 std::vector<std::string>());
82 } 85 }
83 86
84 } // namespace content 87 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698