| 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 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 137 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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 wrapper()->FindReadyRegistrationForDocument( | 1441 wrapper()->FindReadyRegistrationForDocument( |
| 1442 document_url, | 1442 document_url, |
| 1443 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO2, | 1443 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO2, |
| 1444 this, status, continuation)); | 1444 this, status, continuation)); |
| 1445 } | 1445 } |
| 1446 | 1446 |
| 1447 void FindRegistrationOnIO2( | 1447 void FindRegistrationOnIO2( |
| 1448 ServiceWorkerStatusCode* out_status, | 1448 ServiceWorkerStatusCode* out_status, |
| 1449 const base::Closure& continuation, | 1449 const base::Closure& continuation, |
| 1450 ServiceWorkerStatusCode status, | 1450 ServiceWorkerStatusCode status, |
| 1451 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 1451 scoped_refptr<ServiceWorkerRegistration> registration) { |
| 1452 *out_status = status; | 1452 *out_status = status; |
| 1453 if (!registration.get()) | 1453 if (!registration.get()) |
| 1454 EXPECT_NE(SERVICE_WORKER_OK, status); | 1454 EXPECT_NE(SERVICE_WORKER_OK, status); |
| 1455 continuation.Run(); | 1455 continuation.Run(); |
| 1456 } | 1456 } |
| 1457 }; | 1457 }; |
| 1458 | 1458 |
| 1459 static int CountRenderProcessHosts() { | 1459 static int CountRenderProcessHosts() { |
| 1460 int result = 0; | 1460 int result = 0; |
| 1461 for (RenderProcessHost::iterator iter(RenderProcessHost::AllHostsIterator()); | 1461 for (RenderProcessHost::iterator iter(RenderProcessHost::AllHostsIterator()); |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1911 private: | 1911 private: |
| 1912 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerV8CacheStrategiesAggressiveTest); | 1912 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerV8CacheStrategiesAggressiveTest); |
| 1913 }; | 1913 }; |
| 1914 | 1914 |
| 1915 IN_PROC_BROWSER_TEST_F(ServiceWorkerV8CacheStrategiesAggressiveTest, | 1915 IN_PROC_BROWSER_TEST_F(ServiceWorkerV8CacheStrategiesAggressiveTest, |
| 1916 V8CacheOnCacheStorage) { | 1916 V8CacheOnCacheStorage) { |
| 1917 CheckStrategyIsAggressive(); | 1917 CheckStrategyIsAggressive(); |
| 1918 } | 1918 } |
| 1919 | 1919 |
| 1920 } // namespace content | 1920 } // namespace content |
| OLD | NEW |