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

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

Issue 1693303002: ServiceWorker: Make ServiceWorkerStorage more self-defensive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 "content/browser/service_worker/service_worker_internals_ui.h" 5 #include "content/browser/service_worker/service_worker_internals_ui.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 DictionaryValue* info = new DictionaryValue(); 198 DictionaryValue* info = new DictionaryValue();
199 UpdateVersionInfo(*it, info); 199 UpdateVersionInfo(*it, info);
200 result->Append(info); 200 result->Append(info);
201 } 201 }
202 return result; 202 return result;
203 } 203 }
204 204
205 void DidGetStoredRegistrationsOnIOThread( 205 void DidGetStoredRegistrationsOnIOThread(
206 scoped_refptr<ServiceWorkerContextWrapper> context, 206 scoped_refptr<ServiceWorkerContextWrapper> context,
207 const GetRegistrationsCallback& callback, 207 const GetRegistrationsCallback& callback,
208 ServiceWorkerStatusCode status,
208 const std::vector<ServiceWorkerRegistrationInfo>& stored_registrations) { 209 const std::vector<ServiceWorkerRegistrationInfo>& stored_registrations) {
209 DCHECK_CURRENTLY_ON(BrowserThread::IO); 210 DCHECK_CURRENTLY_ON(BrowserThread::IO);
210 BrowserThread::PostTask( 211 BrowserThread::PostTask(
211 BrowserThread::UI, FROM_HERE, 212 BrowserThread::UI, FROM_HERE,
212 base::Bind(callback, context->GetAllLiveRegistrationInfo(), 213 base::Bind(callback, context->GetAllLiveRegistrationInfo(),
213 context->GetAllLiveVersionInfo(), stored_registrations)); 214 context->GetAllLiveVersionInfo(), stored_registrations));
214 } 215 }
215 216
216 void GetRegistrationsOnIOThread( 217 void GetRegistrationsOnIOThread(
217 scoped_refptr<ServiceWorkerContextWrapper> context, 218 scoped_refptr<ServiceWorkerContextWrapper> context,
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 callback.Run(SERVICE_WORKER_ERROR_ABORT); 587 callback.Run(SERVICE_WORKER_ERROR_ABORT);
587 return; 588 return;
588 } 589 }
589 590
590 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here 591 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here
591 // because that reduces a status code to boolean. 592 // because that reduces a status code to boolean.
592 context->context()->UnregisterServiceWorker(scope, callback); 593 context->context()->UnregisterServiceWorker(scope, callback);
593 } 594 }
594 595
595 } // namespace content 596 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698