Changeset 56907 in webkit


Ignore:
Timestamp:
Apr 1, 2010 3:19:12 AM (14 years ago)
Author:
jorlow@chromium.org
Message:

2010-03-31 Jeremy Orlow <jorlow@chromium.org>

Reviewed by Nate Chapin.

Misc IndexedDatabase cleanup
https://bugs.webkit.org/show_bug.cgi?id=36889

No functional changes.

  • bindings/v8/custom/V8CustomIDBCallbacks.h: (WebCore::V8CustomIDBCallbacks::onSuccess): (WebCore::V8CustomIDBCallbacks::onError): (WebCore::V8CustomIDBCallbacks::V8CustomIDBCallbacks):

Get rid of 2 largely redundant bools

  • storage/IndexedDatabase.h:
  • storage/IndexedDatabaseImpl.cpp: (WebCore::IndexedDatabaseImpl::open):
  • storage/IndexedDatabaseImpl.h:
  • storage/IndexedDatabaseRequest.cpp: (WebCore::IndexedDatabaseRequest::open):
  • storage/IndexedDatabaseRequest.h:

Plumb the Frame* and style cleanups.

2010-03-31 Jeremy Orlow <jorlow@chromium.org>

Reviewed by Nate Chapin.

Misc IndexedDatabase cleanup
https://bugs.webkit.org/show_bug.cgi?id=36889

Plumb the Frame* so Chromium knows where the request originated from.

  • public/WebIndexedDatabase.h:
  • src/IndexedDatabaseProxy.cpp: (WebCore::IndexedDatabaseProxy::open):
  • src/IndexedDatabaseProxy.h:
  • src/WebIndexedDatabaseImpl.cpp: (WebKit::WebIndexedDatabaseImpl::open):
  • src/WebIndexedDatabaseImpl.h:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r56905 r56907  
     12010-03-31  Jeremy Orlow  <jorlow@chromium.org>
     2
     3        Reviewed by Nate Chapin.
     4
     5        Misc IndexedDatabase cleanup
     6        https://bugs.webkit.org/show_bug.cgi?id=36889
     7
     8        No functional changes.
     9
     10        * bindings/v8/custom/V8CustomIDBCallbacks.h: 
     11        (WebCore::V8CustomIDBCallbacks::onSuccess):
     12        (WebCore::V8CustomIDBCallbacks::onError):
     13        (WebCore::V8CustomIDBCallbacks::V8CustomIDBCallbacks):
     14            Get rid of 2 largely redundant bools
     15
     16        * storage/IndexedDatabase.h:
     17        * storage/IndexedDatabaseImpl.cpp:
     18        (WebCore::IndexedDatabaseImpl::open):
     19        * storage/IndexedDatabaseImpl.h:
     20        * storage/IndexedDatabaseRequest.cpp:
     21        (WebCore::IndexedDatabaseRequest::open):
     22        * storage/IndexedDatabaseRequest.h:
     23            Plumb the Frame* and style cleanups.
     24
    1252010-03-31  Nikolas Zimmermann  <nzimmermann@rim.com>
    226
  • trunk/WebCore/bindings/v8/custom/V8CustomIDBCallbacks.h

    r56834 r56907  
    6262    virtual void onSuccess(PassRefPtr<ResultType> result)
    6363    {
    64         if (m_onSuccessNull)
     64        if (m_onSuccess.IsEmpty())
    6565            return;
    6666        v8::HandleScope handleScope;
     
    8181    virtual void onError(PassRefPtr<IDBDatabaseError> error)
    8282    {
    83         if (m_onErrorNull)
     83        if (m_onError.IsEmpty())
    8484            return;
    8585        v8::HandleScope handleScope;
     
    100100private:
    101101    V8CustomIDBCallbacks(v8::Local<v8::Value> onSuccess, v8::Local<v8::Value> onError, Frame* frame)
    102         : m_onSuccessNull(!onSuccess->IsObject())
    103         , m_onSuccess(v8::Persistent<v8::Object>::New(onSuccess->ToObject()))
    104         , m_onErrorNull(!onError->IsObject())
    105         , m_onError(v8::Persistent<v8::Object>::New(onError->ToObject()))
     102        : m_onSuccess(onSuccess->IsObject() ? v8::Persistent<v8::Object>::New(onSuccess->ToObject()) : v8::Persistent<v8::Object>())
     103        , m_onError(onError->IsObject() ? v8::Persistent<v8::Object>::New(onError->ToObject()) : v8::Persistent<v8::Object>())
    106104        , m_frame(frame)
    107105    {
     
    109107
    110108    // FIXME: Should these be v8::Functions?  For some reason, VoidCallback (which this copied) uses v8::Objects.
    111     bool m_onSuccessNull;
    112109    v8::Persistent<v8::Object> m_onSuccess;
    113     bool m_onErrorNull;
    114110    v8::Persistent<v8::Object> m_onError;
    115111    RefPtr<Frame> m_frame;
  • trunk/WebCore/storage/IndexedDatabase.h

    r56777 r56907  
    3838namespace WebCore {
    3939
     40class Frame;
    4041class IDBDatabase;
    4142
     
    5152    virtual ~IndexedDatabase() { }
    5253
    53     virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>) = 0;
     54    virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>, Frame*) = 0;
    5455};
    5556
  • trunk/WebCore/storage/IndexedDatabaseImpl.cpp

    r56777 r56907  
    5050}
    5151
    52 void IndexedDatabaseImpl::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>)
     52void IndexedDatabaseImpl::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>, Frame* frame)
    5353{
    5454    // FIXME: Write.
  • trunk/WebCore/storage/IndexedDatabaseImpl.h

    r56777 r56907  
    4040    virtual ~IndexedDatabaseImpl();
    4141
    42     virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBCallbacks<IDBDatabase> >);
     42    virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBCallbacks<IDBDatabase> >, Frame*);
    4343
    4444private:
  • trunk/WebCore/storage/IndexedDatabaseRequest.cpp

    r56834 r56907  
    4949void IndexedDatabaseRequest::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& exception, PassRefPtr<IDBDatabaseCallbacks> callbacks)
    5050{
    51     m_indexedDatabase->open(name, description, modifyDatabase, exception, callbacks);
     51    m_indexedDatabase->open(name, description, modifyDatabase, exception, callbacks, m_frame);
    5252}
    5353
  • trunk/WebCore/storage/IndexedDatabaseRequest.h

    r56834 r56907  
    5151    ~IndexedDatabaseRequest();
    5252
    53     void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks> callbacks);
     53    void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>);
    5454
    5555    void disconnectFrame() { m_frame = 0; }
  • trunk/WebKit/chromium/ChangeLog

    r56880 r56907  
     12010-03-31  Jeremy Orlow  <jorlow@chromium.org>
     2
     3        Reviewed by Nate Chapin.
     4
     5        Misc IndexedDatabase cleanup
     6        https://bugs.webkit.org/show_bug.cgi?id=36889
     7
     8        Plumb the Frame* so Chromium knows where the request originated from.
     9
     10        * public/WebIndexedDatabase.h:
     11        * src/IndexedDatabaseProxy.cpp:
     12        (WebCore::IndexedDatabaseProxy::open):
     13        * src/IndexedDatabaseProxy.h:
     14        * src/WebIndexedDatabaseImpl.cpp:
     15        (WebKit::WebIndexedDatabaseImpl::open):
     16        * src/WebIndexedDatabaseImpl.h:
     17
    1182010-03-31  Alpha Lam  <hclam@chromium.org>
    219
  • trunk/WebKit/chromium/public/WebIndexedDatabase.h

    r56777 r56907  
    3535namespace WebKit {
    3636
     37class WebFrame;
    3738class WebIDBDatabase;
    3839class WebString;
     
    4748    virtual ~WebIndexedDatabase() { }
    4849
    49     virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode, WebIDBCallbacks<WebIDBDatabase>* callbacks) = 0;
     50    virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode, WebIDBCallbacks<WebIDBDatabase>*, WebFrame*) = 0;
    5051};
    5152
  • trunk/WebKit/chromium/src/IndexedDatabaseProxy.cpp

    r56713 r56907  
    3333#include "IDBDatabaseError.h"
    3434#include "IDBDatabaseProxy.h"
     35#include "WebFrameImpl.h"
    3536#include "WebIDBDatabase.h"
    3637#include "WebIDBDatabaseError.h"
     
    5758}
    5859
    59 void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& ec, PassRefPtr<IDBDatabaseCallbacks> callbacks)
     60void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& ec, PassRefPtr<IDBDatabaseCallbacks> callbacks, Frame* frame)
    6061{
     62    WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame);
    6163    m_webIndexedDatabase->open(name, description, modifyDatabase, ec,
    62                                new IDBCallbacksProxy<WebKit::WebIDBDatabase, IDBDatabase, IDBDatabaseProxy>(callbacks));
     64                               new IDBCallbacksProxy<WebKit::WebIDBDatabase, IDBDatabase, IDBDatabaseProxy>(callbacks), webFrame);
    6365}
    6466
  • trunk/WebKit/chromium/src/IndexedDatabaseProxy.h

    r56713 r56907  
    4343    virtual ~IndexedDatabaseProxy();
    4444
    45     virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>);
     45    virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&, PassRefPtr<IDBDatabaseCallbacks>, Frame*);
    4646
    4747private:
  • trunk/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp

    r56777 r56907  
    4848}
    4949
    50 void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode, WebIDBCallbacks<WebIDBDatabase>* callbacksPtr)
     50void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode, WebIDBCallbacks<WebIDBDatabase>* callbacksPtr, WebFrame*)
    5151{
    5252    OwnPtr<WebIDBCallbacks<WebIDBDatabase>*> callbacks(callbacksPtr);
  • trunk/WebKit/chromium/src/WebIndexedDatabaseImpl.h

    r56777 r56907  
    3838    virtual ~WebIndexedDatabaseImpl();
    3939
    40     virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode, WebIDBCallbacks<WebIDBDatabase>* callbacks);
     40    virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode, WebIDBCallbacks<WebIDBDatabase>*, WebFrame*);
    4141};
    4242
Note: See TracChangeset for help on using the changeset viewer.