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

Side by Side Diff: content/browser/permissions/permission_service_context.cc

Issue 1513973002: PermissionServiceContext using mojo::StrongBindingSet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-geolocation-untangle
Patch Set: Created 5 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/permissions/permission_service_context.h" 5 #include "content/browser/permissions/permission_service_context.h"
6 6
7 #include "content/browser/permissions/permission_service_impl.h" 7 #include "content/browser/permissions/permission_service_impl.h"
8 #include "content/public/browser/navigation_details.h" 8 #include "content/public/browser/navigation_details.h"
9 #include "content/public/browser/render_frame_host.h" 9 #include "content/public/browser/render_frame_host.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 13 matching lines...) Expand all
24 : WebContentsObserver(nullptr), 24 : WebContentsObserver(nullptr),
25 render_frame_host_(nullptr), 25 render_frame_host_(nullptr),
26 render_process_host_(render_process_host) { 26 render_process_host_(render_process_host) {
27 } 27 }
28 28
29 PermissionServiceContext::~PermissionServiceContext() { 29 PermissionServiceContext::~PermissionServiceContext() {
30 } 30 }
31 31
32 void PermissionServiceContext::CreateService( 32 void PermissionServiceContext::CreateService(
33 mojo::InterfaceRequest<PermissionService> request) { 33 mojo::InterfaceRequest<PermissionService> request) {
34 services_.push_back(new PermissionServiceImpl(this, request.Pass())); 34 services_.EmplaceService(std::move(request), this);
35 }
36
37 void PermissionServiceContext::ServiceHadConnectionError(
38 PermissionServiceImpl* service) {
39 auto it = std::find(services_.begin(), services_.end(), service);
40 DCHECK(it != services_.end());
41 services_.erase(it);
42 } 35 }
43 36
44 void PermissionServiceContext::RenderFrameHostChanged( 37 void PermissionServiceContext::RenderFrameHostChanged(
45 RenderFrameHost* old_host, 38 RenderFrameHost* old_host,
46 RenderFrameHost* new_host) { 39 RenderFrameHost* new_host) {
47 CancelPendingOperations(old_host); 40 CancelPendingOperations(old_host);
48 } 41 }
49 42
50 void PermissionServiceContext::FrameDeleted( 43 void PermissionServiceContext::FrameDeleted(
51 RenderFrameHost* render_frame_host) { 44 RenderFrameHost* render_frame_host) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 GURL PermissionServiceContext::GetEmbeddingOrigin() const { 76 GURL PermissionServiceContext::GetEmbeddingOrigin() const {
84 return web_contents() ? web_contents()->GetLastCommittedURL().GetOrigin() 77 return web_contents() ? web_contents()->GetLastCommittedURL().GetOrigin()
85 : GURL(); 78 : GURL();
86 } 79 }
87 80
88 RenderFrameHost* PermissionServiceContext::render_frame_host() const { 81 RenderFrameHost* PermissionServiceContext::render_frame_host() const {
89 return render_frame_host_; 82 return render_frame_host_;
90 } 83 }
91 84
92 } // namespace content 85 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/permissions/permission_service_context.h ('k') | content/browser/permissions/permission_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698