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

Side by Side Diff: services/android/java_handler.cc

Issue 1276073004: Offline By Default (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Add missing explicits. Created 5 years, 3 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 | « mojo/tools/data/unittests ('k') | services/dart/content_handler_main.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 "services/android/java_handler.h" 5 #include "services/android/java_handler.h"
6 6
7 #include "base/android/base_jni_onload.h" 7 #include "base/android/base_jni_onload.h"
8 #include "base/android/base_jni_registrar.h" 8 #include "base/android/base_jni_registrar.h"
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 tracing_.Initialize(app); 95 tracing_.Initialize(app);
96 handler_task_runner_ = base::MessageLoop::current()->task_runner(); 96 handler_task_runner_ = base::MessageLoop::current()->task_runner();
97 app->ConnectToService("mojo:url_response_disk_cache", 97 app->ConnectToService("mojo:url_response_disk_cache",
98 &url_response_disk_cache_); 98 &url_response_disk_cache_);
99 } 99 }
100 100
101 void JavaHandler::GetApplication(base::FilePath* archive_path, 101 void JavaHandler::GetApplication(base::FilePath* archive_path,
102 base::FilePath* cache_dir, 102 base::FilePath* cache_dir,
103 mojo::URLResponsePtr response, 103 mojo::URLResponsePtr response,
104 const base::Closure& callback) { 104 const base::Closure& callback) {
105 url_response_disk_cache_->GetFile( 105 url_response_disk_cache_->UpdateAndGet(
106 response.Pass(), 106 response.Pass(),
107 [archive_path, cache_dir, callback](mojo::Array<uint8_t> extracted_path, 107 [archive_path, cache_dir, callback](mojo::Array<uint8_t> extracted_path,
108 mojo::Array<uint8_t> cache_path) { 108 mojo::Array<uint8_t> cache_path) {
109 if (extracted_path.is_null()) { 109 if (extracted_path.is_null()) {
110 *archive_path = base::FilePath(); 110 *archive_path = base::FilePath();
111 *cache_dir = base::FilePath(); 111 *cache_dir = base::FilePath();
112 } else { 112 } else {
113 *archive_path = base::FilePath( 113 *archive_path = base::FilePath(
114 std::string(reinterpret_cast<char*>(&extracted_path.front()), 114 std::string(reinterpret_cast<char*>(&extracted_path.front()),
115 extracted_path.size())); 115 extracted_path.size()));
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 // This is needed because the application needs to access the application 157 // This is needed because the application needs to access the application
158 // context. 158 // context.
159 extern "C" JNI_EXPORT void InitApplicationContext( 159 extern "C" JNI_EXPORT void InitApplicationContext(
160 const base::android::JavaRef<jobject>& context) { 160 const base::android::JavaRef<jobject>& context) {
161 JNIEnv* env = base::android::AttachCurrentThread(); 161 JNIEnv* env = base::android::AttachCurrentThread();
162 base::android::InitApplicationContext(env, context); 162 base::android::InitApplicationContext(env, context);
163 } 163 }
164 164
OLDNEW
« no previous file with comments | « mojo/tools/data/unittests ('k') | services/dart/content_handler_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698