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

Side by Side Diff: chrome/browser/greasemonkey_master.cc

Issue 8908: Make it so that you can refresh and see changes in Greasemonkey... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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/greasemonkey_master.h" 5 #include "chrome/browser/greasemonkey_master.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 // (Asynchronously) scan for our initial set of scripts. 173 // (Asynchronously) scan for our initial set of scripts.
174 StartScan(); 174 StartScan();
175 } 175 }
176 176
177 GreasemonkeyMaster::~GreasemonkeyMaster() { 177 GreasemonkeyMaster::~GreasemonkeyMaster() {
178 if (script_reloader_) 178 if (script_reloader_)
179 script_reloader_->DisownMaster(); 179 script_reloader_->DisownMaster();
180 } 180 }
181 181
182 bool GreasemonkeyMaster::ShareToProcess(ProcessHandle process,
183 SharedMemoryHandle* new_handle) {
184 if (shared_memory_.get())
185 return shared_memory_->ShareToProcess(process, new_handle);
186
187 NOTREACHED();
188 return false;
189 }
190
191 void GreasemonkeyMaster::NewScriptsAvailable(SharedMemory* handle) { 182 void GreasemonkeyMaster::NewScriptsAvailable(SharedMemory* handle) {
192 // Ensure handle is deleted or released. 183 // Ensure handle is deleted or released.
193 scoped_ptr<SharedMemory> handle_deleter(handle); 184 scoped_ptr<SharedMemory> handle_deleter(handle);
194 185
195 if (pending_scan_) { 186 if (pending_scan_) {
196 // While we were scanning, there were further changes. Don't bother 187 // While we were scanning, there were further changes. Don't bother
197 // notifying about these scripts and instead just immediately rescan. 188 // notifying about these scripts and instead just immediately rescan.
198 pending_scan_ = false; 189 pending_scan_ = false;
199 StartScan(); 190 StartScan();
200 } else { 191 } else {
(...skipping 18 matching lines...) Expand all
219 210
220 StartScan(); 211 StartScan();
221 } 212 }
222 213
223 void GreasemonkeyMaster::StartScan() { 214 void GreasemonkeyMaster::StartScan() {
224 if (!script_reloader_) 215 if (!script_reloader_)
225 script_reloader_ = new ScriptReloader(this); 216 script_reloader_ = new ScriptReloader(this);
226 217
227 script_reloader_->StartScan(worker_loop_, *user_script_dir_); 218 script_reloader_->StartScan(worker_loop_, *user_script_dir_);
228 } 219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698