Commit 87886930 authored by Peter Beverloo's avatar Peter Beverloo Committed by Commit Bot

Move Background Fetch registration creation to the Data Manager observer

When a Background Fetch registration is created, a BGFetchJobContoller
is created immediately after committing it to storage even if the job
can't be started just yet -- this should be the scheduler's decision.

This CL is the first step in removing the assumption that each existing
Background Fetch registration is represented by a BGFetchJobController.
Acknowledging creation of the registration is separated from indicating
that a new registration is available, by adding an OnRegistrationCreated
method to the BackgroundFetchDataManagerObserver.

As part of this refactoring, in an effort to avoid passing around unique
pointers to BackgroundFetchRegistration objects, these are now passed by
const& where the receiver makes a copy when necessary. This enabled
reducing knowledge of the protobufs throughout our system, which is a
nice clean-up on its own.

TBR=avi for BUILD.gn

Bug: 850512
Change-Id: I8d3c42a11ab89f7b7c3573a6f9a21e096493b838
Reviewed-on: https://chromium-review.googlesource.com/1149871
Commit-Queue: Peter Beverloo <peter@chromium.org>
Reviewed-by: default avatarMugdha Lakhani <nator@chromium.org>
Reviewed-by: default avatarRayan Kanso <rayankans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577903}
parent 03ac77be
...@@ -444,6 +444,8 @@ jumbo_source_set("browser") { ...@@ -444,6 +444,8 @@ jumbo_source_set("browser") {
"background_fetch/storage/get_initialization_data_task.h", "background_fetch/storage/get_initialization_data_task.h",
"background_fetch/storage/get_metadata_task.cc", "background_fetch/storage/get_metadata_task.cc",
"background_fetch/storage/get_metadata_task.h", "background_fetch/storage/get_metadata_task.h",
"background_fetch/storage/get_registration_task.cc",
"background_fetch/storage/get_registration_task.h",
"background_fetch/storage/get_settled_fetches_task.cc", "background_fetch/storage/get_settled_fetches_task.cc",
"background_fetch/storage/get_settled_fetches_task.h", "background_fetch/storage/get_settled_fetches_task.h",
"background_fetch/storage/image_helpers.cc", "background_fetch/storage/image_helpers.cc",
......
...@@ -73,11 +73,9 @@ void BackgroundFetchContext::DidGetInitializationData( ...@@ -73,11 +73,9 @@ void BackgroundFetchContext::DidGetInitializationData(
} }
for (auto& data : initialization_data) { for (auto& data : initialization_data) {
CreateController(data.registration_id, data.options, data.icon, CreateController(data.registration_id, data.registration, data.options,
data.ui_title, data.num_completed_requests, data.icon, data.ui_title, data.num_completed_requests,
data.num_requests, data.active_fetch_guids, data.num_requests, data.active_fetch_guids);
std::make_unique<BackgroundFetchRegistration>(
std::move(data.registration)));
} }
} }
...@@ -105,7 +103,7 @@ void BackgroundFetchContext::GetDeveloperIdsForServiceWorker( ...@@ -105,7 +103,7 @@ void BackgroundFetchContext::GetDeveloperIdsForServiceWorker(
void BackgroundFetchContext::DidGetRegistration( void BackgroundFetchContext::DidGetRegistration(
blink::mojom::BackgroundFetchService::GetRegistrationCallback callback, blink::mojom::BackgroundFetchService::GetRegistrationCallback callback,
blink::mojom::BackgroundFetchError error, blink::mojom::BackgroundFetchError error,
std::unique_ptr<BackgroundFetchRegistration> registration) { const BackgroundFetchRegistration& registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (error != blink::mojom::BackgroundFetchError::NONE) { if (error != blink::mojom::BackgroundFetchError::NONE) {
...@@ -114,13 +112,15 @@ void BackgroundFetchContext::DidGetRegistration( ...@@ -114,13 +112,15 @@ void BackgroundFetchContext::DidGetRegistration(
return; return;
} }
DCHECK(registration); BackgroundFetchRegistration updated_registration(registration);
// The data manager only has the number of bytes from completed downloads, so // The data manager only has the number of bytes from completed downloads, so
// augment this with the number of downloaded bytes from in-progress jobs. // augment this with the number of downloaded bytes from in-progress jobs.
DCHECK(job_controllers_.count(registration->unique_id)); DCHECK(job_controllers_.count(registration.unique_id));
registration->downloaded += updated_registration.downloaded +=
job_controllers_[registration->unique_id]->GetInProgressDownloadedBytes(); job_controllers_[registration.unique_id]->GetInProgressDownloadedBytes();
std::move(callback).Run(error, *registration.get());
std::move(callback).Run(error, updated_registration);
} }
void BackgroundFetchContext::StartFetch( void BackgroundFetchContext::StartFetch(
...@@ -141,8 +141,7 @@ void BackgroundFetchContext::StartFetch( ...@@ -141,8 +141,7 @@ void BackgroundFetchContext::StartFetch(
data_manager_->CreateRegistration( data_manager_->CreateRegistration(
registration_id, requests, options, icon, registration_id, requests, options, icon,
base::BindOnce(&BackgroundFetchContext::DidCreateRegistration, base::BindOnce(&BackgroundFetchContext::DidCreateRegistration,
weak_factory_.GetWeakPtr(), registration_id, options, icon, weak_factory_.GetWeakPtr(), registration_id));
requests.size()));
} }
void BackgroundFetchContext::GetIconDisplaySize( void BackgroundFetchContext::GetIconDisplaySize(
...@@ -154,35 +153,25 @@ void BackgroundFetchContext::GetIconDisplaySize( ...@@ -154,35 +153,25 @@ void BackgroundFetchContext::GetIconDisplaySize(
void BackgroundFetchContext::DidCreateRegistration( void BackgroundFetchContext::DidCreateRegistration(
const BackgroundFetchRegistrationId& registration_id, const BackgroundFetchRegistrationId& registration_id,
const BackgroundFetchOptions& options,
const SkBitmap& icon,
size_t num_requests,
blink::mojom::BackgroundFetchError error, blink::mojom::BackgroundFetchError error,
std::unique_ptr<BackgroundFetchRegistration> registration) { const BackgroundFetchRegistration& registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
background_fetch::RecordRegistrationCreatedError(error); background_fetch::RecordRegistrationCreatedError(error);
if (error != blink::mojom::BackgroundFetchError::NONE) {
DCHECK(fetch_callbacks_.count(registration_id));
std::move(fetch_callbacks_[registration_id])
.Run(error, base::nullopt /* BackgroundFetchRegistration */);
fetch_callbacks_.erase(registration_id);
return;
}
if (hang_registration_creation_for_testing_) { auto iter = fetch_callbacks_.find(registration_id);
// Hang here, to allow time for testing races. For instance, this helps us
// test the behavior when a service worker gets unregistered before the // The fetch might have been abandoned already if the Service Worker was
// controller can be created. // unregistered or corrupted while registration was in progress.
if (iter == fetch_callbacks_.end())
return; return;
}
DCHECK(registration); if (error == blink::mojom::BackgroundFetchError::NONE)
std::move(iter->second).Run(error, registration);
else
std::move(iter->second).Run(error, base::nullopt /* registration */);
// Create the BackgroundFetchJobController to do the actual fetching. fetch_callbacks_.erase(registration_id);
CreateController(registration_id, options, icon, options.title,
0u /* num_completed_requests */, num_requests,
{} /* outstanding_guids */, std::move(registration));
} }
void BackgroundFetchContext::AddRegistrationObserver( void BackgroundFetchContext::AddRegistrationObserver(
...@@ -250,6 +239,29 @@ void BackgroundFetchContext::AbandonFetches( ...@@ -250,6 +239,29 @@ void BackgroundFetchContext::AbandonFetches(
} }
} }
void BackgroundFetchContext::OnRegistrationCreated(
const BackgroundFetchRegistrationId& registration_id,
const BackgroundFetchRegistration& registration,
const BackgroundFetchOptions& options,
const SkBitmap& icon,
int num_requests) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (hang_registration_creation_for_testing_) {
// Hang here, to allow time for testing races. For instance, this helps us
// test the behavior when a service worker gets unregistered before the
// controller can be created.
return;
}
// TODO(peter): When this moves to the BackgroundFetchScheduler, only create
// a controller when the background fetch can actually be started.
CreateController(registration_id, registration, options, icon, options.title,
0u /* num_completed_requests */, num_requests,
{} /* outstanding_guids */);
}
void BackgroundFetchContext::OnUpdatedUI( void BackgroundFetchContext::OnUpdatedUI(
const BackgroundFetchRegistrationId& registration_id, const BackgroundFetchRegistrationId& registration_id,
const std::string& title) { const std::string& title) {
...@@ -274,18 +286,18 @@ void BackgroundFetchContext::OnStorageWiped() { ...@@ -274,18 +286,18 @@ void BackgroundFetchContext::OnStorageWiped() {
void BackgroundFetchContext::CreateController( void BackgroundFetchContext::CreateController(
const BackgroundFetchRegistrationId& registration_id, const BackgroundFetchRegistrationId& registration_id,
const BackgroundFetchRegistration& registration,
const BackgroundFetchOptions& options, const BackgroundFetchOptions& options,
const SkBitmap& icon, const SkBitmap& icon,
const std::string& ui_title, const std::string& ui_title,
size_t num_completed_requests, size_t num_completed_requests,
size_t num_requests, size_t num_requests,
const std::vector<std::string>& outstanding_guids, const std::vector<std::string>& outstanding_guids) {
std::unique_ptr<BackgroundFetchRegistration> registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
auto controller = std::make_unique<BackgroundFetchJobController>( auto controller = std::make_unique<BackgroundFetchJobController>(
&delegate_proxy_, registration_id, options, icon, &delegate_proxy_, registration_id, options, icon, registration.downloaded,
registration->downloaded, scheduler_.get(), scheduler_.get(),
// Safe because JobControllers are destroyed before RegistrationNotifier. // Safe because JobControllers are destroyed before RegistrationNotifier.
base::BindRepeating(&BackgroundFetchRegistrationNotifier::Notify, base::BindRepeating(&BackgroundFetchRegistrationNotifier::Notify,
base::Unretained(registration_notifier_.get())), base::Unretained(registration_notifier_.get())),
...@@ -297,13 +309,6 @@ void BackgroundFetchContext::CreateController( ...@@ -297,13 +309,6 @@ void BackgroundFetchContext::CreateController(
outstanding_guids, ui_title); outstanding_guids, ui_title);
scheduler_->AddJobController(controller.get()); scheduler_->AddJobController(controller.get());
job_controllers_.emplace(registration_id.unique_id(), std::move(controller)); job_controllers_.emplace(registration_id.unique_id(), std::move(controller));
auto fetch_callback_iter = fetch_callbacks_.find(registration_id);
if (fetch_callback_iter != fetch_callbacks_.end()) {
std::move(fetch_callback_iter->second)
.Run(blink::mojom::BackgroundFetchError::NONE, *registration);
fetch_callbacks_.erase(fetch_callback_iter);
}
} }
void BackgroundFetchContext::Abort( void BackgroundFetchContext::Abort(
......
...@@ -114,6 +114,12 @@ class CONTENT_EXPORT BackgroundFetchContext ...@@ -114,6 +114,12 @@ class CONTENT_EXPORT BackgroundFetchContext
blink::mojom::BackgroundFetchService::UpdateUICallback callback); blink::mojom::BackgroundFetchService::UpdateUICallback callback);
// BackgroundFetchDataManagerObserver implementation. // BackgroundFetchDataManagerObserver implementation.
void OnRegistrationCreated(
const BackgroundFetchRegistrationId& registration_id,
const BackgroundFetchRegistration& registration,
const BackgroundFetchOptions& options,
const SkBitmap& icon,
int num_requests) override;
void OnUpdatedUI(const BackgroundFetchRegistrationId& registration_id, void OnUpdatedUI(const BackgroundFetchRegistrationId& registration_id,
const std::string& title) override; const std::string& title) override;
void OnServiceWorkerDatabaseCorrupted( void OnServiceWorkerDatabaseCorrupted(
...@@ -125,6 +131,8 @@ class CONTENT_EXPORT BackgroundFetchContext ...@@ -125,6 +131,8 @@ class CONTENT_EXPORT BackgroundFetchContext
void OnStorageWiped() override; void OnStorageWiped() override;
private: private:
FRIEND_TEST_ALL_PREFIXES(BackgroundFetchServiceTest,
JobsInitializedOnBrowserRestart);
friend class BackgroundFetchServiceTest; friend class BackgroundFetchServiceTest;
friend class BackgroundFetchJobControllerTest; friend class BackgroundFetchJobControllerTest;
friend class base::DeleteHelper<BackgroundFetchContext>; friend class base::DeleteHelper<BackgroundFetchContext>;
...@@ -138,31 +146,27 @@ class CONTENT_EXPORT BackgroundFetchContext ...@@ -138,31 +146,27 @@ class CONTENT_EXPORT BackgroundFetchContext
// Creates a new Job Controller for the given |registration_id| and |options|, // Creates a new Job Controller for the given |registration_id| and |options|,
// which will start fetching the files that are part of the registration. // which will start fetching the files that are part of the registration.
void CreateController( void CreateController(const BackgroundFetchRegistrationId& registration_id,
const BackgroundFetchRegistrationId& registration_id, const BackgroundFetchRegistration& registration,
const BackgroundFetchOptions& options, const BackgroundFetchOptions& options,
const SkBitmap& icon, const SkBitmap& icon,
const std::string& ui_title, const std::string& ui_title,
size_t num_completed_requests, size_t num_completed_requests,
size_t num_requests, size_t num_requests,
const std::vector<std::string>& outstanding_guids, const std::vector<std::string>& outstanding_guids);
std::unique_ptr<BackgroundFetchRegistration> registration);
// Called when an existing registration has been retrieved from the data // Called when an existing registration has been retrieved from the data
// manager. If the registration does not exist then |registration| is nullptr. // manager. If the registration does not exist then |registration| is nullptr.
void DidGetRegistration( void DidGetRegistration(
blink::mojom::BackgroundFetchService::GetRegistrationCallback callback, blink::mojom::BackgroundFetchService::GetRegistrationCallback callback,
blink::mojom::BackgroundFetchError error, blink::mojom::BackgroundFetchError error,
std::unique_ptr<BackgroundFetchRegistration> registration); const BackgroundFetchRegistration& registration);
// Called when a new registration has been created by the data manager. // Called when a new registration has been created by the data manager.
void DidCreateRegistration( void DidCreateRegistration(
const BackgroundFetchRegistrationId& registration_id, const BackgroundFetchRegistrationId& registration_id,
const BackgroundFetchOptions& options,
const SkBitmap& icon,
size_t num_requests,
blink::mojom::BackgroundFetchError error, blink::mojom::BackgroundFetchError error,
std::unique_ptr<BackgroundFetchRegistration> registration); const BackgroundFetchRegistration& registration);
// Called by a JobController when it finishes processing. Also used to // Called by a JobController when it finishes processing. Also used to
// implement |Abort|. // implement |Abort|.
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "content/browser/background_fetch/storage/delete_registration_task.h" #include "content/browser/background_fetch/storage/delete_registration_task.h"
#include "content/browser/background_fetch/storage/get_developer_ids_task.h" #include "content/browser/background_fetch/storage/get_developer_ids_task.h"
#include "content/browser/background_fetch/storage/get_metadata_task.h" #include "content/browser/background_fetch/storage/get_metadata_task.h"
#include "content/browser/background_fetch/storage/get_registration_task.h"
#include "content/browser/background_fetch/storage/get_settled_fetches_task.h" #include "content/browser/background_fetch/storage/get_settled_fetches_task.h"
#include "content/browser/background_fetch/storage/mark_registration_for_deletion_task.h" #include "content/browser/background_fetch/storage/mark_registration_for_deletion_task.h"
#include "content/browser/background_fetch/storage/mark_request_complete_task.h" #include "content/browser/background_fetch/storage/mark_request_complete_task.h"
...@@ -32,34 +33,6 @@ ...@@ -32,34 +33,6 @@
namespace content { namespace content {
namespace {
// Helper function to convert a BackgroundFetchRegistration proto into a
// BackgroundFetchRegistration struct, and call the appropriate callback.
void GetRegistrationFromMetadata(
BackgroundFetchDataManager::GetRegistrationCallback callback,
blink::mojom::BackgroundFetchError error,
std::unique_ptr<proto::BackgroundFetchMetadata> metadata_proto) {
if (!metadata_proto) {
std::move(callback).Run(error, nullptr);
return;
}
const auto& registration_proto = metadata_proto->registration();
auto registration = std::make_unique<BackgroundFetchRegistration>();
registration->developer_id = registration_proto.developer_id();
registration->unique_id = registration_proto.unique_id();
// TODO(crbug.com/774054): Uploads are not yet supported.
registration->upload_total = registration_proto.upload_total();
registration->uploaded = registration_proto.uploaded();
registration->download_total = registration_proto.download_total();
registration->downloaded = registration_proto.downloaded();
std::move(callback).Run(error, std::move(registration));
}
} // namespace
BackgroundFetchDataManager::BackgroundFetchDataManager( BackgroundFetchDataManager::BackgroundFetchDataManager(
BrowserContext* browser_context, BrowserContext* browser_context,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
...@@ -125,23 +98,8 @@ void BackgroundFetchDataManager::CreateRegistration( ...@@ -125,23 +98,8 @@ void BackgroundFetchDataManager::CreateRegistration(
GetRegistrationCallback callback) { GetRegistrationCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
auto registration_callback =
base::BindOnce(&GetRegistrationFromMetadata, std::move(callback));
AddDatabaseTask(std::make_unique<background_fetch::CreateMetadataTask>( AddDatabaseTask(std::make_unique<background_fetch::CreateMetadataTask>(
this, registration_id, requests, options, icon, this, registration_id, requests, options, icon, std::move(callback)));
std::move(registration_callback)));
}
void BackgroundFetchDataManager::GetMetadata(
int64_t service_worker_registration_id,
const url::Origin& origin,
const std::string& developer_id,
GetMetadataCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
AddDatabaseTask(std::make_unique<background_fetch::GetMetadataTask>(
this, service_worker_registration_id, origin, developer_id,
std::move(callback)));
} }
void BackgroundFetchDataManager::GetRegistration( void BackgroundFetchDataManager::GetRegistration(
...@@ -151,10 +109,9 @@ void BackgroundFetchDataManager::GetRegistration( ...@@ -151,10 +109,9 @@ void BackgroundFetchDataManager::GetRegistration(
GetRegistrationCallback callback) { GetRegistrationCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
auto registration_callback = AddDatabaseTask(std::make_unique<background_fetch::GetRegistrationTask>(
base::BindOnce(&GetRegistrationFromMetadata, std::move(callback)); this, service_worker_registration_id, origin, developer_id,
GetMetadata(service_worker_registration_id, origin, developer_id, std::move(callback)));
std::move(registration_callback));
} }
void BackgroundFetchDataManager::UpdateRegistrationUI( void BackgroundFetchDataManager::UpdateRegistrationUI(
...@@ -174,31 +131,29 @@ void BackgroundFetchDataManager::PopNextRequest( ...@@ -174,31 +131,29 @@ void BackgroundFetchDataManager::PopNextRequest(
auto start_next_request = base::BindOnce( auto start_next_request = base::BindOnce(
&BackgroundFetchDataManager::AddStartNextPendingRequestTask, &BackgroundFetchDataManager::AddStartNextPendingRequestTask,
weak_ptr_factory_.GetWeakPtr(), weak_ptr_factory_.GetWeakPtr(), registration_id, std::move(callback));
registration_id.service_worker_registration_id(), std::move(callback));
// Get the associated metadata, and add a StartNextPendingRequestTask. // Get the associated metadata, and add a StartNextPendingRequestTask.
GetMetadata(registration_id.service_worker_registration_id(), AddDatabaseTask(std::make_unique<background_fetch::GetRegistrationTask>(
registration_id.origin(), registration_id.developer_id(), this, registration_id.service_worker_registration_id(),
std::move(start_next_request)); registration_id.origin(), registration_id.developer_id(),
std::move(start_next_request)));
} }
void BackgroundFetchDataManager::AddStartNextPendingRequestTask( void BackgroundFetchDataManager::AddStartNextPendingRequestTask(
int64_t service_worker_registration_id, const BackgroundFetchRegistrationId& registration_id,
NextRequestCallback callback, NextRequestCallback callback,
blink::mojom::BackgroundFetchError error, blink::mojom::BackgroundFetchError error,
std::unique_ptr<proto::BackgroundFetchMetadata> metadata) { const BackgroundFetchRegistration& registration) {
if (!metadata) { if (error != blink::mojom::BackgroundFetchError::NONE) {
// Stop giving out requests as registration aborted (or otherwise finished). // Stop giving out requests as registration aborted (or otherwise finished).
std::move(callback).Run(nullptr /* request */); std::move(callback).Run(nullptr /* request */);
return; return;
} }
DCHECK_EQ(error, blink::mojom::BackgroundFetchError::NONE);
AddDatabaseTask( AddDatabaseTask(
std::make_unique<background_fetch::StartNextPendingRequestTask>( std::make_unique<background_fetch::StartNextPendingRequestTask>(
this, service_worker_registration_id, std::move(metadata), this, registration_id, registration, std::move(callback)));
std::move(callback)));
} }
void BackgroundFetchDataManager::MarkRequestAsComplete( void BackgroundFetchDataManager::MarkRequestAsComplete(
......
...@@ -66,12 +66,9 @@ class CONTENT_EXPORT BackgroundFetchDataManager ...@@ -66,12 +66,9 @@ class CONTENT_EXPORT BackgroundFetchDataManager
bool /* background_fetch_succeeded */, bool /* background_fetch_succeeded */,
std::vector<BackgroundFetchSettledFetch>, std::vector<BackgroundFetchSettledFetch>,
std::vector<std::unique_ptr<storage::BlobDataHandle>>)>; std::vector<std::unique_ptr<storage::BlobDataHandle>>)>;
using GetMetadataCallback =
base::OnceCallback<void(blink::mojom::BackgroundFetchError,
std::unique_ptr<proto::BackgroundFetchMetadata>)>;
using GetRegistrationCallback = using GetRegistrationCallback =
base::OnceCallback<void(blink::mojom::BackgroundFetchError, base::OnceCallback<void(blink::mojom::BackgroundFetchError,
std::unique_ptr<BackgroundFetchRegistration>)>; const BackgroundFetchRegistration&)>;
using NextRequestCallback = using NextRequestCallback =
base::OnceCallback<void(scoped_refptr<BackgroundFetchRequestInfo>)>; base::OnceCallback<void(scoped_refptr<BackgroundFetchRequestInfo>)>;
using NumRequestsCallback = base::OnceCallback<void(size_t)>; using NumRequestsCallback = base::OnceCallback<void(size_t)>;
...@@ -105,12 +102,6 @@ class CONTENT_EXPORT BackgroundFetchDataManager ...@@ -105,12 +102,6 @@ class CONTENT_EXPORT BackgroundFetchDataManager
const SkBitmap& icon, const SkBitmap& icon,
GetRegistrationCallback callback); GetRegistrationCallback callback);
// Get the BackgroundFetchMetadata.
void GetMetadata(int64_t service_worker_registration_id,
const url::Origin& origin,
const std::string& developer_id,
GetMetadataCallback callback);
// Get the BackgroundFetchRegistration. // Get the BackgroundFetchRegistration.
void GetRegistration(int64_t service_worker_registration_id, void GetRegistration(int64_t service_worker_registration_id,
const url::Origin& origin, const url::Origin& origin,
...@@ -196,10 +187,10 @@ class CONTENT_EXPORT BackgroundFetchDataManager ...@@ -196,10 +187,10 @@ class CONTENT_EXPORT BackgroundFetchDataManager
} }
void AddStartNextPendingRequestTask( void AddStartNextPendingRequestTask(
int64_t service_worker_registration_id, const BackgroundFetchRegistrationId& registration_id,
NextRequestCallback callback, NextRequestCallback callback,
blink::mojom::BackgroundFetchError error, blink::mojom::BackgroundFetchError error,
std::unique_ptr<proto::BackgroundFetchMetadata> metadata); const BackgroundFetchRegistration& registration);
void AddDatabaseTask(std::unique_ptr<background_fetch::DatabaseTask> task); void AddDatabaseTask(std::unique_ptr<background_fetch::DatabaseTask> task);
......
...@@ -5,8 +5,14 @@ ...@@ -5,8 +5,14 @@
#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_OBSERVER_H_ #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_OBSERVER_H_
#define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_OBSERVER_H_ #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_OBSERVER_H_
#include <memory>
class SkBitmap;
namespace content { namespace content {
struct BackgroundFetchOptions;
struct BackgroundFetchRegistration;
class BackgroundFetchRegistrationId; class BackgroundFetchRegistrationId;
// Observer interface for objects that would like to be notified about changes // Observer interface for objects that would like to be notified about changes
...@@ -14,6 +20,14 @@ class BackgroundFetchRegistrationId; ...@@ -14,6 +20,14 @@ class BackgroundFetchRegistrationId;
// will be invoked on the IO thread. // will be invoked on the IO thread.
class BackgroundFetchDataManagerObserver { class BackgroundFetchDataManagerObserver {
public: public:
// Called when the Background Fetch |registration| has been created.
virtual void OnRegistrationCreated(
const BackgroundFetchRegistrationId& registration_id,
const BackgroundFetchRegistration& registration,
const BackgroundFetchOptions& options,
const SkBitmap& icon,
int num_requests) = 0;
// Called when the |title| for the Background Fetch |registration_id| has been // Called when the |title| for the Background Fetch |registration_id| has been
// updated in the data store. // updated in the data store.
virtual void OnUpdatedUI(const BackgroundFetchRegistrationId& registration_id, virtual void OnUpdatedUI(const BackgroundFetchRegistrationId& registration_id,
......
...@@ -290,9 +290,12 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase { ...@@ -290,9 +290,12 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase {
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
} }
protected:
scoped_refptr<BackgroundFetchContext> context_;
private: private:
void DidGetRegistration( void DidGetRegistration(
base::Closure quit_closure, base::OnceClosure quit_closure,
blink::mojom::BackgroundFetchError* out_error, blink::mojom::BackgroundFetchError* out_error,
BackgroundFetchRegistration* out_registration, BackgroundFetchRegistration* out_registration,
blink::mojom::BackgroundFetchError error, blink::mojom::BackgroundFetchError error,
...@@ -305,15 +308,14 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase { ...@@ -305,15 +308,14 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase {
std::move(quit_closure).Run(); std::move(quit_closure).Run();
} }
void DidStartFetch( void DidStartFetch(base::OnceClosure quit_closure,
base::Closure quit_closure, blink::mojom::BackgroundFetchError error,
blink::mojom::BackgroundFetchError error, const BackgroundFetchRegistration& registration) {
std::unique_ptr<BackgroundFetchRegistration> registration) {
ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE); ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
std::move(quit_closure).Run(); std::move(quit_closure).Run();
} }
void DidGetError(base::Closure quit_closure, void DidGetError(base::OnceClosure quit_closure,
blink::mojom::BackgroundFetchError* out_error, blink::mojom::BackgroundFetchError* out_error,
blink::mojom::BackgroundFetchError error) { blink::mojom::BackgroundFetchError error) {
*out_error = error; *out_error = error;
...@@ -321,7 +323,7 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase { ...@@ -321,7 +323,7 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase {
std::move(quit_closure).Run(); std::move(quit_closure).Run();
} }
void DidGetDeveloperIds(base::Closure quit_closure, void DidGetDeveloperIds(base::OnceClosure quit_closure,
blink::mojom::BackgroundFetchError* out_error, blink::mojom::BackgroundFetchError* out_error,
std::vector<std::string>* out_developer_ids, std::vector<std::string>* out_developer_ids,
blink::mojom::BackgroundFetchError error, blink::mojom::BackgroundFetchError error,
...@@ -332,7 +334,6 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase { ...@@ -332,7 +334,6 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase {
std::move(quit_closure).Run(); std::move(quit_closure).Run();
} }
scoped_refptr<BackgroundFetchContext> context_;
std::unique_ptr<BackgroundFetchServiceImpl> service_; std::unique_ptr<BackgroundFetchServiceImpl> service_;
DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceTest); DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceTest);
...@@ -1095,9 +1096,15 @@ TEST_F(BackgroundFetchServiceTest, JobsInitializedOnBrowserRestart) { ...@@ -1095,9 +1096,15 @@ TEST_F(BackgroundFetchServiceTest, JobsInitializedOnBrowserRestart) {
.Build())); .Build()));
BackgroundFetchOptions options; BackgroundFetchOptions options;
// Only register the Fetch. // Only register the Fetch. In order to appropriately simulate a browser
StartFetch(service_worker_registration_id, kExampleDeveloperId, requests, // restart, we do not want the fetch to start yet.
options, SkBitmap()); {
base::AutoReset<bool> hang_registration_creation_for_testing(
&context_->hang_registration_creation_for_testing_, true);
StartFetch(service_worker_registration_id, kExampleDeveloperId, requests,
options, SkBitmap());
}
// Simulate browser restart by re-creating |context_| and |service_|. // Simulate browser restart by re-creating |context_| and |service_|.
SetUp(); SetUp();
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "content/browser/background_fetch/background_fetch_data_manager.h"
#include "content/browser/background_fetch/background_fetch_data_manager_observer.h"
#include "content/browser/background_fetch/storage/database_helpers.h" #include "content/browser/background_fetch/storage/database_helpers.h"
#include "content/browser/background_fetch/storage/image_helpers.h" #include "content/browser/background_fetch/storage/image_helpers.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_context_wrapper.h"
...@@ -191,9 +193,20 @@ void CreateMetadataTask::DidStoreMetadata( ...@@ -191,9 +193,20 @@ void CreateMetadataTask::DidStoreMetadata(
void CreateMetadataTask::FinishWithError( void CreateMetadataTask::FinishWithError(
blink::mojom::BackgroundFetchError error) { blink::mojom::BackgroundFetchError error) {
if (error != blink::mojom::BackgroundFetchError::NONE) BackgroundFetchRegistration registration;
metadata_proto_.reset();
std::move(callback_).Run(error, std::move(metadata_proto_)); if (error == blink::mojom::BackgroundFetchError::NONE) {
DCHECK(metadata_proto_);
registration = ToBackgroundFetchRegistration(*metadata_proto_);
for (auto& observer : data_manager()->observers()) {
observer.OnRegistrationCreated(registration_id_, registration, options_,
icon_, requests_.size());
}
}
std::move(callback_).Run(error, registration);
Finished(); // Destroys |this|. Finished(); // Destroys |this|.
} }
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
namespace content { namespace content {
struct BackgroundFetchRegistration;
namespace background_fetch { namespace background_fetch {
// Creates Background Fetch metadata entries in the database. // Creates Background Fetch metadata entries in the database.
...@@ -24,7 +26,7 @@ class CreateMetadataTask : public DatabaseTask { ...@@ -24,7 +26,7 @@ class CreateMetadataTask : public DatabaseTask {
public: public:
using CreateMetadataCallback = using CreateMetadataCallback =
base::OnceCallback<void(blink::mojom::BackgroundFetchError, base::OnceCallback<void(blink::mojom::BackgroundFetchError,
std::unique_ptr<proto::BackgroundFetchMetadata>)>; const BackgroundFetchRegistration&)>;
CreateMetadataTask(DatabaseTaskHost* host, CreateMetadataTask(DatabaseTaskHost* host,
const BackgroundFetchRegistrationId& registration_id, const BackgroundFetchRegistrationId& registration_id,
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "content/browser/background_fetch/storage/database_helpers.h" #include "content/browser/background_fetch/storage/database_helpers.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "content/browser/background_fetch/background_fetch.pb.h"
namespace content { namespace content {
...@@ -87,6 +88,21 @@ DatabaseStatus ToDatabaseStatus(blink::ServiceWorkerStatusCode status) { ...@@ -87,6 +88,21 @@ DatabaseStatus ToDatabaseStatus(blink::ServiceWorkerStatusCode status) {
return DatabaseStatus::kFailed; return DatabaseStatus::kFailed;
} }
BackgroundFetchRegistration ToBackgroundFetchRegistration(
const proto::BackgroundFetchMetadata& metadata_proto) {
const auto& registration_proto = metadata_proto.registration();
BackgroundFetchRegistration registration;
registration.developer_id = registration_proto.developer_id();
registration.unique_id = registration_proto.unique_id();
registration.upload_total = registration_proto.upload_total();
registration.uploaded = registration_proto.uploaded();
registration.download_total = registration_proto.download_total();
registration.downloaded = registration_proto.downloaded();
return registration;
}
} // namespace background_fetch } // namespace background_fetch
} // namespace content } // namespace content
...@@ -7,11 +7,17 @@ ...@@ -7,11 +7,17 @@
#include <string> #include <string>
#include "content/common/background_fetch/background_fetch_types.h"
#include "content/common/content_export.h"
#include "content/common/service_worker/service_worker_types.h" #include "content/common/service_worker/service_worker_types.h"
#include "third_party/blink/public/common/service_worker/service_worker_status_code.h" #include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
namespace content { namespace content {
namespace proto {
class BackgroundFetchMetadata;
}
namespace background_fetch { namespace background_fetch {
// The database schema is content/browser/background_fetch/storage/README.md. // The database schema is content/browser/background_fetch/storage/README.md.
...@@ -32,7 +38,7 @@ const char kCompletedRequestKeyPrefix[] = "bgfetch_completed_request_"; ...@@ -32,7 +38,7 @@ const char kCompletedRequestKeyPrefix[] = "bgfetch_completed_request_";
// Database Keys. // Database Keys.
std::string ActiveRegistrationUniqueIdKey(const std::string& developer_id); std::string ActiveRegistrationUniqueIdKey(const std::string& developer_id);
std::string RegistrationKey(const std::string& unique_id); CONTENT_EXPORT std::string RegistrationKey(const std::string& unique_id);
std::string UIOptionsKey(const std::string& unique_id); std::string UIOptionsKey(const std::string& unique_id);
...@@ -54,6 +60,10 @@ enum class DatabaseStatus { kOk, kFailed, kNotFound }; ...@@ -54,6 +60,10 @@ enum class DatabaseStatus { kOk, kFailed, kNotFound };
DatabaseStatus ToDatabaseStatus(blink::ServiceWorkerStatusCode status); DatabaseStatus ToDatabaseStatus(blink::ServiceWorkerStatusCode status);
// Converts the |metadata_proto| to a BackgroundFetchRegistration object.
BackgroundFetchRegistration ToBackgroundFetchRegistration(
const proto::BackgroundFetchMetadata& metadata_proto);
} // namespace background_fetch } // namespace background_fetch
} // namespace content } // namespace content
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/background_fetch/storage/get_registration_task.h"
#include "content/browser/background_fetch/background_fetch.pb.h"
#include "content/browser/background_fetch/storage/database_helpers.h"
#include "content/browser/background_fetch/storage/get_metadata_task.h"
namespace content {
namespace background_fetch {
GetRegistrationTask::GetRegistrationTask(DatabaseTaskHost* host,
int64_t service_worker_registration_id,
const url::Origin& origin,
const std::string& developer_id,
GetRegistrationCallback callback)
: DatabaseTask(host),
service_worker_registration_id_(service_worker_registration_id),
origin_(origin),
developer_id_(developer_id),
callback_(std::move(callback)),
weak_factory_(this) {}
GetRegistrationTask::~GetRegistrationTask() = default;
void GetRegistrationTask::Start() {
AddSubTask(std::make_unique<GetMetadataTask>(
this, service_worker_registration_id_, origin_, developer_id_,
base::BindOnce(&GetRegistrationTask::DidGetMetadata,
weak_factory_.GetWeakPtr())));
}
void GetRegistrationTask::DidGetMetadata(
blink::mojom::BackgroundFetchError error,
std::unique_ptr<proto::BackgroundFetchMetadata> metadata_proto) {
metadata_proto_ = std::move(metadata_proto);
FinishWithError(error);
}
void GetRegistrationTask::FinishWithError(
blink::mojom::BackgroundFetchError error) {
BackgroundFetchRegistration registration;
if (error == blink::mojom::BackgroundFetchError::NONE) {
DCHECK(metadata_proto_);
registration = ToBackgroundFetchRegistration(*metadata_proto_);
}
std::move(callback_).Run(error, registration);
Finished(); // Destroys |this|.
}
} // namespace background_fetch
} // namespace content
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_STORAGE_GET_REGISTRATION_TASK_H_
#define CONTENT_BROWSER_BACKGROUND_FETCH_STORAGE_GET_REGISTRATION_TASK_H_
#include <memory>
#include <string>
#include "base/callback_forward.h"
#include "content/browser/background_fetch/storage/database_task.h"
#include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
#include "url/origin.h"
namespace content {
namespace proto {
class BackgroundFetchMetadata;
}
namespace background_fetch {
// Gets an active Background Fetch metadata entry from the database.
class GetRegistrationTask : public DatabaseTask {
public:
using GetRegistrationCallback =
base::OnceCallback<void(blink::mojom::BackgroundFetchError,
const BackgroundFetchRegistration&)>;
GetRegistrationTask(DatabaseTaskHost* host,
int64_t service_worker_registration_id,
const url::Origin& origin,
const std::string& developer_id,
GetRegistrationCallback callback);
~GetRegistrationTask() override;
// DatabaseTask implementation:
void Start() override;
private:
void DidGetMetadata(
blink::mojom::BackgroundFetchError error,
std::unique_ptr<proto::BackgroundFetchMetadata> metadata_proto);
void FinishWithError(blink::mojom::BackgroundFetchError error) override;
int64_t service_worker_registration_id_;
url::Origin origin_;
std::string developer_id_;
GetRegistrationCallback callback_;
std::unique_ptr<proto::BackgroundFetchMetadata> metadata_proto_;
base::WeakPtrFactory<GetRegistrationTask> weak_factory_; // Keep as last.
DISALLOW_COPY_AND_ASSIGN(GetRegistrationTask);
};
} // namespace background_fetch
} // namespace content
#endif // CONTENT_BROWSER_BACKGROUND_FETCH_STORAGE_GET_REGISTRATION_TASK_H_
...@@ -15,15 +15,15 @@ namespace background_fetch { ...@@ -15,15 +15,15 @@ namespace background_fetch {
StartNextPendingRequestTask::StartNextPendingRequestTask( StartNextPendingRequestTask::StartNextPendingRequestTask(
DatabaseTaskHost* host, DatabaseTaskHost* host,
int64_t service_worker_registration_id, const BackgroundFetchRegistrationId& registration_id,
std::unique_ptr<proto::BackgroundFetchMetadata> metadata, const BackgroundFetchRegistration& registration,
NextRequestCallback callback) NextRequestCallback callback)
: DatabaseTask(host), : DatabaseTask(host),
service_worker_registration_id_(service_worker_registration_id), registration_id_(registration_id),
metadata_(std::move(metadata)), registration_(registration),
callback_(std::move(callback)), callback_(std::move(callback)),
weak_factory_(this) { weak_factory_(this) {
DCHECK(metadata_); DCHECK(!registration_id_.is_null());
} }
StartNextPendingRequestTask::~StartNextPendingRequestTask() = default; StartNextPendingRequestTask::~StartNextPendingRequestTask() = default;
...@@ -34,8 +34,8 @@ void StartNextPendingRequestTask::Start() { ...@@ -34,8 +34,8 @@ void StartNextPendingRequestTask::Start() {
void StartNextPendingRequestTask::GetPendingRequests() { void StartNextPendingRequestTask::GetPendingRequests() {
service_worker_context()->GetRegistrationUserDataByKeyPrefix( service_worker_context()->GetRegistrationUserDataByKeyPrefix(
service_worker_registration_id_, registration_id_.service_worker_registration_id(),
PendingRequestKeyPrefix(metadata_->registration().unique_id()), PendingRequestKeyPrefix(registration_.unique_id),
base::BindOnce(&StartNextPendingRequestTask::DidGetPendingRequests, base::BindOnce(&StartNextPendingRequestTask::DidGetPendingRequests,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} }
...@@ -59,7 +59,7 @@ void StartNextPendingRequestTask::DidGetPendingRequests( ...@@ -59,7 +59,7 @@ void StartNextPendingRequestTask::DidGetPendingRequests(
if (!pending_request_.ParseFromString(data.front())) { if (!pending_request_.ParseFromString(data.front())) {
// Service Worker database has been corrupted. Abandon fetches. // Service Worker database has been corrupted. Abandon fetches.
AbandonFetches(service_worker_registration_id_); AbandonFetches(registration_id_.service_worker_registration_id());
FinishWithError(blink::mojom::BackgroundFetchError::STORAGE_ERROR); FinishWithError(blink::mojom::BackgroundFetchError::STORAGE_ERROR);
return; return;
} }
...@@ -67,7 +67,7 @@ void StartNextPendingRequestTask::DidGetPendingRequests( ...@@ -67,7 +67,7 @@ void StartNextPendingRequestTask::DidGetPendingRequests(
// Make sure there isn't already an Active Request. // Make sure there isn't already an Active Request.
// This might happen if the browser is killed in-between writes. // This might happen if the browser is killed in-between writes.
service_worker_context()->GetRegistrationUserData( service_worker_context()->GetRegistrationUserData(
service_worker_registration_id_, registration_id_.service_worker_registration_id(),
{ActiveRequestKey(pending_request_.unique_id(), {ActiveRequestKey(pending_request_.unique_id(),
pending_request_.request_index())}, pending_request_.request_index())},
base::BindOnce(&StartNextPendingRequestTask::DidFindActiveRequest, base::BindOnce(&StartNextPendingRequestTask::DidFindActiveRequest,
...@@ -88,7 +88,7 @@ void StartNextPendingRequestTask::DidFindActiveRequest( ...@@ -88,7 +88,7 @@ void StartNextPendingRequestTask::DidFindActiveRequest(
// We already stored the active request. // We already stored the active request.
if (!active_request_.ParseFromString(data.front())) { if (!active_request_.ParseFromString(data.front())) {
// Service worker database has been corrupted. Abandon fetches. // Service worker database has been corrupted. Abandon fetches.
AbandonFetches(service_worker_registration_id_); AbandonFetches(registration_id_.service_worker_registration_id());
FinishWithError(blink::mojom::BackgroundFetchError::STORAGE_ERROR); FinishWithError(blink::mojom::BackgroundFetchError::STORAGE_ERROR);
return; return;
} }
...@@ -109,7 +109,8 @@ void StartNextPendingRequestTask::CreateAndStoreActiveRequest() { ...@@ -109,7 +109,8 @@ void StartNextPendingRequestTask::CreateAndStoreActiveRequest() {
pending_request_.release_serialized_request()); pending_request_.release_serialized_request());
service_worker_context()->StoreRegistrationUserData( service_worker_context()->StoreRegistrationUserData(
service_worker_registration_id_, GURL(metadata_->origin()), registration_id_.service_worker_registration_id(),
registration_id_.origin().GetURL(),
{{ActiveRequestKey(active_request_.unique_id(), {{ActiveRequestKey(active_request_.unique_id(),
active_request_.request_index()), active_request_.request_index()),
active_request_.SerializeAsString()}}, active_request_.SerializeAsString()}},
...@@ -143,7 +144,7 @@ void StartNextPendingRequestTask::StartDownload() { ...@@ -143,7 +144,7 @@ void StartNextPendingRequestTask::StartDownload() {
// Delete the pending request. // Delete the pending request.
service_worker_context()->ClearRegistrationUserData( service_worker_context()->ClearRegistrationUserData(
service_worker_registration_id_, registration_id_.service_worker_registration_id(),
{PendingRequestKey(pending_request_.unique_id(), {PendingRequestKey(pending_request_.unique_id(),
pending_request_.request_index())}, pending_request_.request_index())},
base::BindOnce(&StartNextPendingRequestTask::DidDeletePendingRequest, base::BindOnce(&StartNextPendingRequestTask::DidDeletePendingRequest,
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "content/browser/background_fetch/background_fetch.pb.h" #include "content/browser/background_fetch/background_fetch.pb.h"
#include "content/browser/background_fetch/background_fetch_request_info.h" #include "content/browser/background_fetch/background_fetch_request_info.h"
#include "content/browser/background_fetch/storage/database_task.h" #include "content/browser/background_fetch/storage/database_task.h"
#include "content/common/background_fetch/background_fetch_types.h"
#include "third_party/blink/public/common/service_worker/service_worker_status_code.h" #include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
namespace content { namespace content {
...@@ -24,8 +25,8 @@ class StartNextPendingRequestTask : public DatabaseTask { ...@@ -24,8 +25,8 @@ class StartNextPendingRequestTask : public DatabaseTask {
StartNextPendingRequestTask( StartNextPendingRequestTask(
DatabaseTaskHost* host, DatabaseTaskHost* host,
int64_t service_worker_registration_id, const BackgroundFetchRegistrationId& registration_id,
std::unique_ptr<proto::BackgroundFetchMetadata> metadata, const BackgroundFetchRegistration& registration,
NextRequestCallback callback); NextRequestCallback callback);
~StartNextPendingRequestTask() override; ~StartNextPendingRequestTask() override;
...@@ -52,8 +53,8 @@ class StartNextPendingRequestTask : public DatabaseTask { ...@@ -52,8 +53,8 @@ class StartNextPendingRequestTask : public DatabaseTask {
void FinishWithError(blink::mojom::BackgroundFetchError error) override; void FinishWithError(blink::mojom::BackgroundFetchError error) override;
int64_t service_worker_registration_id_; BackgroundFetchRegistrationId registration_id_;
std::unique_ptr<proto::BackgroundFetchMetadata> metadata_; BackgroundFetchRegistration registration_;
NextRequestCallback callback_; NextRequestCallback callback_;
// protos don't support move semantics, so these class members will be used // protos don't support move semantics, so these class members will be used
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment