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_listener.h" | 5 #include "chrome/browser/extensions/user_script_listener.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/timer/elapsed_timer.h" | 10 #include "base/timer/elapsed_timer.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 const char* GetNameForLogging() const override { | 57 const char* GetNameForLogging() const override { |
58 return "UserScriptListener::Throttle"; | 58 return "UserScriptListener::Throttle"; |
59 } | 59 } |
60 | 60 |
61 private: | 61 private: |
62 bool should_defer_; | 62 bool should_defer_; |
63 bool did_defer_; | 63 bool did_defer_; |
64 scoped_ptr<base::ElapsedTimer> timer_; | 64 std::unique_ptr<base::ElapsedTimer> timer_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(Throttle); | 66 DISALLOW_COPY_AND_ASSIGN(Throttle); |
67 }; | 67 }; |
68 | 68 |
69 struct UserScriptListener::ProfileData { | 69 struct UserScriptListener::ProfileData { |
70 // True if the user scripts contained in |url_patterns| are ready for | 70 // True if the user scripts contained in |url_patterns| are ready for |
71 // injection. | 71 // injection. |
72 bool user_scripts_ready; | 72 bool user_scripts_ready; |
73 | 73 |
74 // A list of URL patterns that have will have user scripts applied to them. | 74 // A list of URL patterns that have will have user scripts applied to them. |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 &UserScriptListener::ProfileDestroyed, this, profile)); | 274 &UserScriptListener::ProfileDestroyed, this, profile)); |
275 break; | 275 break; |
276 } | 276 } |
277 | 277 |
278 default: | 278 default: |
279 NOTREACHED(); | 279 NOTREACHED(); |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 } // namespace extensions | 283 } // namespace extensions |
OLD | NEW |