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

Side by Side Diff: content/renderer/background_sync/background_sync_client_impl.cc

Issue 2522553003: Mojo C++ bindings: switch WebKit mojom targets to use STL/WTF types. (Closed)
Patch Set: . Created 4 years 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
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_type_converters.h" 10 #include "content/child/background_sync/background_sync_type_converters.h"
(...skipping 10 matching lines...) Expand all
21 mojo::InterfaceRequest<blink::mojom::BackgroundSyncServiceClient> request) { 21 mojo::InterfaceRequest<blink::mojom::BackgroundSyncServiceClient> request) {
22 mojo::MakeStrongBinding(base::WrapUnique(new BackgroundSyncClientImpl), 22 mojo::MakeStrongBinding(base::WrapUnique(new BackgroundSyncClientImpl),
23 std::move(request)); 23 std::move(request));
24 } 24 }
25 25
26 BackgroundSyncClientImpl::~BackgroundSyncClientImpl() {} 26 BackgroundSyncClientImpl::~BackgroundSyncClientImpl() {}
27 27
28 BackgroundSyncClientImpl::BackgroundSyncClientImpl() {} 28 BackgroundSyncClientImpl::BackgroundSyncClientImpl() {}
29 29
30 void BackgroundSyncClientImpl::Sync( 30 void BackgroundSyncClientImpl::Sync(
31 const mojo::String& tag, 31 const std::string& tag,
32 blink::mojom::BackgroundSyncEventLastChance last_chance, 32 blink::mojom::BackgroundSyncEventLastChance last_chance,
33 const SyncCallback& callback) { 33 const SyncCallback& callback) {
34 DCHECK(!blink::Platform::current()->mainThread()->isCurrentThread()); 34 DCHECK(!blink::Platform::current()->mainThread()->isCurrentThread());
35 35
36 ServiceWorkerContextClient* client = 36 ServiceWorkerContextClient* client =
37 ServiceWorkerContextClient::ThreadSpecificInstance(); 37 ServiceWorkerContextClient::ThreadSpecificInstance();
38 if (!client) { 38 if (!client) {
39 callback.Run(blink::mojom::ServiceWorkerEventStatus::ABORTED, 39 callback.Run(blink::mojom::ServiceWorkerEventStatus::ABORTED,
40 base::Time::Now()); 40 base::Time::Now());
41 return; 41 return;
42 } 42 }
43 43
44 blink::WebServiceWorkerContextProxy::LastChanceOption web_last_chance = 44 blink::WebServiceWorkerContextProxy::LastChanceOption web_last_chance =
45 mojo::ConvertTo<blink::WebServiceWorkerContextProxy::LastChanceOption>( 45 mojo::ConvertTo<blink::WebServiceWorkerContextProxy::LastChanceOption>(
46 last_chance); 46 last_chance);
47 47
48 client->DispatchSyncEvent(tag, web_last_chance, callback); 48 client->DispatchSyncEvent(tag, web_last_chance, callback);
49 } 49 }
50 50
51 } // namespace content 51 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698