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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_bridge.cc

Issue 2234873004: Have the RequestCoordinator generate the offline_id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge, and CR fixes per Dimich Created 4 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/android/offline_pages/offline_page_bridge.h" 5 #include "chrome/browser/android/offline_pages/offline_page_bridge.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 if (web_contents) { 362 if (web_contents) {
363 url = web_contents->GetLastCommittedURL(); 363 url = web_contents->GetLastCommittedURL();
364 archiver.reset(new OfflinePageMHTMLArchiver(web_contents)); 364 archiver.reset(new OfflinePageMHTMLArchiver(web_contents));
365 } 365 }
366 366
367 offline_pages::ClientId client_id; 367 offline_pages::ClientId client_id;
368 client_id.name_space = ConvertJavaStringToUTF8(env, j_namespace); 368 client_id.name_space = ConvertJavaStringToUTF8(env, j_namespace);
369 client_id.id = ConvertJavaStringToUTF8(env, j_client_id); 369 client_id.id = ConvertJavaStringToUTF8(env, j_client_id);
370 370
371 offline_page_model_->SavePage( 371 offline_page_model_->SavePage(
372 url, client_id, std::move(archiver), 372 url, client_id, 0ul, std::move(archiver),
373 base::Bind(&SavePageCallback, j_callback_ref, url)); 373 base::Bind(&SavePageCallback, j_callback_ref, url));
374 } 374 }
375 375
376 void OfflinePageBridge::SavePageLater( 376 void OfflinePageBridge::SavePageLater(
377 JNIEnv* env, 377 JNIEnv* env,
378 const JavaParamRef<jobject>& obj, 378 const JavaParamRef<jobject>& obj,
379 const JavaParamRef<jstring>& j_url, 379 const JavaParamRef<jstring>& j_url,
380 const JavaParamRef<jstring>& j_namespace, 380 const JavaParamRef<jstring>& j_namespace,
381 const JavaParamRef<jstring>& j_client_id) { 381 const JavaParamRef<jstring>& j_client_id) {
382 offline_pages::ClientId client_id; 382 offline_pages::ClientId client_id;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 env, ConvertUTF8ToJavaString(env, client_id.name_space), 430 env, ConvertUTF8ToJavaString(env, client_id.name_space),
431 ConvertUTF8ToJavaString(env, client_id.id)); 431 ConvertUTF8ToJavaString(env, client_id.id));
432 } 432 }
433 433
434 bool RegisterOfflinePageBridge(JNIEnv* env) { 434 bool RegisterOfflinePageBridge(JNIEnv* env) {
435 return RegisterNativesImpl(env); 435 return RegisterNativesImpl(env);
436 } 436 }
437 437
438 } // namespace android 438 } // namespace android
439 } // namespace offline_pages 439 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698