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

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

Issue 7254: Initial Greasemonkey support (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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/browser.vcproj ('k') | chrome/browser/greasemonkey_master.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_GREASEMONKEY_MASTER_H__
6 #define CHROME_BROWSER_GREASEMONKEY_MASTER_H__
7
8 #include <vector>
9
10 #include "base/process.h"
11 #include "base/scoped_ptr.h"
12 #include "base/shared_memory.h"
13
14 // Manages a segment of shared memory that contains the Greasemonkey scripts the
15 // user has installed.
16 class GreasemonkeyMaster {
17 public:
18 GreasemonkeyMaster()
19 : shared_memory_serial_(0) {}
20
21 // Reloads scripts from disk into a new chunk of shared memory and notifies
22 // renderers.
23 bool UpdateScripts();
24
25 // Creates a handle to the shared memory that can be used in the specified
26 // process.
27 bool ShareToProcess(ProcessHandle process, SharedMemoryHandle* new_handle);
28
29 // Gets the segment of shared memory for the scripts.
30 SharedMemory* GetSharedMemory() const {
31 return shared_memory_.get();
32 }
33
34 private:
35 // Contains the scripts that were found the last time UpdateScripts() was
36 // called.
37 scoped_ptr<SharedMemory> shared_memory_;
38
39 // A counter that is incremented each time a new shared memory segment is
40 // created. This is used to uniquely identify segments created at different
41 // times by this class.
42 int shared_memory_serial_;
43
44 DISALLOW_COPY_AND_ASSIGN(GreasemonkeyMaster);
45 };
46
47 #endif // CHROME_BROWSER_GREASEMONKEY_MASTER_H__
OLDNEW
« no previous file with comments | « chrome/browser/browser.vcproj ('k') | chrome/browser/greasemonkey_master.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698