| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 123 } |
| 124 | 124 |
| 125 // TODO(aa): Handle more types of metadata. | 125 // TODO(aa): Handle more types of metadata. |
| 126 } | 126 } |
| 127 | 127 |
| 128 line_start = line_end + 1; | 128 line_start = line_end + 1; |
| 129 } | 129 } |
| 130 | 130 |
| 131 // If no patterns were specified, default to @include *. This is what | 131 // If no patterns were specified, default to @include *. This is what |
| 132 // Greasemonkey does. | 132 // Greasemonkey does. |
| 133 if (script->globs().empty() && script->url_patterns().empty()) | 133 if (script->globs().empty() && script->url_patterns().is_empty()) |
| 134 script->add_glob("*"); | 134 script->add_glob("*"); |
| 135 | 135 |
| 136 return true; | 136 return true; |
| 137 } | 137 } |
| 138 | 138 |
| 139 void UserScriptMaster::ScriptReloader::StartLoad( | 139 void UserScriptMaster::ScriptReloader::StartLoad( |
| 140 const UserScriptList& user_scripts) { | 140 const UserScriptList& user_scripts) { |
| 141 // Add a reference to ourselves to keep ourselves alive while we're running. | 141 // Add a reference to ourselves to keep ourselves alive while we're running. |
| 142 // Balanced by NotifyMaster(). | 142 // Balanced by NotifyMaster(). |
| 143 AddRef(); | 143 AddRef(); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 if (!handle) | 373 if (!handle) |
| 374 return; | 374 return; |
| 375 | 375 |
| 376 base::SharedMemoryHandle handle_for_process; | 376 base::SharedMemoryHandle handle_for_process; |
| 377 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) | 377 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) |
| 378 return; // This can legitimately fail if the renderer asserts at startup. | 378 return; // This can legitimately fail if the renderer asserts at startup. |
| 379 | 379 |
| 380 if (base::SharedMemory::IsHandleValid(handle_for_process)) | 380 if (base::SharedMemory::IsHandleValid(handle_for_process)) |
| 381 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process)); | 381 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process)); |
| 382 } | 382 } |
| OLD | NEW |