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

Side by Side Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 2344943002: Make ChromePasswordManagerClient::BindCredentialManager handle missing client gracefully (Closed)
Patch Set: Make ChromePasswordManagerClient::BindCredentialManager handle missing client gracefully Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/password_manager/chrome_password_manager_client_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/password_manager/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 // static 629 // static
630 void ChromePasswordManagerClient::BindCredentialManager( 630 void ChromePasswordManagerClient::BindCredentialManager(
631 content::RenderFrameHost* render_frame_host, 631 content::RenderFrameHost* render_frame_host,
632 password_manager::mojom::CredentialManagerRequest request) { 632 password_manager::mojom::CredentialManagerRequest request) {
633 content::WebContents* web_contents = 633 content::WebContents* web_contents =
634 content::WebContents::FromRenderFrameHost(render_frame_host); 634 content::WebContents::FromRenderFrameHost(render_frame_host);
635 DCHECK(web_contents); 635 DCHECK(web_contents);
636 636
637 ChromePasswordManagerClient* instance = 637 ChromePasswordManagerClient* instance =
638 ChromePasswordManagerClient::FromWebContents(web_contents); 638 ChromePasswordManagerClient::FromWebContents(web_contents);
639 DCHECK(instance); 639
640 // Try to bind to the driver, but if driver is not available for this render
641 // frame host, the request will be just dropped. This will cause the message
642 // pipe to be closed, which will raise a connection error on the peer side.
643 if (!instance)
644 return;
645
640 instance->credential_manager_impl_.BindRequest(std::move(request)); 646 instance->credential_manager_impl_.BindRequest(std::move(request));
641 } 647 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/password_manager/chrome_password_manager_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698