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

Side by Side Diff: components/surfaces/display_impl.h

Issue 1131933006: Ensure that instances of DisplayImpl and SurfaceImpl don't outlive SurfacesServiceApplication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 7 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 | « components/surfaces/display_factory_impl.cc ('k') | components/surfaces/display_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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SURFACES_DISPLAY_IMPL_H_ 5 #ifndef COMPONENTS_SURFACES_DISPLAY_IMPL_H_
6 #define COMPONENTS_SURFACES_DISPLAY_IMPL_H_ 6 #define COMPONENTS_SURFACES_DISPLAY_IMPL_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/surfaces/display_client.h" 9 #include "cc/surfaces/display_client.h"
10 #include "cc/surfaces/surface_factory.h" 10 #include "cc/surfaces/surface_factory.h"
11 #include "cc/surfaces/surface_factory_client.h" 11 #include "cc/surfaces/surface_factory_client.h"
12 #include "components/surfaces/public/interfaces/display.mojom.h" 12 #include "components/surfaces/public/interfaces/display.mojom.h"
13 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" 13 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
14 14
15 namespace cc { 15 namespace cc {
16 class Display; 16 class Display;
17 class SurfaceFactory; 17 class SurfaceFactory;
18 } 18 }
19 19
20 namespace surfaces { 20 namespace surfaces {
21 class SurfacesScheduler; 21 class SurfacesScheduler;
22 class SurfacesServiceApplication;
22 23
23 class DisplayImpl : public mojo::Display, 24 class DisplayImpl : public mojo::Display,
24 public mojo::ViewportParameterListener, 25 public mojo::ViewportParameterListener,
25 public cc::DisplayClient, 26 public cc::DisplayClient,
26 public cc::SurfaceFactoryClient { 27 public cc::SurfaceFactoryClient {
27 public: 28 public:
28 DisplayImpl(cc::SurfaceManager* manager, 29 DisplayImpl(SurfacesServiceApplication* application,
30 cc::SurfaceManager* manager,
29 cc::SurfaceId cc_id, 31 cc::SurfaceId cc_id,
30 SurfacesScheduler* scheduler, 32 SurfacesScheduler* scheduler,
31 mojo::ContextProviderPtr context_provider, 33 mojo::ContextProviderPtr context_provider,
32 mojo::ResourceReturnerPtr returner, 34 mojo::ResourceReturnerPtr returner,
33 mojo::InterfaceRequest<mojo::Display> display_request); 35 mojo::InterfaceRequest<mojo::Display> display_request);
34 ~DisplayImpl() override; 36 ~DisplayImpl() override;
35 37
36 private: 38 private:
37 void OnContextCreated(mojo::CommandBufferPtr gles2_client); 39 void OnContextCreated(mojo::CommandBufferPtr gles2_client);
38 40
(...skipping 11 matching lines...) Expand all
50 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; 52 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override;
51 53
52 // ViewportParameterListener 54 // ViewportParameterListener
53 void OnVSyncParametersUpdated(int64_t timebase, int64_t interval) override; 55 void OnVSyncParametersUpdated(int64_t timebase, int64_t interval) override;
54 56
55 // SurfaceFactoryClient implementation. 57 // SurfaceFactoryClient implementation.
56 void ReturnResources(const cc::ReturnedResourceArray& resources) override; 58 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
57 59
58 void Draw(); 60 void Draw();
59 61
62 SurfacesServiceApplication* application_;
60 cc::SurfaceManager* manager_; 63 cc::SurfaceManager* manager_;
61 cc::SurfaceFactory factory_; 64 cc::SurfaceFactory factory_;
62 cc::SurfaceId cc_id_; 65 cc::SurfaceId cc_id_;
63 SurfacesScheduler* scheduler_; 66 SurfacesScheduler* scheduler_;
64 mojo::ContextProviderPtr context_provider_; 67 mojo::ContextProviderPtr context_provider_;
65 mojo::ResourceReturnerPtr returner_; 68 mojo::ResourceReturnerPtr returner_;
66 69
67 mojo::FramePtr pending_frame_; 70 mojo::FramePtr pending_frame_;
68 SubmitFrameCallback pending_callback_; 71 SubmitFrameCallback pending_callback_;
69 72
70 scoped_ptr<cc::Display> display_; 73 scoped_ptr<cc::Display> display_;
71 74
72 mojo::Binding<mojo::ViewportParameterListener> viewport_param_binding_; 75 mojo::Binding<mojo::ViewportParameterListener> viewport_param_binding_;
73 mojo::StrongBinding<mojo::Display> display_binding_; 76 mojo::StrongBinding<mojo::Display> display_binding_;
74 77
75 DISALLOW_COPY_AND_ASSIGN(DisplayImpl); 78 DISALLOW_COPY_AND_ASSIGN(DisplayImpl);
76 }; 79 };
77 80
78 } // namespace surfaces 81 } // namespace surfaces
79 82
80 #endif // COMPONENTS_SURFACES_DISPLAY_IMPL_H_ 83 #endif // COMPONENTS_SURFACES_DISPLAY_IMPL_H_
OLDNEW
« no previous file with comments | « components/surfaces/display_factory_impl.cc ('k') | components/surfaces/display_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698