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

Unified Diff: Source/bindings/core/dart/DartInjectedScriptManager.h

Issue 1532413002: Added Dartium changes onto 45.0.2454.104 (Closed) Base URL: http://src.chromium.org/blink/branches/chromium/2454
Patch Set: Created 5 years 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: 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)
« no previous file with comments | « Source/bindings/core/dart/DartInjectedScriptHostHelper.cpp ('k') | Source/bindings/core/dart/DartInjectedScriptManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698