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

Side by Side Diff: shell/android/android_handler.cc

Issue 1979683002: ApplicationConnection devolution, part 2.4. (Closed) Base URL: https://github.com/domokit/mojo.git@work795_app_conn_devo_2.3-x-work794_app_conn_devo_2.2
Patch Set: so much doh Created 4 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 | « services/python/content_handler/content_handler_main.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "shell/android/android_handler.h" 5 #include "shell/android/android_handler.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 void AndroidHandler::Initialize(mojo::ApplicationImpl* app) { 127 void AndroidHandler::Initialize(mojo::ApplicationImpl* app) {
128 handler_task_runner_ = base::MessageLoop::current()->task_runner(); 128 handler_task_runner_ = base::MessageLoop::current()->task_runner();
129 mojo::ConnectToService(app->shell(), "mojo:url_response_disk_cache", 129 mojo::ConnectToService(app->shell(), "mojo:url_response_disk_cache",
130 GetProxy(&url_response_disk_cache_)); 130 GetProxy(&url_response_disk_cache_));
131 } 131 }
132 132
133 bool AndroidHandler::ConfigureIncomingConnection( 133 bool AndroidHandler::ConfigureIncomingConnection(
134 mojo::ApplicationConnection* connection) { 134 mojo::ApplicationConnection* connection) {
135 connection->AddService(&content_handler_factory_); 135 connection->GetServiceProviderImpl().AddService<mojo::ContentHandler>(
136 content_handler_factory_.GetInterfaceRequestHandler());
136 return true; 137 return true;
137 } 138 }
138 139
139 void AndroidHandler::ExtractApplication(base::FilePath* extracted_dir, 140 void AndroidHandler::ExtractApplication(base::FilePath* extracted_dir,
140 base::FilePath* cache_dir, 141 base::FilePath* cache_dir,
141 mojo::URLResponsePtr response, 142 mojo::URLResponsePtr response,
142 const base::Closure& callback) { 143 const base::Closure& callback) {
143 url_response_disk_cache_->UpdateAndGetExtracted( 144 url_response_disk_cache_->UpdateAndGetExtracted(
144 response.Pass(), 145 response.Pass(),
145 [extracted_dir, cache_dir, callback](mojo::Array<uint8_t> extracted_path, 146 [extracted_dir, cache_dir, callback](mojo::Array<uint8_t> extracted_path,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 return ConvertUTF8ToJavaString(env, temporary_file.value()).Release(); 179 return ConvertUTF8ToJavaString(env, temporary_file.value()).Release();
179 } 180 }
180 } 181 }
181 } 182 }
182 183
183 bool RegisterAndroidHandlerJni(JNIEnv* env) { 184 bool RegisterAndroidHandlerJni(JNIEnv* env) {
184 return RegisterNativesImpl(env); 185 return RegisterNativesImpl(env);
185 } 186 }
186 187
187 } // namespace shell 188 } // namespace shell
OLDNEW
« no previous file with comments | « services/python/content_handler/content_handler_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698