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

Unified Diff: extensions/renderer/script_context_set.h

Issue 240603003: Remove ChromeV8Extension & most of ChromeV8Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 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 side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/script_context_set.h
diff --git a/chrome/renderer/extensions/chrome_v8_context_set.h b/extensions/renderer/script_context_set.h
similarity index 61%
rename from chrome/renderer/extensions/chrome_v8_context_set.h
rename to extensions/renderer/script_context_set.h
index f47a61fe74a555d34ee8f0148eae68dc34f7404e..4538fb560fae3e7f55b1057aa7ffdba23b0e3dee 100644
--- a/chrome/renderer/extensions/chrome_v8_context_set.h
+++ b/extensions/renderer/script_context_set.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_RENDERER_EXTENSIONS_CHROME_V8_CONTEXT_SET_H_
-#define CHROME_RENDERER_EXTENSIONS_CHROME_V8_CONTEXT_SET_H_
+#ifndef EXTENSIONS_RENDERER_SCRIPT_CONTEXT_SET_H_
+#define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_SET_H_
#include <set>
#include <string>
@@ -27,54 +27,54 @@ class Context;
}
namespace extensions {
-class ChromeV8Context;
+class ScriptContext;
// A container of ExtensionBindingsContext. Since calling JavaScript within a
// context can cause any number of contexts to be created or destroyed, this
// has additional smarts to help with the set changing underneath callers.
-class ChromeV8ContextSet {
+class ScriptContextSet {
public:
- ChromeV8ContextSet();
- ~ChromeV8ContextSet();
+ ScriptContextSet();
+ ~ScriptContextSet();
int size() const;
// Takes ownership of |context|.
- void Add(ChromeV8Context* context);
+ void Add(ScriptContext* context);
// If the specified context is contained in this set, remove it, then delete
// it asynchronously. After this call returns the context object will still
// be valid, but its frame() pointer will be cleared.
- void Remove(ChromeV8Context* context);
+ void Remove(ScriptContext* context);
// Returns a copy to protect against changes.
- typedef std::set<ChromeV8Context*> ContextSet;
+ typedef std::set<ScriptContext*> ContextSet;
ContextSet GetAll() const;
- // Gets the ChromeV8Context corresponding to v8::Context::GetCurrent(), or
+ // Gets the ScriptContext corresponding to v8::Context::GetCurrent(), or
// NULL if no such context exists.
- ChromeV8Context* GetCurrent() const;
+ ScriptContext* GetCurrent() const;
- // Gets the ChromeV8Context corresponding to v8::Context::GetCalling(), or
+ // Gets the ScriptContext corresponding to v8::Context::GetCalling(), or
// NULL if no such context exists.
- ChromeV8Context* GetCalling() const;
+ ScriptContext* GetCalling() const;
- // Gets the ChromeV8Context corresponding to the specified
+ // Gets the ScriptContext corresponding to the specified
// v8::Context or NULL if no such context exists.
- ChromeV8Context* GetByV8Context(v8::Handle<v8::Context> context) const;
+ ScriptContext* GetByV8Context(v8::Handle<v8::Context> context) const;
- // Synchronously runs |callback| with each ChromeV8Context that belongs to
+ // Synchronously runs |callback| with each ScriptContext that belongs to
// |extension_id| in |render_view|.
//
// |extension_id| may be "" to match all extensions.
// |render_view| may be NULL to match all render views.
void ForEach(const std::string& extension_id,
content::RenderView* render_view,
- const base::Callback<void(ChromeV8Context*)>& callback) const;
+ const base::Callback<void(ScriptContext*)>& callback) const;
// Cleans up contexts belonging to an unloaded extension.
//
- // Returns the set of ChromeV8Contexts that were removed as a result. These
+ // Returns the set of ScriptContexts that were removed as a result. These
// are safe to interact with until the end of the current event loop, since
// they're deleted asynchronously.
ContextSet OnExtensionUnloaded(const std::string& extension_id);
@@ -82,9 +82,9 @@ class ChromeV8ContextSet {
private:
ContextSet contexts_;
- DISALLOW_COPY_AND_ASSIGN(ChromeV8ContextSet);
+ DISALLOW_COPY_AND_ASSIGN(ScriptContextSet);
};
} // namespace extensions
-#endif // CHROME_RENDERER_EXTENSIONS_CHROME_V8_CONTEXT_SET_H_
+#endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_SET_H_

Powered by Google App Engine
This is Rietveld 408576698