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

Side by Side Diff: content/browser/service_worker/service_worker_provider_host.cc

Issue 970693003: ServiceWorker: plumbing for ClientQueryOptions (2/2, chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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/browser/service_worker/service_worker_provider_host.h" 5 #include "content/browser/service_worker/service_worker_provider_host.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "content/browser/frame_host/frame_tree.h" 8 #include "content/browser/frame_host/frame_tree.h"
9 #include "content/browser/frame_host/frame_tree_node.h" 9 #include "content/browser/frame_host/frame_tree_node.h"
10 #include "content/browser/frame_host/render_frame_host_impl.h" 10 #include "content/browser/frame_host/render_frame_host_impl.h"
(...skipping 28 matching lines...) Expand all
39 return ServiceWorkerClientInfo(); 39 return ServiceWorkerClientInfo();
40 40
41 // TODO(mlamouri,michaeln): it is possible to end up collecting information 41 // TODO(mlamouri,michaeln): it is possible to end up collecting information
42 // for a frame that is actually being navigated and isn't exactly what we are 42 // for a frame that is actually being navigated and isn't exactly what we are
43 // expecting. 43 // expecting.
44 return ServiceWorkerClientInfo( 44 return ServiceWorkerClientInfo(
45 render_frame_host->GetVisibilityState(), 45 render_frame_host->GetVisibilityState(),
46 render_frame_host->IsFocused(), 46 render_frame_host->IsFocused(),
47 render_frame_host->GetLastCommittedURL(), 47 render_frame_host->GetLastCommittedURL(),
48 render_frame_host->GetParent() ? REQUEST_CONTEXT_FRAME_TYPE_NESTED 48 render_frame_host->GetParent() ? REQUEST_CONTEXT_FRAME_TYPE_NESTED
49 : REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL); 49 : REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL,
50 blink::WebServiceWorkerClientTypeWindow);
falken 2015/03/04 07:16:42 maybe I'm lost, how do we know this is a window an
kinuko 2015/03/05 02:30:23 We collect these clients using render_frame_id, wh
falken 2015/03/05 14:23:01 Acknowledged.
50 } 51 }
51 52
52 ServiceWorkerClientInfo FocusOnUIThread( 53 ServiceWorkerClientInfo FocusOnUIThread(
53 int render_process_id, 54 int render_process_id,
54 int render_frame_id) { 55 int render_frame_id) {
55 RenderFrameHostImpl* render_frame_host = 56 RenderFrameHostImpl* render_frame_host =
56 RenderFrameHostImpl::FromID(render_process_id, render_frame_id); 57 RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
57 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( 58 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
58 WebContents::FromRenderFrameHost(render_frame_host)); 59 WebContents::FromRenderFrameHost(render_frame_host));
59 60
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 return context_ != NULL; 511 return context_ != NULL;
511 } 512 }
512 513
513 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { 514 void ServiceWorkerProviderHost::Send(IPC::Message* message) const {
514 DCHECK(dispatcher_host_); 515 DCHECK(dispatcher_host_);
515 DCHECK(IsReadyToSendMessages()); 516 DCHECK(IsReadyToSendMessages());
516 dispatcher_host_->Send(message); 517 dispatcher_host_->Send(message);
517 } 518 }
518 519
519 } // namespace content 520 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698