Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud #62

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
904422b
First version CloudStorageService WebAPI implementation
May 12, 2015
a437f67
Merge pull request #1 from MozCloudStorage/cloud
edenchuang May 12, 2015
ea53cb4
Cloud storage manager component in Gecko
May 12, 2015
0785508
Merge pull request #2 from MozCloudStorage/cloud
edenchuang May 12, 2015
73fe08e
CloudStorageServiceAPI and CloudStorageManager integration
May 13, 2015
1fbc5f1
Merge pull request #3 from MozCloudStorage/cloud
edenchuang May 13, 2015
36cc737
CloudStorageManager and VolumeManager integration.
May 13, 2015
6411dda
Merge pull request #4 from MozCloudStorage/cloud
edenchuang May 13, 2015
e792bab
testing ...
weilonge May 12, 2015
d54e229
Improve HTTP request web support.
weilonge May 18, 2015
cb4968b
Change the way to pass access_token.
weilonge May 18, 2015
55511da
Move files to system/gonk/cloudstorage .
weilonge May 19, 2015
e906129
Merge pull request #5 from MozCloudStorage/unidisk_gecko
weilonge May 19, 2015
9c0aacc
1. FUSE node system
Jun 3, 2015
9884ed3
Merge pull request #6 from MozCloudStorage/cloudxpcom
edenchuang Jun 3, 2015
c31502d
Get attribute from cloud storage
Jun 3, 2015
70c8c62
Merge pull request #7 from MozCloudStorage/cloudxpcom
edenchuang Jun 3, 2015
57e632e
support readdir from cloudstorage
Jun 4, 2015
0a60f5c
Merge pull request #8 from MozCloudStorage/cloudxpcom
edenchuang Jun 4, 2015
f7f9ddd
fix the bug when trying to get non-exist path's attribute
Jun 4, 2015
8e05abe
Merge pull request #9 from MozCloudStorage/cloudxpcom
edenchuang Jun 4, 2015
44b8ce1
Replace async with foco.
weilonge Jun 4, 2015
ac35615
Merge pull request #10 from MozCloudStorage/foco
weilonge Jun 5, 2015
0b14e4e
Read operation implementation
Jun 5, 2015
723d0fb
Merge pull request #11 from MozCloudStorage/cloudstorage
edenchuang Jun 5, 2015
95478d4
Implement file reading feature.
weilonge Jun 5, 2015
886b31b
Merge pull request #12 from MozCloudStorage/readfile
weilonge Jun 5, 2015
3882029
read operation implementation
Jun 5, 2015
d2780ed
Merge pull request #13 from MozCloudStorage/cloudstorage
edenchuang Jun 5, 2015
fad4c43
Fix data type of Sample js when retrieving data. Improve hash functio…
weilonge Jun 8, 2015
2626757
Merge pull request #14 from MozCloudStorage/fix_samplejs
weilonge Jun 8, 2015
c467521
Fix memory copy issue and the size issue of SampleJS.
weilonge Jun 10, 2015
104d4c6
Merge pull request #15 from MozCloudStorage/fix_memorystore
weilonge Jun 10, 2015
cab61fb
Fix the bug of reading bytes from cloudstorage
Jun 10, 2015
1a66cd0
Merge pull request #16 from MozCloudStorage/cloudstorage
edenchuang Jun 10, 2015
9440954
Fix the length argument of ArrayBuffer.
weilonge Jun 10, 2015
41b68ec
Merge pull request #17 from MozCloudStorage/fix_byteLength
weilonge Jun 10, 2015
7563c07
Fix the bug of read size of file in gecko buffer.
Jun 10, 2015
60d0a30
Merge pull request #18 from MozCloudStorage/cloudstorage
edenchuang Jun 10, 2015
d8ac1e0
Creating static JSXPCOM object for keeping cache of udManager
Jun 10, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions b2g/chrome/content/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ XPCOMUtils.defineLazyModuleGetter(this, "SystemAppProxy",
XPCOMUtils.defineLazyModuleGetter(this, "Screenshot",
"resource://gre/modules/Screenshot.jsm");

/*
XPCOMUtils.defineLazyModuleGetter(this, "CloudStorage",
"resource://gre/modules/CloudStorage.jsm");
*/
Cu.import('resource://gre/modules/Webapps.jsm');
DOMApplicationRegistry.allAppsLaunchable = true;

Expand Down Expand Up @@ -354,6 +358,7 @@ var shell = {
WebappsHelper.init();
UserAgentOverrides.init();
CaptivePortalLoginHelper.init();
// CloudStorage.init();

this.contentBrowser.src = homeURL;
this.isHomeLoaded = false;
Expand Down Expand Up @@ -829,6 +834,7 @@ window.addEventListener('ContentStart', function ss_onContentStart() {
if (e.detail.type !== 'take-screenshot')
return;

/*
try {
shell.sendChromeEvent({
type: 'take-screenshot-success',
Expand All @@ -841,6 +847,8 @@ window.addEventListener('ContentStart', function ss_onContentStart() {
error: String(e)
});
}
*/
// CloudStorage.toggle();
});
});

Expand Down
4 changes: 4 additions & 0 deletions b2g/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@
#ifdef MOZ_WIDGET_GONK
@RESPATH@/components/dom_wifi.xpt
@RESPATH@/components/dom_system_gonk.xpt
@RESPATH@/components/dom_system_gonk_cloudstorage.xpt
#endif

#ifdef MOZ_B2G_RIL
@RESPATH@/components/dom_wappush.xpt
@RESPATH@/components/dom_mobileconnection.xpt
Expand Down Expand Up @@ -465,6 +467,8 @@
@RESPATH@/components/TetheringService.manifest
@RESPATH@/components/WifiWorker.js
@RESPATH@/components/WifiWorker.manifest
@RESPATH@/components/nsCloudStorageInterface.js
@RESPATH@/components/nsCloudStorageInterface.manifest
#endif // MOZ_WIDGET_GONK

; Camera
Expand Down
1 change: 0 additions & 1 deletion b2g/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ if CONFIG['GAIADIR']:
DIRS += ['gaia']

DIRS += ['app']

21 changes: 21 additions & 0 deletions dom/base/Navigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
#ifdef MOZ_B2G_BT
#include "BluetoothManager.h"
#endif

#include "nsCloudStorageService.h"

#include "DOMCameraManager.h"

#ifdef MOZ_AUDIO_CHANNEL_MANAGER
Expand Down Expand Up @@ -196,6 +199,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
#ifdef MOZ_B2G_BT
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBluetooth)
#endif
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCloudStorageService)
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAudioChannelManager)
#endif
Expand Down Expand Up @@ -304,6 +308,10 @@ Navigator::Invalidate()
}
#endif

if (mCloudStorageService) {
mCloudStorageService = nullptr;
}

mCameraManager = nullptr;

if (mMessagesManager) {
Expand Down Expand Up @@ -1859,6 +1867,19 @@ Navigator::GetMozBluetooth(ErrorResult& aRv)
}
#endif //MOZ_B2G_BT

cloudstorage::nsCloudStorageService*
Navigator::GetCloudStorageService(ErrorResult& aRv)
{
if (!mCloudStorageService) {
if (!mWindow) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
mCloudStorageService = cloudstorage::nsCloudStorageService::Create(mWindow);
}
return mCloudStorageService;
}

nsresult
Navigator::EnsureMessagesManager()
{
Expand Down
6 changes: 6 additions & 0 deletions dom/base/Navigator.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ class BluetoothManager;
} // namespace bluetooth
#endif // MOZ_B2G_BT

namespace cloudstorage {
class nsCloudStorageService;
}

#ifdef MOZ_B2G_RIL
class MobileConnectionArray;
#endif
Expand Down Expand Up @@ -253,6 +257,7 @@ class Navigator final : public nsIDOMNavigator
#ifdef MOZ_B2G_BT
bluetooth::BluetoothManager* GetMozBluetooth(ErrorResult& aRv);
#endif // MOZ_B2G_BT
cloudstorage::nsCloudStorageService* GetCloudStorageService(ErrorResult& aRv);
#ifdef MOZ_TIME_MANAGER
time::TimeManager* GetMozTime(ErrorResult& aRv);
#endif // MOZ_TIME_MANAGER
Expand Down Expand Up @@ -369,6 +374,7 @@ class Navigator final : public nsIDOMNavigator
#ifdef MOZ_B2G_BT
nsRefPtr<bluetooth::BluetoothManager> mBluetooth;
#endif
nsRefPtr<cloudstorage::nsCloudStorageService> mCloudStorageService;
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
nsRefPtr<system::AudioChannelManager> mAudioChannelManager;
#endif
Expand Down
1 change: 1 addition & 0 deletions dom/base/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ FAIL_ON_WARNINGS = True
LOCAL_INCLUDES += [
'../battery',
'../bluetooth',
'../cloudstorage',
'../events',
'../media',
'../network',
Expand Down
10 changes: 10 additions & 0 deletions dom/bindings/Bindings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ DOMInterfaces = {
'headerFile': 'mozilla/dom/workers/bindings/ServiceWorkerClients.h',
},

'CloudStorageService': {
'nativeType': 'mozilla::dom::cloudstorage::nsCloudStorageService',
'headerFile': 'nsCloudStorageService.h',
},

'Console': {
'implicitJSContext': [ 'trace', 'time', 'timeEnd' ],
},
Expand Down Expand Up @@ -660,6 +665,11 @@ DOMInterfaces = {
'notflattened': True
},

'InstallEvent': {
'headerFile': 'ServiceWorkerEvents.h',
'nativeType': 'mozilla::dom::workers::InstallEvent',
},

'KeyEvent': {
'concrete': False
},
Expand Down
46 changes: 46 additions & 0 deletions dom/cloudstorage/CloudStorageChild.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "CloudStorageChild.h"
#include "CloudStorageRequestChild.h"
#include "mozilla/DebugOnly.h"
#include "CloudStorageLog.h"

namespace mozilla {
namespace dom {
namespace cloudstorage {

CloudStorageChild::CloudStorageChild()
{
}

CloudStorageChild::~CloudStorageChild()
{
}

PCloudStorageRequestChild*
CloudStorageChild::AllocPCloudStorageRequestChild(const CloudStorageRequest& request)
{
LOG("CloudStorageChild::AllocPCloudStorageRequestChild()");
MOZ_CRASH("should not be here");
}

bool
CloudStorageChild::DeallocPCloudStorageRequestChild(PCloudStorageRequestChild* aActor)
{
LOG("CloudStorageChild::DeallocPCloudStorageRequestChild()");
delete aActor;
return true;
}

void
CloudStorageChild::ActorDestroy(ActorDestroyReason aWhy)
{
}

} // end cloudstorage
} // end dom
} // end mozilla
43 changes: 43 additions & 0 deletions dom/cloudstorage/CloudStorageChild.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_cloudstorage_CloudStorageChild_h
#define mozilla_dom_cloudstorage_CloudStorageChild_h

#include "mozilla/Attributes.h"
#include "mozilla/dom/cloudstorage/PCloudStorageChild.h"
#include "mozilla/dom/cloudstorage/PCloudStorageRequestChild.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/ContentParent.h"

namespace mozilla {
namespace dom {
namespace cloudstorage {

class CloudStorageChild : public PCloudStorageChild
{
friend class mozilla::dom::ContentChild;
public:
CloudStorageChild();

protected:
virtual ~CloudStorageChild();

virtual PCloudStorageRequestChild*
AllocPCloudStorageRequestChild(const CloudStorageRequest& request) override;

virtual bool
DeallocPCloudStorageRequestChild(PCloudStorageRequestChild* aActor) override;

virtual void
ActorDestroy(ActorDestroyReason aWhy) override;

};

} // end cloudstorage
} // end dom
} // end mozilla

#endif
57 changes: 57 additions & 0 deletions dom/cloudstorage/CloudStorageParent.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "CloudStorageParent.h"
#include "CloudStorageRequestParent.h"
#include "CloudStorageLog.h"

namespace mozilla {
namespace dom {
namespace cloudstorage {

CloudStorageParent::CloudStorageParent()
{
}

CloudStorageParent::~CloudStorageParent()
{
}

void
CloudStorageParent::ActorDestroy(ActorDestroyReason aWhy)
{
}

PCloudStorageRequestParent*
CloudStorageParent::AllocPCloudStorageRequestParent(const CloudStorageRequest& aRequest)
{
LOG("CloudStorageParent::AllocPCloudStorageRequestParent()");
// non-used parameter aRequest
return new CloudStorageRequestParent();
}

bool
CloudStorageParent::DeallocPCloudStorageRequestParent(PCloudStorageRequestParent* aActor)
{
LOG("CloudStorageParent::DeallocPCloudStorageRequestParent()");
delete aActor;
return true;
}

bool
CloudStorageParent::RecvPCloudStorageRequestConstructor(PCloudStorageRequestParent* aActor,
const CloudStorageRequest& aRequest)
{
LOG("CloudStorageParent::RecvPCloudStorageRequestConstructor()");
CloudStorageRequestParent* actor = static_cast<CloudStorageRequestParent*>(aActor);
return actor->HandleRequest(aRequest);
}

} // end cloudstorage
} // end dom
} // end mozilla


47 changes: 47 additions & 0 deletions dom/cloudstorage/CloudStorageParent.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_cloudstorage_CloudStorageParent_h
#define mozilla_dom_cloudstorage_CloudStorageParent_h

#include "mozilla/dom/cloudstorage/PCloudStorageParent.h"
#include "mozilla/dom/cloudstorage/PCloudStorageRequestParent.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/ContentParent.h"

#include "mozilla/Attributes.h"

namespace mozilla {
namespace dom {
namespace cloudstorage {

class CloudStorageParent : public PCloudStorageParent
{
friend class mozilla::dom::ContentParent;
public:
CloudStorageParent();
protected:
virtual ~CloudStorageParent();

virtual PCloudStorageRequestParent*
AllocPCloudStorageRequestParent(const CloudStorageRequest& request) override;

virtual bool
DeallocPCloudStorageRequestParent(PCloudStorageRequestParent* aActor) override;

virtual bool
RecvPCloudStorageRequestConstructor(PCloudStorageRequestParent* aActor,
const CloudStorageRequest& request) override;

virtual void
ActorDestroy(ActorDestroyReason aWhy) override;

};

} // end cloudstorage
} // end dom
} // end mozilla

#endif
Loading