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

Side by Side Diff: chrome/common/pepper_plugin_registry.cc

Issue 3750001: base: Move SplitString functions into the base namespace and update the callers. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: brett review, reverted changes in o3d due to it's using an old base revision 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
« no previous file with comments | « chrome/common/extensions/url_pattern.cc ('k') | chrome/common/zip.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) 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/common/pepper_plugin_registry.h" 5 #include "chrome/common/pepper_plugin_registry.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/native_library.h" 9 #include "base/native_library.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 switches::kRegisterPepperPlugins); 68 switches::kRegisterPepperPlugins);
69 if (value.empty()) 69 if (value.empty())
70 return; 70 return;
71 71
72 // FORMAT: 72 // FORMAT:
73 // command-line = <plugin-entry> + *( LWS + "," + LWS + <plugin-entry> ) 73 // command-line = <plugin-entry> + *( LWS + "," + LWS + <plugin-entry> )
74 // plugin-entry = <file-path> + ["#" + <name> + ["#" + <description>]] + 74 // plugin-entry = <file-path> + ["#" + <name> + ["#" + <description>]] +
75 // *1( LWS + ";" + LWS + <mime-type> ) 75 // *1( LWS + ";" + LWS + <mime-type> )
76 76
77 std::vector<std::string> modules; 77 std::vector<std::string> modules;
78 SplitString(value, ',', &modules); 78 base::SplitString(value, ',', &modules);
79 for (size_t i = 0; i < modules.size(); ++i) { 79 for (size_t i = 0; i < modules.size(); ++i) {
80 std::vector<std::string> parts; 80 std::vector<std::string> parts;
81 SplitString(modules[i], ';', &parts); 81 base::SplitString(modules[i], ';', &parts);
82 if (parts.size() < 2) { 82 if (parts.size() < 2) {
83 DLOG(ERROR) << "Required mime-type not found"; 83 DLOG(ERROR) << "Required mime-type not found";
84 continue; 84 continue;
85 } 85 }
86 86
87 std::vector<std::string> name_parts; 87 std::vector<std::string> name_parts;
88 SplitString(parts[0], '#', &name_parts); 88 base::SplitString(parts[0], '#', &name_parts);
89 89
90 PepperPluginInfo plugin; 90 PepperPluginInfo plugin;
91 #if defined(OS_WIN) 91 #if defined(OS_WIN)
92 // This means we can't provide plugins from non-ASCII paths, but 92 // This means we can't provide plugins from non-ASCII paths, but
93 // since this switch is only for development I don't think that's 93 // since this switch is only for development I don't think that's
94 // too awful. 94 // too awful.
95 plugin.path = FilePath(ASCIIToUTF16(name_parts[0])); 95 plugin.path = FilePath(ASCIIToUTF16(name_parts[0]));
96 #else 96 #else
97 plugin.path = FilePath(name_parts[0]); 97 plugin.path = FilePath(name_parts[0]);
98 #endif 98 #endif
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 for (size_t i = 0; i < plugins.size(); ++i) { 204 for (size_t i = 0; i < plugins.size(); ++i) {
205 const FilePath& path = plugins[i].path; 205 const FilePath& path = plugins[i].path;
206 ModuleHandle module = pepper::PluginModule::CreateModule(path); 206 ModuleHandle module = pepper::PluginModule::CreateModule(path);
207 if (!module) { 207 if (!module) {
208 DLOG(ERROR) << "Failed to load pepper module: " << path.value(); 208 DLOG(ERROR) << "Failed to load pepper module: " << path.value();
209 continue; 209 continue;
210 } 210 }
211 modules_[path] = module; 211 modules_[path] = module;
212 } 212 }
213 } 213 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/url_pattern.cc ('k') | chrome/common/zip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698