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

Unified Diff: blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpContentsObserverProxy.java

Issue 2166563003: Split //blimp/client/core to relevant parts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-assignment-source
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpContentsObserverProxy.java
diff --git a/blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpContentsObserverProxy.java b/blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpContentsObserverProxy.java
deleted file mode 100644
index b000c080103d7b75ed70c8f309ff1283bee38cdf..0000000000000000000000000000000000000000
--- a/blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpContentsObserverProxy.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2016 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.blimp.core;
-
-import org.chromium.base.ObserverList;
-import org.chromium.base.annotations.CalledByNative;
-import org.chromium.base.annotations.JNINamespace;
-import org.chromium.blimp_public.BlimpContentsObserver;
-
-/**
- * Serves as a compound observer proxy for dispatching BlimpContentsObserver callbacks,
- * avoiding redundant JNI-related work when there are multiple Java-based observers.
- */
-@JNINamespace("blimp::client")
-class BlimpContentsObserverProxy implements BlimpContentsObserver {
- private final ObserverList<BlimpContentsObserver> mObservers = new ObserverList<>();
-
- private long mNativeBlimpContentsObserverProxy;
-
- BlimpContentsObserverProxy(BlimpContentsImpl blimpContentsImpl) {
- mNativeBlimpContentsObserverProxy = nativeInit(blimpContentsImpl);
- }
-
- void destroy() {
- if (mNativeBlimpContentsObserverProxy != 0) {
- nativeDestroy(mNativeBlimpContentsObserverProxy);
- mNativeBlimpContentsObserverProxy = 0;
- }
- mObservers.clear();
- }
-
- void addObserver(BlimpContentsObserver observer) {
- assert mNativeBlimpContentsObserverProxy != 0;
- mObservers.addObserver(observer);
- }
-
- void removeObserver(BlimpContentsObserver observer) {
- mObservers.removeObserver(observer);
- }
-
- @Override
- @CalledByNative
- public void onUrlUpdated(String url) {
- for (BlimpContentsObserver observer : mObservers) {
- observer.onUrlUpdated(url);
- }
- }
-
- private native long nativeInit(BlimpContentsImpl blimpContentsImpl);
- private native void nativeDestroy(long nativeBlimpContentsObserverProxy);
-}

Powered by Google App Engine
This is Rietveld 408576698