OLD | NEW |
---|---|
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 "components/offline_pages/core/prefetch/prefetch_service_impl.h" | 5 #include "components/offline_pages/core/prefetch/prefetch_service_impl.h" |
6 #include "components/gcm_driver/gcm_driver.h" | |
6 | 7 |
7 namespace offline_pages { | 8 namespace offline_pages { |
9 namespace { | |
10 const char kPrefetchingOfflinePagesAppId[] = | |
11 "com.google.chrome.OfflinePagePrefetch"; | |
12 } | |
13 | |
14 void PrefetchServiceImpl::PrefetchServiceAppHandler::ShutdownHandler() {} | |
15 | |
16 void PrefetchServiceImpl::PrefetchServiceAppHandler::OnStoreReset() {} | |
17 | |
18 void PrefetchServiceImpl::PrefetchServiceAppHandler::OnMessage( | |
19 const std::string& app_id, | |
20 const gcm::IncomingMessage& message) { | |
21 DVLOG(1) << "PrefetchServiceImpl " << __func__ << ":" << message.raw_data; | |
22 } | |
23 | |
24 void PrefetchServiceImpl::PrefetchServiceAppHandler::OnMessagesDeleted( | |
25 const std::string& app_id) { | |
26 NOTIMPLEMENTED(); | |
27 } | |
28 | |
29 void PrefetchServiceImpl::PrefetchServiceAppHandler::OnSendError( | |
30 const std::string& app_id, | |
31 const gcm::GCMClient::SendErrorDetails& send_error_details) { | |
32 // We should never get here, since we are not sending GCM upstream. | |
33 NOTREACHED(); | |
34 } | |
35 | |
36 void PrefetchServiceImpl::PrefetchServiceAppHandler::OnSendAcknowledged( | |
37 const std::string& app_id, | |
38 const std::string& message_id) { | |
39 // We should never get here, since we are not sending GCM upstream. | |
40 NOTREACHED(); | |
41 } | |
8 | 42 |
9 PrefetchServiceImpl::PrefetchServiceImpl() {} | 43 PrefetchServiceImpl::PrefetchServiceImpl() {} |
10 PrefetchServiceImpl::~PrefetchServiceImpl() = default; | 44 PrefetchServiceImpl::~PrefetchServiceImpl() = default; |
11 | 45 |
12 void PrefetchServiceImpl::AddCandidatePrefetchURLs( | 46 void PrefetchServiceImpl::AddCandidatePrefetchURLs( |
13 const std::vector<PrefetchURL>& url_suggestions) { | 47 const std::vector<PrefetchURL>& url_suggestions) { |
14 NOTIMPLEMENTED(); | 48 NOTIMPLEMENTED(); |
15 } | 49 } |
16 void PrefetchServiceImpl::RemoveAllUnprocessedPrefetchURLs( | 50 void PrefetchServiceImpl::RemoveAllUnprocessedPrefetchURLs( |
17 const std::string& name_space) { | 51 const std::string& name_space) { |
18 NOTIMPLEMENTED(); | 52 NOTIMPLEMENTED(); |
19 } | 53 } |
20 | 54 |
21 void PrefetchServiceImpl::RemovePrefetchURLsByClientId( | 55 void PrefetchServiceImpl::RemovePrefetchURLsByClientId( |
22 const ClientId& client_id) { | 56 const ClientId& client_id) { |
23 NOTIMPLEMENTED(); | 57 NOTIMPLEMENTED(); |
24 } | 58 } |
25 | 59 |
26 void PrefetchServiceImpl::BeginBackgroundTask( | 60 void PrefetchServiceImpl::BeginBackgroundTask( |
27 std::unique_ptr<ScopedBackgroundTask> task) { | 61 std::unique_ptr<ScopedBackgroundTask> task) { |
28 NOTIMPLEMENTED(); | 62 NOTIMPLEMENTED(); |
29 } | 63 } |
30 | 64 |
31 void PrefetchServiceImpl::StopBackgroundTask(ScopedBackgroundTask* task) { | 65 void PrefetchServiceImpl::StopBackgroundTask(ScopedBackgroundTask* task) { |
32 NOTIMPLEMENTED(); | 66 NOTIMPLEMENTED(); |
33 } | 67 } |
34 | 68 |
69 void PrefetchServiceImpl::RegisterWithGCMDriver(gcm::GCMDriver* driver) { | |
70 driver->AddAppHandler(kPrefetchingOfflinePagesAppId, &app_handler_); | |
Dmitry Titov
2017/05/11 03:35:20
If you do this in the GCMProfileServiceFactory, yo
| |
71 } | |
72 | |
35 void PrefetchServiceImpl::Shutdown() {} | 73 void PrefetchServiceImpl::Shutdown() {} |
36 | 74 |
37 } // namespace offline_pages | 75 } // namespace offline_pages |
OLD | NEW |