| OLD | NEW |
| 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 "google_apis/gaia/merge_session_helper.h" | 5 #include "google_apis/gaia/merge_session_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 return gaia_auth_fetcher_ || fetchers_.size() > 0u; | 52 return gaia_auth_fetcher_ || fetchers_.size() > 0u; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void MergeSessionHelper::ExternalCcResultFetcher::TimeoutForTests() { | 55 void MergeSessionHelper::ExternalCcResultFetcher::TimeoutForTests() { |
| 56 Timeout(); | 56 Timeout(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void | 59 void |
| 60 MergeSessionHelper::ExternalCcResultFetcher::OnGetCheckConnectionInfoSuccess( | 60 MergeSessionHelper::ExternalCcResultFetcher::OnGetCheckConnectionInfoSuccess( |
| 61 const std::string& data) { | 61 const std::string& data) { |
| 62 base::Value* value = base::JSONReader::Read(data); | 62 scoped_ptr<base::Value> value(base::JSONReader::Read(data)); |
| 63 const base::ListValue* list; | 63 const base::ListValue* list; |
| 64 if (!value || !value->GetAsList(&list)) | 64 if (!value || !value->GetAsList(&list)) |
| 65 return; | 65 return; |
| 66 | 66 |
| 67 // Start a fetcher for each connection URL that needs to be checked. | 67 // Start a fetcher for each connection URL that needs to be checked. |
| 68 for (size_t i = 0; i < list->GetSize(); ++i) { | 68 for (size_t i = 0; i < list->GetSize(); ++i) { |
| 69 const base::DictionaryValue* dict; | 69 const base::DictionaryValue* dict; |
| 70 if (list->GetDictionary(i, &dict)) { | 70 if (list->GetDictionary(i, &dict)) { |
| 71 std::string token; | 71 std::string token; |
| 72 std::string url; | 72 std::string url; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 VLOG(1) << "MergeSessionHelper::HandleNextAccount: no more"; | 332 VLOG(1) << "MergeSessionHelper::HandleNextAccount: no more"; |
| 333 uber_token_fetcher_.reset(); | 333 uber_token_fetcher_.reset(); |
| 334 } else { | 334 } else { |
| 335 if (accounts_.front().empty()) { | 335 if (accounts_.front().empty()) { |
| 336 StartLogOutUrlFetch(); | 336 StartLogOutUrlFetch(); |
| 337 } else { | 337 } else { |
| 338 StartFetching(); | 338 StartFetching(); |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 } | 341 } |
| OLD | NEW |