Changeset 56972 in webkit


Ignore:
Timestamp:
Apr 1, 2010 11:09:07 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-01 Jay Civelli <jcivelli@google.com>

Reviewed by David Levin.

Adds a method to WebFrame to execute JavaScript and get the value
it evaluates to.
https://bugs.webkit.org/show_bug.cgi?id=36907

  • public/WebFrame.h:
  • src/WebFrameImpl.cpp: (WebKit::WebFrameImpl::executeScriptAndReturnValue):
  • src/WebFrameImpl.h:
Location:
trunk/WebKit/chromium
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r56968 r56972  
     12010-04-01  Jay Civelli  <jcivelli@google.com>
     2
     3        Reviewed by David Levin.
     4
     5        Adds a method to WebFrame to execute JavaScript and get the value
     6        it evaluates to.
     7        https://bugs.webkit.org/show_bug.cgi?id=36907
     8
     9        * public/WebFrame.h:
     10        * src/WebFrameImpl.cpp:
     11        (WebKit::WebFrameImpl::executeScriptAndReturnValue):
     12        * src/WebFrameImpl.h:
     13
    1142010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
    215
  • trunk/WebKit/chromium/public/WebFrame.h

    r55814 r56972  
    4040namespace v8 {
    4141class Context;
     42class Value;
     43template <class T> class Handle;
    4244template <class T> class Local;
    4345}
     
    226228
    227229#if WEBKIT_USING_V8
     230    // Executes script in the context of the current page and returns the value
     231    // that the script evaluated to.
     232    virtual v8::Handle<v8::Value> executeScriptAndReturnValue(
     233        const WebScriptSource&) = 0;
     234
    228235    // Returns the V8 context for this frame, or an empty handle if there
    229236    // is none.
  • trunk/WebKit/chromium/src/WebFrameImpl.cpp

    r56958 r56972  
    780780
    781781#if USE(V8)
     782v8::Handle<v8::Value> WebFrameImpl::executeScriptAndReturnValue(
     783    const WebScriptSource& source)
     784{
     785    return m_frame->script()->executeScript(
     786        ScriptSourceCode(source.code, source.url, source.startLine)).v8Value();
     787}
     788
    782789// Returns the V8 context for this frame, or an empty handle if there is none.
    783790v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const
  • trunk/WebKit/chromium/src/WebFrameImpl.h

    r56212 r56972  
    102102    virtual void collectGarbage();
    103103#if WEBKIT_USING_V8
     104    virtual v8::Handle<v8::Value> executeScriptAndReturnValue(
     105        const WebScriptSource&);
    104106    virtual v8::Local<v8::Context> mainWorldScriptContext() const;
    105107#endif
Note: See TracChangeset for help on using the changeset viewer.