| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 registration_->SetActiveVersion(version_.get()); | 643 registration_->SetActiveVersion(version_.get()); |
| 644 version_->DispatchActivateEvent( | 644 version_->DispatchActivateEvent( |
| 645 CreateReceiver(BrowserThread::UI, done, result)); | 645 CreateReceiver(BrowserThread::UI, done, result)); |
| 646 } | 646 } |
| 647 | 647 |
| 648 void FetchOnIOThread(const base::Closure& done, | 648 void FetchOnIOThread(const base::Closure& done, |
| 649 bool* prepare_result, | 649 bool* prepare_result, |
| 650 FetchResult* result) { | 650 FetchResult* result) { |
| 651 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 651 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 652 ServiceWorkerFetchRequest request( | 652 ServiceWorkerFetchRequest request( |
| 653 embedded_test_server()->GetURL("/service_worker/empty.html"), | 653 embedded_test_server()->GetURL("/service_worker/empty.html"), "GET", |
| 654 "GET", | 654 ServiceWorkerHeaderMap(), Referrer(), false, ServiceWorkerClientInfo()); |
| 655 ServiceWorkerHeaderMap(), | |
| 656 Referrer(), | |
| 657 false); | |
| 658 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); | 655 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); |
| 659 version_->DispatchFetchEvent( | 656 version_->DispatchFetchEvent( |
| 660 request, | 657 request, |
| 661 CreatePrepareReceiver(prepare_result), | 658 CreatePrepareReceiver(prepare_result), |
| 662 CreateResponseReceiver( | 659 CreateResponseReceiver( |
| 663 BrowserThread::UI, done, blob_context_.get(), result)); | 660 BrowserThread::UI, done, blob_context_.get(), result)); |
| 664 } | 661 } |
| 665 | 662 |
| 666 void StopOnIOThread(const base::Closure& done, | 663 void StopOnIOThread(const base::Closure& done, |
| 667 ServiceWorkerStatusCode* result) { | 664 ServiceWorkerStatusCode* result) { |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 ASSERT_EQ(SERVICE_WORKER_OK, status); | 1365 ASSERT_EQ(SERVICE_WORKER_OK, status); |
| 1369 // Stop the worker. | 1366 // Stop the worker. |
| 1370 StopWorker(SERVICE_WORKER_OK); | 1367 StopWorker(SERVICE_WORKER_OK); |
| 1371 // Restart the worker. | 1368 // Restart the worker. |
| 1372 StartWorker(SERVICE_WORKER_OK); | 1369 StartWorker(SERVICE_WORKER_OK); |
| 1373 // Stop the worker. | 1370 // Stop the worker. |
| 1374 StopWorker(SERVICE_WORKER_OK); | 1371 StopWorker(SERVICE_WORKER_OK); |
| 1375 } | 1372 } |
| 1376 | 1373 |
| 1377 } // namespace content | 1374 } // namespace content |
| OLD | NEW |