| Index: chrome/android/java_staging/src/org/chromium/chrome/browser/util/NonThreadSafe.java
|
| diff --git a/chrome/android/java_staging/src/org/chromium/chrome/browser/util/NonThreadSafe.java b/chrome/android/java_staging/src/org/chromium/chrome/browser/util/NonThreadSafe.java
|
| deleted file mode 100644
|
| index 9bfc32cede62bfd107833018628a35f492ea0425..0000000000000000000000000000000000000000
|
| --- a/chrome/android/java_staging/src/org/chromium/chrome/browser/util/NonThreadSafe.java
|
| +++ /dev/null
|
| @@ -1,45 +0,0 @@
|
| -// Copyright 2015 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -package org.chromium.chrome.browser.util;
|
| -
|
| -import org.chromium.base.VisibleForTesting;
|
| -import org.chromium.base.annotations.SuppressFBWarnings;
|
| -
|
| -/**
|
| - * NonThreadSafe is a helper class used to help verify that methods of a
|
| - * class are called from the same thread.
|
| - */
|
| -public class NonThreadSafe {
|
| - private Long mThreadId = null;
|
| -
|
| - public NonThreadSafe() {
|
| - ensureThreadIdAssigned();
|
| - }
|
| -
|
| - /**
|
| - * Changes the thread that is checked for in CalledOnValidThread. This may
|
| - * be useful when an object may be created on one thread and then used
|
| - * exclusively on another thread.
|
| - */
|
| - @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD")
|
| - @VisibleForTesting
|
| - public synchronized void detachFromThread() {
|
| - mThreadId = null;
|
| - }
|
| -
|
| - /**
|
| - * Checks if the method is called on the valid thread.
|
| - * Assigns the current thread if no thread was assigned.
|
| - */
|
| - @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD")
|
| - public synchronized boolean calledOnValidThread() {
|
| - ensureThreadIdAssigned();
|
| - return mThreadId.equals(Thread.currentThread().getId());
|
| - }
|
| -
|
| - private void ensureThreadIdAssigned() {
|
| - if (mThreadId == null) mThreadId = Thread.currentThread().getId();
|
| - }
|
| -}
|
|
|