| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 base::Closure CreatePrepareReceiver(bool* is_prepared) { | 128 base::Closure CreatePrepareReceiver(bool* is_prepared) { |
| 129 return base::Bind(&ReceivePrepareResult, is_prepared); | 129 return base::Bind(&ReceivePrepareResult, is_prepared); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void ReceiveFindRegistrationStatus( | 132 void ReceiveFindRegistrationStatus( |
| 133 BrowserThread::ID run_quit_thread, | 133 BrowserThread::ID run_quit_thread, |
| 134 const base::Closure& quit, | 134 const base::Closure& quit, |
| 135 ServiceWorkerStatusCode* out_status, | 135 ServiceWorkerStatusCode* out_status, |
| 136 ServiceWorkerStatusCode status, | 136 ServiceWorkerStatusCode status, |
| 137 scoped_refptr<ServiceWorkerRegistration> registration) { | 137 const scoped_refptr<ServiceWorkerRegistration>& registration) { |
| 138 *out_status = status; | 138 *out_status = status; |
| 139 if (!quit.is_null()) | 139 if (!quit.is_null()) |
| 140 BrowserThread::PostTask(run_quit_thread, FROM_HERE, quit); | 140 BrowserThread::PostTask(run_quit_thread, FROM_HERE, quit); |
| 141 } | 141 } |
| 142 | 142 |
| 143 ServiceWorkerStorage::FindRegistrationCallback CreateFindRegistrationReceiver( | 143 ServiceWorkerStorage::FindRegistrationCallback CreateFindRegistrationReceiver( |
| 144 BrowserThread::ID run_quit_thread, | 144 BrowserThread::ID run_quit_thread, |
| 145 const base::Closure& quit, | 145 const base::Closure& quit, |
| 146 ServiceWorkerStatusCode* status) { | 146 ServiceWorkerStatusCode* status) { |
| 147 return base::Bind(&ReceiveFindRegistrationStatus, run_quit_thread, quit, | 147 return base::Bind(&ReceiveFindRegistrationStatus, run_quit_thread, quit, |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 wrapper()->FindReadyRegistrationForDocument( | 1419 wrapper()->FindReadyRegistrationForDocument( |
| 1420 document_url, | 1420 document_url, |
| 1421 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO2, | 1421 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO2, |
| 1422 this, status, continuation)); | 1422 this, status, continuation)); |
| 1423 } | 1423 } |
| 1424 | 1424 |
| 1425 void FindRegistrationOnIO2( | 1425 void FindRegistrationOnIO2( |
| 1426 ServiceWorkerStatusCode* out_status, | 1426 ServiceWorkerStatusCode* out_status, |
| 1427 const base::Closure& continuation, | 1427 const base::Closure& continuation, |
| 1428 ServiceWorkerStatusCode status, | 1428 ServiceWorkerStatusCode status, |
| 1429 scoped_refptr<ServiceWorkerRegistration> registration) { | 1429 const scoped_refptr<ServiceWorkerRegistration>& registration) { |
| 1430 *out_status = status; | 1430 *out_status = status; |
| 1431 if (!registration.get()) | 1431 if (!registration.get()) |
| 1432 EXPECT_NE(SERVICE_WORKER_OK, status); | 1432 EXPECT_NE(SERVICE_WORKER_OK, status); |
| 1433 continuation.Run(); | 1433 continuation.Run(); |
| 1434 } | 1434 } |
| 1435 }; | 1435 }; |
| 1436 | 1436 |
| 1437 static int CountRenderProcessHosts() { | 1437 static int CountRenderProcessHosts() { |
| 1438 int result = 0; | 1438 int result = 0; |
| 1439 for (RenderProcessHost::iterator iter(RenderProcessHost::AllHostsIterator()); | 1439 for (RenderProcessHost::iterator iter(RenderProcessHost::AllHostsIterator()); |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 private: | 1889 private: |
| 1890 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerV8CacheStrategiesAggressiveTest); | 1890 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerV8CacheStrategiesAggressiveTest); |
| 1891 }; | 1891 }; |
| 1892 | 1892 |
| 1893 IN_PROC_BROWSER_TEST_F(ServiceWorkerV8CacheStrategiesAggressiveTest, | 1893 IN_PROC_BROWSER_TEST_F(ServiceWorkerV8CacheStrategiesAggressiveTest, |
| 1894 V8CacheOnCacheStorage) { | 1894 V8CacheOnCacheStorage) { |
| 1895 CheckStrategyIsAggressive(); | 1895 CheckStrategyIsAggressive(); |
| 1896 } | 1896 } |
| 1897 | 1897 |
| 1898 } // namespace content | 1898 } // namespace content |
| OLD | NEW |