| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Contains the definition of a few helper functions used for generating sync | 5 // Contains the definition of a few helper functions used for generating sync |
| 6 // URLs. | 6 // URLs. |
| 7 | 7 |
| 8 #include "chrome/browser/sync/engine/net/url_translator.h" | 8 #include "chrome/browser/sync/engine/net/url_translator.h" |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 const char kParameterAuthToken[] = "auth"; | 22 const char kParameterAuthToken[] = "auth"; |
| 23 const char kParameterClientID[] = "client_id"; | 23 const char kParameterClientID[] = "client_id"; |
| 24 } | 24 } |
| 25 | 25 |
| 26 // Convenience wrappers around CgiEscapePath(). | 26 // Convenience wrappers around CgiEscapePath(). |
| 27 string CgiEscapeString(const char* src) { | 27 string CgiEscapeString(const char* src) { |
| 28 return CgiEscapeString(string(src)); | 28 return CgiEscapeString(string(src)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 string CgiEscapeString(const string& src) { | 31 string CgiEscapeString(const string& src) { |
| 32 return EscapePath(src); | 32 return EscapeUrl(src); |
| 33 } | 33 } |
| 34 | 34 |
| 35 // This method appends the query string to the sync server path. | 35 // This method appends the query string to the sync server path. |
| 36 string MakeSyncServerPath(const string& path, const string& query_string) { | 36 string MakeSyncServerPath(const string& path, const string& query_string) { |
| 37 string result = path; | 37 string result = path; |
| 38 result.append("?"); | 38 result.append("?"); |
| 39 result.append(query_string); | 39 result.append(query_string); |
| 40 return result; | 40 return result; |
| 41 } | 41 } |
| 42 | 42 |
| 43 string MakeSyncQueryString(const string& client_id) { | 43 string MakeSyncQueryString(const string& client_id) { |
| 44 string query; | 44 string query; |
| 45 query += kParameterClientID; | 45 query += kParameterClientID; |
| 46 query += "=" + CgiEscapeString(client_id); | 46 query += "=" + CgiEscapeString(client_id); |
| 47 return query; | 47 return query; |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace browser_sync | 50 } // namespace browser_sync |
| OLD | NEW |