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

Unified Diff: mojo/cc/context_provider_mojo.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/cc/context_provider_mojo.h ('k') | mojo/dbus/dbus_external_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/cc/context_provider_mojo.cc
diff --git a/mojo/cc/context_provider_mojo.cc b/mojo/cc/context_provider_mojo.cc
index 7356b587c4064e10048bde6be72f9ac188429cea..10254b5468ae5a4feb18a289d3a65dad73d59770 100644
--- a/mojo/cc/context_provider_mojo.cc
+++ b/mojo/cc/context_provider_mojo.cc
@@ -10,7 +10,9 @@ namespace mojo {
ContextProviderMojo::ContextProviderMojo(
ScopedMessagePipeHandle command_buffer_handle)
- : command_buffer_handle_(command_buffer_handle.Pass()) {}
+ : command_buffer_handle_(command_buffer_handle.Pass()),
+ context_lost_(false) {
+}
bool ContextProviderMojo::BindToCurrentThread() {
DCHECK(command_buffer_handle_.is_valid());
@@ -42,7 +44,9 @@ cc::ContextProvider::Capabilities ContextProviderMojo::ContextCapabilities() {
return capabilities_;
}
-bool ContextProviderMojo::IsContextLost() { return !context_; }
+bool ContextProviderMojo::IsContextLost() {
+ return context_lost_;
+}
bool ContextProviderMojo::DestroyedOnMainThread() { return !context_; }
ContextProviderMojo::~ContextProviderMojo() {
@@ -51,10 +55,7 @@ ContextProviderMojo::~ContextProviderMojo() {
}
void ContextProviderMojo::ContextLost() {
- if (context_) {
- MojoGLES2DestroyContext(context_);
- context_ = NULL;
- }
+ context_lost_ = true;
}
} // namespace mojo
« no previous file with comments | « mojo/cc/context_provider_mojo.h ('k') | mojo/dbus/dbus_external_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698