OLD | NEW |
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 "google_apis/gaia/oauth_request_signer.h" | 5 #include "google_apis/gaia/oauth_request_signer.h" |
6 | 6 |
7 #include <cctype> | 7 #include <cctype> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <cstdlib> | 9 #include <cstdlib> |
10 #include <cstring> | 10 #include <cstring> |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 DCHECK(request_base_url.is_valid()); | 402 DCHECK(request_base_url.is_valid()); |
403 Parameters parameters(request_parameters); | 403 Parameters parameters(request_parameters); |
404 bool is_signed = SignParameters(request_base_url, signature_method, | 404 bool is_signed = SignParameters(request_base_url, signature_method, |
405 http_method, consumer_key, consumer_secret, | 405 http_method, consumer_key, consumer_secret, |
406 token_key, token_secret, ¶meters); | 406 token_key, token_secret, ¶meters); |
407 if (is_signed) { | 407 if (is_signed) { |
408 std::string signed_text; | 408 std::string signed_text; |
409 switch (http_method) { | 409 switch (http_method) { |
410 case GET_METHOD: | 410 case GET_METHOD: |
411 signed_text = request_base_url.spec() + '?'; | 411 signed_text = request_base_url.spec() + '?'; |
412 // Intentionally falling through | 412 FALLTHROUGH_INTENDED; |
413 case POST_METHOD: | 413 case POST_METHOD: |
414 signed_text += BuildBaseStringParameters(parameters); | 414 signed_text += BuildBaseStringParameters(parameters); |
415 break; | 415 break; |
416 default: | 416 default: |
417 NOTREACHED(); | 417 NOTREACHED(); |
418 } | 418 } |
419 *signed_text_return = signed_text; | 419 *signed_text_return = signed_text; |
420 } | 420 } |
421 return is_signed; | 421 return is_signed; |
422 } | 422 } |
(...skipping 27 matching lines...) Expand all Loading... |
450 signed_text += | 450 signed_text += |
451 base::StringPrintf( | 451 base::StringPrintf( |
452 "%s=\"%s\"", | 452 "%s=\"%s\"", |
453 OAuthRequestSigner::Encode(param->first).c_str(), | 453 OAuthRequestSigner::Encode(param->first).c_str(), |
454 OAuthRequestSigner::Encode(param->second).c_str()); | 454 OAuthRequestSigner::Encode(param->second).c_str()); |
455 } | 455 } |
456 *signed_text_return = signed_text; | 456 *signed_text_return = signed_text; |
457 } | 457 } |
458 return is_signed; | 458 return is_signed; |
459 } | 459 } |
OLD | NEW |