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

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

Issue 1200053004: Move more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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 <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/version.h" 10 #include "base/version.h"
(...skipping 17 matching lines...) Expand all
28 bool GetDeclarationValue(const base::StringPiece& line, 28 bool GetDeclarationValue(const base::StringPiece& line,
29 const base::StringPiece& prefix, 29 const base::StringPiece& prefix,
30 std::string* value) { 30 std::string* value) {
31 base::StringPiece::size_type index = line.find(prefix); 31 base::StringPiece::size_type index = line.find(prefix);
32 if (index == base::StringPiece::npos) 32 if (index == base::StringPiece::npos)
33 return false; 33 return false;
34 34
35 std::string temp(line.data() + index + prefix.length(), 35 std::string temp(line.data() + index + prefix.length(),
36 line.length() - index - prefix.length()); 36 line.length() - index - prefix.length());
37 37
38 if (temp.empty() || !IsWhitespace(temp[0])) 38 if (temp.empty() || !base::IsUnicodeWhitespace(temp[0]))
39 return false; 39 return false;
40 40
41 base::TrimWhitespaceASCII(temp, base::TRIM_ALL, value); 41 base::TrimWhitespaceASCII(temp, base::TRIM_ALL, value);
42 return true; 42 return true;
43 } 43 }
44 44
45 } // namespace 45 } // namespace
46 46
47 // static 47 // static
48 bool UserScriptLoader::ParseMetadataHeader(const base::StringPiece& script_text, 48 bool UserScriptLoader::ParseMetadataHeader(const base::StringPiece& script_text,
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) 397 if (!shared_memory->ShareToProcess(handle, &handle_for_process))
398 return; // This can legitimately fail if the renderer asserts at startup. 398 return; // This can legitimately fail if the renderer asserts at startup.
399 399
400 if (base::SharedMemory::IsHandleValid(handle_for_process)) { 400 if (base::SharedMemory::IsHandleValid(handle_for_process)) {
401 process->Send(new ExtensionMsg_UpdateUserScripts( 401 process->Send(new ExtensionMsg_UpdateUserScripts(
402 handle_for_process, host_id(), changed_hosts, whitelisted_only)); 402 handle_for_process, host_id(), changed_hosts, whitelisted_only));
403 } 403 }
404 } 404 }
405 405
406 } // namespace extensions 406 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/vpn_provider/vpn_provider_api.cc ('k') | extensions/common/csp_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698