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/renderer_host/media/webrtc_identity_service_host.h" | 5 #include "content/browser/renderer_host/media/webrtc_identity_service_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "content/browser/child_process_security_policy_impl.h" | 9 #include "content/browser/child_process_security_policy_impl.h" |
10 #include "content/browser/media/webrtc_identity_store.h" | 10 #include "content/browser/media/webrtc_identity_store.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const std::string& common_name) { | 43 const std::string& common_name) { |
44 if (!cancel_callback_.is_null()) { | 44 if (!cancel_callback_.is_null()) { |
45 DLOG(WARNING) | 45 DLOG(WARNING) |
46 << "Request rejected because the previous request has not finished."; | 46 << "Request rejected because the previous request has not finished."; |
47 SendErrorMessage(sequence_number, net::ERR_INSUFFICIENT_RESOURCES); | 47 SendErrorMessage(sequence_number, net::ERR_INSUFFICIENT_RESOURCES); |
48 return; | 48 return; |
49 } | 49 } |
50 | 50 |
51 ChildProcessSecurityPolicyImpl* policy = | 51 ChildProcessSecurityPolicyImpl* policy = |
52 ChildProcessSecurityPolicyImpl::GetInstance(); | 52 ChildProcessSecurityPolicyImpl::GetInstance(); |
53 if (!policy->CanAccessCookiesForOrigin(renderer_process_id_, origin)) { | 53 if (!policy->CanAccessDataForOrigin(renderer_process_id_, origin)) { |
54 DLOG(WARNING) << "Request rejected because origin access is denied."; | 54 DLOG(WARNING) << "Request rejected because origin access is denied."; |
55 SendErrorMessage(sequence_number, net::ERR_ACCESS_DENIED); | 55 SendErrorMessage(sequence_number, net::ERR_ACCESS_DENIED); |
56 return; | 56 return; |
57 } | 57 } |
58 | 58 |
59 cancel_callback_ = identity_store_->RequestIdentity( | 59 cancel_callback_ = identity_store_->RequestIdentity( |
60 origin, | 60 origin, |
61 identity_name, | 61 identity_name, |
62 common_name, | 62 common_name, |
63 base::Bind(&WebRTCIdentityServiceHost::OnComplete, | 63 base::Bind(&WebRTCIdentityServiceHost::OnComplete, |
(...skipping 23 matching lines...) Expand all Loading... |
87 SendErrorMessage(sequence_number, status); | 87 SendErrorMessage(sequence_number, status); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 void WebRTCIdentityServiceHost::SendErrorMessage(int sequence_number, | 91 void WebRTCIdentityServiceHost::SendErrorMessage(int sequence_number, |
92 int error) { | 92 int error) { |
93 Send(new WebRTCIdentityHostMsg_RequestFailed(sequence_number, error)); | 93 Send(new WebRTCIdentityHostMsg_RequestFailed(sequence_number, error)); |
94 } | 94 } |
95 | 95 |
96 } // namespace content | 96 } // namespace content |
OLD | NEW |