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

Side by Side Diff: mojo/runner/android/android_handler.cc

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « media/mojo/services/mojo_cdm_service.cc ('k') | mojo/services/network/url_loader_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 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 "mojo/runner/android/android_handler.h" 5 #include "mojo/runner/android/android_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/android/context_utils.h" 10 #include "base/android/context_utils.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 void AndroidHandler::RunApplication( 136 void AndroidHandler::RunApplication(
137 InterfaceRequest<Application> application_request, 137 InterfaceRequest<Application> application_request,
138 URLResponsePtr response) { 138 URLResponsePtr response) {
139 JNIEnv* env = AttachCurrentThread(); 139 JNIEnv* env = AttachCurrentThread();
140 RunAndroidApplicationFn run_android_application_fn = &RunAndroidApplication; 140 RunAndroidApplicationFn run_android_application_fn = &RunAndroidApplication;
141 if (!response->url.is_null()) { 141 if (!response->url.is_null()) {
142 base::FilePath internal_app_path; 142 base::FilePath internal_app_path;
143 base::FilePath path_to_mojo; 143 base::FilePath path_to_mojo;
144 if (IsCachedApp(env, GURL(response->url), &internal_app_path, 144 if (IsCachedApp(env, GURL(response->url.get()), &internal_app_path,
145 &path_to_mojo)) { 145 &path_to_mojo)) {
146 ScopedJavaLocalRef<jstring> j_internal_app_path( 146 ScopedJavaLocalRef<jstring> j_internal_app_path(
147 ConvertUTF8ToJavaString(env, internal_app_path.value())); 147 ConvertUTF8ToJavaString(env, internal_app_path.value()));
148 ScopedJavaLocalRef<jstring> j_path_to_mojo( 148 ScopedJavaLocalRef<jstring> j_path_to_mojo(
149 ConvertUTF8ToJavaString(env, path_to_mojo.value())); 149 ConvertUTF8ToJavaString(env, path_to_mojo.value()));
150 Java_AndroidHandler_bootstrapCachedApp( 150 Java_AndroidHandler_bootstrapCachedApp(
151 env, GetApplicationContext(), j_path_to_mojo.obj(), 151 env, GetApplicationContext(), j_path_to_mojo.obj(),
152 j_internal_app_path.obj(), 152 j_internal_app_path.obj(),
153 application_request.PassMessagePipe().release().value(), 153 application_request.PassMessagePipe().release().value(),
154 reinterpret_cast<jlong>(run_android_application_fn)); 154 reinterpret_cast<jlong>(run_android_application_fn));
(...skipping 20 matching lines...) Expand all
175 connection->AddService(&content_handler_factory_); 175 connection->AddService(&content_handler_factory_);
176 return true; 176 return true;
177 } 177 }
178 178
179 bool RegisterAndroidHandlerJni(JNIEnv* env) { 179 bool RegisterAndroidHandlerJni(JNIEnv* env) {
180 return RegisterNativesImpl(env); 180 return RegisterNativesImpl(env);
181 } 181 }
182 182
183 } // namespace runner 183 } // namespace runner
184 } // namespace mojo 184 } // namespace mojo
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_cdm_service.cc ('k') | mojo/services/network/url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698