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

Side by Side Diff: chrome/browser/extensions/user_script_master.h

Issue 209073: Merge 26476 - Fixed a few data races on reference counters.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 3 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 | « no previous file | chrome/browser/history/history_marshaling.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/chrome/browser/extensions/user_script_master.h:r69-2775
Merged /trunk/src/chrome/browser/extensions/user_script_master.h:r26476
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 #ifndef CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_
6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/directory_watcher.h" 10 #include "base/directory_watcher.h"
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/scoped_ptr.h" 12 #include "base/scoped_ptr.h"
13 #include "base/shared_memory.h" 13 #include "base/shared_memory.h"
14 #include "chrome/common/extensions/user_script.h" 14 #include "chrome/common/extensions/user_script.h"
15 #include "chrome/common/notification_registrar.h" 15 #include "chrome/common/notification_registrar.h"
16 #include "testing/gtest/include/gtest/gtest_prod.h" 16 #include "testing/gtest/include/gtest/gtest_prod.h"
17 17
18 class MessageLoop; 18 class MessageLoop;
19 class StringPiece; 19 class StringPiece;
20 20
21 // Manages a segment of shared memory that contains the user scripts the user 21 // Manages a segment of shared memory that contains the user scripts the user
22 // has installed. Lives on the UI thread. 22 // has installed. Lives on the UI thread.
23 class UserScriptMaster : public base::RefCounted<UserScriptMaster>, 23 class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
24 public DirectoryWatcher::Delegate, 24 public DirectoryWatcher::Delegate,
25 public NotificationObserver { 25 public NotificationObserver {
26 public: 26 public:
27 // For testability, the constructor takes the MessageLoop to run the 27 // For testability, the constructor takes the MessageLoop to run the
28 // script-reloading worker on as well as the path the scripts live in. 28 // script-reloading worker on as well as the path the scripts live in.
29 // These are normally the file thread and a directory inside the profile. 29 // These are normally the file thread and a directory inside the profile.
30 UserScriptMaster(MessageLoop* worker, const FilePath& script_dir); 30 UserScriptMaster(MessageLoop* worker, const FilePath& script_dir);
31 ~UserScriptMaster(); 31 ~UserScriptMaster();
32 32
33 // Add a watched directory. All scripts will be reloaded when any file in 33 // Add a watched directory. All scripts will be reloaded when any file in
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 // If the script directory is modified while we're rescanning it, we note 155 // If the script directory is modified while we're rescanning it, we note
156 // that we're currently mid-scan and then start over again once the scan 156 // that we're currently mid-scan and then start over again once the scan
157 // finishes. This boolean tracks whether another scan is pending. 157 // finishes. This boolean tracks whether another scan is pending.
158 bool pending_scan_; 158 bool pending_scan_;
159 159
160 DISALLOW_COPY_AND_ASSIGN(UserScriptMaster); 160 DISALLOW_COPY_AND_ASSIGN(UserScriptMaster);
161 }; 161 };
162 162
163 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ 163 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/history_marshaling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698