OLD | NEW |
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class DictionaryValue; | 46 class DictionaryValue; |
47 } | 47 } |
48 | 48 |
49 | 49 |
50 using protocol::Maybe; | 50 using protocol::Maybe; |
51 | 51 |
52 class InjectedScript final { | 52 class InjectedScript final { |
53 public: | 53 public: |
54 ~InjectedScript(); | 54 ~InjectedScript(); |
55 | 55 |
56 void evaluate( | |
57 ErrorString*, | |
58 const String16& expression, | |
59 const String16& objectGroup, | |
60 bool includeCommandLineAPI, | |
61 bool returnByValue, | |
62 bool generatePreview, | |
63 OwnPtr<protocol::Runtime::RemoteObject>* result, | |
64 Maybe<bool>* wasThrown, | |
65 Maybe<protocol::Runtime::ExceptionDetails>*); | |
66 void callFunctionOn( | 56 void callFunctionOn( |
67 ErrorString*, | 57 ErrorString*, |
68 const String16& objectId, | 58 const String16& objectId, |
69 const String16& expression, | 59 const String16& expression, |
70 const String16& arguments, | 60 const String16& arguments, |
71 bool returnByValue, | 61 bool returnByValue, |
72 bool generatePreview, | 62 bool generatePreview, |
73 OwnPtr<protocol::Runtime::RemoteObject>* result, | 63 OwnPtr<protocol::Runtime::RemoteObject>* result, |
74 Maybe<bool>* wasThrown); | 64 Maybe<bool>* wasThrown); |
75 void getFunctionDetails(ErrorString*, const String16& functionId, OwnPtr<pro
tocol::Debugger::FunctionDetails>* result); | 65 void getFunctionDetails(ErrorString*, const String16& functionId, OwnPtr<pro
tocol::Debugger::FunctionDetails>* result); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 Maybe<bool>* wasThrown, | 103 Maybe<bool>* wasThrown, |
114 Maybe<protocol::Runtime::ExceptionDetails>*); | 104 Maybe<protocol::Runtime::ExceptionDetails>*); |
115 | 105 |
116 private: | 106 private: |
117 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8
::Context>); | 107 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8
::Context>); |
118 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8:
:Object>, PassOwnPtr<InjectedScriptNative>, int contextId); | 108 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8:
:Object>, PassOwnPtr<InjectedScriptNative>, int contextId); |
119 | 109 |
120 v8::Local<v8::Value> v8Value() const; | 110 v8::Local<v8::Value> v8Value() const; |
121 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE
xception) const; | 111 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE
xception) const; |
122 PassOwnPtr<protocol::Value> makeCall(V8FunctionCall&); | 112 PassOwnPtr<protocol::Value> makeCall(V8FunctionCall&); |
123 PassOwnPtr<protocol::Runtime::RemoteObject> makeEvalCall(ErrorString*, V8Fun
ctionCall&, Maybe<bool>* wasThrown, Maybe<protocol::Runtime::ExceptionDetails>*
= 0); | 113 PassOwnPtr<protocol::Runtime::RemoteObject> makeEvalCall(ErrorString*, V8Fun
ctionCall&, Maybe<bool>* wasThrown); |
124 PassOwnPtr<protocol::Value> makeCallWithExceptionDetails(V8FunctionCall&, Ma
ybe<protocol::Runtime::ExceptionDetails>*); | 114 PassOwnPtr<protocol::Value> makeCallWithExceptionDetails(V8FunctionCall&, Ma
ybe<protocol::Runtime::ExceptionDetails>*); |
125 v8::MaybeLocal<v8::Value> wrapValue(ErrorString*, v8::Local<v8::Value>, cons
t String16& groupName, bool forceValueType, bool generatePreview) const; | 115 v8::MaybeLocal<v8::Value> wrapValue(ErrorString*, v8::Local<v8::Value>, cons
t String16& groupName, bool forceValueType, bool generatePreview) const; |
126 | 116 |
127 InjectedScriptManager* m_manager; | 117 InjectedScriptManager* m_manager; |
128 v8::Isolate* m_isolate; | 118 v8::Isolate* m_isolate; |
129 v8::Global<v8::Context> m_context; | 119 v8::Global<v8::Context> m_context; |
130 v8::Global<v8::Value> m_value; | 120 v8::Global<v8::Value> m_value; |
131 OwnPtr<InjectedScriptNative> m_native; | 121 OwnPtr<InjectedScriptNative> m_native; |
132 int m_contextId; | 122 int m_contextId; |
133 String16 m_origin; | 123 String16 m_origin; |
134 }; | 124 }; |
135 | 125 |
136 } // namespace blink | 126 } // namespace blink |
137 | 127 |
138 #endif | 128 #endif |
OLD | NEW |