OLD | NEW |
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 12 matching lines...) Expand all Loading... |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
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 #include "core/inspector/MainThreadDebugger.h" | 31 #include "core/inspector/MainThreadDebugger.h" |
32 | 32 |
| 33 #include "bindings/core/v8/BindingSecurity.h" |
33 #include "bindings/core/v8/DOMWrapperWorld.h" | 34 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 35 #include "bindings/core/v8/V8Window.h" |
34 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
35 #include "core/inspector/InspectorTaskRunner.h" | 37 #include "core/inspector/InspectorTaskRunner.h" |
36 #include "core/inspector/v8/V8Debugger.h" | 38 #include "core/inspector/v8/V8Debugger.h" |
37 #include "platform/UserGestureIndicator.h" | 39 #include "platform/UserGestureIndicator.h" |
38 #include "wtf/OwnPtr.h" | 40 #include "wtf/OwnPtr.h" |
39 #include "wtf/PassOwnPtr.h" | 41 #include "wtf/PassOwnPtr.h" |
40 #include "wtf/ThreadingPrimitives.h" | 42 #include "wtf/ThreadingPrimitives.h" |
41 | 43 |
42 namespace blink { | 44 namespace blink { |
43 | 45 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 token->setPauseInDebugger(); | 117 token->setPauseInDebugger(); |
116 // Wait for continue or step command. | 118 // Wait for continue or step command. |
117 m_clientMessageLoop->run(pausedFrame); | 119 m_clientMessageLoop->run(pausedFrame); |
118 } | 120 } |
119 | 121 |
120 void MainThreadDebugger::quitMessageLoopOnPause() | 122 void MainThreadDebugger::quitMessageLoopOnPause() |
121 { | 123 { |
122 m_clientMessageLoop->quitNow(); | 124 m_clientMessageLoop->quitNow(); |
123 } | 125 } |
124 | 126 |
| 127 bool MainThreadDebugger::canAccessContext(v8::Local<v8::Context> context) |
| 128 { |
| 129 if (context.IsEmpty()) |
| 130 return false; |
| 131 DOMWindow* window = toDOMWindow(context->GetIsolate(), context->Global()); |
| 132 return window && BindingSecurity::shouldAllowAccessTo(context->GetIsolate(),
callingDOMWindow(context->GetIsolate()), window, DoNotReportSecurityError); |
| 133 } |
| 134 |
125 } // namespace blink | 135 } // namespace blink |
OLD | NEW |