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

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 1899803002: Offline Pages: Use 'binary encoding' to create MHTML, instead of base64. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final nits. Created 4 years, 8 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 | « no previous file | chrome/browser/android/offline_pages/offline_page_mhtml_archiver.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "android_webview/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "android_webview/browser/aw_browser_context.h" 10 #include "android_webview/browser/aw_browser_context.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 void AwContents::GenerateMHTML(JNIEnv* env, 404 void AwContents::GenerateMHTML(JNIEnv* env,
405 const JavaParamRef<jobject>& obj, 405 const JavaParamRef<jobject>& obj,
406 const JavaParamRef<jstring>& jpath, 406 const JavaParamRef<jstring>& jpath,
407 const JavaParamRef<jobject>& callback) { 407 const JavaParamRef<jobject>& callback) {
408 DCHECK_CURRENTLY_ON(BrowserThread::UI); 408 DCHECK_CURRENTLY_ON(BrowserThread::UI);
409 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); 409 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>();
410 j_callback->Reset(env, callback); 410 j_callback->Reset(env, callback);
411 base::FilePath target_path(ConvertJavaStringToUTF8(env, jpath)); 411 base::FilePath target_path(ConvertJavaStringToUTF8(env, jpath));
412 web_contents_->GenerateMHTML( 412 web_contents_->GenerateMHTML(
413 target_path, 413 target_path,
414 false /* use_binary_encoding */,
414 base::Bind(&GenerateMHTMLCallback, base::Owned(j_callback), target_path)); 415 base::Bind(&GenerateMHTMLCallback, base::Owned(j_callback), target_path));
415 } 416 }
416 417
417 void AwContents::CreatePdfExporter(JNIEnv* env, 418 void AwContents::CreatePdfExporter(JNIEnv* env,
418 const JavaParamRef<jobject>& obj, 419 const JavaParamRef<jobject>& obj,
419 const JavaParamRef<jobject>& pdfExporter) { 420 const JavaParamRef<jobject>& pdfExporter) {
420 pdf_exporter_.reset( 421 pdf_exporter_.reset(
421 new AwPdfExporter(env, 422 new AwPdfExporter(env,
422 pdfExporter, 423 pdfExporter,
423 web_contents_.get())); 424 web_contents_.get()));
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 const JavaParamRef<jobject>& obj) { 1293 const JavaParamRef<jobject>& obj) {
1293 web_contents_->ResumeLoadingCreatedWebContents(); 1294 web_contents_->ResumeLoadingCreatedWebContents();
1294 } 1295 }
1295 1296
1296 void SetShouldDownloadFavicons(JNIEnv* env, 1297 void SetShouldDownloadFavicons(JNIEnv* env,
1297 const JavaParamRef<jclass>& jclazz) { 1298 const JavaParamRef<jclass>& jclazz) {
1298 g_should_download_favicons = true; 1299 g_should_download_favicons = true;
1299 } 1300 }
1300 1301
1301 } // namespace android_webview 1302 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/offline_page_mhtml_archiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698