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

Side by Side Diff: chrome/browser/android/tab_state.cc

Issue 2315323002: Pass JavaRef to WebContents::FromJavaWebContents. (Closed)
Patch Set: Created 4 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
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 "chrome/browser/android/tab_state.h" 5 #include "chrome/browser/android/tab_state.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 return result; 564 return result;
565 } 565 }
566 566
567 // Creates a historical tab entry from the serialized tab contents contained 567 // Creates a historical tab entry from the serialized tab contents contained
568 // within |state|. 568 // within |state|.
569 static void CreateHistoricalTab(JNIEnv* env, 569 static void CreateHistoricalTab(JNIEnv* env,
570 const JavaParamRef<jclass>& clazz, 570 const JavaParamRef<jclass>& clazz,
571 const JavaParamRef<jobject>& state, 571 const JavaParamRef<jobject>& state,
572 jint saved_state_version) { 572 jint saved_state_version) {
573 std::unique_ptr<WebContents> web_contents(WebContents::FromJavaWebContents( 573 std::unique_ptr<WebContents> web_contents(WebContents::FromJavaWebContents(
574 WebContentsState::RestoreContentsFromByteBuffer(env, clazz, state, 574 WebContentsState::RestoreContentsFromByteBuffer(
575 saved_state_version, true) 575 env, clazz, state, saved_state_version, true)));
576 .obj()));
577 if (web_contents.get()) 576 if (web_contents.get())
578 TabAndroid::CreateHistoricalTabFromContents(web_contents.get()); 577 TabAndroid::CreateHistoricalTabFromContents(web_contents.get());
579 } 578 }
580 579
581 bool RegisterTabState(JNIEnv* env) { 580 bool RegisterTabState(JNIEnv* env) {
582 return RegisterNativesImpl(env); 581 return RegisterNativesImpl(env);
583 } 582 }
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_android.cc ('k') | chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698