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

Side by Side Diff: chrome/browser/extensions/api/identity/identity_api.cc

Issue 829853006: IdentityLaunchWebAuthFlowFunction shouldn't be able to send response twice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/api/identity/identity_api.h" 5 #include "chrome/browser/extensions/api/identity/identity_api.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 break; 936 break;
937 case WebAuthFlow::LOAD_FAILED: 937 case WebAuthFlow::LOAD_FAILED:
938 error_ = identity_constants::kPageLoadFailure; 938 error_ = identity_constants::kPageLoadFailure;
939 break; 939 break;
940 default: 940 default:
941 NOTREACHED() << "Unexpected error from web auth flow: " << failure; 941 NOTREACHED() << "Unexpected error from web auth flow: " << failure;
942 error_ = identity_constants::kInvalidRedirect; 942 error_ = identity_constants::kInvalidRedirect;
943 break; 943 break;
944 } 944 }
945 SendResponse(false); 945 SendResponse(false);
946 Release(); // Balanced in RunAsync. 946 Release(); // Balanced in RunAsync.
Michael Courage 2015/01/08 22:45:27 Would we not also want to detach here as well?
947 } 947 }
948 948
949 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( 949 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange(
950 const GURL& redirect_url) { 950 const GURL& redirect_url) {
951 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { 951 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) {
952 SetResult(new base::StringValue(redirect_url.spec())); 952 SetResult(new base::StringValue(redirect_url.spec()));
953 SendResponse(true); 953 SendResponse(true);
954 if (auth_flow_)
955 auth_flow_.release()->DetachDelegateAndDelete();
954 Release(); // Balanced in RunAsync. 956 Release(); // Balanced in RunAsync.
955 } 957 }
956 } 958 }
957 959
958 } // namespace extensions 960 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698