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