Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2010-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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 namespace WebKit { | 83 namespace WebKit { |
| 84 | 84 |
| 85 class ClientMessageLoopAdapter : public PageScriptDebugServer::ClientMessageLoop { | 85 class ClientMessageLoopAdapter : public PageScriptDebugServer::ClientMessageLoop { |
| 86 public: | 86 public: |
| 87 static void ensureClientMessageLoopCreated(WebDevToolsAgentClient* client) | 87 static void ensureClientMessageLoopCreated(WebDevToolsAgentClient* client) |
| 88 { | 88 { |
| 89 if (s_instance) | 89 if (s_instance) |
| 90 return; | 90 return; |
| 91 OwnPtr<ClientMessageLoopAdapter> instance = adoptPtr(new ClientMessageLo opAdapter(adoptPtr(client->createClientMessageLoop()))); | 91 OwnPtr<ClientMessageLoopAdapter> instance = adoptPtr(new ClientMessageLo opAdapter(adoptPtr(client->createClientMessageLoop()))); |
| 92 s_instance = instance.get(); | 92 s_instance = instance.get(); |
| 93 PageScriptDebugServer::shared().setClientMessageLoop(instance.release()) ; | 93 PageScriptDebugServer::setClientMessageLoop(instance.release()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 static void inspectedViewClosed(WebViewImpl* view) | 96 static void inspectedViewClosed(WebViewImpl* view) |
| 97 { | 97 { |
| 98 if (s_instance) | 98 if (s_instance) |
| 99 s_instance->m_frozenViews.remove(view); | 99 s_instance->m_frozenViews.remove(view); |
| 100 } | 100 } |
| 101 | 101 |
| 102 static void didNavigate() | 102 static void didNavigate() |
| 103 { | 103 { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 | 356 |
| 357 WebDevToolsAgentImpl::WebDevToolsAgentImpl( | 357 WebDevToolsAgentImpl::WebDevToolsAgentImpl( |
| 358 WebViewImpl* webViewImpl, | 358 WebViewImpl* webViewImpl, |
| 359 WebDevToolsAgentClient* client) | 359 WebDevToolsAgentClient* client) |
| 360 : m_hostId(client->hostIdentifier()) | 360 : m_hostId(client->hostIdentifier()) |
| 361 , m_client(client) | 361 , m_client(client) |
| 362 , m_webViewImpl(webViewImpl) | 362 , m_webViewImpl(webViewImpl) |
| 363 , m_attached(false) | 363 , m_attached(false) |
| 364 { | 364 { |
| 365 ASSERT(m_hostId > 0); | 365 ASSERT(m_hostId > 0); |
| 366 ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client); | |
|
yurys
2013/07/08 11:13:04
Why do you need it to be initialized when there is
| |
| 366 } | 367 } |
| 367 | 368 |
| 368 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() | 369 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() |
| 369 { | 370 { |
| 370 ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl); | 371 ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl); |
| 371 if (m_attached) | 372 if (m_attached) |
| 372 WebKit::Platform::current()->currentThread()->removeTaskObserver(this); | 373 WebKit::Platform::current()->currentThread()->removeTaskObserver(this); |
| 373 } | 374 } |
| 374 | 375 |
| 375 void WebDevToolsAgentImpl::attach() | 376 void WebDevToolsAgentImpl::attach() |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 751 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack endDispatcher::kProfiler_getCPUProfileCmd] | 752 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack endDispatcher::kProfiler_getCPUProfileCmd] |
| 752 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack endDispatcher::kHeapProfiler_getHeapSnapshotCmd]; | 753 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack endDispatcher::kHeapProfiler_getHeapSnapshotCmd]; |
| 753 } | 754 } |
| 754 | 755 |
| 755 void WebDevToolsAgent::processPendingMessages() | 756 void WebDevToolsAgent::processPendingMessages() |
| 756 { | 757 { |
| 757 PageScriptDebugServer::shared().runPendingTasks(); | 758 PageScriptDebugServer::shared().runPendingTasks(); |
| 758 } | 759 } |
| 759 | 760 |
| 760 } // namespace WebKit | 761 } // namespace WebKit |
| OLD | NEW |