Cleanup namespace usage in Source/core/modules/[battery/* to indexeddb/*]

Cleanup namespace usage in Source/core/modules/[battery/* to indexeddb/*]

- Merge multiple |namespace blink {}| blocks
- Remove unnecessary  blink:: prefixes
- Make blank lines consistent

BUG=None

Review URL: https://codereview.chromium.org/466813003

git-svn-id: svn://svn.chromium.org/blink/trunk@180106 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 044f0395
......@@ -11,20 +11,18 @@
#include "public/platform/WebBatteryStatusListener.h"
namespace blink {
class WebBatteryStatus;
}
namespace blink {
class WebBatteryStatus;
class BatteryDispatcher FINAL : public PlatformEventDispatcher, public blink::WebBatteryStatusListener {
class BatteryDispatcher FINAL : public PlatformEventDispatcher, public WebBatteryStatusListener {
public:
static BatteryDispatcher& instance();
virtual ~BatteryDispatcher();
BatteryStatus* latestData();
// Inherited from blink::WebBatteryStatusListener.
virtual void updateBatteryStatus(const blink::WebBatteryStatus&) OVERRIDE;
// Inherited from WebBatteryStatusListener.
virtual void updateBatteryStatus(const WebBatteryStatus&) OVERRIDE;
private:
BatteryDispatcher();
......@@ -36,6 +34,6 @@ private:
RefPtrWillBePersistent<BatteryStatus> m_batteryStatus;
};
}
} // namespace blink
#endif // BatteryDispatcher_h
......@@ -14,7 +14,7 @@ namespace blink {
class DeviceLightController;
// This class listens to device light data and notifies all registered controllers.
class DeviceLightDispatcher FINAL : public PlatformEventDispatcher, public blink::WebDeviceLightListener {
class DeviceLightDispatcher FINAL : public PlatformEventDispatcher, public WebDeviceLightListener {
public:
static DeviceLightDispatcher& instance();
......
......@@ -31,10 +31,8 @@
#include "wtf/RefPtr.h"
namespace blink {
class WebDeviceMotionData;
}
namespace blink {
class WebDeviceMotionData;
class DeviceMotionData : public RefCountedWillBeGarbageCollected<DeviceMotionData> {
public:
......@@ -96,7 +94,7 @@ public:
PassRefPtrWillBeRawPtr<RotationRate>,
bool canProvideInterval,
double interval);
static PassRefPtrWillBeRawPtr<DeviceMotionData> create(const blink::WebDeviceMotionData&);
static PassRefPtrWillBeRawPtr<DeviceMotionData> create(const WebDeviceMotionData&);
void trace(Visitor*);
Acceleration* acceleration() const { return m_acceleration.get(); }
......
......@@ -36,17 +36,14 @@
#include "public/platform/WebDeviceMotionListener.h"
#include "wtf/RefPtr.h"
namespace blink {
class WebDeviceMotionData;
}
namespace blink {
class DeviceMotionController;
class DeviceMotionData;
class WebDeviceMotionData;
// This class listens to device motion data and notifies all registered controllers.
class DeviceMotionDispatcher FINAL : public PlatformEventDispatcher, public blink::WebDeviceMotionListener {
class DeviceMotionDispatcher FINAL : public PlatformEventDispatcher, public WebDeviceMotionListener {
public:
static DeviceMotionDispatcher& instance();
......@@ -55,7 +52,7 @@ public:
DeviceMotionData* latestDeviceMotionData();
// Inherited from WebDeviceMotionListener.
virtual void didChangeDeviceMotion(const blink::WebDeviceMotionData&) OVERRIDE;
virtual void didChangeDeviceMotion(const WebDeviceMotionData&) OVERRIDE;
private:
DeviceMotionDispatcher();
......
......@@ -30,16 +30,14 @@
#include "wtf/RefCounted.h"
namespace blink {
class WebDeviceOrientationData;
}
namespace blink {
class WebDeviceOrientationData;
class DeviceOrientationData : public RefCountedWillBeGarbageCollected<DeviceOrientationData> {
public:
static PassRefPtrWillBeRawPtr<DeviceOrientationData> create();
static PassRefPtrWillBeRawPtr<DeviceOrientationData> create(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma, bool canProvideAbsolute = false, bool absolute = false);
static PassRefPtrWillBeRawPtr<DeviceOrientationData> create(const blink::WebDeviceOrientationData&);
static PassRefPtrWillBeRawPtr<DeviceOrientationData> create(const WebDeviceOrientationData&);
void trace(Visitor*) { }
double alpha() const;
......
......@@ -36,17 +36,14 @@
#include "public/platform/WebDeviceOrientationListener.h"
#include "wtf/RefPtr.h"
namespace blink {
class WebDeviceOrientationData;
}
namespace blink {
class DeviceOrientationController;
class DeviceOrientationData;
class WebDeviceOrientationData;
// This class listens to device orientation data and notifies all registered controllers.
class DeviceOrientationDispatcher : public PlatformEventDispatcher, public blink::WebDeviceOrientationListener {
class DeviceOrientationDispatcher : public PlatformEventDispatcher, public WebDeviceOrientationListener {
public:
static DeviceOrientationDispatcher& instance();
......@@ -55,7 +52,7 @@ public:
DeviceOrientationData* latestDeviceOrientationData();
// Inherited from WebDeviceOrientationListener.
virtual void didChangeDeviceOrientation(const blink::WebDeviceOrientationData&) OVERRIDE;
virtual void didChangeDeviceOrientation(const WebDeviceOrientationData&) OVERRIDE;
private:
DeviceOrientationDispatcher();
......
......@@ -40,11 +40,11 @@ public:
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(needkey);
static void keyAdded(HTMLMediaElement&, const String& keySystem, const String& sessionId);
static void keyError(HTMLMediaElement&, const String& keySystem, const String& sessionId, blink::WebMediaPlayerClient::MediaKeyErrorCode, unsigned short systemCode);
static void keyMessage(HTMLMediaElement&, const String& keySystem, const String& sessionId, const unsigned char* message, unsigned messageLength, const blink::WebURL& defaultURL);
static void keyError(HTMLMediaElement&, const String& keySystem, const String& sessionId, WebMediaPlayerClient::MediaKeyErrorCode, unsigned short systemCode);
static void keyMessage(HTMLMediaElement&, const String& keySystem, const String& sessionId, const unsigned char* message, unsigned messageLength, const WebURL& defaultURL);
static void keyNeeded(HTMLMediaElement&, const String& contentType, const unsigned char* initData, unsigned initDataLength);
static void playerDestroyed(HTMLMediaElement&);
static blink::WebContentDecryptionModule* contentDecryptionModule(HTMLMediaElement&);
static WebContentDecryptionModule* contentDecryptionModule(HTMLMediaElement&);
static HTMLMediaElementEncryptedMedia& from(HTMLMediaElement&);
static const char* supplementName();
......@@ -53,9 +53,9 @@ public:
private:
HTMLMediaElementEncryptedMedia();
void generateKeyRequest(blink::WebMediaPlayer*, const String& keySystem, PassRefPtr<Uint8Array> initData, ExceptionState&);
void addKey(blink::WebMediaPlayer*, const String& keySystem, PassRefPtr<Uint8Array> key, PassRefPtr<Uint8Array> initData, const String& sessionId, ExceptionState&);
void cancelKeyRequest(blink::WebMediaPlayer*, const String& keySystem, const String& sessionId, ExceptionState&);
void generateKeyRequest(WebMediaPlayer*, const String& keySystem, PassRefPtr<Uint8Array> initData, ExceptionState&);
void addKey(WebMediaPlayer*, const String& keySystem, PassRefPtr<Uint8Array> key, PassRefPtr<Uint8Array> initData, const String& sessionId, ExceptionState&);
void cancelKeyRequest(WebMediaPlayer*, const String& keySystem, const String& sessionId, ExceptionState&);
// EventTarget
bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener>);
......@@ -71,7 +71,7 @@ private:
// (v0.1b or WD). Returns whether the mode is allowed and successfully set.
bool setEmeMode(EmeMode, ExceptionState&);
blink::WebContentDecryptionModule* contentDecryptionModule();
WebContentDecryptionModule* contentDecryptionModule();
void setMediaKeysInternal(HTMLMediaElement&, MediaKeys*);
EmeMode m_emeMode;
......@@ -79,6 +79,6 @@ private:
PersistentWillBeMember<MediaKeys> m_mediaKeys;
};
}
} // namespace blink
#endif
......@@ -35,11 +35,6 @@
#include "public/platform/WebContentDecryptionModuleSession.h"
#include "wtf/Forward.h"
namespace blink {
class WebContentDecryptionModule;
class WebString;
}
namespace blink {
class ScriptPromise;
......@@ -47,6 +42,8 @@ class ScriptState;
class GenericEventQueue;
class MediaKeyError;
class MediaKeys;
class WebContentDecryptionModule;
class WebString;
// References are held by JS only. However, even if all JS references are
// dropped, it won't be garbage collected until close event received or
......@@ -63,7 +60,7 @@ class MediaKeys;
// The WebContentDecryptionModuleSession has the same lifetime as this object.
class MediaKeySession FINAL
: public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaKeySession>, public ActiveDOMObject, public EventTargetWithInlineData
, private blink::WebContentDecryptionModuleSession::Client {
, private WebContentDecryptionModuleSession::Client {
DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<MediaKeySession>);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession);
public:
......@@ -97,22 +94,22 @@ private:
class PendingAction;
friend class MediaKeySessionInitializer;
MediaKeySession(ExecutionContext*, MediaKeys*, PassOwnPtr<blink::WebContentDecryptionModuleSession>);
MediaKeySession(ExecutionContext*, MediaKeys*, PassOwnPtr<WebContentDecryptionModuleSession>);
void actionTimerFired(Timer<MediaKeySession>*);
// blink::WebContentDecryptionModuleSession::Client
virtual void message(const unsigned char* message, size_t messageLength, const blink::WebURL& destinationURL) OVERRIDE;
// WebContentDecryptionModuleSession::Client
virtual void message(const unsigned char* message, size_t messageLength, const WebURL& destinationURL) OVERRIDE;
virtual void ready() OVERRIDE;
virtual void close() OVERRIDE;
virtual void error(MediaKeyErrorCode, unsigned long systemCode) OVERRIDE;
virtual void error(blink::WebContentDecryptionModuleException, unsigned long systemCode, const blink::WebString& errorMessage) OVERRIDE;
virtual void error(WebContentDecryptionModuleException, unsigned long systemCode, const WebString& errorMessage) OVERRIDE;
ScriptPromise updateInternal(ScriptState*, PassRefPtr<ArrayBuffer> response);
String m_keySystem;
RefPtrWillBeMember<MediaKeyError> m_error;
OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue;
OwnPtr<blink::WebContentDecryptionModuleSession> m_session;
OwnPtr<WebContentDecryptionModuleSession> m_session;
// Used to determine if MediaKeys is still active.
WeakMember<MediaKeys> m_keys;
......@@ -128,6 +125,6 @@ private:
Timer<MediaKeySession> m_actionTimer;
};
}
} // namespace blink
#endif // MediaKeySession_h
......@@ -8,18 +8,15 @@
#include "wtf/PassOwnPtr.h"
#include "wtf/text/WTFString.h"
namespace blink {
class WebContentDecryptionModule;
}
namespace blink {
class ExecutionContext;
class Page;
class WebContentDecryptionModule;
class MediaKeysClient {
public:
virtual PassOwnPtr<blink::WebContentDecryptionModule> createContentDecryptionModule(ExecutionContext*, const String& keySystem) = 0;
virtual PassOwnPtr<WebContentDecryptionModule> createContentDecryptionModule(ExecutionContext*, const String& keySystem) = 0;
protected:
virtual ~MediaKeysClient() { }
......
......@@ -8,19 +8,16 @@
#include "core/page/Page.h"
#include "wtf/PassOwnPtr.h"
namespace blink {
class WebContentDecryptionModule;
}
namespace blink {
class ExecutionContext;
class MediaKeysClient;
class WebContentDecryptionModule;
class MediaKeysController FINAL : public NoBaseWillBeGarbageCollected<MediaKeysController>, public WillBeHeapSupplement<Page> {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeysController);
public:
PassOwnPtr<blink::WebContentDecryptionModule> createContentDecryptionModule(ExecutionContext*, const String& keySystem);
PassOwnPtr<WebContentDecryptionModule> createContentDecryptionModule(ExecutionContext*, const String& keySystem);
static void provideMediaKeysTo(Page&, MediaKeysClient*);
static MediaKeysController* from(Page* page) { return static_cast<MediaKeysController*>(WillBeHeapSupplement<Page>::from(page, supplementName())); }
......
......@@ -9,17 +9,14 @@
#include "platform/ContentDecryptionModuleResult.h"
#include "wtf/Forward.h"
namespace blink {
class WebString;
}
namespace blink {
class ScriptPromise;
class ScriptPromiseResolver;
class ScriptState;
class WebString;
ExceptionCode WebCdmExceptionToExceptionCode(blink::WebContentDecryptionModuleException);
ExceptionCode WebCdmExceptionToExceptionCode(WebContentDecryptionModuleException);
// This class wraps the promise resolver and is passed (indirectly) to Chromium
// to fullfill the promise. This implementation of complete() will resolve the
......@@ -33,8 +30,8 @@ public:
// ContentDecryptionModuleResult implementation.
virtual void complete() OVERRIDE;
virtual void completeWithSession(blink::WebContentDecryptionModuleResult::SessionStatus) OVERRIDE;
virtual void completeWithError(blink::WebContentDecryptionModuleException, unsigned long systemCode, const blink::WebString&) OVERRIDE;
virtual void completeWithSession(WebContentDecryptionModuleResult::SessionStatus) OVERRIDE;
virtual void completeWithError(WebContentDecryptionModuleException, unsigned long systemCode, const WebString&) OVERRIDE;
// It is only valid to call this before completion.
ScriptPromise promise();
......
......@@ -144,7 +144,7 @@ private:
class FileWriterBaseCallbacks FINAL : public FileSystemCallbacksBase {
public:
static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtrWillBeRawPtr<FileWriterBase>, PassOwnPtr<FileWriterBaseCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*);
virtual void didCreateFileWriter(PassOwnPtr<blink::WebFileWriter>, long long length) OVERRIDE;
virtual void didCreateFileWriter(PassOwnPtr<WebFileWriter>, long long length) OVERRIDE;
private:
FileWriterBaseCallbacks(PassRefPtrWillBeRawPtr<FileWriterBase>, PassOwnPtr<FileWriterBaseCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*);
......@@ -174,6 +174,6 @@ private:
OwnPtr<VoidCallback> m_successCallback;
};
} // namespace
} // namespace blink
#endif // FileSystemCallbacks_h
......@@ -49,7 +49,7 @@ public:
virtual ~FileSystemClient() { }
virtual bool requestFileSystemAccessSync(ExecutionContext*) = 0;
virtual void requestFileSystemAccessAsync(ExecutionContext*, PassOwnPtr<blink::PermissionCallbacks>) = 0;
virtual void requestFileSystemAccessAsync(ExecutionContext*, PassOwnPtr<PermissionCallbacks>) = 0;
};
void provideLocalFileSystemTo(LocalFrame&, PassOwnPtr<FileSystemClient>);
......
......@@ -46,7 +46,7 @@ class Blob;
class ExceptionState;
class ExecutionContext;
class FileWriter FINAL : public FileWriterBase, public ActiveDOMObject, public EventTargetWithInlineData, public blink::WebFileWriterClient {
class FileWriter FINAL : public FileWriterBase, public ActiveDOMObject, public EventTargetWithInlineData, public WebFileWriterClient {
DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<FileWriterBase>);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FileWriter);
public:
......@@ -68,7 +68,7 @@ public:
// WebFileWriterClient
virtual void didWrite(long long bytes, bool complete) OVERRIDE;
virtual void didTruncate() OVERRIDE;
virtual void didFail(blink::WebFileError) OVERRIDE;
virtual void didFail(WebFileError) OVERRIDE;
// ActiveDOMObject
virtual void stop() OVERRIDE;
......
......@@ -35,14 +35,14 @@
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
namespace blink { class WebFileWriter; }
namespace blink {
class WebFileWriter;
class FileWriterBase : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<FileWriterBase> {
public:
virtual ~FileWriterBase();
void initialize(PassOwnPtr<blink::WebFileWriter>, long long length);
void initialize(PassOwnPtr<WebFileWriter>, long long length);
long long position() const
{
......@@ -58,7 +58,7 @@ public:
protected:
FileWriterBase();
blink::WebFileWriter* writer()
WebFileWriter* writer()
{
return m_writer.get();
}
......@@ -78,7 +78,7 @@ protected:
private:
friend class WTF::RefCounted<FileWriterBase>;
OwnPtr<blink::WebFileWriter> m_writer;
OwnPtr<WebFileWriter> m_writer;
long long m_position;
long long m_length;
};
......
......@@ -42,7 +42,7 @@ namespace blink {
class Blob;
class ExceptionState;
class FileWriterSync FINAL : public FileWriterBase, public ScriptWrappable, public blink::WebFileWriterClient {
class FileWriterSync FINAL : public FileWriterBase, public ScriptWrappable, public WebFileWriterClient {
public:
static FileWriterSync* create()
{
......@@ -58,7 +58,7 @@ public:
// WebFileWriterClient, via FileWriterBase
virtual void didWrite(long long bytes, bool complete) OVERRIDE;
virtual void didTruncate() OVERRIDE;
virtual void didFail(blink::WebFileError) OVERRIDE;
virtual void didFail(WebFileError) OVERRIDE;
private:
FileWriterSync();
......
......@@ -43,7 +43,7 @@ public:
~Gamepad();
const GamepadButtonVector& buttons() const { return m_buttons; }
void setButtons(unsigned count, const blink::WebGamepadButton* data);
void setButtons(unsigned count, const WebGamepadButton* data);
void trace(Visitor*);
......
......@@ -10,22 +10,19 @@
#include "public/platform/WebGamepad.h"
#include "public/platform/WebGamepadListener.h"
namespace blink {
class WebGamepads;
}
namespace blink {
class NavigatorGamepad;
class WebGamepads;
class GamepadDispatcher : public PlatformEventDispatcher, public blink::WebGamepadListener {
class GamepadDispatcher : public PlatformEventDispatcher, public WebGamepadListener {
public:
static GamepadDispatcher& instance();
void sampleGamepads(blink::WebGamepads&);
void sampleGamepads(WebGamepads&);
struct ConnectionChange {
blink::WebGamepad pad;
WebGamepad pad;
unsigned index;
};
......@@ -36,14 +33,14 @@ private:
virtual ~GamepadDispatcher();
// WebGamepadListener
virtual void didConnectGamepad(unsigned index, const blink::WebGamepad&) OVERRIDE;
virtual void didDisconnectGamepad(unsigned index, const blink::WebGamepad&) OVERRIDE;
virtual void didConnectGamepad(unsigned index, const WebGamepad&) OVERRIDE;
virtual void didDisconnectGamepad(unsigned index, const WebGamepad&) OVERRIDE;
// PlatformEventDispatcher
virtual void startListening() OVERRIDE;
virtual void stopListening() OVERRIDE;
void dispatchDidConnectOrDisconnectGamepad(unsigned index, const blink::WebGamepad&, bool connected);
void dispatchDidConnectOrDisconnectGamepad(unsigned index, const WebGamepad&, bool connected);
ConnectionChange m_latestChange;
};
......
......@@ -42,13 +42,13 @@ public:
void set(unsigned index, Gamepad*);
Gamepad* item(unsigned index);
unsigned length() const { return blink::WebGamepads::itemsLengthCap; }
unsigned length() const { return WebGamepads::itemsLengthCap; }
void trace(Visitor*);
private:
GamepadList();
Member<Gamepad> m_items[blink::WebGamepads::itemsLengthCap];
Member<Gamepad> m_items[WebGamepads::itemsLengthCap];
};
} // namespace blink
......
......@@ -34,15 +34,11 @@
#include "platform/heap/Handle.h"
#include "public/platform/WebGamepads.h"
namespace blink {
class WebGamepad;
class WebGamepads;
}
namespace blink {
class Document;
class Gamepad;
class Gamepads;
class GamepadList;
class Navigator;
class WebKitGamepadList;
......@@ -62,7 +58,7 @@ public:
virtual void trace(Visitor*);
void didConnectOrDisconnectGamepad(unsigned index, const blink::WebGamepad&, bool connected);
void didConnectOrDisconnectGamepad(unsigned index, const WebGamepad&, bool connected);
private:
explicit NavigatorGamepad(LocalFrame*);
......
......@@ -23,7 +23,7 @@ public:
typedef Vector<float> FloatVector;
const FloatVector& buttons() const { return m_buttons; }
void setButtons(unsigned count, const blink::WebGamepadButton* data);
void setButtons(unsigned count, const WebGamepadButton* data);
void trace(Visitor*) { }
......
......@@ -21,13 +21,13 @@ public:
void set(unsigned index, WebKitGamepad*);
WebKitGamepad* item(unsigned index);
unsigned length() const { return blink::WebGamepads::itemsLengthCap; }
unsigned length() const { return WebGamepads::itemsLengthCap; }
void trace(Visitor*);
private:
WebKitGamepadList();
Member<WebKitGamepad> m_items[blink::WebGamepads::itemsLengthCap];
Member<WebKitGamepad> m_items[WebGamepads::itemsLengthCap];
};
} // namespace blink
......
......@@ -35,12 +35,6 @@
namespace blink {
class WebBlobInfo;
}
namespace blink {
class DOMStringList;
class IDBCursor;
class IDBCursorWithValue;
......@@ -49,6 +43,7 @@ class IDBIndex;
class IDBKeyPath;
class IDBObjectStore;
class IDBTransaction;
class WebBlobInfo;
class IDBAny : public GarbageCollectedFinalized<IDBAny> {
public:
......@@ -65,7 +60,7 @@ public:
{
return new IDBAny(idbObject);
}
static IDBAny* create(PassRefPtr<SharedBuffer> value, const Vector<blink::WebBlobInfo>* blobInfo)
static IDBAny* create(PassRefPtr<SharedBuffer> value, const Vector<WebBlobInfo>* blobInfo)
{
return new IDBAny(value, blobInfo);
}
......@@ -78,7 +73,7 @@ public:
{
return new IDBAny(value);
}
static IDBAny* create(PassRefPtr<SharedBuffer> value, const Vector<blink::WebBlobInfo>* blobInfo, IDBKey* key, const IDBKeyPath& keyPath)
static IDBAny* create(PassRefPtr<SharedBuffer> value, const Vector<WebBlobInfo>* blobInfo, IDBKey* key, const IDBKeyPath& keyPath)
{
return new IDBAny(value, blobInfo, key, keyPath);
}
......@@ -114,7 +109,7 @@ public:
IDBObjectStore* idbObjectStore() const;
IDBTransaction* idbTransaction() const;
SharedBuffer* buffer() const;
const Vector<blink::WebBlobInfo>* blobInfo() const;
const Vector<WebBlobInfo>* blobInfo() const;
int64_t integer() const;
const String& string() const;
const IDBKey* key() const;
......@@ -131,8 +126,8 @@ private:
explicit IDBAny(IDBKey*);
explicit IDBAny(const IDBKeyPath&);
explicit IDBAny(const String&);
IDBAny(PassRefPtr<SharedBuffer>, const Vector<blink::WebBlobInfo>*);
IDBAny(PassRefPtr<SharedBuffer>, const Vector<blink::WebBlobInfo>*, IDBKey*, const IDBKeyPath&);
IDBAny(PassRefPtr<SharedBuffer>, const Vector<WebBlobInfo>*);
IDBAny(PassRefPtr<SharedBuffer>, const Vector<WebBlobInfo>*, IDBKey*, const IDBKeyPath&);
explicit IDBAny(int64_t);
const Type m_type;
......@@ -147,7 +142,7 @@ private:
const Member<IDBKey> m_idbKey;
const IDBKeyPath m_idbKeyPath;
const RefPtr<SharedBuffer> m_buffer;
const Vector<blink::WebBlobInfo>* m_blobInfo;
const Vector<WebBlobInfo>* m_blobInfo;
const String m_string;
const int64_t m_integer;
};
......
......@@ -38,17 +38,12 @@
namespace blink {
class WebBlobInfo;
} // namespace blink
namespace blink {
class ExceptionState;
class IDBAny;
class IDBTransaction;
class ExecutionContext;
class SharedBuffer;
class WebBlobInfo;
class IDBCursor : public GarbageCollectedFinalized<IDBCursor>, public ScriptWrappable {
public:
......@@ -57,10 +52,10 @@ public:
static const AtomicString& directionPrev();
static const AtomicString& directionPrevUnique();
static blink::WebIDBCursorDirection stringToDirection(const String& modeString, ExceptionState&);
static WebIDBCursorDirection stringToDirection(const String& modeString, ExceptionState&);
static const AtomicString& directionToString(unsigned short mode);
static IDBCursor* create(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
static IDBCursor* create(PassOwnPtr<WebIDBCursor>, WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
virtual ~IDBCursor();
void trace(Visitor*);
void contextWillBeDestroyed() { m_backend.clear(); }
......@@ -86,22 +81,22 @@ public:
void postSuccessHandlerCallback();
bool isDeleted() const;
void close();
void setValueReady(IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector<blink::WebBlobInfo> >);
void setValueReady(IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector<WebBlobInfo> >);
IDBKey* idbPrimaryKey() const { return m_primaryKey; }
IDBRequest* request() const { return m_request.get(); }
virtual bool isKeyCursor() const { return true; }
virtual bool isCursorWithValue() const { return false; }
protected:
IDBCursor(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
IDBCursor(PassOwnPtr<WebIDBCursor>, WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
private:
IDBObjectStore* effectiveObjectStore() const;
void handleBlobAcks();
OwnPtr<blink::WebIDBCursor> m_backend;
OwnPtr<WebIDBCursor> m_backend;
Member<IDBRequest> m_request;
const blink::WebIDBCursorDirection m_direction;
const WebIDBCursorDirection m_direction;
Member<IDBAny> m_source;
Member<IDBTransaction> m_transaction;
bool m_gotValue;
......@@ -111,7 +106,7 @@ private:
Member<IDBKey> m_key;
Member<IDBKey> m_primaryKey;
RefPtr<SharedBuffer> m_value;
OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo;
OwnPtr<Vector<WebBlobInfo> > m_blobInfo;
};
} // namespace blink
......
......@@ -40,7 +40,7 @@ class IDBTransaction;
class IDBCursorWithValue FINAL : public IDBCursor {
public:
static IDBCursorWithValue* create(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
static IDBCursorWithValue* create(PassOwnPtr<WebIDBCursor>, WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
virtual ~IDBCursorWithValue();
// The value attribute defined in the IDL is simply implemented in IDBCursor (but not exposed via
......@@ -50,7 +50,7 @@ public:
virtual bool isCursorWithValue() const OVERRIDE { return true; }
private:
IDBCursorWithValue(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
IDBCursorWithValue(PassOwnPtr<WebIDBCursor>, WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
};
DEFINE_TYPE_CASTS(IDBCursorWithValue, IDBCursor, cursor, cursor->isCursorWithValue(), cursor.isCursorWithValue());
......
......@@ -56,7 +56,7 @@ class IDBDatabase FINAL
DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<IDBDatabase>);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBDatabase);
public:
static IDBDatabase* create(ExecutionContext*, PassOwnPtr<blink::WebIDBDatabase>, IDBDatabaseCallbacks*);
static IDBDatabase* create(ExecutionContext*, PassOwnPtr<WebIDBDatabase>, IDBDatabaseCallbacks*);
virtual ~IDBDatabase();
virtual void trace(Visitor*) OVERRIDE;
......@@ -112,11 +112,11 @@ public:
}
// Will return nullptr if this database is stopped.
blink::WebIDBDatabase* backend() const { return m_backend.get(); }
WebIDBDatabase* backend() const { return m_backend.get(); }
static int64_t nextTransactionId();
void ackReceivedBlobs(const Vector<blink::WebBlobInfo>*);
void ackReceivedBlobs(const Vector<WebBlobInfo>*);
static const char indexDeletedErrorMessage[];
static const char isKeyCursorErrorMessage[];
......@@ -135,12 +135,12 @@ public:
static const char databaseClosedErrorMessage[];
private:
IDBDatabase(ExecutionContext*, PassOwnPtr<blink::WebIDBDatabase>, IDBDatabaseCallbacks*);
IDBDatabase(ExecutionContext*, PassOwnPtr<WebIDBDatabase>, IDBDatabaseCallbacks*);
void closeConnection();
IDBDatabaseMetadata m_metadata;
OwnPtr<blink::WebIDBDatabase> m_backend;
OwnPtr<WebIDBDatabase> m_backend;
Member<IDBTransaction> m_versionChangeTransaction;
typedef HeapHashMap<int64_t, Member<IDBTransaction> > TransactionMap;
TransactionMap m_transactions;
......
......@@ -69,9 +69,9 @@ public:
bool isDeleted() const;
// Used internally and by InspectorIndexedDBAgent:
IDBRequest* openCursor(ScriptState*, IDBKeyRange*, blink::WebIDBCursorDirection);
IDBRequest* openCursor(ScriptState*, IDBKeyRange*, WebIDBCursorDirection);
blink::WebIDBDatabase* backendDB() const;
WebIDBDatabase* backendDB() const;
private:
IDBIndex(const IDBIndexMetadata&, IDBObjectStore*, IDBTransaction*);
......
......@@ -88,10 +88,10 @@ public:
IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&);
// Used by IDBCursor::update():
IDBRequest* put(ScriptState*, blink::WebIDBPutMode, IDBAny* source, ScriptValue&, IDBKey*, ExceptionState&);
IDBRequest* put(ScriptState*, WebIDBPutMode, IDBAny* source, ScriptValue&, IDBKey*, ExceptionState&);
// Used internally and by InspectorIndexedDBAgent:
IDBRequest* openCursor(ScriptState*, IDBKeyRange*, blink::WebIDBCursorDirection, blink::WebIDBTaskType = blink::WebIDBTaskTypeNormal);
IDBRequest* openCursor(ScriptState*, IDBKeyRange*, WebIDBCursorDirection, WebIDBTaskType = WebIDBTaskTypeNormal);
void markDeleted() { m_deleted = true; }
bool isDeleted() const { return m_deleted; }
......@@ -102,14 +102,14 @@ public:
typedef HeapVector<Member<IDBKey> > IndexKeys;
blink::WebIDBDatabase* backendDB() const;
WebIDBDatabase* backendDB() const;
private:
IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*);
IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, const Dictionary&, ExceptionState&);
IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, bool unique, bool multiEntry, ExceptionState&);
IDBRequest* put(ScriptState*, blink::WebIDBPutMode, IDBAny* source, ScriptValue&, const ScriptValue& key, ExceptionState&);
IDBRequest* put(ScriptState*, WebIDBPutMode, IDBAny* source, ScriptValue&, const ScriptValue& key, ExceptionState&);
int64_t findIndexId(const String& name) const;
bool containsIndex(const String& name) const
......
......@@ -42,8 +42,8 @@ public:
using IDBRequest::onSuccess;
virtual void onBlocked(int64_t existingVersion) OVERRIDE;
virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<blink::WebIDBDatabase>, const IDBDatabaseMetadata&, blink::WebIDBDataLoss, String dataLossMessage) OVERRIDE;
virtual void onSuccess(PassOwnPtr<blink::WebIDBDatabase>, const IDBDatabaseMetadata&) OVERRIDE;
virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<WebIDBDatabase>, const IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage) OVERRIDE;
virtual void onSuccess(PassOwnPtr<WebIDBDatabase>, const IDBDatabaseMetadata&) OVERRIDE;
virtual void onSuccess(int64_t oldVersion) OVERRIDE;
// EventTarget
......
......@@ -87,24 +87,24 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(success);
DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
void setCursorDetails(IndexedDB::CursorType, blink::WebIDBCursorDirection);
void setCursorDetails(IndexedDB::CursorType, WebIDBCursorDirection);
void setPendingCursor(IDBCursor*);
void abort();
virtual void onError(PassRefPtrWillBeRawPtr<DOMError>);
virtual void onSuccess(const Vector<String>&);
virtual void onSuccess(PassOwnPtr<blink::WebIDBCursor>, IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::WebBlobInfo> >);
virtual void onSuccess(PassOwnPtr<WebIDBCursor>, IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<WebBlobInfo> >);
virtual void onSuccess(IDBKey*);
virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::WebBlobInfo> >);
virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::WebBlobInfo> >, IDBKey*, const IDBKeyPath&);
virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<WebBlobInfo> >);
virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<WebBlobInfo> >, IDBKey*, const IDBKeyPath&);
virtual void onSuccess(int64_t);
virtual void onSuccess();
virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::WebBlobInfo> >);
virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<WebBlobInfo> >);
// Only IDBOpenDBRequest instances should receive these:
virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); }
virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<blink::WebIDBDatabase>, const IDBDatabaseMetadata&, blink::WebIDBDataLoss, String dataLossMessage) { ASSERT_NOT_REACHED(); }
virtual void onSuccess(PassOwnPtr<blink::WebIDBDatabase>, const IDBDatabaseMetadata&) { ASSERT_NOT_REACHED(); }
virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<WebIDBDatabase>, const IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage) { ASSERT_NOT_REACHED(); }
virtual void onSuccess(PassOwnPtr<WebIDBDatabase>, const IDBDatabaseMetadata&) { ASSERT_NOT_REACHED(); }
// ActiveDOMObject
virtual bool hasPendingActivity() const OVERRIDE FINAL;
......@@ -139,7 +139,7 @@ protected:
bool m_requestAborted; // May be aborted by transaction then receive async onsuccess; ignore vs. assert.
private:
void setResultCursor(IDBCursor*, IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector<blink::WebBlobInfo> >);
void setResultCursor(IDBCursor*, IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector<WebBlobInfo> >);
void handleBlobAcks();
RefPtr<ScriptState> m_scriptState;
......@@ -152,14 +152,14 @@ private:
// Only used if the result type will be a cursor.
IndexedDB::CursorType m_cursorType;
blink::WebIDBCursorDirection m_cursorDirection;
WebIDBCursorDirection m_cursorDirection;
// When a cursor is continued/advanced, m_result is cleared and m_pendingCursor holds it.
Member<IDBCursor> m_pendingCursor;
// New state is not applied to the cursor object until the event is dispatched.
Member<IDBKey> m_cursorKey;
Member<IDBKey> m_cursorPrimaryKey;
RefPtr<SharedBuffer> m_cursorValue;
OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo;
OwnPtr<Vector<WebBlobInfo> > m_blobInfo;
bool m_didFireUpgradeNeededEvent;
bool m_preventPropagation;
......
......@@ -55,7 +55,7 @@ class IDBTransaction FINAL
DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<IDBTransaction>);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBTransaction);
public:
static IDBTransaction* create(ExecutionContext*, int64_t, const Vector<String>& objectStoreNames, blink::WebIDBTransactionMode, IDBDatabase*);
static IDBTransaction* create(ExecutionContext*, int64_t, const Vector<String>& objectStoreNames, WebIDBTransactionMode, IDBDatabase*);
static IDBTransaction* create(ExecutionContext*, int64_t, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata& previousMetadata);
virtual ~IDBTransaction();
virtual void trace(Visitor*) OVERRIDE;
......@@ -64,18 +64,18 @@ public:
static const AtomicString& modeReadWrite();
static const AtomicString& modeVersionChange();
static blink::WebIDBTransactionMode stringToMode(const String&, ExceptionState&);
static const AtomicString& modeToString(blink::WebIDBTransactionMode);
static WebIDBTransactionMode stringToMode(const String&, ExceptionState&);
static const AtomicString& modeToString(WebIDBTransactionMode);
// When the connection is closed backend will be 0.
blink::WebIDBDatabase* backendDB() const;
WebIDBDatabase* backendDB() const;
int64_t id() const { return m_id; }
bool isActive() const { return m_state == Active; }
bool isFinished() const { return m_state == Finished; }
bool isFinishing() const { return m_state == Finishing; }
bool isReadOnly() const { return m_mode == blink::WebIDBTransactionModeReadOnly; }
bool isVersionChange() const { return m_mode == blink::WebIDBTransactionModeVersionChange; }
bool isReadOnly() const { return m_mode == WebIDBTransactionModeReadOnly; }
bool isVersionChange() const { return m_mode == WebIDBTransactionModeVersionChange; }
// Implement the IDBTransaction IDL
const String& mode() const;
......@@ -110,7 +110,7 @@ public:
virtual void stop() OVERRIDE;
private:
IDBTransaction(ExecutionContext*, int64_t, const Vector<String>&, blink::WebIDBTransactionMode, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata&);
IDBTransaction(ExecutionContext*, int64_t, const Vector<String>&, WebIDBTransactionMode, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata&);
void enqueueEvent(PassRefPtrWillBeRawPtr<Event>);
......@@ -125,7 +125,7 @@ private:
Member<IDBDatabase> m_database;
const Vector<String> m_objectStoreNames;
Member<IDBOpenDBRequest> m_openDBRequest;
const blink::WebIDBTransactionMode m_mode;
const WebIDBTransactionMode m_mode;
State m_state;
bool m_hasPendingActivity;
bool m_contextStopped;
......
......@@ -52,7 +52,7 @@ public:
{
return adoptRefWillBeNoop(new IDBVersionChangeEvent());
}
static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicString& eventType, unsigned long long oldVersion, const Nullable<unsigned long long>& newVersion, blink::WebIDBDataLoss dataLoss = blink::WebIDBDataLossNone, const String& dataLossMessage = String())
static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicString& eventType, unsigned long long oldVersion, const Nullable<unsigned long long>& newVersion, WebIDBDataLoss dataLoss = WebIDBDataLossNone, const String& dataLossMessage = String())
{
return adoptRefWillBeNoop(new IDBVersionChangeEvent(eventType, oldVersion, newVersion, dataLoss, dataLossMessage));
}
......@@ -73,12 +73,12 @@ public:
private:
IDBVersionChangeEvent();
IDBVersionChangeEvent(const AtomicString& eventType, unsigned long long oldVersion, const Nullable<unsigned long long>& newVersion, blink::WebIDBDataLoss, const String& dataLoss);
IDBVersionChangeEvent(const AtomicString& eventType, unsigned long long oldVersion, const Nullable<unsigned long long>& newVersion, WebIDBDataLoss, const String& dataLoss);
IDBVersionChangeEvent(const AtomicString& eventType, const IDBVersionChangeEventInit&);
unsigned long long m_oldVersion;
Nullable<unsigned long long> m_newVersion;
blink::WebIDBDataLoss m_dataLoss;
WebIDBDataLoss m_dataLoss;
String m_dataLossMessage;
};
......
......@@ -35,6 +35,8 @@
#include "wtf/RefPtr.h"
namespace blink {
class IDBRequest;
class WebBlobInfo;
class WebData;
class WebIDBCursor;
......@@ -44,30 +46,26 @@ class WebIDBIndex;
class WebIDBKey;
class WebIDBKeyPath;
struct WebIDBMetadata;
}
namespace blink {
class IDBRequest;
class WebIDBCallbacksImpl FINAL : public blink::WebIDBCallbacks {
class WebIDBCallbacksImpl FINAL : public WebIDBCallbacks {
public:
static PassOwnPtr<WebIDBCallbacksImpl> create(IDBRequest*);
virtual ~WebIDBCallbacksImpl();
// Pointers transfer ownership.
virtual void onError(const blink::WebIDBDatabaseError&) OVERRIDE;
virtual void onSuccess(const blink::WebVector<blink::WebString>&) OVERRIDE;
virtual void onSuccess(blink::WebIDBCursor*, const blink::WebIDBKey&, const blink::WebIDBKey& primaryKey, const blink::WebData&, const blink::WebVector<blink::WebBlobInfo>&) OVERRIDE;
virtual void onSuccess(blink::WebIDBDatabase*, const blink::WebIDBMetadata&) OVERRIDE;
virtual void onSuccess(const blink::WebIDBKey&) OVERRIDE;
virtual void onSuccess(const blink::WebData&, const blink::WebVector<blink::WebBlobInfo>&) OVERRIDE;
virtual void onSuccess(const blink::WebData&, const blink::WebVector<blink::WebBlobInfo>&, const blink::WebIDBKey&, const blink::WebIDBKeyPath&) OVERRIDE;
virtual void onError(const WebIDBDatabaseError&) OVERRIDE;
virtual void onSuccess(const WebVector<WebString>&) OVERRIDE;
virtual void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&, const WebVector<WebBlobInfo>&) OVERRIDE;
virtual void onSuccess(WebIDBDatabase*, const WebIDBMetadata&) OVERRIDE;
virtual void onSuccess(const WebIDBKey&) OVERRIDE;
virtual void onSuccess(const WebData&, const WebVector<WebBlobInfo>&) OVERRIDE;
virtual void onSuccess(const WebData&, const WebVector<WebBlobInfo>&, const WebIDBKey&, const WebIDBKeyPath&) OVERRIDE;
virtual void onSuccess(long long) OVERRIDE;
virtual void onSuccess() OVERRIDE;
virtual void onSuccess(const blink::WebIDBKey&, const blink::WebIDBKey& primaryKey, const blink::WebData&, const blink::WebVector<blink::WebBlobInfo>&) OVERRIDE;
virtual void onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&, const WebVector<WebBlobInfo>&) OVERRIDE;
virtual void onBlocked(long long oldVersion) OVERRIDE;
virtual void onUpgradeNeeded(long long oldVersion, blink::WebIDBDatabase*, const blink::WebIDBMetadata&, unsigned short dataLoss, blink::WebString dataLossMessage) OVERRIDE;
virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const WebIDBMetadata&, unsigned short dataLoss, WebString dataLossMessage) OVERRIDE;
private:
explicit WebIDBCallbacksImpl(IDBRequest*);
......
......@@ -36,7 +36,7 @@
namespace blink {
class WebIDBDatabaseCallbacksImpl FINAL : public blink::WebIDBDatabaseCallbacks {
class WebIDBDatabaseCallbacksImpl FINAL : public WebIDBDatabaseCallbacks {
public:
static PassOwnPtr<WebIDBDatabaseCallbacksImpl> create(IDBDatabaseCallbacks*);
......@@ -44,7 +44,7 @@ public:
virtual void onForcedClose() OVERRIDE;
virtual void onVersionChange(long long oldVersion, long long newVersion) OVERRIDE;
virtual void onAbort(long long transactionId, const blink::WebIDBDatabaseError&) OVERRIDE;
virtual void onAbort(long long transactionId, const WebIDBDatabaseError&) OVERRIDE;
virtual void onComplete(long long transactionId) OVERRIDE;
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment