| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/geolocation/chrome_access_token_store.h" | 5 #include "chrome/browser/geolocation/chrome_access_token_store.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/string_piece.h" | 8 #include "base/string_piece.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // This was the default location service url for Chrome versions 14 and earlier | 23 // This was the default location service url for Chrome versions 14 and earlier |
| 24 // but is no longer supported. | 24 // but is no longer supported. |
| 25 const char* kOldDefaultNetworkProviderUrl = "https://www.google.com/loc/json"; | 25 const char* kOldDefaultNetworkProviderUrl = "https://www.google.com/loc/json"; |
| 26 | 26 |
| 27 // Loads access tokens and other necessary data on the UI thread, and | 27 // Loads access tokens and other necessary data on the UI thread, and |
| 28 // calls back to the originator on the originating threaad. | 28 // calls back to the originator on the originating threaad. |
| 29 class TokenLoadingJob : public base::RefCountedThreadSafe<TokenLoadingJob> { | 29 class TokenLoadingJob : public base::RefCountedThreadSafe<TokenLoadingJob> { |
| 30 public: | 30 public: |
| 31 TokenLoadingJob( | 31 TokenLoadingJob( |
| 32 const AccessTokenStore::LoadAccessTokensCallbackType& callback) | 32 const AccessTokenStore::LoadAccessTokensCallbackType& callback) |
| 33 : callback_(callback) { | 33 : callback_(callback), |
| 34 system_request_context_(NULL) { |
| 34 } | 35 } |
| 35 | 36 |
| 36 void Run() { | 37 void Run() { |
| 37 BrowserThread::PostTaskAndReply( | 38 BrowserThread::PostTaskAndReply( |
| 38 BrowserThread::UI, | 39 BrowserThread::UI, |
| 39 FROM_HERE, | 40 FROM_HERE, |
| 40 base::Bind(&TokenLoadingJob::PerformWorkOnUIThread, this), | 41 base::Bind(&TokenLoadingJob::PerformWorkOnUIThread, this), |
| 41 base::Bind(&TokenLoadingJob::RespondOnOriginatingThread, this)); | 42 base::Bind(&TokenLoadingJob::RespondOnOriginatingThread, this)); |
| 42 } | 43 } |
| 43 | 44 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 access_token_dictionary->SetWithoutPathExpansion( | 107 access_token_dictionary->SetWithoutPathExpansion( |
| 107 server_url.spec(), Value::CreateStringValue(token)); | 108 server_url.spec(), Value::CreateStringValue(token)); |
| 108 } | 109 } |
| 109 | 110 |
| 110 void ChromeAccessTokenStore::SaveAccessToken(const GURL& server_url, | 111 void ChromeAccessTokenStore::SaveAccessToken(const GURL& server_url, |
| 111 const string16& access_token) { | 112 const string16& access_token) { |
| 112 BrowserThread::PostTask( | 113 BrowserThread::PostTask( |
| 113 BrowserThread::UI, FROM_HERE, | 114 BrowserThread::UI, FROM_HERE, |
| 114 base::Bind(&SetAccessTokenOnUIThread, server_url, access_token)); | 115 base::Bind(&SetAccessTokenOnUIThread, server_url, access_token)); |
| 115 } | 116 } |
| OLD | NEW |