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

Side by Side Diff: android_webview/browser/shared_renderer_state.h

Issue 349653004: Merge 279934 "aw: Fix hardware teardown race" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2062/src/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
6 #define ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ 6 #define ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void ClientRequestDrawGL(); 50 void ClientRequestDrawGL();
51 51
52 void SetDrawGLInput(scoped_ptr<DrawGLInput> input); 52 void SetDrawGLInput(scoped_ptr<DrawGLInput> input);
53 scoped_ptr<DrawGLInput> PassDrawGLInput(); 53 scoped_ptr<DrawGLInput> PassDrawGLInput();
54 54
55 // Set by UI and read by RT. 55 // Set by UI and read by RT.
56 void SetHardwareAllowed(bool allowed); 56 void SetHardwareAllowed(bool allowed);
57 bool IsHardwareAllowed() const; 57 bool IsHardwareAllowed() const;
58 58
59 // Set by RT and read by UI.
60 void SetHardwareInitialized(bool initialized);
61 bool IsHardwareInitialized() const;
62
63 void SetSharedContext(gpu::GLInProcessContext* context); 59 void SetSharedContext(gpu::GLInProcessContext* context);
64 gpu::GLInProcessContext* GetSharedContext() const; 60 gpu::GLInProcessContext* GetSharedContext() const;
65 61
66 void ReturnResources(const cc::TransferableResourceArray& input); 62 void ReturnResources(const cc::TransferableResourceArray& input);
67 void InsertReturnedResources(const cc::ReturnedResourceArray& resources); 63 void InsertReturnedResources(const cc::ReturnedResourceArray& resources);
68 void SwapReturnedResources(cc::ReturnedResourceArray* resources); 64 void SwapReturnedResources(cc::ReturnedResourceArray* resources);
69 bool ReturnedResourcesEmpty() const; 65 bool ReturnedResourcesEmpty() const;
70 66
71 private: 67 private:
72 void ClientRequestDrawGLOnUIThread(); 68 void ClientRequestDrawGLOnUIThread();
73 69
74 scoped_refptr<base::MessageLoopProxy> ui_loop_; 70 scoped_refptr<base::MessageLoopProxy> ui_loop_;
75 // TODO(boliu): Remove |client_on_ui_| from shared state. 71 // TODO(boliu): Remove |client_on_ui_| from shared state.
76 BrowserViewRendererClient* client_on_ui_; 72 BrowserViewRendererClient* client_on_ui_;
77 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; 73 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_;
78 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; 74 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_;
79 75
80 // Accessed by both UI and RT thread. 76 // Accessed by both UI and RT thread.
81 mutable base::Lock lock_; 77 mutable base::Lock lock_;
82 scoped_ptr<DrawGLInput> draw_gl_input_; 78 scoped_ptr<DrawGLInput> draw_gl_input_;
83 bool hardware_allowed_; 79 bool hardware_allowed_;
84 bool hardware_initialized_;
85 gpu::GLInProcessContext* share_context_; 80 gpu::GLInProcessContext* share_context_;
86 cc::ReturnedResourceArray returned_resources_; 81 cc::ReturnedResourceArray returned_resources_;
87 }; 82 };
88 83
89 } // namespace android_webview 84 } // namespace android_webview
90 85
91 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ 86 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
OLDNEW
« no previous file with comments | « android_webview/browser/browser_view_renderer.cc ('k') | android_webview/browser/shared_renderer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698