| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer/background_sync/background_sync_client_impl.h" | 5 #include "content/renderer/background_sync/background_sync_client_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/child/background_sync/background_sync_provider.h" | 10 #include "content/child/background_sync/background_sync_provider.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void BackgroundSyncClientImpl::Sync( | 33 void BackgroundSyncClientImpl::Sync( |
| 34 const mojo::String& tag, | 34 const mojo::String& tag, |
| 35 blink::mojom::BackgroundSyncEventLastChance last_chance, | 35 blink::mojom::BackgroundSyncEventLastChance last_chance, |
| 36 const SyncCallback& callback) { | 36 const SyncCallback& callback) { |
| 37 DCHECK(!blink::Platform::current()->mainThread()->isCurrentThread()); | 37 DCHECK(!blink::Platform::current()->mainThread()->isCurrentThread()); |
| 38 | 38 |
| 39 ServiceWorkerContextClient* client = | 39 ServiceWorkerContextClient* client = |
| 40 ServiceWorkerContextClient::ThreadSpecificInstance(); | 40 ServiceWorkerContextClient::ThreadSpecificInstance(); |
| 41 if (!client) { | 41 if (!client) { |
| 42 callback.Run(blink::mojom::ServiceWorkerEventStatus::ABORTED, | 42 callback.Run(blink::mojom::ServiceWorkerEventStatus::ABORTED, |
| 43 base::Time::Now().ToDoubleT()); | 43 base::Time::Now()); |
| 44 return; | 44 return; |
| 45 } | 45 } |
| 46 | 46 |
| 47 blink::WebServiceWorkerContextProxy::LastChanceOption web_last_chance = | 47 blink::WebServiceWorkerContextProxy::LastChanceOption web_last_chance = |
| 48 mojo::ConvertTo<blink::WebServiceWorkerContextProxy::LastChanceOption>( | 48 mojo::ConvertTo<blink::WebServiceWorkerContextProxy::LastChanceOption>( |
| 49 last_chance); | 49 last_chance); |
| 50 | 50 |
| 51 client->DispatchSyncEvent(tag, web_last_chance, callback); | 51 client->DispatchSyncEvent(tag, web_last_chance, callback); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace content | 54 } // namespace content |
| OLD | NEW |