| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "core/html/parser/TextResourceDecoder.h" | 43 #include "core/html/parser/TextResourceDecoder.h" |
| 44 #include "core/inspector/InspectorFrontendClient.h" | 44 #include "core/inspector/InspectorFrontendClient.h" |
| 45 #include "core/layout/LayoutTheme.h" | 45 #include "core/layout/LayoutTheme.h" |
| 46 #include "core/loader/FrameLoader.h" | 46 #include "core/loader/FrameLoader.h" |
| 47 #include "core/page/ContextMenuController.h" | 47 #include "core/page/ContextMenuController.h" |
| 48 #include "core/page/ContextMenuProvider.h" | 48 #include "core/page/ContextMenuProvider.h" |
| 49 #include "core/page/Page.h" | 49 #include "core/page/Page.h" |
| 50 #include "platform/ContextMenu.h" | 50 #include "platform/ContextMenu.h" |
| 51 #include "platform/ContextMenuItem.h" | 51 #include "platform/ContextMenuItem.h" |
| 52 #include "platform/HostWindow.h" | 52 #include "platform/HostWindow.h" |
| 53 #include "platform/ScriptForbiddenScope.h" |
| 53 #include "platform/SharedBuffer.h" | 54 #include "platform/SharedBuffer.h" |
| 54 #include "platform/UserGestureIndicator.h" | 55 #include "platform/UserGestureIndicator.h" |
| 55 #include "platform/network/ResourceError.h" | 56 #include "platform/network/ResourceError.h" |
| 56 #include "platform/network/ResourceRequest.h" | 57 #include "platform/network/ResourceRequest.h" |
| 57 #include "platform/network/ResourceResponse.h" | 58 #include "platform/network/ResourceResponse.h" |
| 58 | 59 |
| 59 namespace blink { | 60 namespace blink { |
| 60 | 61 |
| 61 class FrontendMenuProvider final : public ContextMenuProvider { | 62 class FrontendMenuProvider final : public ContextMenuProvider { |
| 62 public: | 63 public: |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 131 } |
| 131 | 132 |
| 132 DEFINE_TRACE(DevToolsHost) | 133 DEFINE_TRACE(DevToolsHost) |
| 133 { | 134 { |
| 134 visitor->trace(m_frontendFrame); | 135 visitor->trace(m_frontendFrame); |
| 135 visitor->trace(m_menuProvider); | 136 visitor->trace(m_menuProvider); |
| 136 } | 137 } |
| 137 | 138 |
| 138 void DevToolsHost::evaluateScript(const String& expression) | 139 void DevToolsHost::evaluateScript(const String& expression) |
| 139 { | 140 { |
| 141 if (ScriptForbiddenScope::isScriptForbidden()) |
| 142 return; |
| 140 if (!m_frontendFrame) | 143 if (!m_frontendFrame) |
| 141 return; | 144 return; |
| 142 ScriptState* scriptState = ScriptState::forMainWorld(m_frontendFrame); | 145 ScriptState* scriptState = ScriptState::forMainWorld(m_frontendFrame); |
| 143 if (!scriptState) | 146 if (!scriptState) |
| 144 return; | 147 return; |
| 145 ScriptState::Scope scope(scriptState); | 148 ScriptState::Scope scope(scriptState); |
| 146 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 149 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); |
| 147 V8RecursionScope recursionScope(scriptState->isolate()); | 150 V8RecursionScope recursionScope(scriptState->isolate()); |
| 148 v8::Local<v8::String> source = v8AtomicString(scriptState->isolate(), expres
sion.utf8().data()); | 151 v8::Local<v8::String> source = v8AtomicString(scriptState->isolate(), expres
sion.utf8().data()); |
| 149 V8ScriptRunner::compileAndRunInternalScript(source, scriptState->isolate(),
String(), TextPosition()); | 152 V8ScriptRunner::compileAndRunInternalScript(source, scriptState->isolate(),
String(), TextPosition()); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 { | 242 { |
| 240 return m_client && m_client->isUnderTest(); | 243 return m_client && m_client->isUnderTest(); |
| 241 } | 244 } |
| 242 | 245 |
| 243 bool DevToolsHost::isHostedMode() | 246 bool DevToolsHost::isHostedMode() |
| 244 { | 247 { |
| 245 return false; | 248 return false; |
| 246 } | 249 } |
| 247 | 250 |
| 248 } // namespace blink | 251 } // namespace blink |
| OLD | NEW |