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

Unified Diff: components/bitmap_uploader/bitmap_uploader.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/bitmap_uploader/bitmap_uploader.h ('k') | components/clipboard/clipboard_application_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bitmap_uploader/bitmap_uploader.cc
diff --git a/components/bitmap_uploader/bitmap_uploader.cc b/components/bitmap_uploader/bitmap_uploader.cc
index ad0ce5abc180ee0817171ff0b11b5b58390a0fa9..506e5fe2c08973f82bb8484eb9b340bbc0f7465d 100644
--- a/components/bitmap_uploader/bitmap_uploader.cc
+++ b/components/bitmap_uploader/bitmap_uploader.cc
@@ -16,10 +16,7 @@
#include "mojo/converters/surfaces/surfaces_utils.h"
#include "mojo/public/c/gles2/chromium_extension.h"
#include "mojo/public/c/gles2/gles2.h"
-#include "mojo/services/network/public/interfaces/url_loader.mojom.h"
-#include "mojo/shell/public/cpp/application_impl.h"
-#include "mojo/shell/public/cpp/connect.h"
-#include "mojo/shell/public/interfaces/shell.mojom.h"
+#include "mojo/shell/public/cpp/shell.h"
namespace bitmap_uploader {
namespace {
@@ -30,8 +27,6 @@ void LostContext(void*) {
// TODO(fsamuel): Figure out if there's something useful to do here.
}
-void OnGotRemoteIDs(uint32_t remote_id, uint32_t content_handler_id) {}
-
} // namespace
const char kBitmapUploaderForAcceleratedWidget[] =
@@ -51,19 +46,11 @@ BitmapUploader::~BitmapUploader() {
MojoGLES2DestroyContext(gles2_context_);
}
-void BitmapUploader::Init(mojo::shell::mojom::Shell* shell) {
+void BitmapUploader::Init(mojo::Shell* shell) {
surface_ = window_->RequestSurface(mus::mojom::SurfaceType::DEFAULT);
surface_->BindToThread();
- mojo::ServiceProviderPtr gpu_service_provider;
- mojo::URLRequestPtr request2(mojo::URLRequest::New());
- request2->url = mojo::String::From("mojo:mus");
- shell->ConnectToApplication(std::move(request2),
- mojo::GetProxy(&gpu_service_provider), nullptr,
- mojo::CreatePermissiveCapabilityFilter(),
- base::Bind(&OnGotRemoteIDs));
- ConnectToService(gpu_service_provider.get(), &gpu_service_);
-
+ shell->ConnectToService("mojo:mus", &gpu_service_);
mus::mojom::CommandBufferPtr gles2_client;
gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client));
gles2_context_ = MojoGLES2CreateContext(
« no previous file with comments | « components/bitmap_uploader/bitmap_uploader.h ('k') | components/clipboard/clipboard_application_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698