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

Side by Side Diff: extensions/browser/user_script_loader.cc

Issue 2259383002: Consistently use namespaced base::Version in extensions code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « extensions/browser/updater/update_service_unittest.cc ('k') | extensions/common/extension.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/user_script_loader.h" 5 #include "extensions/browser/user_script_loader.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 script->add_glob(value); 108 script->add_glob(value);
109 } else if (GetDeclarationValue(line, kExcludeDeclaration, &value)) { 109 } else if (GetDeclarationValue(line, kExcludeDeclaration, &value)) {
110 base::ReplaceSubstringsAfterOffset(&value, 0, "\\", "\\\\"); 110 base::ReplaceSubstringsAfterOffset(&value, 0, "\\", "\\\\");
111 base::ReplaceSubstringsAfterOffset(&value, 0, "?", "\\?"); 111 base::ReplaceSubstringsAfterOffset(&value, 0, "?", "\\?");
112 script->add_exclude_glob(value); 112 script->add_exclude_glob(value);
113 } else if (GetDeclarationValue(line, kNamespaceDeclaration, &value)) { 113 } else if (GetDeclarationValue(line, kNamespaceDeclaration, &value)) {
114 script->set_name_space(value); 114 script->set_name_space(value);
115 } else if (GetDeclarationValue(line, kNameDeclaration, &value)) { 115 } else if (GetDeclarationValue(line, kNameDeclaration, &value)) {
116 script->set_name(value); 116 script->set_name(value);
117 } else if (GetDeclarationValue(line, kVersionDeclaration, &value)) { 117 } else if (GetDeclarationValue(line, kVersionDeclaration, &value)) {
118 Version version(value); 118 base::Version version(value);
119 if (version.IsValid()) 119 if (version.IsValid())
120 script->set_version(version.GetString()); 120 script->set_version(version.GetString());
121 } else if (GetDeclarationValue(line, kDescriptionDeclaration, &value)) { 121 } else if (GetDeclarationValue(line, kDescriptionDeclaration, &value)) {
122 script->set_description(value); 122 script->set_description(value);
123 } else if (GetDeclarationValue(line, kMatchDeclaration, &value)) { 123 } else if (GetDeclarationValue(line, kMatchDeclaration, &value)) {
124 URLPattern pattern(UserScript::ValidUserScriptSchemes()); 124 URLPattern pattern(UserScript::ValidUserScriptSchemes());
125 if (URLPattern::PARSE_SUCCESS != pattern.Parse(value)) 125 if (URLPattern::PARSE_SUCCESS != pattern.Parse(value))
126 return false; 126 return false;
127 script->add_url_pattern(pattern); 127 script->add_url_pattern(pattern);
128 } else if (GetDeclarationValue(line, kExcludeMatchDeclaration, &value)) { 128 } else if (GetDeclarationValue(line, kExcludeMatchDeclaration, &value)) {
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) 417 if (!shared_memory->ShareToProcess(handle, &handle_for_process))
418 return; // This can legitimately fail if the renderer asserts at startup. 418 return; // This can legitimately fail if the renderer asserts at startup.
419 419
420 if (base::SharedMemory::IsHandleValid(handle_for_process)) { 420 if (base::SharedMemory::IsHandleValid(handle_for_process)) {
421 process->Send(new ExtensionMsg_UpdateUserScripts( 421 process->Send(new ExtensionMsg_UpdateUserScripts(
422 handle_for_process, host_id(), changed_hosts, whitelisted_only)); 422 handle_for_process, host_id(), changed_hosts, whitelisted_only));
423 } 423 }
424 } 424 }
425 425
426 } // namespace extensions 426 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/updater/update_service_unittest.cc ('k') | extensions/common/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698