OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |