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

Side by Side Diff: extensions/renderer/module_system.h

Issue 1074273002: Move the event attach/detach logic on unload from event.js to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix memory leak Created 5 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_RENDERER_MODULE_SYSTEM_H_ 5 #ifndef EXTENSIONS_RENDERER_MODULE_SYSTEM_H_
6 #define EXTENSIONS_RENDERER_MODULE_SYSTEM_H_ 6 #define EXTENSIONS_RENDERER_MODULE_SYSTEM_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 const std::string& field, 135 const std::string& field,
136 const std::string& module_name, 136 const std::string& module_name,
137 const std::string& module_field); 137 const std::string& module_field);
138 138
139 // Passes exceptions to |handler| rather than console::Fatal. 139 // Passes exceptions to |handler| rather than console::Fatal.
140 void SetExceptionHandlerForTest(scoped_ptr<ExceptionHandler> handler) { 140 void SetExceptionHandlerForTest(scoped_ptr<ExceptionHandler> handler) {
141 exception_handler_ = handler.Pass(); 141 exception_handler_ = handler.Pass();
142 } 142 }
143 143
144 protected: 144 protected:
145 friend class ModuleSystemTest;
145 friend class ScriptContext; 146 friend class ScriptContext;
146 void Invalidate() override; 147 void Invalidate() override;
147 148
148 private: 149 private:
149 typedef std::map<std::string, linked_ptr<NativeHandler> > NativeHandlerMap; 150 typedef std::map<std::string, linked_ptr<NativeHandler> > NativeHandlerMap;
150 151
151 // Retrieves the lazily defined field specified by |property|. 152 // Retrieves the lazily defined field specified by |property|.
152 static void LazyFieldGetter(v8::Local<v8::String> property, 153 static void LazyFieldGetter(v8::Local<v8::String> property,
153 const v8::PropertyCallbackInfo<v8::Value>& info); 154 const v8::PropertyCallbackInfo<v8::Value>& info);
154 // Retrieves the lazily defined field specified by |property| on a native 155 // Retrieves the lazily defined field specified by |property| on a native
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 std::set<std::string> overridden_native_handlers_; 226 std::set<std::string> overridden_native_handlers_;
226 227
227 base::WeakPtrFactory<ModuleSystem> weak_factory_; 228 base::WeakPtrFactory<ModuleSystem> weak_factory_;
228 229
229 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); 230 DISALLOW_COPY_AND_ASSIGN(ModuleSystem);
230 }; 231 };
231 232
232 } // namespace extensions 233 } // namespace extensions
233 234
234 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_H_ 235 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698