OLD | NEW |
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 | |
9 #include <string> | 8 #include <string> |
| 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "content/browser/devtools/devtools_agent_host_impl.h" | 16 #include "content/browser/devtools/devtools_agent_host_impl.h" |
17 #include "content/browser/devtools/service_worker_devtools_manager.h" | 17 #include "content/browser/devtools/service_worker_devtools_manager.h" |
18 #include "content/browser/service_worker/service_worker_context_observer.h" | 18 #include "content/browser/service_worker/service_worker_context_observer.h" |
19 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 19 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 static_cast<ServiceWorkerContextWrapper*>( | 424 static_cast<ServiceWorkerContextWrapper*>( |
425 partition->GetServiceWorkerContext()); | 425 partition->GetServiceWorkerContext()); |
426 if (PartitionObserver* observer = | 426 if (PartitionObserver* observer = |
427 observers_.get(reinterpret_cast<uintptr_t>(partition))) { | 427 observers_.get(reinterpret_cast<uintptr_t>(partition))) { |
428 partition_id = observer->partition_id(); | 428 partition_id = observer->partition_id(); |
429 } else { | 429 } else { |
430 partition_id = next_partition_id_++; | 430 partition_id = next_partition_id_++; |
431 scoped_ptr<PartitionObserver> new_observer( | 431 scoped_ptr<PartitionObserver> new_observer( |
432 new PartitionObserver(partition_id, web_ui())); | 432 new PartitionObserver(partition_id, web_ui())); |
433 context->AddObserver(new_observer.get()); | 433 context->AddObserver(new_observer.get()); |
434 observers_.set(reinterpret_cast<uintptr_t>(partition), new_observer.Pass()); | 434 observers_.set(reinterpret_cast<uintptr_t>(partition), |
| 435 std::move(new_observer)); |
435 } | 436 } |
436 | 437 |
437 BrowserThread::PostTask( | 438 BrowserThread::PostTask( |
438 BrowserThread::IO, FROM_HERE, | 439 BrowserThread::IO, FROM_HERE, |
439 base::Bind(GetRegistrationsOnIOThread, context, | 440 base::Bind(GetRegistrationsOnIOThread, context, |
440 base::Bind(DidGetRegistrations, AsWeakPtr(), partition_id, | 441 base::Bind(DidGetRegistrations, AsWeakPtr(), partition_id, |
441 context->is_incognito() ? base::FilePath() | 442 context->is_incognito() ? base::FilePath() |
442 : partition->GetPath()))); | 443 : partition->GetPath()))); |
443 } | 444 } |
444 | 445 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 callback.Run(SERVICE_WORKER_ERROR_ABORT); | 614 callback.Run(SERVICE_WORKER_ERROR_ABORT); |
614 return; | 615 return; |
615 } | 616 } |
616 | 617 |
617 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here | 618 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here |
618 // because that reduces a status code to boolean. | 619 // because that reduces a status code to boolean. |
619 context->context()->UnregisterServiceWorker(scope, callback); | 620 context->context()->UnregisterServiceWorker(scope, callback); |
620 } | 621 } |
621 | 622 |
622 } // namespace content | 623 } // namespace content |
OLD | NEW |