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

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

Issue 12218125: Only register component-updated Flash if it is newer than the bundled one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/flash_component_installer.h" 5 #include "chrome/browser/component_updater/flash_component_installer.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info)) 181 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info))
182 return; 182 return;
183 183
184 std::vector<webkit::WebPluginInfo> plugins; 184 std::vector<webkit::WebPluginInfo> plugins;
185 PluginService::GetInstance()->GetInternalPlugins(&plugins); 185 PluginService::GetInstance()->GetInternalPlugins(&plugins);
186 for (std::vector<webkit::WebPluginInfo>::const_iterator it = plugins.begin(); 186 for (std::vector<webkit::WebPluginInfo>::const_iterator it = plugins.begin();
187 it != plugins.end(); ++it) { 187 it != plugins.end(); ++it) {
188 if (!IsPepperFlash(*it)) 188 if (!IsPepperFlash(*it))
189 continue; 189 continue;
190 190
191 // If the version we're trying to register is older than the existing one, 191 // Do it only if the version we're trying to register is newer.
192 // don't do it. 192 Version registered_version(UTF16ToUTF8(it->version));
193 if (version.IsOlderThan(UTF16ToUTF8(it->version))) 193 if (registered_version.IsValid() &&
194 version.CompareTo(registered_version) <= 0) {
194 return; 195 return;
cpu_(ooo_6.6-7.5) 2013/02/12 22:18:17 why not registered_version.IsOlderThan(version)
yzshen1 2013/02/12 22:27:19 That is because IsOlderThan() receives a string, s
196 }
195 197
196 // If the version is newer, remove the old one first. 198 // If the version is newer, remove the old one first.
197 PluginService::GetInstance()->UnregisterInternalPlugin(it->path); 199 PluginService::GetInstance()->UnregisterInternalPlugin(it->path);
198 break; 200 break;
199 } 201 }
200 202
201 PluginService::GetInstance()->RegisterInternalPlugin( 203 PluginService::GetInstance()->RegisterInternalPlugin(
202 plugin_info.ToWebPluginInfo(), true); 204 plugin_info.ToWebPluginInfo(), true);
203 PluginService::GetInstance()->RefreshPlugins(); 205 PluginService::GetInstance()->RefreshPlugins();
204 } 206 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 #if defined(GOOGLE_CHROME_BUILD) 387 #if defined(GOOGLE_CHROME_BUILD)
386 // Component updated flash supersedes bundled flash therefore if that one 388 // Component updated flash supersedes bundled flash therefore if that one
387 // is disabled then this one should never install. 389 // is disabled then this one should never install.
388 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 390 CommandLine* cmd_line = CommandLine::ForCurrentProcess();
389 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) 391 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash))
390 return; 392 return;
391 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 393 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
392 base::Bind(&StartPepperFlashUpdateRegistration, cus)); 394 base::Bind(&StartPepperFlashUpdateRegistration, cus));
393 #endif 395 #endif
394 } 396 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698