| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "core/page/Page.h" | 50 #include "core/page/Page.h" |
| 51 #include "platform/ContextMenuItem.h" | 51 #include "platform/ContextMenuItem.h" |
| 52 #include "platform/weborigin/SecurityOrigin.h" | 52 #include "platform/weborigin/SecurityOrigin.h" |
| 53 #include "public/web/WebDevToolsFrontendClient.h" | 53 #include "public/web/WebDevToolsFrontendClient.h" |
| 54 #include "public/web/WebScriptSource.h" | 54 #include "public/web/WebScriptSource.h" |
| 55 #include "web/InspectorFrontendClientImpl.h" | 55 #include "web/InspectorFrontendClientImpl.h" |
| 56 #include "web/WebLocalFrameImpl.h" | 56 #include "web/WebLocalFrameImpl.h" |
| 57 #include "web/WebViewImpl.h" | 57 #include "web/WebViewImpl.h" |
| 58 #include "wtf/OwnPtr.h" | 58 #include "wtf/OwnPtr.h" |
| 59 | 59 |
| 60 using namespace WebCore; | 60 using namespace blink; |
| 61 | 61 |
| 62 namespace blink { | 62 namespace blink { |
| 63 | 63 |
| 64 class WebDevToolsFrontendImpl::InspectorFrontendResumeObserver : public ActiveDO
MObject { | 64 class WebDevToolsFrontendImpl::InspectorFrontendResumeObserver : public ActiveDO
MObject { |
| 65 WTF_MAKE_NONCOPYABLE(InspectorFrontendResumeObserver); | 65 WTF_MAKE_NONCOPYABLE(InspectorFrontendResumeObserver); |
| 66 public: | 66 public: |
| 67 InspectorFrontendResumeObserver(WebDevToolsFrontendImpl* webDevToolsFrontend
Impl, Document* document) | 67 InspectorFrontendResumeObserver(WebDevToolsFrontendImpl* webDevToolsFrontend
Impl, Document* document) |
| 68 : ActiveDOMObject(document) | 68 : ActiveDOMObject(document) |
| 69 , m_webDevToolsFrontendImpl(webDevToolsFrontendImpl) | 69 , m_webDevToolsFrontendImpl(webDevToolsFrontendImpl) |
| 70 { | 70 { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 void WebDevToolsFrontendImpl::resume() | 113 void WebDevToolsFrontendImpl::resume() |
| 114 { | 114 { |
| 115 // We should call maybeDispatch asynchronously here because we are not allow
ed to update activeDOMObjects list in | 115 // We should call maybeDispatch asynchronously here because we are not allow
ed to update activeDOMObjects list in |
| 116 // resume (See ExecutionContext::resumeActiveDOMObjects). | 116 // resume (See ExecutionContext::resumeActiveDOMObjects). |
| 117 if (!m_inspectorFrontendDispatchTimer.isActive()) | 117 if (!m_inspectorFrontendDispatchTimer.isActive()) |
| 118 m_inspectorFrontendDispatchTimer.startOneShot(0, FROM_HERE); | 118 m_inspectorFrontendDispatchTimer.startOneShot(0, FROM_HERE); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void WebDevToolsFrontendImpl::maybeDispatch(WebCore::Timer<WebDevToolsFrontendIm
pl>*) | 121 void WebDevToolsFrontendImpl::maybeDispatch(blink::Timer<WebDevToolsFrontendImpl
>*) |
| 122 { | 122 { |
| 123 while (!m_messages.isEmpty()) { | 123 while (!m_messages.isEmpty()) { |
| 124 Document* document = m_webViewImpl->page()->deprecatedLocalMainFrame()->
document(); | 124 Document* document = m_webViewImpl->page()->deprecatedLocalMainFrame()->
document(); |
| 125 if (document->activeDOMObjectsAreSuspended()) { | 125 if (document->activeDOMObjectsAreSuspended()) { |
| 126 m_inspectorFrontendResumeObserver = adoptPtr(new InspectorFrontendRe
sumeObserver(this, document)); | 126 m_inspectorFrontendResumeObserver = adoptPtr(new InspectorFrontendRe
sumeObserver(this, document)); |
| 127 return; | 127 return; |
| 128 } | 128 } |
| 129 m_inspectorFrontendResumeObserver.clear(); | 129 m_inspectorFrontendResumeObserver.clear(); |
| 130 doDispatchOnInspectorFrontend(m_messages.takeFirst()); | 130 doDispatchOnInspectorFrontend(m_messages.takeFirst()); |
| 131 } | 131 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 158 } | 158 } |
| 159 v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(dispatchF
unction); | 159 v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(dispatchF
unction); |
| 160 Vector< v8::Handle<v8::Value> > args; | 160 Vector< v8::Handle<v8::Value> > args; |
| 161 args.append(v8String(isolate, message)); | 161 args.append(v8String(isolate, message)); |
| 162 v8::TryCatch tryCatch; | 162 v8::TryCatch tryCatch; |
| 163 tryCatch.SetVerbose(true); | 163 tryCatch.SetVerbose(true); |
| 164 ScriptController::callFunction(frame->frame()->document(), function, dispatc
herObject, args.size(), args.data(), isolate); | 164 ScriptController::callFunction(frame->frame()->document(), function, dispatc
herObject, args.size(), args.data(), isolate); |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |