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

Side by Side Diff: content/child/service_worker/service_worker_dispatcher.cc

Issue 806703004: [ServiceWorker] Use WebPageVisibilityState in ClientInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « content/child/request_extra_data.h ('k') | content/common/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « content/child/request_extra_data.h ('k') | content/common/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698