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

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

Issue 2002883002: ServiceWorker: Store the existence of fetch event handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 base::Bind(&self::DispatchInstallEventOnIOThread, this, done, result), 644 base::Bind(&self::DispatchInstallEventOnIOThread, this, done, result),
645 CreateReceiver(BrowserThread::UI, done, result)); 645 CreateReceiver(BrowserThread::UI, done, result));
646 } 646 }
647 647
648 void DispatchInstallEventOnIOThread(const base::Closure& done, 648 void DispatchInstallEventOnIOThread(const base::Closure& done,
649 ServiceWorkerStatusCode* result) { 649 ServiceWorkerStatusCode* result) {
650 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 650 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
651 int request_id = 651 int request_id =
652 version_->StartRequest(ServiceWorkerMetrics::EventType::INSTALL, 652 version_->StartRequest(ServiceWorkerMetrics::EventType::INSTALL,
653 CreateReceiver(BrowserThread::UI, done, result)); 653 CreateReceiver(BrowserThread::UI, done, result));
654 version_->DispatchSimpleEvent<ServiceWorkerHostMsg_InstallEventFinished>( 654 version_->DispatchInstallEvent(request_id);
655 request_id, ServiceWorkerMsg_InstallEvent(request_id));
656 } 655 }
657 656
658 void StoreOnIOThread(const base::Closure& done, 657 void StoreOnIOThread(const base::Closure& done,
659 ServiceWorkerStatusCode* result, 658 ServiceWorkerStatusCode* result,
660 int64_t version_id) { 659 int64_t version_id) {
661 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 660 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
662 ServiceWorkerVersion* version = 661 ServiceWorkerVersion* version =
663 wrapper()->context()->GetLiveVersion(version_id); 662 wrapper()->context()->GetLiveVersion(version_id);
664 wrapper()->context()->storage()->StoreRegistration( 663 wrapper()->context()->storage()->StoreRegistration(
665 registration_.get(), version, 664 registration_.get(), version,
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 NavigateToTestPage(); 1833 NavigateToTestPage();
1835 // The V8 code cache must be stored to the CacheStorage which must be bigger 1834 // The V8 code cache must be stored to the CacheStorage which must be bigger
1836 // than 12 byte. 1835 // than 12 byte.
1837 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); 1836 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize);
1838 1837
1839 NavigateToTestPage(); 1838 NavigateToTestPage();
1840 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); 1839 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize);
1841 } 1840 }
1842 1841
1843 } // namespace content 1842 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698