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

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

Issue 788073007: Cleanup geofence registrations when a service worker is unregistered. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: slightly improve mock usage in test Created 5 years, 12 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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 value->SetString("sourceURL", message.source_url.spec()); 370 value->SetString("sourceURL", message.source_url.spec());
371 args.push_back(value.release()); 371 args.push_back(value.release());
372 web_ui_->CallJavascriptFunction("serviceworker.onConsoleMessageReported", 372 web_ui_->CallJavascriptFunction("serviceworker.onConsoleMessageReported",
373 args.get()); 373 args.get());
374 } 374 }
375 void OnRegistrationStored(const GURL& pattern) override { 375 void OnRegistrationStored(const GURL& pattern) override {
376 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 376 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
377 web_ui_->CallJavascriptFunction("serviceworker.onRegistrationStored", 377 web_ui_->CallJavascriptFunction("serviceworker.onRegistrationStored",
378 StringValue(pattern.spec())); 378 StringValue(pattern.spec()));
379 } 379 }
380 void OnRegistrationDeleted(const GURL& pattern) override { 380 void OnRegistrationDeleted(int64 registration_id,
381 const GURL& pattern) override {
381 web_ui_->CallJavascriptFunction("serviceworker.onRegistrationDeleted", 382 web_ui_->CallJavascriptFunction("serviceworker.onRegistrationDeleted",
382 StringValue(pattern.spec())); 383 StringValue(pattern.spec()));
383 } 384 }
384 int partition_id() const { return partition_id_; } 385 int partition_id() const { return partition_id_; }
385 386
386 private: 387 private:
387 const int partition_id_; 388 const int partition_id_;
388 WebUI* const web_ui_; 389 WebUI* const web_ui_;
389 }; 390 };
390 391
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 return; 669 return;
669 } 670 }
670 671
671 base::Callback<void(ServiceWorkerStatusCode)> callback = 672 base::Callback<void(ServiceWorkerStatusCode)> callback =
672 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); 673 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
673 FindRegistrationForPattern( 674 FindRegistrationForPattern(
674 context, GURL(scope_string), base::Bind(StartActiveWorker, callback)); 675 context, GURL(scope_string), base::Bind(StartActiveWorker, callback));
675 } 676 }
676 677
677 } // namespace content 678 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698