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

Unified Diff: Source/core/inspector/InjectedScript.h

Issue 1168423002: DevTools: merge InjectedScriptBase into InjectedScript (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: typedef -> using Created 5 years, 6 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/inspector/InjectedScript.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InjectedScript.h
diff --git a/Source/core/inspector/InjectedScript.h b/Source/core/inspector/InjectedScript.h
index aacd584c368d9dc739a70e644d5ac6a6ac4865a5..92e44fbab42316e6f93cbb5bd4d80e524095b77b 100644
--- a/Source/core/inspector/InjectedScript.h
+++ b/Source/core/inspector/InjectedScript.h
@@ -33,7 +33,6 @@
#include "bindings/core/v8/ScriptValue.h"
#include "core/InspectorTypeBuilder.h"
-#include "core/inspector/InjectedScriptBase.h"
#include "core/inspector/InjectedScriptManager.h"
#include "core/inspector/InjectedScriptNative.h"
#include "wtf/Forward.h"
@@ -41,12 +40,25 @@
namespace blink {
+class JSONValue;
class Node;
+class ScriptFunctionCall;
-class InjectedScript final : public InjectedScriptBase {
+typedef String ErrorString;
+PassRefPtr<JSONValue> toJSONValue(const ScriptValue&);
+
+
+class InjectedScript final {
public:
InjectedScript();
- virtual ~InjectedScript() { }
+ ~InjectedScript();
+
+ bool isEmpty() const { return m_injectedScriptObject.isEmpty(); }
+ ScriptState* scriptState() const
+ {
+ ASSERT(!isEmpty());
+ return m_injectedScriptObject.scriptState();
+ }
void evaluate(
ErrorString*,
@@ -106,10 +118,20 @@ public:
private:
friend InjectedScript InjectedScriptManager::injectedScriptFor(ScriptState*);
+ using InspectedStateAccessCheck = bool (*)(ScriptState*);
InjectedScript(ScriptValue, InspectedStateAccessCheck, PassRefPtr<InjectedScriptNative>);
ScriptValue nodeAsScriptValue(Node*);
+ void initialize(ScriptValue, InspectedStateAccessCheck);
+ bool canAccessInspectedWindow() const;
+ const ScriptValue& injectedScriptObject() const;
+ ScriptValue callFunctionWithEvalEnabled(ScriptFunctionCall&, bool& hadException) const;
+ void makeCall(ScriptFunctionCall&, RefPtr<JSONValue>* result);
+ void makeEvalCall(ErrorString*, ScriptFunctionCall&, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown, RefPtr<TypeBuilder::Debugger::ExceptionDetails>* = 0);
+ void makeCallWithExceptionDetails(ScriptFunctionCall&, RefPtr<JSONValue>* result, RefPtr<TypeBuilder::Debugger::ExceptionDetails>*);
+ ScriptValue m_injectedScriptObject;
+ InspectedStateAccessCheck m_inspectedStateAccessCheck;
RefPtr<InjectedScriptNative> m_native;
};
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/inspector/InjectedScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698