Chromium Code Reviews| OLD | NEW |
|---|---|
| (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.origin(), fetch_request.tag()}; | |
|
Peter Beverloo
2017/02/13 18:35:05
nit: I think you can drop the " = " and call the c
harkness
2017/02/14 13:52:46
Done.
| |
| 24 if (fetch_map_.find(id) != fetch_map_.end()) { | |
| 25 DLOG(ERROR) << "Origin " << fetch_request.origin() | |
| 26 << " has already created a fetch request with tag " | |
| 27 << fetch_request.tag(); | |
| 28 // TODO(harkness) Figure out how to return errors like this. | |
| 29 return; | |
| 30 } | |
| 31 fetch_map_[id] = fetch_request; | |
| 32 } | |
| 33 | |
| 34 } // namespace content | |
| OLD | NEW |