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

Side by Side Diff: Source/core/inspector/InjectedScriptBase.h

Issue 293963003: Remove ScriptObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InjectedScript.cpp ('k') | Source/core/inspector/InjectedScriptBase.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef InjectedScriptBase_h 31 #ifndef InjectedScriptBase_h
32 #define InjectedScriptBase_h 32 #define InjectedScriptBase_h
33 33
34 #include "InspectorTypeBuilder.h" 34 #include "InspectorTypeBuilder.h"
35 #include "bindings/v8/ScriptObject.h"
36 #include "bindings/v8/ScriptState.h" 35 #include "bindings/v8/ScriptState.h"
36 #include "bindings/v8/ScriptValue.h"
37 #include "wtf/Forward.h" 37 #include "wtf/Forward.h"
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 class JSONValue; 41 class JSONValue;
42 class ScriptFunctionCall; 42 class ScriptFunctionCall;
43 43
44 typedef String ErrorString; 44 typedef String ErrorString;
45 45
46 46
47 class InjectedScriptBase { 47 class InjectedScriptBase {
48 public: 48 public:
49 virtual ~InjectedScriptBase() { } 49 virtual ~InjectedScriptBase() { }
50 50
51 const String& name() const { return m_name; } 51 const String& name() const { return m_name; }
52 bool isEmpty() const { return m_injectedScriptObject.isEmpty(); } 52 bool isEmpty() const { return m_injectedScriptObject.isEmpty(); }
53 ScriptState* scriptState() const { return m_injectedScriptObject.scriptState (); } 53 ScriptState* scriptState() const { return m_injectedScriptObject.scriptState (); }
54 54
55 protected: 55 protected:
56 typedef bool (*InspectedStateAccessCheck)(ScriptState*); 56 typedef bool (*InspectedStateAccessCheck)(ScriptState*);
57 InjectedScriptBase(const String& name); 57 InjectedScriptBase(const String& name);
58 InjectedScriptBase(const String& name, ScriptObject, InspectedStateAccessChe ck); 58 InjectedScriptBase(const String& name, ScriptValue, InspectedStateAccessChec k);
59 59
60 void initialize(ScriptObject, InspectedStateAccessCheck); 60 void initialize(ScriptValue, InspectedStateAccessCheck);
61 bool canAccessInspectedWindow() const; 61 bool canAccessInspectedWindow() const;
62 const ScriptObject& injectedScriptObject() const; 62 const ScriptValue& injectedScriptObject() const;
63 ScriptValue callFunctionWithEvalEnabled(ScriptFunctionCall&, bool& hadExcept ion) const; 63 ScriptValue callFunctionWithEvalEnabled(ScriptFunctionCall&, bool& hadExcept ion) const;
64 void makeCall(ScriptFunctionCall&, RefPtr<JSONValue>* result); 64 void makeCall(ScriptFunctionCall&, RefPtr<JSONValue>* result);
65 void makeEvalCall(ErrorString*, ScriptFunctionCall&, RefPtr<TypeBuilder::Run time::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown); 65 void makeEvalCall(ErrorString*, ScriptFunctionCall&, RefPtr<TypeBuilder::Run time::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown);
66 66
67 private: 67 private:
68 String m_name; 68 String m_name;
69 ScriptObject m_injectedScriptObject; 69 ScriptValue m_injectedScriptObject;
70 InspectedStateAccessCheck m_inspectedStateAccessCheck; 70 InspectedStateAccessCheck m_inspectedStateAccessCheck;
71 }; 71 };
72 72
73 73
74 } // namespace WebCore 74 } // namespace WebCore
75 75
76 #endif 76 #endif
OLDNEW
« no previous file with comments | « Source/core/inspector/InjectedScript.cpp ('k') | Source/core/inspector/InjectedScriptBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698