OLD | NEW |
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/child/service_worker/service_worker_dispatcher.h" | 5 #include "content/child/service_worker/service_worker_dispatcher.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 int embedded_worker_id, | 674 int embedded_worker_id, |
675 int request_id, | 675 int request_id, |
676 int provider_id) { | 676 int provider_id) { |
677 blink::WebServiceWorkerClientInfo info; | 677 blink::WebServiceWorkerClientInfo info; |
678 ScriptClientMap::iterator found = script_clients_.find(provider_id); | 678 ScriptClientMap::iterator found = script_clients_.find(provider_id); |
679 // TODO(ksakamoto): Could we track these values in the browser side? Except | 679 // TODO(ksakamoto): Could we track these values in the browser side? Except |
680 // for |isFocused|, it would be pretty easy. | 680 // for |isFocused|, it would be pretty easy. |
681 if (found != script_clients_.end() && found->second->getClientInfo(&info)) { | 681 if (found != script_clients_.end() && found->second->getClientInfo(&info)) { |
682 ServiceWorkerClientInfo result; | 682 ServiceWorkerClientInfo result; |
683 result.client_id = info.clientID; | 683 result.client_id = info.clientID; |
684 result.visibility_state = info.visibilityState.utf8(); | 684 result.page_visibility_state = info.pageVisibilityState; |
685 result.is_focused = info.isFocused; | 685 result.is_focused = info.isFocused; |
686 result.url = info.url; | 686 result.url = info.url; |
687 result.frame_type = static_cast<RequestContextFrameType>(info.frameType); | 687 result.frame_type = static_cast<RequestContextFrameType>(info.frameType); |
688 | 688 |
689 thread_safe_sender_->Send(new ServiceWorkerHostMsg_GetClientInfoSuccess( | 689 thread_safe_sender_->Send(new ServiceWorkerHostMsg_GetClientInfoSuccess( |
690 embedded_worker_id, request_id, result)); | 690 embedded_worker_id, request_id, result)); |
691 } else { | 691 } else { |
692 thread_safe_sender_->Send(new ServiceWorkerHostMsg_GetClientInfoError( | 692 thread_safe_sender_->Send(new ServiceWorkerHostMsg_GetClientInfoError( |
693 embedded_worker_id, request_id)); | 693 embedded_worker_id, request_id)); |
694 } | 694 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 attrs.installing, thread_safe_sender_.get()); | 736 attrs.installing, thread_safe_sender_.get()); |
737 ServiceWorkerHandleReference::Adopt( | 737 ServiceWorkerHandleReference::Adopt( |
738 attrs.waiting, thread_safe_sender_.get()); | 738 attrs.waiting, thread_safe_sender_.get()); |
739 ServiceWorkerHandleReference::Adopt( | 739 ServiceWorkerHandleReference::Adopt( |
740 attrs.active, thread_safe_sender_.get()); | 740 attrs.active, thread_safe_sender_.get()); |
741 } | 741 } |
742 return registration; | 742 return registration; |
743 } | 743 } |
744 | 744 |
745 } // namespace content | 745 } // namespace content |
OLD | NEW |