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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void OneShotPendingDidGetSWRegistration( | 78 void OneShotPendingDidGetSWRegistration( |
79 const scoped_refptr<BackgroundSyncContext> sync_context, | 79 const scoped_refptr<BackgroundSyncContext> sync_context, |
80 const std::string& tag, | 80 const std::string& tag, |
81 const base::Callback<void(bool)>& callback, | 81 const base::Callback<void(bool)>& callback, |
82 ServiceWorkerStatusCode status, | 82 ServiceWorkerStatusCode status, |
83 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 83 const scoped_refptr<ServiceWorkerRegistration>& registration) { |
84 ASSERT_EQ(SERVICE_WORKER_OK, status); | 84 ASSERT_EQ(SERVICE_WORKER_OK, status); |
85 int64_t service_worker_id = registration->id(); | 85 int64_t service_worker_id = registration->id(); |
86 BackgroundSyncManager* sync_manager = sync_context->background_sync_manager(); | 86 BackgroundSyncManager* sync_manager = sync_context->background_sync_manager(); |
87 sync_manager->GetRegistration( | 87 sync_manager->GetRegistration( |
88 service_worker_id, tag, SYNC_ONE_SHOT, | 88 service_worker_id, tag, |
89 base::Bind(&OneShotPendingDidGetSyncRegistration, callback)); | 89 base::Bind(&OneShotPendingDidGetSyncRegistration, callback)); |
90 } | 90 } |
91 | 91 |
92 void OneShotPendingOnIOThread( | 92 void OneShotPendingOnIOThread( |
93 const scoped_refptr<BackgroundSyncContext> sync_context, | 93 const scoped_refptr<BackgroundSyncContext> sync_context, |
94 const scoped_refptr<ServiceWorkerContextWrapper> sw_context, | 94 const scoped_refptr<ServiceWorkerContextWrapper> sw_context, |
95 const std::string& tag, | 95 const std::string& tag, |
96 const GURL& url, | 96 const GURL& url, |
97 const base::Callback<void(bool)>& callback) { | 97 const base::Callback<void(bool)>& callback) { |
98 sw_context->FindReadyRegistrationForDocument( | 98 sw_context->FindReadyRegistrationForDocument( |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 GURL url = alt_server.GetURL(kRegisterSyncURL); | 657 GURL url = alt_server.GetURL(kRegisterSyncURL); |
658 EXPECT_TRUE( | 658 EXPECT_TRUE( |
659 RunScript(BuildScriptString("registerOneShotFromCrossOriginServiceWorker", | 659 RunScript(BuildScriptString("registerOneShotFromCrossOriginServiceWorker", |
660 url.spec()), | 660 url.spec()), |
661 &script_result)); | 661 &script_result)); |
662 EXPECT_EQ(BuildExpectedResult("worker", "failed to register sync"), | 662 EXPECT_EQ(BuildExpectedResult("worker", "failed to register sync"), |
663 script_result); | 663 script_result); |
664 } | 664 } |
665 | 665 |
666 } // namespace content | 666 } // namespace content |
OLD | NEW |