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

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

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/file_select_helper.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) 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/extensions/user_script_master.h" 5 #include "chrome/browser/extensions/user_script_master.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 base::StringPiece::size_type index = line.find(prefix); 44 base::StringPiece::size_type index = line.find(prefix);
45 if (index == base::StringPiece::npos) 45 if (index == base::StringPiece::npos)
46 return false; 46 return false;
47 47
48 std::string temp(line.data() + index + prefix.length(), 48 std::string temp(line.data() + index + prefix.length(),
49 line.length() - index - prefix.length()); 49 line.length() - index - prefix.length());
50 50
51 if (temp.empty() || !IsWhitespace(temp[0])) 51 if (temp.empty() || !IsWhitespace(temp[0]))
52 return false; 52 return false;
53 53
54 TrimWhitespaceASCII(temp, TRIM_ALL, value); 54 base::TrimWhitespaceASCII(temp, base::TRIM_ALL, value);
55 return true; 55 return true;
56 } 56 }
57 57
58 UserScriptMaster::ScriptReloader::ScriptReloader(UserScriptMaster* master) 58 UserScriptMaster::ScriptReloader::ScriptReloader(UserScriptMaster* master)
59 : master_(master) { 59 : master_(master) {
60 CHECK(BrowserThread::GetCurrentThreadIdentifier(&master_thread_id_)); 60 CHECK(BrowserThread::GetCurrentThreadIdentifier(&master_thread_id_));
61 } 61 }
62 62
63 // static 63 // static
64 bool UserScriptMaster::ScriptReloader::ParseMetadataHeader( 64 bool UserScriptMaster::ScriptReloader::ParseMetadataHeader(
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 457
458 base::SharedMemoryHandle handle_for_process; 458 base::SharedMemoryHandle handle_for_process;
459 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) 459 if (!shared_memory->ShareToProcess(handle, &handle_for_process))
460 return; // This can legitimately fail if the renderer asserts at startup. 460 return; // This can legitimately fail if the renderer asserts at startup.
461 461
462 if (base::SharedMemory::IsHandleValid(handle_for_process)) 462 if (base::SharedMemory::IsHandleValid(handle_for_process))
463 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process)); 463 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process));
464 } 464 }
465 465
466 } // namespace extensions 466 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/file_select_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698