Removed Resource Saving 59/43759/1
authorAndrew Cox <andrew.cox@partner.samsung.com>
Mon, 13 Jul 2015 14:48:10 +0000 (15:48 +0100)
committerAndrew Cox <andrew.cox@partner.samsung.com>
Mon, 13 Jul 2015 15:02:32 +0000 (16:02 +0100)
Change-Id: I4fe2a6b00e364e39a321bc7c13f4a4980350f766
Signed-off-by: Andrew Cox <andrew.cox@partner.samsung.com>
15 files changed:
automated-tests/src/dali-internal/utc-Dali-Internal-ResourceClient.cpp
automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp
automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.h
dali/integration-api/platform-abstraction.h
dali/integration-api/resource-cache.h
dali/internal/event/images/image-impl.cpp
dali/internal/event/images/image-impl.h
dali/internal/event/resources/resource-client.cpp
dali/internal/event/resources/resource-client.h
dali/internal/event/resources/resource-ticket-observer.h
dali/internal/event/resources/resource-ticket.cpp
dali/internal/event/resources/resource-ticket.h
dali/internal/update/resources/resource-manager-declarations.h
dali/internal/update/resources/resource-manager.cpp
dali/internal/update/resources/resource-manager.h

index 3ea4b7f..d4cf8f7 100644 (file)
@@ -51,7 +51,6 @@ class TestTicketObserver : public Internal::ResourceTicketObserver
 public:
   TestTicketObserver()
   : mLoadingFailedCalled(0), mLoadingSucceededCalled(0),
-    mSavingFailedCalled(0), mSavingSucceededCalled(0),
     mUploadedCount(0)
   {}
 
@@ -63,14 +62,6 @@ public:
     tet_printf("TicketObserver: LoadingSucceeded()  called %d times", mLoadingSucceededCalled);
     return mLoadingSucceededCalled;
   }
-  int SaveFailedCalled() {
-    tet_printf("TicketObserver: SavingFailed() called %d times", mSavingFailedCalled);
-    return mSavingFailedCalled;
-  }
-  int SaveSucceededCalled() {
-    tet_printf("TicketObserver: SavingSucceeded() called %d times", mSavingSucceededCalled);
-    return mSavingSucceededCalled;
-  }
   int  UploadCalled() {
     tet_printf("TicketObserver: Uploaded() called %d times", mUploadedCount);
     return mUploadedCount;
@@ -78,23 +69,17 @@ public:
   void Reset() {
     mLoadingFailedCalled    = 0;
     mLoadingSucceededCalled = 0;
-    mSavingFailedCalled     = 0;
-    mSavingSucceededCalled  = 0;
     mUploadedCount           = 0;
   }
 
 public: // From ResourceTicketObserver
   virtual void ResourceLoadingFailed(const Internal::ResourceTicket& ticket) {mLoadingFailedCalled++;}
   virtual void ResourceLoadingSucceeded(const Internal::ResourceTicket& ticket) {mLoadingSucceededCalled++;}
-  virtual void ResourceSavingFailed(const Internal::ResourceTicket& ticket) {mSavingFailedCalled++;}
-  virtual void ResourceSavingSucceeded(const Internal::ResourceTicket& ticket) {mSavingSucceededCalled++;}
   virtual void ResourceUploaded(const Internal::ResourceTicket& ticket) {mUploadedCount++;}
 
 private:
   int mLoadingFailedCalled;
   int mLoadingSucceededCalled;
-  int mSavingFailedCalled;
-  int mSavingSucceededCalled;
   int mUploadedCount;
 };
 
@@ -702,69 +687,6 @@ int UtcDaliInternalRequestReloadBitmapRequests03(void)
   END_TEST;
 }
 
-/**
-//int UtcDaliInternalSaveResource01(void)//
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with valid id, and valid filename");
-  testTicketObserver.Reset();
-
-  DALI_TEST_CHECK(0);
-  END_TEST;
-}
-
-
-//int UtcDaliInternalSaveResource02(void)//
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with invalid id");
-  testTicketObserver.Reset();
-
-  DALI_TEST_CHECK(0);
-  END_TEST;
-}
-
-//int UtcDaliInternalSaveResource03(void)//
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with invalid id");
-  testTicketObserver.Reset();
-
-  DALI_TEST_CHECK ( 0 );
-  END_TEST;
-}
-
-
-//int UtcDaliInternalSaveResource04(void)//
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with valid id, but invalid filename");
-  testTicketObserver.Reset();
-  DALI_TEST_CHECK( 0 );
-  END_TEST;
-}
-*/
-
-int UtcDaliInternalSaveResource05(void)
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with valid id, but invalid resource type");
-  testTicketObserver.Reset();
-
-  Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
-
-  // First, load a bitmap resource
-  Internal::ResourceTicketPtr ticket = CheckLoadBitmap(application, "bitmap.jpg", 80, 80);
-
-  // Try saving it
-  resourceClient.SaveResource( ticket, "bitmap.png" );
-  application.SendNotification(); // Flush update messages
-  application.Render();           // Process save resource request
-
-  DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::SaveResourceFunc ) );
-  END_TEST;
-}
-
 int UtcDaliInternalRequestResourceTicket01(void)
 {
   TestApplication application;
index fb31688..f0ea225 100644 (file)
@@ -123,20 +123,6 @@ Integration::ResourcePointer TestPlatformAbstraction::LoadResourceSynchronously(
 }
 
 /**
- * @copydoc PlatformAbstraction::SaveResource()
- */
-void TestPlatformAbstraction::SaveResource(const Integration::ResourceRequest& request)
-{
-  mTrace.PushCall("SaveResource", "");
-  if(mRequest != NULL)
-  {
-    delete mRequest;
-    tet_infoline ("Warning: multiple resource requests not handled by Test Suite. You may see unexpected errors");
-  }
-  mRequest = new Integration::ResourceRequest(request);
-}
-
-/**
  * @copydoc PlatformAbstraction::CancelLoad()
  */
 void TestPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
@@ -159,14 +145,6 @@ void TestPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
   {
     cache.LoadFailed( mResources.loadFailedId, mResources.loadFailure );
   }
-  if(mResources.saved)
-  {
-    cache.SaveComplete( mResources.savedId, mResources.savedType );
-  }
-  if(mResources.saveFailed)
-  {
-    cache.SaveFailed( mResources.saveFailedId, mResources.saveFailure );
-  }
 }
 
 /**
@@ -272,7 +250,6 @@ bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
     case SuspendFunc:                         return mTrace.FindMethod("Suspend");
     case ResumeFunc:                          return mTrace.FindMethod("Resume");
     case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource");
-    case SaveResourceFunc:                    return mTrace.FindMethod("SaveResource");
     case LoadFileFunc:                        return mTrace.FindMethod("LoadFile");
     case SaveFileFunc:                        return mTrace.FindMethod("SaveFile");
     case CancelLoadFunc:                      return mTrace.FindMethod("CancelLoad");
@@ -327,22 +304,6 @@ void TestPlatformAbstraction::SetResourceLoadFailed(Integration::ResourceId  id,
   mResources.loadFailure = failure;
 }
 
-void TestPlatformAbstraction::SetResourceSaved(Integration::ResourceId      savedId,
-                                               Integration::ResourceTypeId  savedType)
-{
-  mResources.saved = true;
-  mResources.savedId = savedId;
-  mResources.savedType = savedType;
-}
-
-void TestPlatformAbstraction::SetResourceSaveFailed(Integration::ResourceId  id,
-                                                    Integration::ResourceFailure failure)
-{
-  mResources.saveFailed = true;
-  mResources.saveFailedId = id;
-  mResources.saveFailure = failure;
-}
-
 Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
 {
   return mRequest;
index fc66701..5428d97 100644 (file)
@@ -49,14 +49,6 @@ public:
     bool                         loadFailed;
     Integration::ResourceId      loadFailedId;
     Integration::ResourceFailure loadFailure;
-
-    bool                         saved;
-    Integration::ResourceId      savedId;
-    Integration::ResourceTypeId  savedType;
-
-    bool                         saveFailed;
-    Integration::ResourceId      saveFailedId;
-    Integration::ResourceFailure saveFailure;
   };
 
   struct LoadFileResult
@@ -116,11 +108,6 @@ public:
   virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
 
   /**
-   * @copydoc PlatformAbstraction::SaveResource()
-   */
-  virtual void SaveResource(const Integration::ResourceRequest& request);
-
-  /**
    * @copydoc PlatformAbstraction::CancelLoad()
    */
   virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
@@ -181,7 +168,6 @@ public: // TEST FUNCTIONS
     SuspendFunc,
     ResumeFunc,
     LoadResourceFunc,
-    SaveResourceFunc,
     SaveFileFunc,
     LoadFileFunc,
     CancelLoadFunc,
@@ -215,12 +201,6 @@ public: // TEST FUNCTIONS
   void SetResourceLoadFailed(Integration::ResourceId  id,
                              Integration::ResourceFailure failure);
 
-  void SetResourceSaved(Integration::ResourceId      savedId,
-                        Integration::ResourceTypeId  savedType);
-
-  void SetResourceSaveFailed(Integration::ResourceId  id,
-                             Integration::ResourceFailure failure);
-
   Integration::ResourceRequest* GetRequest();
 
   void DiscardRequest();
index 59a5cbb..6398636 100644 (file)
@@ -142,12 +142,6 @@ public:
   virtual ResourcePointer LoadResourceSynchronously( const ResourceType& resourceType, const std::string& resourcePath ) = 0;
 
   /**
-   * Request that a resource be saved to the native filesystem.
-   * This is an asynchronous request.
-   */
-  virtual void SaveResource(const ResourceRequest& request) = 0;
-
-  /**
    * Cancel an ongoing LoadResource() request.
    * Multi-threading note: this method will be called from the main thread only i.e. not
    * from within the Core::Render() method.
index e5fa3d6..0ca6803 100644 (file)
@@ -70,28 +70,12 @@ public:
   virtual void LoadResponse(ResourceId id, ResourceTypeId type, ResourcePointer resource, LoadStatus status) = 0;
 
   /**
-   * Provide the results of a resource saving operation.
-   * @param[in] id The unique ID of the resource.
-   *               This should match an ID previously passed into PlatformAbstraction::SaveResource().
-   * @param[in] type The type of the resource.
-   */
-  virtual void SaveComplete(ResourceId id, ResourceTypeId type) = 0;
-
-  /**
    * Report that a resource loading operation has failed.
    * @param[in] id The unique ID of the load request.
    *               This should match an ID previously passed into PlatformAbstraction::LoadResource().
    * @param[in] failure An error code, used to determine why the load failed.
    */
   virtual void LoadFailed(ResourceId id, ResourceFailure failure) = 0;
-
-  /**
-   * Report that a resource saving operation has failed.
-   * @param[in] id The unique ID of the save request.
-   *               This should match an ID previously passed into PlatformAbstraction::LoadResource().
-   * @param[in] failure An error code, used to determine why the save failed.
-   */
-  virtual void SaveFailed(ResourceId id, ResourceFailure failure) = 0;
 };
 
 
index 8734ca4..4e3fa1e 100644 (file)
@@ -93,16 +93,6 @@ void Image::ResourceUploaded(const ResourceTicket& ticket)
   mUploaded.Emit( Dali::Image( this ) );
 }
 
-void Image::ResourceSavingSucceeded( const ResourceTicket& ticket )
-{
-  // do nothing
-}
-
-void Image::ResourceSavingFailed( const ResourceTicket& ticket )
-{
-  // do nothing
-}
-
 unsigned int Image::GetWidth() const
 {
   return mWidth;
index d0ec736..540b63f 100644 (file)
@@ -119,16 +119,6 @@ public: // From ResourceTicketObserver
    */
   virtual void ResourceUploaded(const ResourceTicket& ticket);
 
-  /**
-   * @copydoc Dali::Internal::ResourceTicketObserver::ResourceSavingSucceeded()
-   */
-  virtual void ResourceSavingSucceeded( const ResourceTicket& ticket );
-
-  /**
-   * @copydoc Dali::Internal::ResourceTicketObserver::ResourceSavingFailed()
-   */
-  virtual void ResourceSavingFailed( const ResourceTicket& ticket );
-
 public:
 
   /**
index c5ec4da..e6274e8 100644 (file)
@@ -205,28 +205,6 @@ bool ResourceClient::ReloadResource( ResourceId id, bool resetFinishedStatus, Lo
   return resourceExists;
 }
 
-void ResourceClient::SaveResource( ResourceTicketPtr ticket, const std::string& url )
-{
-  DALI_ASSERT_DEBUG( ticket );
-
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: SaveResource(Id: %u, path:%s)\n", ticket->GetId(), url.c_str());
-
-  const ResourceTypePath * const typePathPtr = &ticket->GetTypePath();
-  if( typePathPtr )
-  {
-    if( 0 != url.length() )
-    {
-      ResourceTypePath typePath( *(typePathPtr->type), url );
-      RequestSaveResourceMessage( mEventThreadServices, mResourceManager, ticket->GetId(), typePath );
-    }
-    else
-    {
-      ResourceTypePath typePath( *typePathPtr );
-      RequestSaveResourceMessage( mEventThreadServices, mResourceManager, ticket->GetId(), typePath );
-    }
-  }
-}
-
 ResourceTicketPtr ResourceClient::RequestResourceTicket( ResourceId id )
 {
   DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: RequestResourceTicket(Id: %u)\n", id);
@@ -463,19 +441,6 @@ void ResourceClient::NotifyUploaded( ResourceId id )
   }
 }
 
-void ResourceClient::NotifySaveRequested( ResourceId id )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifySaveRequested(id:%u)\n", id);
-
-  TicketContainerIter ticketIter = mImpl->mTickets.find(id);
-  if(ticketIter != mImpl->mTickets.end())
-  {
-    ResourceTicket* ticket = ticketIter->second;
-    SaveResource( ticket, "" );
-  }
-}
-
-
 void ResourceClient::NotifyLoading( ResourceId id )
 {
   DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifyLoading(id:%u)\n", id);
@@ -512,30 +477,6 @@ void ResourceClient::NotifyLoadingFailed( ResourceId id )
   }
 }
 
-void ResourceClient::NotifySavingSucceeded( ResourceId id )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifySavingSucceeded(id:%u)\n", id);
-
-  TicketContainerIter ticketIter = mImpl->mTickets.find(id);
-  if(ticketIter != mImpl->mTickets.end())
-  {
-    ResourceTicket* ticket = ticketIter->second;
-    ticket->SavingSucceeded();
-  }
-}
-
-void ResourceClient::NotifySavingFailed( ResourceId id )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifySavingFailed(id:%u)\n", id);
-
-  TicketContainerIter ticketIter = mImpl->mTickets.find(id);
-  if(ticketIter != mImpl->mTickets.end())
-  {
-    ResourceTicket* ticket = ticketIter->second;
-    ticket->SavingFailed();
-  }
-}
-
 void ResourceClient::UpdateImageTicket( ResourceId id, const ImageAttributes& imageAttributes ) ///!< Issue #AHC01
 {
   DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: UpdateImageTicket(id:%u)\n", id);
index c4b7123..055c9e2 100644 (file)
@@ -134,16 +134,6 @@ public:
   bool ReloadResource( ResourceId id, bool resetFinishedStatus = false, Integration::LoadResourcePriority priority = Integration::LoadPriorityNormal );
 
   /**
-   * Save a resource to the given url.
-   * If the resource type is saveable (model), then the ticket observer will get
-   * notified with ResourceSavingSucceeded() or ResourceSavingFailed(), otherwise there
-   * will be no response.
-   * @param[in] ticket The ticket of the resource to save
-   * @param[in] url The url to save the resource to.
-   */
-  void SaveResource( ResourceTicketPtr ticket, const std::string& url );
-
-  /**
    * Get the ticket for the associated resource ID.
    * If no ticket can be found for this resource, then this returns
    * NULL to indicate the resource doesn't exist.
@@ -267,12 +257,6 @@ public: // Message methods
   void NotifyUploaded( ResourceId id );
 
   /**
-   * Notify client that the resource has been updated and requires saving.
-   * @param[in] id The resource id of the updated resource
-   */
-  void NotifySaveRequested( ResourceId id );
-
-  /**
    * Notify associated ticket observers that the resource is loading.
    * @param[in] id The resource id of the loading resource
    */
@@ -290,18 +274,6 @@ public: // Message methods
    */
   void NotifyLoadingFailed( ResourceId id );
 
-  /**
-   * Notify associated ticket observers that the resource has saved successfully
-   * @param[in] id The resource id of the saved resource
-   */
-  void NotifySavingSucceeded( ResourceId id );
-
-  /**
-   * Notify associated ticket observers that the resource save failed
-   * @param[in] id The resource id of the failed resource
-   */
-  void NotifySavingFailed( ResourceId id );
-
  /**
    * Finds ImageTicket which belongs to resource identified by id and updates the cached
    * attributes with a new set which contains the actual width and height of the loaded
@@ -331,11 +303,6 @@ inline MessageBase* UploadedMessage( ResourceClient& client, ResourceId id )
   return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifyUploaded, id );
 }
 
-inline MessageBase* SaveResourceMessage( ResourceClient& client, ResourceId id )
-{
-  return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifySaveRequested, id );
-}
-
 inline MessageBase* LoadingMessage( ResourceClient& client, ResourceId id )
 {
   return new MessageValue1< ResourceClient, ResourceId  >( &client, &ResourceClient::NotifyLoading, id );
@@ -351,16 +318,6 @@ inline MessageBase* LoadingFailedMessage( ResourceClient& client, ResourceId id
   return new MessageValue1< ResourceClient, ResourceId  >( &client, &ResourceClient::NotifyLoadingFailed, id );
 }
 
-inline MessageBase* SavingSucceededMessage( ResourceClient& client, ResourceId id )
-{
-  return new MessageValue1< ResourceClient, ResourceId  >( &client, &ResourceClient::NotifySavingSucceeded, id );
-}
-
-inline MessageBase* SavingFailedMessage( ResourceClient& client, ResourceId id )
-{
-  return new MessageValue1< ResourceClient, ResourceId  >( &client, &ResourceClient::NotifySavingFailed, id );
-}
-
 } // namespace Internal
 } // namespace Dali
 
index 8a98bc1..8b7c154 100644 (file)
@@ -55,18 +55,6 @@ public:
    * @param[in] ticket The ticket for this resource.
    */
   virtual void ResourceUploaded( const ResourceTicket& ticket ) = 0;
-
-  /**
-   * Called when a resource is saved successfully.
-   * @param[in] ticket The ticket for this resource.
-   */
-  virtual void ResourceSavingSucceeded( const ResourceTicket& ticket ) = 0;
-
-  /**
-   * Called when a resource fails to save.
-   * @param[in] ticket The ticket for this resource.
-   */
-  virtual void ResourceSavingFailed( const ResourceTicket& ticket ) = 0;
 };
 
 } // namespace Internal
index 259d742..0ebb28f 100644 (file)
@@ -160,48 +160,6 @@ void ResourceTicket::Uploaded()
   mObservers.erase( endIter, mObservers.end() );
 }
 
-void ResourceTicket::SavingSucceeded()
-{
-  // Using array operator as the call back out to application code might call back in
-  // and corrupt the mObservers list. Presumption is the operator gets the current address
-  // and adds an offset so a push_back() triggered reallocation should still work.
-  size_t count = mObservers.size();
-  for(size_t i = 0; i < count; i++)
-  {
-    if( mObservers[i] != NULL)
-    {
-      mObservers[i]->ResourceSavingSucceeded(*this);
-    }
-  }
-
-  // Move NULL pointers to the end...
-  ObserverIter endIter = remove_if( mObservers.begin(), mObservers.end(), isNULL );
-
-  // ...and remove them
-  mObservers.erase( endIter, mObservers.end() );
-}
-
-void ResourceTicket::SavingFailed()
-{
-  // Using array operator as the call back out to application code might call back in
-  // and corrupt the mObservers list. Presumption is the operator gets the current address
-  // and adds an offset so a push_back() triggered reallocation should still work.
-  size_t count = mObservers.size();
-  for(size_t i = 0; i < count; i++)
-  {
-    if( mObservers[i] != NULL)
-    {
-      mObservers[i]->ResourceSavingFailed(*this);
-    }
-  }
-
-  // Move NULL pointers to the end...
-  ObserverIter endIter = remove_if( mObservers.begin(), mObservers.end(), isNULL );
-
-  // ...and remove them
-  mObservers.erase( endIter, mObservers.end() );
-}
-
 void ResourceTicket::StopLifetimeObservation()
 {
   mLifetimeObserver = NULL;
index 958da0b..da510a4 100644 (file)
@@ -119,18 +119,6 @@ public: // Used by the ResourceClient
   void Uploaded();
 
   /**
-   * Called when a resource is saved successfully.
-   * The ResourceTicketObservers will be notified.
-   */
-  void SavingSucceeded();
-
-  /**
-   * Called when a resource fails to save.
-   * The ResourceTicketObservers will be notified.
-   */
-  void SavingFailed();
-
-  /**
    * Called when the ResourceTicketLifetimeObserver is being destroyed.
    * This method should only be called during destruction of the Dali core.
    */
index c8414d8..8fbadac 100644 (file)
@@ -39,7 +39,6 @@ struct ResourcePostProcessRequest
   enum PostProcess
   {
     UPLOADED,
-    SAVE,
     DELETED
   };
 
index 5c558de..2d6a140 100644 (file)
@@ -130,8 +130,6 @@ struct ResourceManager::ResourceManagerImpl
   LiveRequestContainer newFailedRequests;
   LiveRequestContainer oldFailedRequests;
   DeadRequestContainer deadRequests;
-  LiveRequestContainer saveRequests;          ///< copy of id's being saved (must also be in newCompleteRequests or oldCompleteRequests)
-  LiveRequestContainer completeSaveRequests;  ///< successful save ids are moved from saveRequests to here
 
   /**
    * This is the resource cache. It's filled/emptied from within Core::Update()
@@ -209,12 +207,6 @@ void ResourceManager::PostProcessResources( BufferIndex updateBufferIndex )
         SendToClient( UploadedMessage( *mImpl->mResourceClient, ppRequest.id ) );
         break;
       }
-      case ResourcePostProcessRequest::SAVE:
-      {
-        SendToClient( SaveResourceMessage( *mImpl->mResourceClient, ppRequest.id ) );
-        break;
-
-      }
       case ResourcePostProcessRequest::DELETED:
       {
         // TextureObservers handled in TextureCache
@@ -240,7 +232,6 @@ bool ResourceManager::ResourcesToProcess()
   workTodo |= !mImpl->newFailedRequests.empty();
   // check if there's something still loading
   workTodo |= !mImpl->loadingRequests.empty();
-  workTodo |= !mImpl->saveRequests.empty();
 
   return workTodo;
 }
@@ -390,59 +381,6 @@ void ResourceManager::HandleReloadResourceRequest( ResourceId id, const Resource
   }
 }
 
-void ResourceManager::HandleSaveResourceRequest( ResourceId id, const ResourceTypePath& typePath )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleSaveResourceRequest(id:%u, path:%s)\n", id, typePath.path.c_str());
-
-  bool resourceFound = false;
-
-  // ID must be in the complete sets
-  LiveRequestIter iter = mImpl->newCompleteRequests.find(id);
-  if (iter != mImpl->newCompleteRequests.end())
-  {
-    resourceFound = true;
-  }
-  else
-  {
-    LiveRequestIter iter = mImpl->oldCompleteRequests.find(id);
-    if (iter != mImpl->oldCompleteRequests.end())
-    {
-      resourceFound = true;
-    }
-  }
-
-  if( resourceFound )
-  {
-    ResourcePointer resource;
-    DALI_ASSERT_DEBUG( typePath.type != NULL );
-
-    switch( typePath.type->id )
-    {
-      case ResourceBitmap:
-      {
-        break;
-      }
-      case ResourceNativeImage:
-      {
-        break;
-      }
-      case ResourceTargetImage:
-      {
-        break;
-      }
-
-    }
-
-    if( resource ) // i.e. if it's a saveable resource
-    {
-      mImpl->saveRequests.insert(id);
-
-      ResourceRequest request(id, *typePath.type, typePath.path, resource);
-      mImpl->mPlatformAbstraction.SaveResource(request);
-    }
-  }
-}
-
 void ResourceManager::HandleDiscardResourceRequest( ResourceId deadId, ResourceTypeId typeId )
 {
   bool wasComplete = false;
@@ -450,9 +388,6 @@ void ResourceManager::HandleDiscardResourceRequest( ResourceId deadId, ResourceT
 
   DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleDiscardResourceRequest(id:%u)\n", deadId);
 
-  // remove copies of the deadId from completed/failed saving sets
-  RemoveId(mImpl->completeSaveRequests, deadId);
-
   // Search for the ID in one of the live containers
   // IDs are only briefly held in the new-completed or failed containers; check those last
   // Try removing from the old-completed requests
@@ -680,29 +615,6 @@ void ResourceManager::LoadResponse( ResourceId id, ResourceTypeId type, Resource
   }
 }
 
-void ResourceManager::SaveComplete(ResourceId id, ResourceTypeId type)
-{
-  DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: SaveComplete(id:%u)\n", id);
-
-  // ID must be in the saving set
-  LiveRequestIter iter = mImpl->saveRequests.find(id);
-
-  if (iter != mImpl->saveRequests.end())
-  {
-    // Remove from the saving set
-    mImpl->saveRequests.erase(iter);
-
-    // If resource has not been discarded..
-    if( mImpl->deadRequests.find(id) == mImpl->deadRequests.end() )
-    {
-      SendToClient( SavingSucceededMessage( *mImpl->mResourceClient, id ) );
-    }
-
-    mImpl->cacheUpdated = true;
-  }
-}
-
 void ResourceManager::LoadFailed(ResourceId id, ResourceFailure failure)
 {
   DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: LoadFailed(id:%u)\n", id);
@@ -725,30 +637,6 @@ void ResourceManager::LoadFailed(ResourceId id, ResourceFailure failure)
   }
 }
 
-void ResourceManager::SaveFailed(ResourceId id, ResourceFailure failure)
-{
-  DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: SaveFailed(id:%u)\n", id);
-
-  // ID must be in the saving set
-  LiveRequestIter iter = mImpl->saveRequests.find(id);
-
-  if (iter != mImpl->saveRequests.end())
-  {
-    // Remove from the saving set
-    mImpl->saveRequests.erase(iter);
-
-    // If resource has not been discarded..
-
-    if( mImpl->deadRequests.find(id) == mImpl->deadRequests.end() )
-    {
-      SendToClient( SavingFailedMessage( *mImpl->mResourceClient, id ) );
-    }
-
-    mImpl->cacheUpdated = true;
-  }
-}
-
 /********************************************************************************
  ********************************* Private Methods  *****************************
  ********************************************************************************/
@@ -797,24 +685,6 @@ void ResourceManager::DiscardDeadResources( BufferIndex updateBufferIndex )
 {
   for (DeadRequestIter iter = mImpl->deadRequests.begin(); iter != mImpl->deadRequests.end(); )
   {
-    // Delay destroying ids in saveRequests
-    if( mImpl->saveRequests.find(iter->first) != mImpl->saveRequests.end())
-    {
-      ++iter;
-      continue;
-    }
-
-    /**
-     * We should find a resource of the correct type, and move it to the DiscardQueue.
-     */
-    switch (iter->second)
-    {
-      case ResourceBitmap:
-      case ResourceNativeImage:
-      case ResourceTargetImage:
-        break;
-    }
-
     // Erase the item and increment the iterator
     mImpl->deadRequests.erase(iter++);
   }
index 6c91394..08aaad8 100644 (file)
@@ -273,13 +273,6 @@ public: // Used by ResourceClient
   void HandleReloadResourceRequest( ResourceId id, const ResourceTypePath& typePath, Integration::LoadResourcePriority priority, bool resetFinishedStatus );
 
   /**
-   * Save a resource to the given url
-   * @param[in] id       The resource id
-   * @param[in] typePath The type & path of the resource
-   */
-  void HandleSaveResourceRequest( ResourceId id, const ResourceTypePath& typePath );
-
-  /**
    * Resource ticket has been discarded, throw away the actual resource
    */
   void HandleDiscardResourceRequest( ResourceId id, Integration::ResourceTypeId typeId );
@@ -325,20 +318,10 @@ public:
   virtual void LoadResponse(ResourceId id, Integration::ResourceTypeId type, Integration::ResourcePointer resource, Integration::LoadStatus loadStatus);
 
   /**
-   * @copydoc Integration::ResourceCache::SaveComplete
-   */
-  virtual void SaveComplete(ResourceId id, Integration::ResourceTypeId type);
-
-  /**
    * @copydoc Integration::ResourceCache::LoadFailed
    */
   virtual void LoadFailed(ResourceId id, Integration::ResourceFailure failure);
 
-  /**
-   * @copydoc Integration::ResourceCache::SaveFailed
-   */
-  virtual void SaveFailed(ResourceId id, Integration::ResourceFailure failure);
-
   /********************************************************************************
    ********************************* Private Methods  *****************************
    ********************************************************************************/
@@ -549,20 +532,6 @@ inline void RequestReloadResourceMessage( EventThreadServices& eventThreadServic
   new (slot) LocalType( &manager, &ResourceManager::HandleReloadResourceRequest, id, typePath, priority, resetFinishedStatus );
 }
 
-inline void RequestSaveResourceMessage( EventThreadServices& eventThreadServices,
-                                        ResourceManager& manager,
-                                        ResourceId id,
-                                        const ResourceTypePath& typePath )
-{
-  typedef MessageValue2< ResourceManager, ResourceId, ResourceTypePath > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleSaveResourceRequest, id, typePath );
-}
-
 inline void RequestDiscardResourceMessage( EventThreadServices& eventThreadServices,
                                            ResourceManager& manager,
                                            ResourceId id,