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

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

Issue 2678273003: Initial framework setup and skeleton for BackgroundFetchContext (Closed)
Patch Set: Removed unused browser_context_ stored member. Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/background_fetch/background_fetch_data_manager.h"
6
7 #include "content/browser/background_fetch/background_fetch_context.h"
8 #include "content/browser/background_fetch/fetch_request.h"
9
10 namespace content {
11
12 BackgroundFetchDataManager::BackgroundFetchDataManager(
13 BackgroundFetchContext* background_fetch_context)
14 : background_fetch_context_(background_fetch_context) {
15 DCHECK(background_fetch_context_);
16 // TODO(harkness) Read from persistent storage and recreate requests.
17 }
18
19 BackgroundFetchDataManager::~BackgroundFetchDataManager() {}
20
21 void BackgroundFetchDataManager::CreateRequest(
22 const FetchRequest& fetch_request) {
23 FetchIdentifier id(fetch_request.service_worker_registration_id(),
24 fetch_request.tag());
25 if (fetch_map_.find(id) != fetch_map_.end()) {
26 DLOG(ERROR) << "Origin " << fetch_request.origin()
27 << " has already created a fetch request with tag "
28 << fetch_request.tag();
29 // TODO(harkness) Figure out how to return errors like this.
30 return;
31 }
32 fetch_map_[id] = fetch_request;
33 }
34
35 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698