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

Side by Side Diff: blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java

Issue 2247143004: Remove app context init from LibraryLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix per review. Created 4 years, 2 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 package org.chromium.blimp; 5 package org.chromium.blimp;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.app.Activity; 8 import android.app.Activity;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.os.Bundle; 10 import android.os.Bundle;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 private int mCommitsBase; 67 private int mCommitsBase;
68 private int mSent; 68 private int mSent;
69 private int mReceived; 69 private int mReceived;
70 private int mCommits; 70 private int mCommits;
71 private String mToken = null; 71 private String mToken = null;
72 72
73 @Override 73 @Override
74 @SuppressFBWarnings("DM_EXIT") // FindBugs doesn't like System.exit(). 74 @SuppressFBWarnings("DM_EXIT") // FindBugs doesn't like System.exit().
75 protected void onCreate(Bundle savedInstanceState) { 75 protected void onCreate(Bundle savedInstanceState) {
76 super.onCreate(savedInstanceState); 76 super.onCreate(savedInstanceState);
77
78 buildAndTriggerTokenSourceIfNeeded(); 77 buildAndTriggerTokenSourceIfNeeded();
79
80 try { 78 try {
81 BlimpLibraryLoader.startAsync(this, this); 79 BlimpLibraryLoader.startAsync(this);
82 } catch (ProcessInitException e) { 80 } catch (ProcessInitException e) {
83 Log.e(TAG, "Native startup exception", e); 81 Log.e(TAG, "Native startup exception", e);
84 System.exit(-1); 82 System.exit(-1);
85 return; 83 return;
86 } 84 }
87 } 85 }
88 86
89 @Override 87 @Override
90 protected void onDestroy() { 88 protected void onDestroy() {
91 if (mTabControlFeature != null) { 89 if (mTabControlFeature != null) {
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 // TokenSourceImpl. This will exponentially backoff while it tries to ge t the access 332 // TokenSourceImpl. This will exponentially backoff while it tries to ge t the access
335 // token. See {@link RetryingTokenSource} for more information. The un derlying 333 // token. See {@link RetryingTokenSource} for more information. The un derlying
336 // TokenSourceImpl will attempt to query GoogleAuthUtil, but might fail if there is no 334 // TokenSourceImpl will attempt to query GoogleAuthUtil, but might fail if there is no
337 // account selected, in which case it will ask this Activity to show an account chooser 335 // account selected, in which case it will ask this Activity to show an account chooser
338 // and notify it of the selection result. 336 // and notify it of the selection result.
339 mTokenSource = new RetryingTokenSource(new TokenSourceImpl(this)); 337 mTokenSource = new RetryingTokenSource(new TokenSourceImpl(this));
340 mTokenSource.setCallback(this); 338 mTokenSource.setCallback(this);
341 mTokenSource.getToken(); 339 mTokenSource.getToken();
342 } 340 }
343 } 341 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698