| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 67 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 68 ScriptState* scriptState = ScriptState::forMainWorld(m_webFrame->frame()); | 68 ScriptState* scriptState = ScriptState::forMainWorld(m_webFrame->frame()); |
| 69 DCHECK(scriptState); | 69 DCHECK(scriptState); |
| 70 ScriptState::Scope scope(scriptState); | 70 ScriptState::Scope scope(scriptState); |
| 71 | 71 |
| 72 if (m_devtoolsHost) | 72 if (m_devtoolsHost) |
| 73 m_devtoolsHost->disconnectClient(); | 73 m_devtoolsHost->disconnectClient(); |
| 74 m_devtoolsHost = DevToolsHost::create(this, m_webFrame->frame()); | 74 m_devtoolsHost = DevToolsHost::create(this, m_webFrame->frame()); |
| 75 v8::Local<v8::Object> global = scriptState->context()->Global(); | 75 v8::Local<v8::Object> global = scriptState->context()->Global(); |
| 76 v8::Local<v8::Value> devtoolsHostObj = | 76 v8::Local<v8::Value> devtoolsHostObj = |
| 77 toV8(m_devtoolsHost.get(), global, scriptState->isolate()); | 77 ToV8(m_devtoolsHost.get(), global, scriptState->isolate()); |
| 78 DCHECK(!devtoolsHostObj.IsEmpty()); | 78 DCHECK(!devtoolsHostObj.IsEmpty()); |
| 79 global->Set(v8AtomicString(isolate, "DevToolsHost"), devtoolsHostObj); | 79 global->Set(v8AtomicString(isolate, "DevToolsHost"), devtoolsHostObj); |
| 80 } | 80 } |
| 81 | 81 |
| 82 if (m_injectedScriptForOrigin.isEmpty()) | 82 if (m_injectedScriptForOrigin.isEmpty()) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 String origin = frame->getSecurityOrigin().toString(); | 85 String origin = frame->getSecurityOrigin().toString(); |
| 86 String script = m_injectedScriptForOrigin.get(origin); | 86 String script = m_injectedScriptForOrigin.get(origin); |
| 87 if (script.isEmpty()) | 87 if (script.isEmpty()) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 113 ->viewImpl() | 113 ->viewImpl() |
| 114 ->showContextMenuAtPoint(x, y, menuProvider); | 114 ->showContextMenuAtPoint(x, y, menuProvider); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin, | 117 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin, |
| 118 const String& source) { | 118 const String& source) { |
| 119 m_injectedScriptForOrigin.set(origin, source); | 119 m_injectedScriptForOrigin.set(origin, source); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace blink | 122 } // namespace blink |
| OLD | NEW |