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

Side by Side Diff: sky/engine/v8_inspector/PageScriptDebugServer.h

Issue 764573002: Parametrize PageScriptDebugServer with v8::Context -> InspectorHost resolver (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Removed Page::m_inspectorHost Created 6 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 unified diff | Download patch
« no previous file with comments | « sky/engine/core/page/Page.cpp ('k') | sky/engine/v8_inspector/PageScriptDebugServer.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) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 2011 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 static void interruptAndRun(PassOwnPtr<Task>); 61 static void interruptAndRun(PassOwnPtr<Task>);
62 62
63 class ClientMessageLoop { 63 class ClientMessageLoop {
64 public: 64 public:
65 virtual ~ClientMessageLoop() { } 65 virtual ~ClientMessageLoop() { }
66 virtual void run(inspector::InspectorHost*) = 0; 66 virtual void run(inspector::InspectorHost*) = 0;
67 virtual void quitNow() = 0; 67 virtual void quitNow() = 0;
68 }; 68 };
69 void setClientMessageLoop(PassOwnPtr<ClientMessageLoop>); 69 void setClientMessageLoop(PassOwnPtr<ClientMessageLoop>);
70 70
71 class InspectorHostResolver {
72 public:
73 virtual ~InspectorHostResolver() { }
74 virtual inspector::InspectorHost* inspectorHostFor(v8::Handle<v8::Contex t>) = 0;
75 };
76 void setInspectorHostResolver(PassOwnPtr<InspectorHostResolver>);
77
71 virtual void compileScript(ScriptState*, const String& expression, const Str ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace) override; 78 virtual void compileScript(ScriptState*, const String& expression, const Str ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace) override;
72 virtual void clearCompiledScripts() override; 79 virtual void clearCompiledScripts() override;
73 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum nNumber, RefPtr<ScriptCallStack>* stackTrace) override; 80 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum nNumber, RefPtr<ScriptCallStack>* stackTrace) override;
74 virtual void setPreprocessorSource(const String&) override; 81 virtual void setPreprocessorSource(const String&) override;
75 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) overrid e; 82 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) overrid e;
76 virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSou rceCode&) override; 83 virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSou rceCode&) override;
77 virtual String preprocessEventListener(LocalFrame*, const String& source, co nst String& url, const String& functionName) override; 84 virtual String preprocessEventListener(LocalFrame*, const String& source, co nst String& url, const String& functionName) override;
78 virtual void clearPreprocessor() override; 85 virtual void clearPreprocessor() override;
79 86
80 virtual void muteWarningsAndDeprecations() override; 87 virtual void muteWarningsAndDeprecations() override;
81 virtual void unmuteWarningsAndDeprecations() override; 88 virtual void unmuteWarningsAndDeprecations() override;
82 89
83 private: 90 private:
84 PageScriptDebugServer(); 91 PageScriptDebugServer();
85 virtual ~PageScriptDebugServer(); 92 virtual ~PageScriptDebugServer();
86 93
87 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte xt>) override; 94 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte xt>) override;
88 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) override; 95 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) override;
89 virtual void quitMessageLoopOnPause() override; 96 virtual void quitMessageLoopOnPause() override;
90 97
91 typedef HashMap<inspector::InspectorHost*, ScriptDebugListener*> ListenersMa p; 98 typedef HashMap<inspector::InspectorHost*, ScriptDebugListener*> ListenersMa p;
92 ListenersMap m_listenersMap; 99 ListenersMap m_listenersMap;
93 OwnPtr<ClientMessageLoop> m_clientMessageLoop; 100 OwnPtr<ClientMessageLoop> m_clientMessageLoop;
101 OwnPtr<InspectorHostResolver> m_inspectorHostResolver;
94 inspector::InspectorHost* m_pausedHost; 102 inspector::InspectorHost* m_pausedHost;
95 HashMap<String, String> m_compiledScriptURLs; 103 HashMap<String, String> m_compiledScriptURLs;
96 104
97 OwnPtr<ScriptSourceCode> m_preprocessorSourceCode; 105 OwnPtr<ScriptSourceCode> m_preprocessorSourceCode;
98 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; 106 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor;
99 bool canPreprocess(LocalFrame*); 107 bool canPreprocess(LocalFrame*);
100 static v8::Isolate* s_mainThreadIsolate; 108 static v8::Isolate* s_mainThreadIsolate;
101 }; 109 };
102 110
103 } // namespace blink 111 } // namespace blink
104 112
105 113
106 #endif // SKY_ENGINE_V8_INSPECTOR_PAGESCRIPTDEBUGSERVER_H_ 114 #endif // SKY_ENGINE_V8_INSPECTOR_PAGESCRIPTDEBUGSERVER_H_
OLDNEW
« no previous file with comments | « sky/engine/core/page/Page.cpp ('k') | sky/engine/v8_inspector/PageScriptDebugServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698