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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // Balanced by NotifyMaster(). | 156 // Balanced by NotifyMaster(). |
157 AddRef(); | 157 AddRef(); |
158 | 158 |
159 this->extensions_info_ = extensions_info_; | 159 this->extensions_info_ = extensions_info_; |
160 BrowserThread::PostTask( | 160 BrowserThread::PostTask( |
161 BrowserThread::FILE, FROM_HERE, | 161 BrowserThread::FILE, FROM_HERE, |
162 base::Bind( | 162 base::Bind( |
163 &UserScriptMaster::ScriptReloader::RunLoad, this, user_scripts)); | 163 &UserScriptMaster::ScriptReloader::RunLoad, this, user_scripts)); |
164 } | 164 } |
165 | 165 |
| 166 UserScriptMaster::ScriptReloader::~ScriptReloader() {} |
| 167 |
166 void UserScriptMaster::ScriptReloader::NotifyMaster( | 168 void UserScriptMaster::ScriptReloader::NotifyMaster( |
167 base::SharedMemory* memory) { | 169 base::SharedMemory* memory) { |
168 // The master went away, so these new scripts aren't useful anymore. | 170 // The master went away, so these new scripts aren't useful anymore. |
169 if (!master_) | 171 if (!master_) |
170 delete memory; | 172 delete memory; |
171 else | 173 else |
172 master_->NewScriptsAvailable(memory); | 174 master_->NewScriptsAvailable(memory); |
173 | 175 |
174 // Drop our self-reference. | 176 // Drop our self-reference. |
175 // Balances StartLoad(). | 177 // Balances StartLoad(). |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 | 436 |
435 base::SharedMemoryHandle handle_for_process; | 437 base::SharedMemoryHandle handle_for_process; |
436 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) | 438 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) |
437 return; // This can legitimately fail if the renderer asserts at startup. | 439 return; // This can legitimately fail if the renderer asserts at startup. |
438 | 440 |
439 if (base::SharedMemory::IsHandleValid(handle_for_process)) | 441 if (base::SharedMemory::IsHandleValid(handle_for_process)) |
440 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process)); | 442 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process)); |
441 } | 443 } |
442 | 444 |
443 } // namespace extensions | 445 } // namespace extensions |
OLD | NEW |