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

Side by Side Diff: content/browser/service_worker/service_worker_browsertest.cc

Issue 2034663002: ServiceWorker: Keep the worker alive until FetchEvent.waitUntil settles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months 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 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 base::Bind(&self::DispatchInstallEventOnIOThread, this, done, result), 648 base::Bind(&self::DispatchInstallEventOnIOThread, this, done, result),
649 CreateReceiver(BrowserThread::UI, done, result)); 649 CreateReceiver(BrowserThread::UI, done, result));
650 } 650 }
651 651
652 void DispatchInstallEventOnIOThread(const base::Closure& done, 652 void DispatchInstallEventOnIOThread(const base::Closure& done,
653 ServiceWorkerStatusCode* result) { 653 ServiceWorkerStatusCode* result) {
654 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 654 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
655 int request_id = 655 int request_id =
656 version_->StartRequest(ServiceWorkerMetrics::EventType::INSTALL, 656 version_->StartRequest(ServiceWorkerMetrics::EventType::INSTALL,
657 CreateReceiver(BrowserThread::UI, done, result)); 657 CreateReceiver(BrowserThread::UI, done, result));
658 version_->DispatchEvent<ServiceWorkerHostMsg_InstallEventFinished>( 658 version_
659 request_id, ServiceWorkerMsg_InstallEvent(request_id), 659 ->RegisterRequestCallback<ServiceWorkerHostMsg_InstallEventFinished>(
660 base::Bind(&self::ReceiveInstallEventOnIOThread, this, done, result)); 660 request_id, base::Bind(&self::ReceiveInstallEventOnIOThread, this,
661 done, result));
662 version_->DispatchEvent({request_id},
663 ServiceWorkerMsg_InstallEvent(request_id));
661 } 664 }
662 665
663 void ReceiveInstallEventOnIOThread(const base::Closure& done, 666 void ReceiveInstallEventOnIOThread(const base::Closure& done,
664 ServiceWorkerStatusCode* out_result, 667 ServiceWorkerStatusCode* out_result,
665 int request_id, 668 int request_id,
666 blink::WebServiceWorkerEventResult result, 669 blink::WebServiceWorkerEventResult result,
667 bool has_fetch_handler) { 670 bool has_fetch_handler) {
668 version_->FinishRequest( 671 version_->FinishRequest(
669 request_id, result == blink::WebServiceWorkerEventResultCompleted); 672 request_id, result == blink::WebServiceWorkerEventResultCompleted);
670 version_->set_has_fetch_handler(has_fetch_handler); 673 version_->set_has_fetch_handler(has_fetch_handler);
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 private: 1895 private:
1893 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerV8CacheStrategiesAggressiveTest); 1896 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerV8CacheStrategiesAggressiveTest);
1894 }; 1897 };
1895 1898
1896 IN_PROC_BROWSER_TEST_F(ServiceWorkerV8CacheStrategiesAggressiveTest, 1899 IN_PROC_BROWSER_TEST_F(ServiceWorkerV8CacheStrategiesAggressiveTest,
1897 V8CacheOnCacheStorage) { 1900 V8CacheOnCacheStorage) {
1898 CheckStrategyIsAggressive(); 1901 CheckStrategyIsAggressive();
1899 } 1902 }
1900 1903
1901 } // namespace content 1904 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698