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

Side by Side Diff: chrome/browser/extensions/extension_updater.cc

Issue 3859003: FBTF: Even more ctor/virtual deinlining. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Created 10 years, 2 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/extensions/extension_updater.h" 5 #include "chrome/browser/extensions/extension_updater.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 const int kStartupWaitSeconds = 60 * 5; 61 const int kStartupWaitSeconds = 60 * 5;
62 62
63 // For sanity checking on update frequency - enforced in release mode only. 63 // For sanity checking on update frequency - enforced in release mode only.
64 static const int kMinUpdateFrequencySeconds = 30; 64 static const int kMinUpdateFrequencySeconds = 30;
65 static const int kMaxUpdateFrequencySeconds = 60 * 60 * 24 * 7; // 7 days 65 static const int kMaxUpdateFrequencySeconds = 60 * 60 * 24 * 7; // 7 days
66 66
67 // Maximum length of an extension manifest update check url, since it is a GET 67 // Maximum length of an extension manifest update check url, since it is a GET
68 // request. We want to stay under 2K because of proxies, etc. 68 // request. We want to stay under 2K because of proxies, etc.
69 static const int kExtensionsManifestMaxURLSize = 2000; 69 static const int kExtensionsManifestMaxURLSize = 2000;
70 70
71 ManifestFetchData::ManifestFetchData(GURL update_url)
72 : base_url_(update_url),
73 full_url_(update_url) {
74 }
75
76 ManifestFetchData::~ManifestFetchData() {}
71 77
72 // The format for request parameters in update checks is: 78 // The format for request parameters in update checks is:
73 // 79 //
74 // ?x=EXT1_INFO&x=EXT2_INFO 80 // ?x=EXT1_INFO&x=EXT2_INFO
75 // 81 //
76 // where EXT1_INFO and EXT2_INFO are url-encoded strings of the form: 82 // where EXT1_INFO and EXT2_INFO are url-encoded strings of the form:
77 // 83 //
78 // id=EXTENSION_ID&v=VERSION&uc 84 // id=EXTENSION_ID&v=VERSION&uc
79 // 85 //
80 // Additionally, we may include the parameter ping=PING_DATA where PING_DATA 86 // Additionally, we may include the parameter ping=PING_DATA where PING_DATA
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 125 }
120 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 0); 126 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 0);
121 127
122 // We have room so go ahead and add the extension. 128 // We have room so go ahead and add the extension.
123 extension_ids_.insert(id); 129 extension_ids_.insert(id);
124 ping_days_[id] = days; 130 ping_days_[id] = days;
125 full_url_ = GURL(full_url_.possibly_invalid_spec() + extra); 131 full_url_ = GURL(full_url_.possibly_invalid_spec() + extra);
126 return true; 132 return true;
127 } 133 }
128 134
135 bool ManifestFetchData::Includes(std::string extension_id) const {
136 return extension_ids_.find(extension_id) != extension_ids_.end();
137 }
138
129 bool ManifestFetchData::DidPing(std::string extension_id) const { 139 bool ManifestFetchData::DidPing(std::string extension_id) const {
130 std::map<std::string, int>::const_iterator i = ping_days_.find(extension_id); 140 std::map<std::string, int>::const_iterator i = ping_days_.find(extension_id);
131 if (i != ping_days_.end()) { 141 if (i != ping_days_.end()) {
132 return ShouldPing(i->second); 142 return ShouldPing(i->second);
133 } 143 }
134 return false; 144 return false;
135 } 145 }
136 146
137 bool ManifestFetchData::ShouldPing(int days) const { 147 bool ManifestFetchData::ShouldPing(int days) const {
138 return base_url_.DomainIs("google.com") && 148 return base_url_.DomainIs("google.com") &&
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 extension_fetcher_.reset( 858 extension_fetcher_.reset(
849 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); 859 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this));
850 extension_fetcher_->set_request_context( 860 extension_fetcher_->set_request_context(
851 Profile::GetDefaultRequestContext()); 861 Profile::GetDefaultRequestContext());
852 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | 862 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES |
853 net::LOAD_DO_NOT_SAVE_COOKIES); 863 net::LOAD_DO_NOT_SAVE_COOKIES);
854 extension_fetcher_->Start(); 864 extension_fetcher_->Start();
855 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); 865 current_extension_fetch_ = ExtensionFetch(id, url, hash, version);
856 } 866 }
857 } 867 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698