| Index: sky/engine/tonic/dart_snapshot_loader.h
|
| diff --git a/sky/engine/core/script/dart_snapshot_loader.h b/sky/engine/tonic/dart_snapshot_loader.h
|
| similarity index 61%
|
| rename from sky/engine/core/script/dart_snapshot_loader.h
|
| rename to sky/engine/tonic/dart_snapshot_loader.h
|
| index 43930069d3ed955ce67f49f4b63b15a83fd1afb6..483299a35707f71fe4f58a9958d3a432de9395e9 100644
|
| --- a/sky/engine/core/script/dart_snapshot_loader.h
|
| +++ b/sky/engine/tonic/dart_snapshot_loader.h
|
| @@ -2,49 +2,38 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef SKY_ENGINE_CORE_SCRIPT_DART_SNAPSHOT_LOADER_H_
|
| -#define SKY_ENGINE_CORE_SCRIPT_DART_SNAPSHOT_LOADER_H_
|
| +#ifndef SKY_ENGINE_TONIC_DART_SNAPSHOT_LOADER_H_
|
| +#define SKY_ENGINE_TONIC_DART_SNAPSHOT_LOADER_H_
|
|
|
| #include "base/callback_forward.h"
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "dart/runtime/include/dart_api.h"
|
| #include "mojo/common/data_pipe_drainer.h"
|
| -#include "mojo/services/network/public/interfaces/url_loader.mojom.h"
|
| -#include "sky/engine/platform/fetcher/MojoFetcher.h"
|
| #include "sky/engine/wtf/OwnPtr.h"
|
| #include "sky/engine/wtf/Vector.h"
|
| #include "sky/engine/wtf/text/WTFString.h"
|
|
|
| namespace blink {
|
| -
|
| class DartState;
|
| -class KURL;
|
|
|
| -class DartSnapshotLoader : public MojoFetcher::Client,
|
| - public mojo::common::DataPipeDrainer::Client {
|
| +class DartSnapshotLoader : public mojo::common::DataPipeDrainer::Client {
|
| public:
|
| explicit DartSnapshotLoader(DartState* dart_state);
|
| ~DartSnapshotLoader();
|
|
|
| - void LoadSnapshot(const KURL& url, mojo::URLResponsePtr response,
|
| + void LoadSnapshot(mojo::ScopedDataPipeConsumerHandle pipe,
|
| const base::Closure& callback);
|
|
|
| - DartState* dart_state() const { return dart_state_.get(); }
|
| -
|
| private:
|
| - // MojoFetcher::Client
|
| - void OnReceivedResponse(mojo::URLResponsePtr response) override;
|
| -
|
| // mojo::common::DataPipeDrainer::Client
|
| void OnDataAvailable(const void* data, size_t num_bytes) override;
|
| void OnDataComplete() override;
|
|
|
| base::WeakPtr<DartState> dart_state_;
|
| + OwnPtr<mojo::common::DataPipeDrainer> drainer_;
|
| // TODO(abarth): Should we be using SharedBuffer to buffer the data?
|
| Vector<uint8_t> buffer_;
|
| - OwnPtr<MojoFetcher> fetcher_;
|
| - OwnPtr<mojo::common::DataPipeDrainer> drainer_;
|
| base::Closure callback_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DartSnapshotLoader);
|
| @@ -52,4 +41,4 @@ class DartSnapshotLoader : public MojoFetcher::Client,
|
|
|
| } // namespace blink
|
|
|
| -#endif // SKY_ENGINE_CORE_SCRIPT_DART_SNAPSHOT_LOADER_H_
|
| +#endif // SKY_ENGINE_TONIC_DART_SNAPSHOT_LOADER_H_
|
|
|