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

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

Issue 2118243002: [proof-of-concept] SW thread independent of the main thread Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/service_worker/service_worker_context_wrapper.h" 5 #include "content/browser/service_worker/service_worker_context_wrapper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 837
838 observer_list_->Notify(FROM_HERE, 838 observer_list_->Notify(FROM_HERE,
839 &ServiceWorkerContextObserver::OnStorageWiped); 839 &ServiceWorkerContextObserver::OnStorageWiped);
840 } 840 }
841 841
842 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { 842 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() {
843 DCHECK_CURRENTLY_ON(BrowserThread::IO); 843 DCHECK_CURRENTLY_ON(BrowserThread::IO);
844 return context_core_.get(); 844 return context_core_.get();
845 } 845 }
846 846
847 void ServiceWorkerContextWrapper::CreateService(
848 mojo::InterfaceRequest<blink::mojom::ServiceWorkerService> request) {
849 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
850 BrowserThread::PostTask(
851 BrowserThread::IO, FROM_HERE,
852 base::Bind(&ServiceWorkerContextWrapper::CreateService, this,
853 base::Passed(&request)));
854 return;
855 }
856 context_core_->CreateService(std::move(request));
857 }
858
847 } // namespace content 859 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698