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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 { | 56 { |
57 if (m_frontendHost) | 57 if (m_frontendHost) |
58 m_frontendHost->disconnectClient(); | 58 m_frontendHost->disconnectClient(); |
59 m_client = 0; | 59 m_client = 0; |
60 } | 60 } |
61 | 61 |
62 void InspectorFrontendClientImpl::windowObjectCleared() | 62 void InspectorFrontendClientImpl::windowObjectCleared() |
63 { | 63 { |
64 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 64 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
65 ASSERT(m_frontendPage->mainFrame()); | 65 ASSERT(m_frontendPage->mainFrame()); |
66 ScriptState* scriptState = ScriptState::forMainWorld(m_frontendPage->mainFra
me()); | 66 ScriptState* scriptState = ScriptState::forMainWorld(m_frontendPage->depreca
tedLocalMainFrame()); |
67 ScriptState::Scope scope(scriptState); | 67 ScriptState::Scope scope(scriptState); |
68 | 68 |
69 if (m_frontendHost) | 69 if (m_frontendHost) |
70 m_frontendHost->disconnectClient(); | 70 m_frontendHost->disconnectClient(); |
71 m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage); | 71 m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage); |
72 v8::Handle<v8::Object> global = scriptState->context()->Global(); | 72 v8::Handle<v8::Object> global = scriptState->context()->Global(); |
73 v8::Handle<v8::Value> frontendHostObj = toV8(m_frontendHost.get(), global, s
criptState->isolate()); | 73 v8::Handle<v8::Value> frontendHostObj = toV8(m_frontendHost.get(), global, s
criptState->isolate()); |
74 | 74 |
75 global->Set(v8::String::NewFromUtf8(isolate, "InspectorFrontendHost"), front
endHostObj); | 75 global->Set(v8::String::NewFromUtf8(isolate, "InspectorFrontendHost"), front
endHostObj); |
76 ScriptController* scriptController = m_frontendPage->mainFrame() ? &m_fronte
ndPage->mainFrame()->script() : 0; | 76 ScriptController* scriptController = m_frontendPage->mainFrame() ? &m_fronte
ndPage->deprecatedLocalMainFrame()->script() : 0; |
77 if (scriptController) { | 77 if (scriptController) { |
78 String installAdditionalAPI = | 78 String installAdditionalAPI = |
79 "" // Wrap messages that go to embedder. | 79 "" // Wrap messages that go to embedder. |
80 "(function(host, methodEntries) {" | 80 "(function(host, methodEntries) {" |
81 " host._lastCallId = 0;" | 81 " host._lastCallId = 0;" |
82 " host._callbacks = [];" | 82 " host._callbacks = [];" |
83 " host.embedderMessageAck = function(id, error)" | 83 " host.embedderMessageAck = function(id, error)" |
84 " {" | 84 " {" |
85 " var callback = host._callbacks[id];" | 85 " var callback = host._callbacks[id];" |
86 " delete host._callbacks[id];" | 86 " delete host._callbacks[id];" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 { | 157 { |
158 m_client->sendMessageToEmbedder(message); | 158 m_client->sendMessageToEmbedder(message); |
159 } | 159 } |
160 | 160 |
161 bool InspectorFrontendClientImpl::isUnderTest() | 161 bool InspectorFrontendClientImpl::isUnderTest() |
162 { | 162 { |
163 return m_client->isUnderTest(); | 163 return m_client->isUnderTest(); |
164 } | 164 } |
165 | 165 |
166 } // namespace blink | 166 } // namespace blink |
OLD | NEW |