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

Side by Side Diff: chrome/browser/component_updater/component_updater_service.cc

Issue 7978039: net: Put more functions from escape.h into net namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_updater.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/component_updater/component_updater_service.h" 5 #include "chrome/browser/component_updater/component_updater_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 19 matching lines...) Expand all
30 #include "net/base/escape.h" 30 #include "net/base/escape.h"
31 #include "net/base/load_flags.h" 31 #include "net/base/load_flags.h"
32 32
33 namespace { 33 namespace {
34 // Extends an omaha compatible update check url |query| string. Does 34 // Extends an omaha compatible update check url |query| string. Does
35 // not mutate the string if it would be longer than |limit| chars. 35 // not mutate the string if it would be longer than |limit| chars.
36 bool AddQueryString(std::string id, std::string version, 36 bool AddQueryString(std::string id, std::string version,
37 size_t limit, std::string* query) { 37 size_t limit, std::string* query) {
38 std::string additional = 38 std::string additional =
39 base::StringPrintf("id=%s&v=%s&uc", id.c_str(), version.c_str()); 39 base::StringPrintf("id=%s&v=%s&uc", id.c_str(), version.c_str());
40 additional = "x=" + EscapeQueryParamValue(additional, true); 40 additional = "x=" + net::EscapeQueryParamValue(additional, true);
41 if ((additional.size() + query->size() + 1) > limit) 41 if ((additional.size() + query->size() + 1) > limit)
42 return false; 42 return false;
43 query->append(1, query->empty()? '?' : '&'); 43 query->append(1, query->empty()? '?' : '&');
44 query->append(additional); 44 query->append(additional);
45 return true; 45 return true;
46 } 46 }
47 47
48 // Produces an extension-like friendly |id|. This might be removed in the 48 // Produces an extension-like friendly |id|. This might be removed in the
49 // future if we roll our on packing tools. 49 // future if we roll our on packing tools.
50 static std::string HexStringToID(const std::string& hexstr) { 50 static std::string HexStringToID(const std::string& hexstr) {
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 ScheduleNextRun(false); 725 ScheduleNextRun(false);
726 } 726 }
727 727
728 // The component update factory. Using the component updater as a singleton 728 // The component update factory. Using the component updater as a singleton
729 // is the job of the browser process. 729 // is the job of the browser process.
730 ComponentUpdateService* ComponentUpdateServiceFactory( 730 ComponentUpdateService* ComponentUpdateServiceFactory(
731 ComponentUpdateService::Configurator* config) { 731 ComponentUpdateService::Configurator* config) {
732 DCHECK(config); 732 DCHECK(config);
733 return new CrxUpdateService(config); 733 return new CrxUpdateService(config);
734 } 734 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698