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

Side by Side Diff: chrome/browser/sync/engine/net/url_translator.cc

Issue 194065: Initial commit of sync engine code to browser/sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixes to gtest include path, reverted syncapi. Created 11 years, 3 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 | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4 //
5 // Contains the definition of a few helper functions used for generating sync
6 // URLs.
7
8 #include "chrome/browser/sync/engine/net/url_translator.h"
9
10 #include "base/basictypes.h"
11 #include "base/logging.h"
12 #include "base/port.h"
13 #include "chrome/browser/sync/util/character_set_converters.h"
14 #include "net/base/escape.h"
15
16 using std::string;
17
18 namespace browser_sync {
19
20 namespace {
21 // Parameters that the server understands. (here, a-Z)
22 const char kParameterAuthToken[] = "auth";
23 const char kParameterClientID[] = "client_id";
24 }
25
26 // Convenience wrappers around CgiEscapePath().
27 string CgiEscapeString(const char* src) {
28 return CgiEscapeString(string(src));
29 }
30
31 string CgiEscapeString(const string& src) {
32 return EscapePath(src);
33 }
34
35 // This method appends the query string to the sync server path.
36 string MakeSyncServerPath(const string& path, const string& query_string) {
37 string result = path;
38 result.append("?");
39 result.append(query_string);
40 return result;
41 }
42
43 string MakeSyncQueryString(const string& client_id) {
44 string query;
45 query += kParameterClientID;
46 query += "=" + CgiEscapeString(client_id);
47 return query;
48 }
49
50 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698