| 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 441 |
| 442 // TODO(mlamouri,michaeln): it is possible to end up collecting information | 442 // 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 | 443 // for a frame that is actually being navigated and isn't exactly what we are |
| 444 // expecting. | 444 // expecting. |
| 445 return ServiceWorkerClientInfo( | 445 return ServiceWorkerClientInfo( |
| 446 render_frame_host->GetVisibilityState(), | 446 render_frame_host->GetVisibilityState(), render_frame_host->IsFocused(), |
| 447 render_frame_host->IsFocused(), | |
| 448 render_frame_host->GetLastCommittedURL(), | 447 render_frame_host->GetLastCommittedURL(), |
| 449 render_frame_host->GetParent() ? REQUEST_CONTEXT_FRAME_TYPE_NESTED | 448 render_frame_host->GetParent() ? REQUEST_CONTEXT_FRAME_TYPE_NESTED |
| 450 : REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, | 449 : REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, |
| 450 render_frame_host->frame_tree_node()->last_focus_time(), |
| 451 blink::WebServiceWorkerClientTypeWindow); | 451 blink::WebServiceWorkerClientTypeWindow); |
| 452 } | 452 } |
| 453 | 453 |
| 454 void ServiceWorkerProviderHost::AddScopedProcessReferenceToPattern( | 454 void ServiceWorkerProviderHost::AddScopedProcessReferenceToPattern( |
| 455 const GURL& pattern) { | 455 const GURL& pattern) { |
| 456 associated_patterns_.push_back(pattern); | 456 associated_patterns_.push_back(pattern); |
| 457 IncreaseProcessReference(pattern); | 457 IncreaseProcessReference(pattern); |
| 458 } | 458 } |
| 459 | 459 |
| 460 void ServiceWorkerProviderHost::ClaimedByRegistration( | 460 void ServiceWorkerProviderHost::ClaimedByRegistration( |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 return context_ != NULL; | 677 return context_ != NULL; |
| 678 } | 678 } |
| 679 | 679 |
| 680 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { | 680 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { |
| 681 DCHECK(dispatcher_host_); | 681 DCHECK(dispatcher_host_); |
| 682 DCHECK(IsReadyToSendMessages()); | 682 DCHECK(IsReadyToSendMessages()); |
| 683 dispatcher_host_->Send(message); | 683 dispatcher_host_->Send(message); |
| 684 } | 684 } |
| 685 | 685 |
| 686 } // namespace content | 686 } // namespace content |
| OLD | NEW |