Index: Source/bindings/core/dart/DartInjectedScriptManager.h |
diff --git a/Source/core/inspector/InjectedScriptManager.h b/Source/bindings/core/dart/DartInjectedScriptManager.h |
similarity index 64% |
copy from Source/core/inspector/InjectedScriptManager.h |
copy to Source/bindings/core/dart/DartInjectedScriptManager.h |
index 73ad0e85b035a2661cadd00c23834660268a7e31..c08e817d12eedac6e01653be6513d32a736d864c 100644 |
--- a/Source/core/inspector/InjectedScriptManager.h |
+++ b/Source/bindings/core/dart/DartInjectedScriptManager.h |
@@ -1,6 +1,6 @@ |
/* |
* Copyright (C) 2007 Apple Inc. All rights reserved. |
- * Copyright (C) 2012 Google Inc. All rights reserved. |
+ * Copyright (C) 2014 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
@@ -27,11 +27,11 @@ |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef InjectedScriptManager_h |
-#define InjectedScriptManager_h |
+#ifndef DartInjectedScriptManager_h |
+#define DartInjectedScriptManager_h |
-#include "bindings/core/v8/ScriptState.h" |
-#include "core/CoreExport.h" |
+#include "bindings/common/ScriptState.h" |
+#include "bindings/core/v8/ScopedPersistent.h" |
#include "wtf/Forward.h" |
#include "wtf/HashMap.h" |
#include "wtf/text/WTFString.h" |
@@ -39,56 +39,50 @@ |
namespace blink { |
-class InjectedScript; |
+class LocalDOMWindow; |
+class DartInjectedScript; |
class InjectedScriptHost; |
-class InjectedScriptNative; |
class ScriptValue; |
+class InjectedScriptManager; |
-class CORE_EXPORT InjectedScriptManager : public NoBaseWillBeGarbageCollectedFinalized<InjectedScriptManager> { |
- WTF_MAKE_NONCOPYABLE(InjectedScriptManager); |
- WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InjectedScriptManager); |
+// This is a snapshot of InjectedScriptManager at 38 refactored to only support Dart |
+// with functionality not of interest to Dart removed. |
+class DartInjectedScriptManager { |
+ WTF_MAKE_NONCOPYABLE(DartInjectedScriptManager); |
public: |
- static PassOwnPtrWillBeRawPtr<InjectedScriptManager> createForPage(); |
- static PassOwnPtrWillBeRawPtr<InjectedScriptManager> createForWorker(); |
- ~InjectedScriptManager(); |
- DECLARE_TRACE(); |
+ typedef bool (*InspectedStateAccessCheck)(ScriptState*); |
- void disconnect(); |
+ explicit DartInjectedScriptManager(InspectedStateAccessCheck, InjectedScriptManager* javaScriptInjectedScriptManager); |
+ ~DartInjectedScriptManager(); |
InjectedScriptHost* injectedScriptHost(); |
- InjectedScript injectedScriptFor(ScriptState*); |
- InjectedScript injectedScriptForId(int); |
+ DartInjectedScript* injectedScriptFor(ScriptState*); |
+ DartInjectedScript* injectedScriptForId(int); |
int injectedScriptIdFor(ScriptState*); |
- InjectedScript injectedScriptForObjectId(const String& objectId); |
+ DartInjectedScript* injectedScriptForObjectId(const String& objectId); |
void discardInjectedScripts(); |
- void discardInjectedScriptFor(ScriptState*); |
+ void discardInjectedScriptsFor(LocalDOMWindow*); |
void releaseObjectGroup(const String& objectGroup); |
- typedef bool (*InspectedStateAccessCheck)(ScriptState*); |
InspectedStateAccessCheck inspectedStateAccessCheck() const { return m_inspectedStateAccessCheck; } |
- void setCustomObjectFormatterEnabled(bool); |
+ InjectedScriptManager* javaScriptInjectedScriptManager() { return m_javaScriptInjectedScriptManager; } |
private: |
- explicit InjectedScriptManager(InspectedStateAccessCheck); |
- |
- String injectedScriptSource(); |
- ScriptValue createInjectedScript(const String& source, ScriptState*, int id, InjectedScriptNative*); |
- |
static bool canAccessInspectedWindow(ScriptState*); |
static bool canAccessInspectedWorkerGlobalScope(ScriptState*); |
int m_nextInjectedScriptId; |
- typedef HashMap<int, InjectedScript> IdToInjectedScriptMap; |
+ // FIXMEDART: use RefPtr<DartInjectedScript> instead. |
+ typedef HashMap<int, DartInjectedScript*> IdToInjectedScriptMap; |
IdToInjectedScriptMap m_idToInjectedScript; |
- RefPtrWillBeMember<InjectedScriptHost> m_injectedScriptHost; |
InspectedStateAccessCheck m_inspectedStateAccessCheck; |
typedef HashMap<RefPtr<ScriptState>, int> ScriptStateToId; |
ScriptStateToId m_scriptStateToId; |
- bool m_customObjectFormatterEnabled; |
+ InjectedScriptManager* m_javaScriptInjectedScriptManager; |
}; |
} // namespace blink |
-#endif // !defined(InjectedScriptManager_h) |
+#endif // !defined(DartInjectedScriptManager_h) |