| 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 25 matching lines...) Expand all Loading... |
| 36 #include <wtf/Forward.h> | 36 #include <wtf/Forward.h> |
| 37 #include <wtf/RefPtr.h> | 37 #include <wtf/RefPtr.h> |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class InspectorValue; | 41 class InspectorValue; |
| 42 class ScriptFunctionCall; | 42 class ScriptFunctionCall; |
| 43 | 43 |
| 44 typedef String ErrorString; | 44 typedef String ErrorString; |
| 45 | 45 |
| 46 #if ENABLE(INSPECTOR) | |
| 47 | 46 |
| 48 class InjectedScriptBase { | 47 class InjectedScriptBase { |
| 49 public: | 48 public: |
| 50 virtual ~InjectedScriptBase() { } | 49 virtual ~InjectedScriptBase() { } |
| 51 | 50 |
| 52 const String& name() const { return m_name; } | 51 const String& name() const { return m_name; } |
| 53 bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); } | 52 bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); } |
| 54 ScriptState* scriptState() const { return m_injectedScriptObject.scriptState
(); } | 53 ScriptState* scriptState() const { return m_injectedScriptObject.scriptState
(); } |
| 55 | 54 |
| 56 protected: | 55 protected: |
| 57 typedef bool (*InspectedStateAccessCheck)(ScriptState*); | 56 typedef bool (*InspectedStateAccessCheck)(ScriptState*); |
| 58 InjectedScriptBase(const String& name); | 57 InjectedScriptBase(const String& name); |
| 59 InjectedScriptBase(const String& name, ScriptObject, InspectedStateAccessChe
ck); | 58 InjectedScriptBase(const String& name, ScriptObject, InspectedStateAccessChe
ck); |
| 60 | 59 |
| 61 void initialize(ScriptObject, InspectedStateAccessCheck); | 60 void initialize(ScriptObject, InspectedStateAccessCheck); |
| 62 bool canAccessInspectedWindow() const; | 61 bool canAccessInspectedWindow() const; |
| 63 const ScriptObject& injectedScriptObject() const; | 62 const ScriptObject& injectedScriptObject() const; |
| 64 ScriptValue callFunctionWithEvalEnabled(ScriptFunctionCall&, bool& hadExcept
ion) const; | 63 ScriptValue callFunctionWithEvalEnabled(ScriptFunctionCall&, bool& hadExcept
ion) const; |
| 65 void makeCall(ScriptFunctionCall&, RefPtr<InspectorValue>* result); | 64 void makeCall(ScriptFunctionCall&, RefPtr<InspectorValue>* result); |
| 66 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); |
| 67 | 66 |
| 68 private: | 67 private: |
| 69 String m_name; | 68 String m_name; |
| 70 ScriptObject m_injectedScriptObject; | 69 ScriptObject m_injectedScriptObject; |
| 71 InspectedStateAccessCheck m_inspectedStateAccessCheck; | 70 InspectedStateAccessCheck m_inspectedStateAccessCheck; |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 #endif | |
| 75 | 73 |
| 76 } // namespace WebCore | 74 } // namespace WebCore |
| 77 | 75 |
| 78 #endif | 76 #endif |
| OLD | NEW |