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/browser/service_worker/service_worker_provider_host.h" | 5 #include "content/browser/service_worker/service_worker_provider_host.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
431 } | 431 } |
432 | 432 |
433 // static | 433 // static |
434 ServiceWorkerClientInfo ServiceWorkerProviderHost::GetWindowClientInfoOnUI( | 434 ServiceWorkerClientInfo ServiceWorkerProviderHost::GetWindowClientInfoOnUI( |
435 int render_process_id, | 435 int render_process_id, |
436 int render_frame_id) { | 436 int render_frame_id) { |
437 RenderFrameHostImpl* render_frame_host = | 437 RenderFrameHostImpl* render_frame_host = |
438 RenderFrameHostImpl::FromID(render_process_id, render_frame_id); | 438 RenderFrameHostImpl::FromID(render_process_id, render_frame_id); |
439 if (!render_frame_host) | 439 if (!render_frame_host) |
440 return ServiceWorkerClientInfo(); | 440 return ServiceWorkerClientInfo(); |
441 RenderWidgetHost* render_widget_host = | |
442 render_frame_host->GetRenderWidgetHost(); | |
nhiroki
2015/08/19 03:45:50
I wonder if we can call LastFocusTime() w/o exposi
| |
441 | 443 |
442 // TODO(mlamouri,michaeln): it is possible to end up collecting information | 444 // TODO(mlamouri,michaeln): it is possible to end up collecting information |
443 // for a frame that is actually being navigated and isn't exactly what we are | 445 // for a frame that is actually being navigated and isn't exactly what we are |
444 // expecting. | 446 // expecting. |
445 return ServiceWorkerClientInfo( | 447 return ServiceWorkerClientInfo( |
446 render_frame_host->GetVisibilityState(), | 448 render_frame_host->GetVisibilityState(), render_frame_host->IsFocused(), |
447 render_frame_host->IsFocused(), | |
448 render_frame_host->GetLastCommittedURL(), | 449 render_frame_host->GetLastCommittedURL(), |
449 render_frame_host->GetParent() ? REQUEST_CONTEXT_FRAME_TYPE_NESTED | 450 render_frame_host->GetParent() ? REQUEST_CONTEXT_FRAME_TYPE_NESTED |
450 : REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, | 451 : REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, |
452 render_widget_host ? render_widget_host->LastFocusTime() | |
453 : base::TimeTicks(), | |
451 blink::WebServiceWorkerClientTypeWindow); | 454 blink::WebServiceWorkerClientTypeWindow); |
452 } | 455 } |
453 | 456 |
454 void ServiceWorkerProviderHost::AddScopedProcessReferenceToPattern( | 457 void ServiceWorkerProviderHost::AddScopedProcessReferenceToPattern( |
455 const GURL& pattern) { | 458 const GURL& pattern) { |
456 associated_patterns_.push_back(pattern); | 459 associated_patterns_.push_back(pattern); |
457 IncreaseProcessReference(pattern); | 460 IncreaseProcessReference(pattern); |
458 } | 461 } |
459 | 462 |
460 void ServiceWorkerProviderHost::ClaimedByRegistration( | 463 void ServiceWorkerProviderHost::ClaimedByRegistration( |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
677 return context_ != NULL; | 680 return context_ != NULL; |
678 } | 681 } |
679 | 682 |
680 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { | 683 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { |
681 DCHECK(dispatcher_host_); | 684 DCHECK(dispatcher_host_); |
682 DCHECK(IsReadyToSendMessages()); | 685 DCHECK(IsReadyToSendMessages()); |
683 dispatcher_host_->Send(message); | 686 dispatcher_host_->Send(message); |
684 } | 687 } |
685 | 688 |
686 } // namespace content | 689 } // namespace content |
OLD | NEW |