Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: sky/viewer/platform/weburlloader_impl.h

Issue 959773005: Share sky::PlatformImpl bettween sky_viewer and SkyShell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/viewer/platform/platform_impl.cc ('k') | sky/viewer/platform/weburlloader_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SKY_VIEWER_PLATFORM_WEBURLLOADER_IMPL_H_
6 #define SKY_VIEWER_PLATFORM_WEBURLLOADER_IMPL_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "mojo/common/handle_watcher.h"
10 #include "mojo/services/network/public/interfaces/url_loader.mojom.h"
11 #include "sky/engine/public/platform/WebURLLoader.h"
12 #include "sky/engine/public/platform/WebURLRequest.h"
13
14 namespace mojo {
15 class NetworkService;
16 }
17
18 namespace sky {
19
20 class WebURLLoaderImpl : public blink::WebURLLoader {
21 public:
22 explicit WebURLLoaderImpl(mojo::NetworkService* network_service);
23
24 private:
25 virtual ~WebURLLoaderImpl();
26
27 // blink::WebURLLoader methods:
28 virtual void loadAsynchronously(
29 const blink::WebURLRequest&, blink::WebURLLoaderClient* client) override;
30 virtual void cancel() override;
31
32 void OnReceivedResponse(mojo::URLResponsePtr response);
33 void OnReceivedError(mojo::URLResponsePtr response);
34 void OnReceivedRedirect(mojo::URLResponsePtr response);
35 void ReadMore();
36 void WaitToReadMore();
37 void OnResponseBodyStreamReady(MojoResult result);
38
39 blink::WebURLLoaderClient* client_;
40 GURL url_;
41 mojo::URLLoaderPtr url_loader_;
42 mojo::ScopedDataPipeConsumerHandle response_body_stream_;
43 mojo::common::HandleWatcher handle_watcher_;
44
45 base::WeakPtrFactory<WebURLLoaderImpl> weak_factory_;
46
47 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl);
48 };
49
50 } // namespace sky
51
52 #endif // SKY_VIEWER_PLATFORM_WEBURLLOADER_IMPL_H_
OLDNEW
« no previous file with comments | « sky/viewer/platform/platform_impl.cc ('k') | sky/viewer/platform/weburlloader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698